Let's Make Robots!

2WD Car Driving in circles

Hi!

I've just mounted a magician robot, using Dagu's magician chassis and Dagu magician controller. By runing the simple code that follows, it walks in circles, while it should be walking straight in line. I guess one of the motors is being faster than the other. Is this normal?

http://www.robotshop.com/content/PDF/manual-rs015.pdf

http://www.robotgear.com.au/Product.aspx/Details/548

 

Regards

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
It is common for them to not move at exactly the same speed.

are the two pins, 9 and 10, meant for PWM output on your controller?

Yes mate, this 2 are the pwm pins!

Hi Markamas, Sorry, I forgot. Here is it. Also, I thought about writing driving but I was not sure about this expression since I had never written something driving without a driver before. I was confused! =)

 

int MLD = 7;

int MLV = 9;

int MRD = 8;

int MRV = 10;

void setup() {                

  pinMode(MLD, OUTPUT); // Left direction

  pinMode(MLV, OUTPUT); // left speed

  pinMode(MRD, OUTPUT); // Right direction

  pinMode(MRV, OUTPUT); // right speed

}

 

void loop () {

 

   digitalWrite(MLD,HIGH);   

   digitalWrite(MRD, HIGH);       

   analogWrite(MLV, 200);   //PWM Speed Control

   analogWrite(MRV, 200);   //PWM Speed Control

 

}

 

Hmm I can`t find the code. And I guess you meant driving instead of walking?