Working on an FTC robot for competition tomorrow and would like to find some way to synch our drive motors together. We are thinking about using the encoders but have no idea how to do that using robotc. Any help will be greatly appreciated.

Thu Apr 28, 2011 10:35 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: encoders and synchronizing motors

Are you trying to make the robot to go straight? If so try the following. Basically, the difference of the left and right encoder values becomes your correction factor. The bigger the difference the bigger the correction (i.e. Proportional PID control). The difference is multiplied to a proportional scale factor (Kp). You need to fine tune this value to make the correction smooth. Then you apply the calculated correction to the left and right motors. If the encoders are running with the same values, the difference is zero. Then no correction will happen. If the right wheel runs faster, you will have a positive correction that will make the left motor turn faster and the right motor turn slower and vice versa.

Last edited by MHTS on Sat Apr 30, 2011 11:40 am, edited 1 time in total.

Fri Apr 29, 2011 1:13 am

swhite

Rookie

Joined: Thu Apr 28, 2011 8:52 pmPosts: 2

Re: encoders and synchronizing motors

thank you very much. That is basically what we are trying to do... We have been having difficulty getting the robot to go straight in autonomous mode so this will definitely help. The code we are using in autonomous mode requires the robot to turn so I am assuming that I will have to add this block as needed. Please correct me if I am wrong. My programming skills are lacking and its kind of like the blind leading the blind...

One question I have is that if we are going to four wheel drive a robot, would it be necessary to put encoders on each wheel?Thanks.

Fri Oct 21, 2011 11:21 pm

magicode

Moderator

Joined: Tue Sep 14, 2010 9:19 pmPosts: 496

Re: encoders and synchronizing motors

While it is hard to speak without knowing the specifics of your drive, if it is a 4 wheel tank drive, then generally no. You would only really need one encoder on either side of the robot.

_________________sudo rm -rf /

Fri Oct 21, 2011 11:40 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: encoders and synchronizing motors

hongyeus wrote:

One question I have is that if we are going to four wheel drive a robot, would it be necessary to put encoders on each wheel?Thanks.

Are you talking about 4-wheel drive or 4-motor drive? Most of the time, people have 4-wheel drive but only one motor for each side. The two wheels on each side are usually chained to the same motor. So typically, you have one encoder on each side. If you truly have 4-motor drive, then the question is: are the two motors on one side synchronized by a chain? If so, you still need only one encoder for each side. If you don't have a mechanism to synchronize the wheels on one side, you may have a problem. In that case, you may need one encoder for each motor just for synchronizing the speed. Normally, there is no benefit of 2 unsynchronized motors on one side unless you have a mecanum drive train. Mecanum allows your robot to go sideway. In that case, you also need 4 encoders, one on each wheel so you can calculate the net movement of the robot.

Sat Oct 22, 2011 1:49 am

magicode

Moderator

Joined: Tue Sep 14, 2010 9:19 pmPosts: 496

Re: encoders and synchronizing motors

Quote:

Normally, there is no benefit of 2 unsynchronized motors on one side unless you have a mecanum drive train

I would disagree with this statement. Many teams use this configuration to gain more speed and pushing power. Having the motors unsychronized does not have too much of in effect in driver control mode (except if your robot is experiencing a lot of slippage). And I have been able to program fairly accurate PID control using only two encoders on a 4 motor tank drive.

_________________sudo rm -rf /

Sat Oct 22, 2011 9:24 am

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: encoders and synchronizing motors

You can still use 4 motors for the 4 wheels to gain speed but using a chain to link them will make sure the two wheels on one side is always running the same speed. You could run them independently but then you will have to put encoders on the two wheels of the same side and use software to monitor their speeds to make sure they are in sync. I am not saying it's not doable with just two encoders for 4 motors but I personally don't see benefits of doing that.

Sat Oct 22, 2011 9:44 am

magicode

Moderator

Joined: Tue Sep 14, 2010 9:19 pmPosts: 496

Re: encoders and synchronizing motors

You're right, that chaining the two motored wheels together on each side is in general a better idea then leaving them independent. I'm just saying that if chaining is not an option (some teams either don't have room, or find that it over complicates their chassis to chain the wheels), and only two encoders are available, then good results can be achieved with just two encoders on unchained wheels.

_________________sudo rm -rf /

Sat Oct 22, 2011 11:04 am

hongyeus

Rookie

Joined: Fri Oct 21, 2011 11:14 pmPosts: 9

Re: encoders and synchronizing motors

All right, thanks so much, and yes sorry I was referring to 4-motor tank drive. I will see if I can chain the motors on each side together.

Thanks!

Sat Oct 22, 2011 12:22 pm

hongyeus

Rookie

Joined: Fri Oct 21, 2011 11:14 pmPosts: 9

Re: encoders and synchronizing motors

I actually have another question about chaining the two motors on each side together... If the two motors chained together did run at different powers, wouldn't this in effect increase the resistance and literally "force" the motors to run together? Would there be any negative impacts of doing this?

Sat Oct 22, 2011 3:21 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: encoders and synchronizing motors

First, when you chain 2 motors together, make sure your code will program the same power to them. So then the speed difference should be minimal if any. The motors can take that stress produced by the difference. To the motor, this is just a slight variant in its loading. It is equivalent to a weight difference on all the four wheels or even different friction on the wheels, then one of the motors will work slightly harder than the other one. So this is normal stress. Even if you don't chain them together, assuming the wheels don't slip, you will have the same effect (one wheel running faster and takes more load).

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum