Society of Robots - Robot Forum

Software => Software => Topic started by: Fiona on March 29, 2008, 09:44:58 AM

Title: Controlling of DC Motor with Robot Controller
Post 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!


             
Title: Re: Controlling of DC Motor with Robot Controller
Post by: Fiona on March 29, 2008, 09:50:17 AM
Btw guys, I did insert a delay between each motion. It still doesn't work.  >:(
Title: Re: Controlling of DC Motor with Robot Controller
Post by: Maltaeron on March 29, 2008, 02:12:03 PM
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,
Title: Re: Controlling of DC Motor with Robot Controller
Post by: michaelsane on March 29, 2008, 03:40:17 PM
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?
Title: Re: Controlling of DC Motor with Robot Controller
Post by: Admin on March 30, 2008, 10:55:59 AM
http://www.ifirobotics.com/forum/viewtopic.php?t=66&sid=2ca42dbb1ceb536385bc087ca3757f9a

Quote
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.
Title: Re: Controlling of DC Motor with Robot Controller
Post by: airman00 on March 31, 2008, 06:03:56 PM
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