Dawn Robotics Forum Support and community forums for Dawn Robotics Ltd 2014-04-06T13:12:40+01:00 http://forum.dawnrobotics.co.uk/feed.php?f=10&t=1238 2014-04-06T13:12:40+01:00 2014-04-06T13:12:40+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1238&p=1293#p1293 <![CDATA[Re: Pi Camera Robot Wheels, Outputs & Duration]]>

Thanks.

Statistics: Posted by JTeagle — Sun Apr 06, 2014 1:12 pm


]]>
2014-04-06T12:50:44+01:00 2014-04-06T12:50:44+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1238&p=1291#p1291 <![CDATA[Re: Pi Camera Robot Wheels, Outputs & Duration]]>
Sorry for the delayed reply. I was out at the Linux User Pi Jam in Poole yesterday, and so didn't have time to look at the forum yesterday.

What you're seeing is the 'Dead man's switch' feature that I put into the Mini Driver sketch. Essentially, I didn't want the robot to drive off into a wall if it was driving forward, and communication was lost over wifi etc.

You can disable this if you want by commenting out the following lines from mini_driver_firmware/mini_driver_firmware.ino

Code:
// Turn off the motors if we haven't received a command for a while
unsigned long curTime = millis();
   
if ( curTime - gLastCommandTime > MOTOR_COMMAND_TIMEOUT_MS )
{
    gLeftMotorDutyCycle = 0;
    gRightMotorDutyCycle = 0;
    gLeftMotorDirection = eMD_Forwards;
    gRightMotorDirection = eMD_Forwards;
}


If you change either VERSION_MAJOR or VERSION_MINOR at the top of the file, then the next time you connect to the mini driver with an instance of the MiniDriver class, it should see that the version number is wrong, and download the new version of the firmware to the mini driver board.

Having said that, personally I would leave the timeout in there and just send the desired motor speed repeatedly. I know it seems a bit tedious, but I feel that it's good as a safety feature, and I tend to run my robots with state machines, where commands are sent at regular intervals to the robot depending upon the current state of the robot.

Regards

Alan

Statistics: Posted by Alan — Sun Apr 06, 2014 12:50 pm


]]>
2014-04-05T12:01:04+01:00 2014-04-05T12:01:04+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1238&p=1289#p1289 <![CDATA[Pi Camera Robot Wheels, Outputs & Duration]]>
This is working, not an issue with getting it to work as such, but despite me leaving the current speed in effect for 5 seconds (i.e., I'm not sending a new signal to change speeds within that 5 seconds), the wheels only appear to run for 2 seconds and then stop.

I tested this theory by having the script set the wheels to a value of 20 (fairly sedate), waiting 5 seconds, then setting them to 80 (belting along), waiting another 5 seconds, and then finally setting them back to 0.

What I'm actually getting is 2 seconds of slow rotate, back to still for the remaining 3 seconds, then 2 seconds of fast rotate, back to still for the remaining 3 seconds. I can confirm the timing is working as I do get the 5 seconds before it changes speed (and then prints the final message).

I can't see anything in the mini_driver.py file which might suggest a time limit... and indeed, if you keep your foot on the joystick on the web page it will go for longer than 2 seconds.

Note that I *am* running this test with the wheels running free, as my Pi is using the mains power so I don't want it unplugging itself by running away across the floor :)

Any ideas? Am I supposed to keep re-enforcing the outputs at regular intervals? This seems a little tedious.

Statistics: Posted by JTeagle — Sat Apr 05, 2014 12:01 pm


]]>