2x60hv encoder tuning

Questions about using encoders with the Roboclaw product line
Post Reply
cjmbasicmicro
Posts: 6
Joined: Sat Mar 07, 2020 9:11 am

2x60hv encoder tuning

Post by cjmbasicmicro » Tue Apr 28, 2020 6:36 pm

I determined QPPS to be about 22500 for my motor. M1 Speed in motion studio is positive when I move the Motor1 control up (and speed is negative when I move the control down), so, I believe have the direction right.

However, autotune doesn't work. Autotune makes very severe/rough forward and backward motion of the motor, for a few seconds, then, returns P=1.29, I=.15, D=0, and QPPS=27,562 (which is different than what I measure). Then, when I test using the slider on the velocity screen, by moving up just a bit, the motor immediately goes to full speed forward. In a subsequent auto-tune attempt (the one reflected in the config file below), auto-tune determined QPPS to be 7312..

Do the current limits, current blanking, default speed, or default accel/default decel on the General Settings screen have any interaction with the autotune?

Nor does the manual tuning procedure (setting QPPS, and starting with P=1, I=0, D=0. ). Same thing motor jumps to full speed forward as soon as I move the Motor1 velocity Control slider up.

I wonder where's some other setting in my controller that's getting in the way of the PID loop working..

Can you help me diagnose?

Thank you!

User avatar
Basicmicro Support
Posts: 1365
Joined: Thu Feb 26, 2015 9:45 pm

Re: 2x60hv encoder tuning

Post by Basicmicro Support » Wed Apr 29, 2020 8:02 am

Please dont post raw file data like that in the forums. If you need to send a file please send an email to support.

Im assuming you are using Velicty Settings to tune the motor.

Auto tune will not work for all situations. If there is alot of backlash in the gear train or anything that causes a significant amount of non-linearity in the load(like a severaly lopsided load) can cause the autotune to fail.

Based on your description autotune is getting widely different values from run to run which means it is not reading things correctly. This could be the above or something to do with the enocder.

If you have a scope check the encoder signals for noise. If they are not clean square qaves you may need to add some filtering.

If you have lowered the default current limits before autotuning that can have an effect. The autotuner runs the motor back and forth to get measurments. If the current limit is set too low the autotuner cant move the motor appropriately and the tuned values will be wrong and could be the cause of your random variance from run to run. Same with voltage limits. If your setup is using a power supply more so than a battery, if the controller brakes the motor because of an over voltage due to regen which could happen in the autotune routine, then you will also get invalid autotune readings.

If the motor jumps to full speed when you have set P=1 and I and D to 0 then your encoder readings are not valid. When only P is set it is basically being controlled like open loop Duty control so it should NOT take of at full speed when you move the slider to low speed setting.

I recommend you call in so I can walk through some things with you to see what may be going on.

cjmbasicmicro
Posts: 6
Joined: Sat Mar 07, 2020 9:11 am

Re: 2x60hv encoder tuning

Post by cjmbasicmicro » Wed Apr 29, 2020 8:36 am

I'm using a quadrature encoder

https://www.digikey.com/product-detail/ ... D/10269186

that has differential signals A+, A-, B+, B-. I wired A- and B- to ground on the roboclaw, and A+ and B+ to ENC1 A and B on the roboclaw. Configured for 48ppr. According to the spec sheet the encoder provides about +3.3v between A- and A+.

The M1 speed seems to be perfect in sign&magnitude at all speeds of the motor including top speed which is about 27k qpps.

One question I have is logic battery voltage; on the Basicmicro Motion Studio software the Logic Battery is 2.1-2.2 volts. Where is this coming from? (My controller doesn' have the jumper to "force" using its internal BEC for logic battery). I'm driving the controller using RC signals and I'm quite certain that source of those signals (which is a Pixhawk autopilot) has a good +5v. Does logic battery voltage of 2.1 raise any concern to you?

I'll call in a bit later to discuss.

cjmbasicmicro
Posts: 6
Joined: Sat Mar 07, 2020 9:11 am

Re: 2x60hv encoder tuning

Post by cjmbasicmicro » Wed Apr 29, 2020 7:07 pm

Thanks to basicmicro's excellent phone support this issue was tracked down to a firmware problem. I updated firmware and everything started working!

User avatar
Basicmicro Support
Posts: 1365
Joined: Thu Feb 26, 2015 9:45 pm

Re: 2x60hv encoder tuning

Post by Basicmicro Support » Thu Apr 30, 2020 7:46 am

Just to tie up all the loose ends, the Logic battery voltage is the actual voltage on the Logic battery input. When not being used this input can float. Usually it floats below 3v as in your case. In some cases it can float above 3v which can cause a false Logic Battery low error. In those cases we recommend adding a jumper to the LB+- pin to hold the input at a solid 0v.

Note, on old models there was a separate jumper to connect the LB input to the Main Battery input. That is handled now through automatic switches so there is normally no jumper.

Post Reply