Thursday, April 29, 2010
Neater Block Diagram
Again, this is a sketch of the communication between each component. The communication between the cars, controllers, and gate is all wireless
Error Handling
Every task must end with
nrk_wait_until_next_period();
-When we were adjusting our PWM so that no signal would be output when there was zero duty period, we mistakenly put the above statement into the check, leading to 'Task Reserve Violated' errors. We put the check in because there was a slight lag between setting and clearing the pin that caused the cars to inch forward, even when duty periods were 0.
Wednesday, April 28, 2010
Block Diagram
This is the new block diagram for our communication setup. I decided to draw it because I was prompted to draw a block diagram in an interview this morning, and because I was trying to figure out some enabling stuff for the gate. From this, the new communication from controller to gate was born.
TODO:
compartmentalize code. It's getting unwieldy.
Tuesday, April 27, 2010
Integrating the Gate
CONTROLLER->duty periods->CAR
CAR->if they won->GATE
GATE->enable/disable based on start/end of race->CONTROLLER
After getting past initialization issues, we now have hit a wall: once you send a packet, you stop receiving. the fix: enable receiving every time you send a packet.
Now all three of the nodes are sending packets in a circle. The actual gate still needs to be built.
I think what we're going to do is have gate effectively enable each of the cars through the controllers. To signal the race start, both controllers will have to press the "select" button. Then, the gate will check that both cars are under the gate (using information from the light sensors on the cars) and once this is verified, it will count down the start of the race with LEDs. Once the race has officially begun, the controllers will be able to send non-zero duty periods to their respective cars, and they'll be able to move. Once one of the cars senses that they have won, it will inform the gate, which will display the winner.
Monday, April 26, 2010
The Start\End Gate
Also, the new (and neat!) circuits for the car and controller are debugged and working. Now, if we want our cars to drive backwards, they're set up to do it! We just need to update our controller-to-duty period algorithm....
More Wiring, and Starting the START/END Gate
Today we also wired up the other car and joystick, and got some new nodes as well (we still need one more firefly, but we got two today). We continued working on getting the cars to detect which has won the race using light sensors, and were also working on making the cars go backwards. Also, the broken car is now soldered back together.
Still to do:
-build end gate
-program end gate node
-finish hooking up light sensors
-get communication between cars and end gate
-debug some of the wiring for making the tanks go forward/backward
It seems like we didn't make much progress today even though we spent a lot of time in the lab. We still have a lot to do...
Sunday, April 25, 2010
The Working Baseline
Controller Finished
Basic overview of our joystick:
-takes in ADC values for x and y axis
-converts this data into duty periods for the PWMs for each motor
-sends packets consisting of these duty periods to sister node
-car is stationary when joystick is at origin
-car moves forward, turns
-still cant move backwards; any motion of joystick in negative y direction gives duty periods of 0 (no motion)
Saturday, April 24, 2010
No signal produced when node not connected to programmer board
Tuesday, April 20, 2010
PWM straight from the ATmega128
Monday, April 19, 2010
Parts update
Though one of our car chassis came in broken and we'll need to solder back together one of the connections, our other car is running smoothly.
Tuesday, April 13, 2010
Car Chassis
http://www.pololu.com/catalog/product/1059
Monday, April 12, 2010
Parts
Our biggest problem with the car body is going to be the chassis. We need something strong that also allows for steering. We can either get someone in MEAM to help us build something or we can buy a chassis.
Buggy Car Chassis Kit: http://www.hobbyengineering.com/H2020.html
Pololu 3pi robot http://www.pololu.com/catalog/product/975
Boe Bot http://www.parallax.com/tabid/411/Default.aspx
We already have Boe Bots, but they run on servo motors and are very slow, so we'd need new DC motors for those
For our joystick, we're going to use potentiometer joysticks.
http://www.sparkfun.com/commerce/product_info.php?products_id=9032
For the starting and ending gates, were going to need LEDs, which we can find in the lab.
each car will sense when it crosses the finish line, and send that information to the finishing gate to be displayed. The cars will sense when they enter the dark of the finishing gate/garage with light sensors/photoresistors, which we can find in the lab.
Preliminary Project Description
Racecars
We are planning on building two racecars for our final project. Each player will control their respective car using a joystick. The joysticks will controls what direction the car drives in, whether the car drives in forward or reverse, and at what speed the racecar moves. For this, we will use a two-axis accelerometer. If we decide to change the joystick into a wii-mote type of controller, we will need a three-axis accelerometer and a gyroscope. The cars will have DC motors that turn their wheels, whose PWMs (and thus speeds) will be adjusted in correlation with the distance the joystick is moved from the origin. If the joystick is moved backwards, the duty cycles created by PWM will be decreased to zero and the direction of the DC motor will be changed before the duty cycle is increased again. This can be used as a breaking mechanism, where the player will hold the joystick backwards for a short amount of time to slow down the car before it starts moving backwards, as well as a mechanism for driving in reverse. When the car is turning, one of the wheels will turn faster than the other, and thus its motor will have a larger duty cycle.
The cars will have a starting gate that double as a finish line. It will tell the cars when to move with sequential starting lights. An option is that the cars will not be able to move before the start signal is initiated, so that no false starts will occur. When the race finished, the start/end gate will register which car passed through the gate first, and the result of who won will be displayed on the gate using LEDs.