|
Re: Motor control for steering
To expand on the above: Assuming the gearbox allows the shaft to turn slow enough, you tell the motor to turn in one direction (for example, PWM 0 means counter-clockwise, 255 means clockwise) until the potentiometer (attached to the steering "fork") reaches the desired position.
A potentiometer is a vailable resistor, they usually have about 270 degrees of rotation. Use a 5k or 10 k Linear potentiometer for this application (100k is too high a value). The center pin of the pot goes to thr Signal Input pin on the RC, one end pin of the pot goes to the RC 5 volt supply, the other end to the RC ground (All at the Analog inputs). This will return a value of 0 to 1023, depending upon position.
So, let's say a left turn is a 184 reading on your potentiometer: Command the motor to spin in the correct direction until the pot reads 184. Or, take the steering input from a joystick (0 to 255), multiply by 4, and that't the Pot's target value.
It really requires PI or PID control, not hard to implement but really important.
Don
__________________
I am N2IRZ - What's your callsign?
|