Here's a short video demonstrating our project. Also note that Joe got a job offer. He's pretty excited.
Monday, May 3, 2010
Thursday, April 29, 2010
Neater Block Diagram
Error Handling
Things To Look Out For:
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.
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
We've set up the communication between the cars, controllers, and gates. They'll communicate in a circle:
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.
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
We've started working on the start/end gate code. So far, the gate node is receiving packets and can register and display who wins. So basically, the easy part. We still need to get the cars to send special packets out when they register that they win. They sense that they win when their light sensors are in darkness. The cars need to respond to that win detection by sending out packets that start with an identifier for the gate node (we're using the number 99) and follow by their identifying number (1 or 2). The gate node then checks to see if each packet is for them, reads in the winner, and displays it. The actual gate has yet to be built. Our project for tomorrow: get the gate built and working.
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....
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....
Subscribe to:
Posts (Atom)