Need help for understanding PIV autotune

Questions about using encoders with the Roboclaw product line
Post Reply
Konstantin
Posts: 3
Joined: Mon Feb 27, 2017 5:00 am
Need help for understanding PIV autotune

Post by Konstantin »

I have RoboClaw 2x15 and Firmware Version 4.1.19
The motors are from Pololu https://www.pololu.com/product/1444
With quadrature encoder 64 counts per revolution of the motor shaft, 3200 counts per revolution of the gearbox’s output shaft.
Motor power 12 V and speed 200 RPM
Calculated QPPS is 10 666 ( 3200 pulses per rotation, 200 RPM, max speed (200 / 60) 3200 )
I test RoboClaw in PWM mode - motors and encoder works correctly.
I make PIV auto tune - result on picture https://yadi.sk/i/OHtFnkwC3EiT7r

But RoboClaw does not drive straight.
I set the same Accessel, Deccel and Speed for both motors in commands SpeedAccelDeccelPositionM1 and SpeedAccelDeccelPositionM2. Result on picture - https://yadi.sk/i/7lxZ76US3EiYxM
Red - expected path.
Blue - actual path.

I correctly understand that the M1 accelerated more than the M2?
What am I doing wrong?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Need help for understanding PIV autotune

Post by Basicmicro Support »

First check if your QPPS is correct. Run the motor at 100% power in the PWM Settings screen and read the speed at the top of the screen. That is your actual QPPS for that motor at that voltage.

If that is not the cause then check the encoder signals with an osciloscope if you have access to one. Look for noise in the signals. If there is noise this can be causing false encoder counts. We have seen a fair number of motors with these magnetic hall sensors have encoder noise problems because of snubber caps that are on the pcbs of the encoders. These snubber caps are putting a large amount of noise into the board which feeds back to the Roboclaw via the 5v power and the encoder signal wires. Removing these snubber caps from the pcb has fixed all the encoders we have had this problem with. We install external snubber caps directly to the motor leads instead.

You can determine which cap(or caps) are the snubber caps by checking continutity from the motor power leads to one or both sides of a cap on the encoder PCB. If it is a motor with a singal snubber cap one side will have continuity to one motor lead and the other side will have continuity to the other motor lead. If there are two caps one side of each cap will have continuity to a motor lead.

If encoder noise is NOT the problem then your tuning may be incorrect.

Assuming it was not an incorrect QPPS and not a bad encoder please provide me the code you are using to run the motors.
Konstantin
Posts: 3
Joined: Mon Feb 27, 2017 5:00 am
Re: Need help for understanding PIV autotune

Post by Konstantin »

Hello!

I check QPPS as you recommend, experimental result are
M1 QPPS = 11 655 - https://yadi.sk/i/-p13vJWl3EpFRA
M2 QPPS = 12 257 - https://yadi.sk/i/GI4mz4fO3EpFTq
Both motors are faster then declarated Pololu.

I didn't have oscilloscope but I made next experiment.
I make one full rotation and encoder result was equal 3200.

Now I fill real QPPS to each motor before PIV tuning?
Or Minimum? Or Maximum?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Need help for understanding PIV autotune

Post by Basicmicro Support »

QPPS is not that critical. If you are within 10% of the motors actual speed then that is fine. However your symptoms still point to encoder problems. Manually turning the encoders wont show the problem. The motor must be running to show the problem.

Run the motor for 10 seconds in one direction. Not the Distance the encoders travel. Then run the motors in reverse for 10 seconds(same power level in each direction, use PWM settings screen in Ion Motion to do this). Note the second distance traveled. If they are off by more than a little bit that will show there is an encoder problem.

Also, instead of using the Individual motor commands, send the SpeedAccelDeccelPositionM1M2 command instead. There are alot of arguments in those commands. If you are using the default baudrate that could be slowing down the start of the second motor enough to cause the delay in your motion you are seeing. If the second motor starts some time after the first then the first motor will always be faster than the second during the acceleration period causing the robot to turn some during the acceleration phase. Then once both motors are at the same speed the robot would move in a straight line, until they start decelerating. At which point the first motor would start to decel fist which would cause the robot to turn back the other direction some while decel is happening.

Using the dual motor command will start both motors movements at the same instant.
Konstantin
Posts: 3
Joined: Mon Feb 27, 2017 5:00 am
Re: Need help for understanding PIV autotune

Post by Konstantin »

I damage one of motor :(
Now waiting new from Pololu.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Need help for understanding PIV autotune

Post by Basicmicro Support »

Sorry to hear that. Let me know when you are setup again and I'll help you out.

Post Reply