ROBOTC.net forums
http://www.robotc.net/forums/

1 Encoder for 2 different motors
http://www.robotc.net/forums/viewtopic.php?f=52&t=2762
Page 1 of 1

Author:  JuanAcosta [ Wed Nov 17, 2010 11:58 pm ]
Post subject:  1 Encoder for 2 different motors

Hi

Is there anyway possible that i could have 1 motor (the left drive motor) and 1 motor (the right drive motor) sync with the use of just one encoder on one of the motors? I don't want to have to use 2 different encoders for each motor. Is this possible? When i tried.... the side with the encoder would actually go at the speed i wanted but the other motor would not imitate it.
would it be something like this?

nMotorEncoder[motorA] = 0;
while(nMotorEncoder[motorA] < 1440) //turn one revolution only
{
motor[motorA] = 15;
motor[motorB] = motor[motorA];
}

Author:  mightor [ Thu Nov 18, 2010 1:07 am ]
Post subject:  Re: 1 Encoder for 2 different motors

How can you be sure that at X amount of power, both motors turn at the exact same speed? :) What if motorA turns 10% faster than motorB? Unless you like your robot to go around in a wide circle, I think you may want to reconsider this approach :)

- Xander

Author:  MHTS [ Thu Nov 18, 2010 1:48 am ]
Post subject:  Re: 1 Encoder for 2 different motors

In order to sync the speed of two motors, you must have the ability of monitoring the speed of both motors so you can adjust their relative speeds. This means you must have two encoders, one for each motor. However, if your goal is to have the robot drive straight, you could have a directional sensor such as the compass or gyro as your guiding sensor although I still think the encoder is more accurate.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/