Autotune causing IonMotion v 1.66 to hang

Questions about using encoders with the Roboclaw product line
Post Reply
bsorel
Posts: 18
Joined: Sat Jan 16, 2016 11:02 am
Autotune causing IonMotion v 1.66 to hang

Post by bsorel »

As soon as I hit the command to autotune, whether it is in velocity or position control the program freezes. I not only have to restart the program but also power cycle the RoboClaw. As I said before I'm using v1.66. The Roboclaw model is an 2x7a and firmware is 4.1.16. I have no problems in PWM manually controlling the motors and reading encoder counts. Just looking to run these motors at the same speed.

thanks.
bsorel
Posts: 18
Joined: Sat Jan 16, 2016 11:02 am
Re: Autotune causing IonMotion v 1.66 to hang

Post by bsorel »

I'll add what I'm attempting to do. maybe in this context this will help. I am trying to get the motors to sync with each other which is a mixture of position and velocity control. When you get a pair of linear actuators no matter what the quality of them one is always faster than the other. If it was linear error that would be easier to correct but still I am attempting to tune the faster motor down so it drives maybe 95% of it's maximum. I've attempted this in code to send lower setpoints but like I said it's not linear and does not work plus I don't want custom firmware for each one of these units. So, all that said. What is my best plan of attack here?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Autotune causing IonMotion v 1.66 to hang

Post by Basicmicro Support »

First, for linear actuators with analog encoders I recommend you use the IonMotionQA/firmware release. We've specifically changed the A/D sampling for motors like linear actuators(eg motors with analog encoders) to improve noise immunity on the encoder inputs. Noise caused problems in the older firmware for these kinds of motors combined with their large deadzone/slop it made tuning them particularly hard.

Whether you use the new or older IonMotion, before autotuning you need to make sure your motors encoder is working correctly. That means it is reading in the correct direction on the correct encoder channel. When in the PWM Settings screen move the motor slider up. The encoder value(for that particular motor) should increase when the motor starts moving. If it does then you are wired up correctly. If it doesnt or is on the wrong encoder channel then the autotuner will not work correctly(freezing is one possibility).

Second cause of problems is if your are running from a power supply that can not provide enough power. The autotuner can pull the maximum power the motor will draw. If you are using a power supply this can cause brownouts.

Third cause of problems, if your USB cable doesnt have a choke on it, noise from the motor can cause the USB to disconnect which will also cause the software to freeze up(this is fairly rare but happens).

With lienar actuators I usually manual tune them. The reason is because of the very large slop in them. Also with linear actuators I usually only use P for position control and almost nevery use velocit control at all(because their encoders tend to be very low resolution). I recoommend you start with Vel PID values all set to zero(except QPPS which needs to be set reasonably close to the motors maximum speed), and set all the Pos PID values to 0 except P and MinPos and MaxPos. Set P starting around 2000 adn start increasing from there. Set MinPos and Maxpos near but not at the min and maximum encoder positions on your motor.

Test by setting a posiiton on the slider. Increase P until the motion is direct and stops without any overshoot but stops sharply at the setpoint.

After you have position control tuned you can still use speed accel and deccel values even if you are not using Vel PID settings.

Once both motors are tuned well you should be able to run them synced. However you will not be able to run at 95% of the motors speeds in most cases. You must have margin for sticking points(most linear actuators are less than smooth) or changes in the load. I would estimate 80% would be the best you can expect but you can use the PWM charting option in IonMotion to see how close your motors are getting to 100% duty when running a position movement at some speed. If the controller is maxing out the PWM duty then you are going to fast or have too heavy a load on the motor for that speed.

Remember, PID control is not magic. If the motor doesnt have the power to make a movement it wont no matter what the PID tries to do.
bsorel
Posts: 18
Joined: Sat Jan 16, 2016 11:02 am
Re: Autotune causing IonMotion v 1.66 to hang

Post by bsorel »

I should have given you more information. I am using linear actuators but I have quadrature encoders on each of them. One runs around 140 qpps and the other around 130. I thought that by running command 37 run M1 and M2 with signed speed around 130 they would just sync. It appears that this isn't the case. Perhaps a lower speed value? Where can I find this IonMotion QA/ Firmware release?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Autotune causing IonMotion v 1.66 to hang

Post by Basicmicro Support »

At best you will be able to run around 110 to 120. 130 is the absolute max speed of the one motor. You have to leave margin. I usually recommend 20% because over the full range the actuator will almost never be able to hold that speed. Anywhere it cant hold that speed(because its already maxed at 100% power) will cause it to slip behind the other actuator.

I recommend you chart the PWM of both motors in IonMotion while running them side by side. If either motor hits max PWM while moving you are trying to move too fast. If you'd like help with that call us and I'll walk you through running that test.

The QA release is recommend for linear actuators with analog encoders but isnt required for quadrature based encoders. However you can still get it in the General Discussion forums announcement for IonMotionQA 1.7.0. We plan on replacing 1.6.6 pretty soon with it anyway. We have a few more GUI changes we are making before that though.

Post Reply