Tuning and position

Questions about using encoders with the Roboclaw product line
Post Reply
Joe
Posts: 34
Joined: Fri Dec 23, 2016 1:00 am
Tuning and position

Post by Joe »

Finally I received my RC 2x45ST and I was trying to configure it with some problems.

I'm using quadrature encoders (AMT-102, which work very well) to controll two DC 24V motors. One motor should control a linear slide the other motor is to move the whole device forward and backward to prdefined positions.
I determined the QPPS as 13350 an put that value in the IONMotion settings. The motor (I tried only one motor for the beginning) works well back and forth and the encoder's reading is as it should be.
After that I used P=1, I=0, D=0 that works as well.
But no auto tune works. Neither velocity nor position. In position mode autotune does nothing and in velocitiy the motor goes forward and back and then running endless.
Also if I set min and max positions the encoders counts well but doesnt stop at max or min position.

What could be wrong?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Tuning and position

Post by Basicmicro Support »

Make sure you have the latest firmware and IonMotion software.

Make sure the encoders increase in value when the motor is moving forward. use the PWM settings window and move the motors power slider UP for forward. If the encoder is going backwards/down relative to the motor swap the motor wires or the encoder A/B wires. Then re-test.

If that wasnt the problem check the power to the board. If you are running from a power supply it may be causing the Roboclaw to brownout during the autotune. Autotune can cause large power spikes.

Also listen for the USB connection to disconnect when autotuning. Some USB connections are more suseptible to noise than others. Since autotune uses the motors agressively there is alot of noise potential. A disconnecting USB sound would indicate this is the problem(or a brownout). The fix for USB noise issues is to use a USB cable with a ferite bead on the end nearest the Roboclaw.

Note a P value of 1 is basically nothing. A velocity P value will usually be in the thousands. A position P value may be in the 10s of thousands(though usually mine are 5 to 8000).

Note on manual tuning velocity: I usually start around 500 for P. Test and then double it and test until it reaches a point where the motor starts to noticeably vibrate(may need to have your hand on the motor to notice a difference between normal running and excessive vibration). Then back it off until you find the point where the vibration starts. Take 2/3rds of that value as your P value. Then set I to 1/10 that value and test. If the motor is too agressive reduce I until you are satisified. If it feels to damped, increase I until you are satisfied.

Once Velocity is tuned well you can usaully just set a P value for Position(PI-P control). Start with a Position P of 500 and test. Double P until the position control is too agressive. Then back it off until it is critically damped(slows to a stop without over shoot at the setpoint).

Post Reply