Synchronize Motors

Hi,

I bought a "2wd smart car kit"[1] along with a motor control shield L293D[2] from ebay.

I run into the following issues:

  • the wheels have different speed.
  • running one motor multiple times for a specified time results in different travel distances
    I didn't find any information on that issue, maybe someone of you got an idea what's the problem.
    Is it the controller, to cheap motors, code issues, are encoders[3] necessary, wrong type of motor, ...

thank you.

/** just a simplified version to show you my approach, not my actual code */

#include <AFMotor.h>
AF_DCMotor motorRight(1,MOTOR12_1KHZ);
AF_DCMotor motorLeft(3,MOTOR12_1KHZ);

void setup() {}

void loop() {
    motorRight.setSpeed(180);
    motorLeft.setSpeed(180);
    delay(1000);
}

[1] 2WD 4WD Robot Smart Car Chassis Kits Speed Encoder 65x26mm Tire for Arduino | eBay
[2] L293d Motor Drive Shield Expansion Board for Arduino Duemilanove Mega UNO for sale online | eBay
[3] 2PCS HC 020K Double Speed Measuring Sensor Module And Photoelectric Encoders Kit | eBay

1 Like

You cannot tell a DC motor to GO and expect any positional accuracy.

You provide 3 links at the end of your post. The last one is for an encoder. That can be used to measure the movement of the motor. Are you using it?

Edit: you used code tags on your very first post. Karma++

Seems like my karma bonus works, helpful answer in no time. :smiley:

Unfortunately the encoders haven't been part of the kit, but I already ordered them.

Since I have little to no experience with motors, I thought it might be one of the other issues as well because I didn't see the encoders in any of the tutorials where ppl are using this kit. But It was mostly "obstacle avoiding cars" where precision isn't really a thing...

Thank you. :slight_smile: