Dawn Robotics Forum Support and community forums for Dawn Robotics Ltd 2014-09-12T13:50:26+01:00 http://forum.dawnrobotics.co.uk/feed.php?f=10&t=1271 2014-09-12T13:50:26+01:00 2014-09-12T13:50:26+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1271&p=1426#p1426 <![CDATA[Re: Setting duration/speed of Motors using minidriver]]>
Sorry for the delayed reply on this.

With your wheel motion, you may be falling foul of the 'dead man's switch' that is implemented on the mini driver. Basically if it doesn't recieve motion commands for about 2 seconds it will shut down the motors, to stop the robot from driving into walls if comms go down.

The recommended way to work around this is to have a control loop that constantly checks the state you want your robot to be in and then updates the motor outputs accordingly. I'd put a small delay at the end of each loop to avoid flooding the mini driver with commands. Something like

time.sleep( 0.01 )

Regards

Alan

Statistics: Posted by Alan — Fri Sep 12, 2014 1:50 pm


]]>
2014-09-12T12:33:44+01:00 2014-09-12T12:33:44+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1271&p=1423#p1423 <![CDATA[Re: Setting duration/speed of Motors using minidriver]]> I posted the current python opencv code under projects section of this forum if anyone is interested. Also there are a few mistakes. Realized the speed value range to the wheels is 256 between -128 and +128. Originally thought it was +- 256. Correct me if I am wrong. Will change the variables. Was sometimes getting python trackback invalid value errors from minidriver and that is probably why. I would still like to be able to control the wheel duration as well as the speed. Just struggling a little at this point since I am new to robotics. Any help would be appreciated.
Regards
Claude ..

Statistics: Posted by pageauc — Fri Sep 12, 2014 12:33 pm


]]>
2014-09-12T00:42:36+01:00 2014-09-12T00:42:36+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1271&p=1420#p1420 <![CDATA[Re: Setting duration/speed of Motors using minidriver]]> http://youtu.be/Lc0isSkMcZA

Here is a playlist for the previous updates and the video that inspired me
https://www.youtube.com/playlist?list=PLLXJw_uJtQLYspXORG_To3sDPQ3N1BIFB

Statistics: Posted by pageauc — Fri Sep 12, 2014 12:42 am


]]>
2014-09-11T20:44:55+01:00 2014-09-11T20:44:55+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1271&p=1418#p1418 <![CDATA[Re: Setting duration/speed of Motors using minidriver]]> One problem is that at lower speeds the robot may not be able to overcome friction to rotate, so a higher speed might sometimes be needed. Will need a feedback loop to make sure wheels are in the correct position without needless oscillations back and forth . Might need to calibrate one wheel robot rotation values to get roughly the angle I want.
It still seems eerie to see the robot wake up from motion detection, then find and track your face. Anyway having some fun.
Sorry to disturb you. BTW I will shortly edit part4 of my robot project and upload to YouTube. Will post URL when it is available for anyone who might be interested.
Claude ...

Statistics: Posted by pageauc — Thu Sep 11, 2014 8:44 pm


]]>
2014-09-11T19:40:48+01:00 2014-09-11T19:40:48+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1271&p=1417#p1417 <![CDATA[Setting duration/speed of Motors using minidriver]]>
I have got my opencv python script working with the Dawn Robot camera module and can control pan/tilt to follow a face. I am trying to program a wheel to turn slightly if the pan goes past a specific point. This would allow the robot to turn and center the pan. Eg someone moving left or right past the normal pan so the robot would rotate using one wheel to keep person in view.
I would like to control the duration of the motor to make it proportional to the cumulative pan of the camera in a particular direction. Eg If the camera pans past a certain amount one wheel should move slightly to turn the robot so the camera can keep the face in the camera frame. Not sure if my programming is correct. used minidirver command to turn one wheel forward or backward depending on the pan. Waited 1.0 then send wheel a minidirver wheel stop value 0. This does not seem to work. The wheel turns for about 3 seconds and I can't figure out why. I would like to be able to send it a short duration pulse to turn the robot maybe 30-60 degrees or so at a time.
Here is a code snippet. direction variable is -1 or +1 depending on wheel direction to turn. The wheel turns in correct direction OK but runs far too long. Looked at minidriver python code but still can't figure out how to control duration. I know web interface can move robot a little bit at a time if the joystick is move a little bit. Can you help me out?
Thanks Claude ...

Here is a code snippet that I am using. right_wheel_min is set to 130.
if ( abs(Nav_LR)>3 or abs(Nav_UD)>3 ):
if Nav_LR < 0:
direction = 1
elif Nav_LR > 0:
direction = -1

miniDriver.setOutputs( left_wheel_stop, (right_wheel_min + (abs(Nav_LR))) * direction, current_pan_pos, current_tilt_pos )
time.sleep( 1.0 )
miniDriver.setOutputs( left_wheel_stop, right_wheel_stop , current_pan_pos, current_tilt_pos )

Statistics: Posted by pageauc — Thu Sep 11, 2014 7:40 pm


]]>