View Single Post
  #1   Spotlight this post!  
Unread 02-05-2011, 09:59
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,088
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Encoders and Mecanum Drive

Quote:
Originally Posted by wiiking123 View Post
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.



Last edited by Ether : 02-05-2011 at 10:13.
Reply With Quote