Society of Robots - Robot Forum
Software => Software => Topic started by: Fiona on March 29, 2008, 09:44:58 AM
-
Hi guys,
I'm trying to control the motion of my robot with a 2004 Mini Robot Controller (EDU-RC-2004). However, I wasn't able to change the motion of the DC motor. For example, when i wrote
/* Moving robot forward */
pwm01 = 20;
pwm02 = 250;
/* Stop robot */
pwm01 = 127;
pwm02 = 127;
/* Moving robot backward */
pwm01 = 250;
pwm02 = 20;
The robot only execute the last motion which is to move backward.
Does anyone knows what is the problem? Thank You!
-
Btw guys, I did insert a delay between each motion. It still doesn't work. >:(
-
Are you using a DC motor or a modified servo?
If you are using a dc motor, you would have to reverse polarity in order to have a motor go backwards, and different PWM settings would only give different speeds.
If you are using a servo, make sure you have the PWM set up correctly and then it should work.
Good luck,
-
Since you are using a FIRST controller I am wondering if you are using a victor speed controller, or is it a custom h-bridge?
-
http://www.ifirobotics.com/forum/viewtopic.php?t=66&sid=2ca42dbb1ceb536385bc087ca3757f9a
The robot only execute the last motion which is to move backward.
What do you mean?
Are you using a microcontroller? Are you sure that pwm01 is actually emitting a ~1.1ms pulse? Hook it up to an oscope, as I suspect the PWM you are using is meant for DC motors, and not for servo control like with your controller.
-
Hi guys,
I'm trying to control the motion of my robot with a 2004 Mini Robot Controller (EDU-RC-2004). However, I wasn't able to change the motion of the DC motor. For example, when i wrote
/* Moving robot forward */
pwm01 = 20;
pwm02 = 250;
/* Stop robot */
pwm01 = 127;
pwm02 = 127;
/* Moving robot backward */
pwm01 = 250;
pwm02 = 20;
The robot only execute the last motion which is to move backward.
Does anyone knows what is the problem? Thank You!
very silly mistake
the same PWM must be sent a couple of times , not once