Author Topic: Controlling of DC Motor with Robot Controller  (Read 2356 times)

0 Members and 1 Guest are viewing this topic.

Offline FionaTopic starter

  • Beginner
  • *
  • Posts: 2
  • Helpful? 0
Controlling of DC Motor with Robot Controller
« 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!


             

Offline FionaTopic starter

  • Beginner
  • *
  • Posts: 2
  • Helpful? 0
Re: Controlling of DC Motor with Robot Controller
« Reply #1 on: March 29, 2008, 09:50:17 AM »
Btw guys, I did insert a delay between each motion. It still doesn't work.  >:(

Offline Maltaeron

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 0
Re: Controlling of DC Motor with Robot Controller
« Reply #2 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,

Offline michaelsane

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: Controlling of DC Motor with Robot Controller
« Reply #3 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?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,659
  • Helpful? 169
    • Society of Robots
Re: Controlling of DC Motor with Robot Controller
« Reply #4 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.

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: Controlling of DC Motor with Robot Controller
« Reply #5 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
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

 


Get Your Ad Here