Log in

View Full Version : Encoders and Mecanum Drive


wiiking123
01-05-2011, 23:26
Recently, our team decided to add Digital Encoders into our drivetrain containing mecanum wheels. I was wondering exactly how we go about integrating our encoders into our code. Examples would be much appreciated, but advice is just as good.

Ether
02-05-2011, 09:59
Recently, our team decided to add Digital Encoders into our drivetrain containing mecanum wheels. I was wondering exactly how we go about integrating our encoders into our code. Examples would be much appreciated, but advice is just as good.

Figure out what a reasonable value for maximum wheel speed is for your drivetrain. Scale the encoder rate feedback so it has a range of -1 to +1, where +1 corresponds to that maximum speed. For each of the four wheels, use the existing +/-1 open-loop wheel speed command (from your mecanum inverse kinematic calculation) as the setpoint for a PID, and use the scaled encoder rate for that wheel as the process variable.

Be advised of the following: 1) tuning a PID for speed is different from tuning a PID for position (there are some helpful threads on this topic); 2) there are some known issues (FPGA) with the encoder rate computation


If all you want to do with the encoders is to make autonomous more accurate, you could consider reading position from the encoders instead of rate. Starting with a sequence of known intermediate stations along a desired vehicle path, compute the rotation for each wheel for each station and close the loop on wheel rotation for each wheel, keeping the command one station ahead of the current vehicle position. You may need to limit the time rate of change of each PID output in order to prevent wheel slipping. The spacing of the stations need not be equidistant. Experiment with the spacing of the stations to get the desired result.

vhcook
02-05-2011, 14:36
With mechanum, you will need encoders on all four wheels to get an accurate position reference, and you'll have to correct for wheel diameter and the vector of the force applied by the angled rollers. I have some detailed notes from our development this season, and I'll see if I can put together a white paper over the next couple of weeks. There is a bit of slip because of the rollers, but you can get reasonably accurate readings.

Ether
02-05-2011, 15:14
I have some detailed notes from our development this season, and I'll see if I can put together a white paper over the next couple of weeks.

You might find the following CD papers useful as you are preparing your notes:

http://www.chiefdelphi.com/media/papers/1836

http://www.chiefdelphi.com/media/papers/2390

http://www.chiefdelphi.com/media/papers/2434




With mechanum ... you'll have to correct for ... the vector of the force applied by the angled rollers.

The inverse kinematic calculation of the wheel speeds takes care of that.

vhcook
02-05-2011, 15:22
You might find the following CD papers useful as you are preparing your notes:


Thanks! That will definitely help.

jhersh
06-05-2011, 23:19
2) there are some known issues (FPGA) with the encoder rate computation

FYI, Doug found the source of the problem in the FPGA... we are considering releasing a new image that contains a fix for use in the off-season... is that of value to anyone? Or is the current work-around sufficient?

-Joe

Joe Ross
07-05-2011, 12:58
FYI, Doug found the source of the problem in the FPGA... we are considering releasing a new image that contains a fix for use in the off-season... is that of value to anyone? Or is the current work-around sufficient?

I would appreciate a new image. It probably wouldn't be that useful for teams working on their current robot, but for everyone working on new platforms, it would be very nice to have.

Ryan Gordon
13-05-2011, 17:22
FYI, Doug found the source of the problem in the FPGA... we are considering releasing a new image that contains a fix for use in the off-season... is that of value to anyone? Or is the current work-around sufficient?

-Joe

Our team would definitely like the new image

kamocat
07-06-2011, 13:57
I would like the new image as well.
All my encoders are connected to Jaguars, but I do use the semi-period counter functions for SONAR.

jhersh
21-06-2011, 16:03
There is a new update posted for LabVIEW... see here. http://www.chiefdelphi.com/forums/showpost.php?p=1066392&postcount=71