View Full Version : Rack and Pinion/Motors and servos
psniffler
22-01-2008, 20:28
How have other teams done rack and pinion in terms of motors? Is there a way to turn a motor into an accurate enough servo? Or how else could we implement it?
Kingofl337
22-01-2008, 22:31
Yes you can use a PID control loop or springs to recenter the steering wheels.
DarKCroNo
24-01-2008, 22:43
king of l337 would you mind explaining in detail about PID control loops and things like that and how we can achieve that? thanks it's our rookie year and we've been able to manage but there are still some things we're unsure.
Jaybee1405
24-01-2008, 22:46
We're using a form of this with a potentiometer and a globe motor.
kevin.li.rit
24-01-2008, 22:55
We're using a form of this with a potentiometer and a globe motor.
Could you go into more detail?
shock190
25-01-2008, 00:05
king of l337 would you mind explaining in detail about PID control loops and things like that and how we can achieve that? thanks it's our rookie year and we've been able to manage but there are still some things we're unsure.
Well, heres the very short version of a PID control loop.
First off, you need the steering motor hooked up to a potentiometer or something similar (a 10 turn pot should be more than enough for most rack and pinion setups). The PID loop takes the value that you want the pot to read (corresponding to the position of the rack and pinion), and the value the pot is actually at. Then the three parts kick in:
P- proportional control. This simply takes the difference between the desired value and the actual value, then multiplies this by a constant that you pick through estimation and testing. This essentially compensates purely based on distance from the desired location. It is also important to implement a dead band of values to prevent the motor from overshooting the intended target and then oscillating around it for a long time (the constant also plays a big part in this).
I- integral control. This is somewhat more challenging to implement (it requires an array setup in C, or something similar). It takes the last X number of error values (you choose X), sums them to determine the overall error, then multiplies this by a different chosen constant. This is extremely useful when inside the deadband of the P control, as it sums the errors, then applies a light correction to decrease the sum of the errors (move the error to zero SLOWLY).
D- derivative control. This is about the same difficulty level as integral. It uses the same array as the I control, but takes the derivative (or rate of change) of the last few error values, and scales the speed (with yet another constant) in relation to that. So as the actual value approaches the desired, the motor speed slows down.
After all of these functions (or just P, PI, PD...), you sum all of the control loop outputs together, and apply that correction to your motor. I'm sure other people on here are much more capable of explaining the source code to make one work well (I'm more of a mech myself), but thats the general theory behind one.
MrForbes
25-01-2008, 00:09
We set up this prototype steering mechanism, it worked ok...as well as can be expected for a 2wd Ackermann steering robot, that is.
http://www.chiefdelphi.com/forums/showpost.php?p=680695&postcount=3
We're going skid steer 6wd with fancy steering wheel control programmed into it instead. But it was a fun experiment to build this robot and drive it around.
DarKCroNo
25-01-2008, 16:16
Thanks so much! however if it is possible would you mind explaining in a bit more detail? is the PID a programming code? and how would the robot controller whether the rack and pinion has gone either left or right? Thanks again!
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.