RC Mode position control with feedback

Questions about using encoders with the Roboclaw product line
Post Reply
-Martin-
Posts: 2
Joined: Wed Apr 06, 2016 11:06 am
RC Mode position control with feedback

Post by -Martin- »

Hi,

I have bought a Roboclaw 2x7A motorcontroller to be used for position control (servo) with feedback from 10-turn 5K ohm pots and control via RC mode.

Tried to calibrate the system with the Ionmc App this afternoon, but could not get it to work properly. The motor did not follow the slider in any situation (manual or auto tune) and mostly would just be buzzing and sometimes moving a little back and forth. If changing the dead stop values the motor would run to a new setpoint, but not the one specified by the slider.

I have calculated the QPPS from the formula given in another thread, however I have one doubt; Should I use the actual motorspeed or the speed of the geared motor output shaft?

360/Degrees of pot range * (MaxPotValue-MinPotValue) * (RPM/60) = (360/3600)*(1810-0)*(18/60)=54

360/Degrees of pot range * (MaxPotValue-MinPotValue) * (RPM/60) = (360/3600)*(1810-0)*(5600/60)=16893

I have connected a 7,5k ohm resistor to the 5V line to the pot as described in the manual and it seems to work correctly in the Ionmc App, where it measures from 0 to 1810 (0-1,8V) stop-to-stop.

I am hoping that you can point me in the right direction on order to get my system op and running and I have attached two screen shots to check my setup.
1.png
1.png (83.02 KiB) Viewed 6363 times
2.png
2.png (76.5 KiB) Viewed 6363 times
Brgds

Martin
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: RC Mode position control with feedback

Post by Basicmicro Support »

1. Autotuning probably wont work for a 5 turn pot. The resolution is so low it cant really get any good data from it, so manual tuning is required. I recommend you call in for support on the manual tuning. It will be very difficult to go back and forth in the forums helping you out with the tuning. If you cant call in, I can setup a time I will be available on skype. Email support@ionmc.com if you can use skype, with your skype name and I'll add you to my contacts.

If you cant do that, then the steps for tuning is to keep increasing P until the motor starts to oscilate instead of stopping at the set point. Then back P off to 2/3rds that value. In your case you may not need any I or D at all. If you need D a good starting point is 10 times P. I dont recommend I with such a low res encoder.

2. Witha 5 turn pot you can probably run the motor to determine the QPPS. Move it all the way to one end of the pot and then run it at 10%, 25% or 50% PWM and read out the encoder speed. Then multiply that value by 10,4 or 2 depending on the PWM you used.

When calculating from a formula, the RPM is the RPM at the encoder/pot.
-Martin-
Posts: 2
Joined: Wed Apr 06, 2016 11:06 am
Re: RC Mode position control with feedback

Post by -Martin- »

I managed to solve the problem, don't know if I am wrong here, but I thought the software position slider would work irrespective of which mode the Roboclaw was set at? In my case I had it set to RC, as this is the mode I will be using. I found however that the slider did not work in RC mode, so only after changing the Roboclaw to serial mode was I able to control the motor via the software.

After clearing above issue, manual tuning was no problem and as you said, no I or D was needed.

Thank you for the assistance.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: RC Mode position control with feedback

Post by Basicmicro Support »

When in RC or Analog mode those signals are constantly sending commands to the motors. So technically the sliders do work but are immediately overridden by the RC/Analog input signal. So in effect they will not work do anything when the Roboclaw is in RC or Analog mode.

The solution is to change back to PacketSerial temporary(without saving the setting).

Post Reply