Page 1 of 1

Roboclaw 2x60 with servocity super duty linear as servo

Posted: Mon Aug 12, 2019 10:51 am
by Sazabi
Hello,

I have some questions regarding Roboclaw setup. As subject states, I'm using Roboclaw 2x60 with Servocity (robotzone) superduty linear actuator.I want it to behave as giant servo. Actuator has built-in multi-turn 10k pot. I've separated pot wiring from motor power wires (had some irratical encoder data readings in Motion Studio), added 15K resistor on 5V line. Encoder readings goes from ~280 to ~1770. On PWM Settings screen running motor at full speed, top menu showed ~360 value. Is it possible to find QPPS with this info, or should I count pot rotations for a full actuator throw? I dont have motor RPM value, but I think I can figure it out if needed. Manual states motor duty cycle is 25%.
On General Settings tab, PWM mode, sine works, but locked antiphase just runs actuator in one direction till endstop and than no reaction. Even with encoder deactivated. Which should I use for correct control?
Without encoder activated, control is just as it should be. With encoder, P set to 2000, I and D to 0 rod keeps struggling back and forth. Deadzone set to 0 to 15. With deadzone set to 20 control is nearly great, sometimes rod doesnt get back to starting position. But unrecognized joystick stroke is too big, I'm loosing few cm of movement from center point.
Editing PID settings doesnt help much. Is that because of wrong QPPS setup? I've used valuse of 360. The only thing helped is deadzone, much, again, I'm loosing too much of small movement from center.

Re: Roboclaw 2x60 with servocity super duty linear as servo

Posted: Tue Aug 13, 2019 9:31 am
by Basicmicro Support
QPPS is the top speed measurement so 360. I recommend setting it slightly higher than the actual top speed.

You should never change the PWM mode to Locked antiphase unless you have a specific application that requires it. Otherwise leave the default set to Sign Magnitude.

Make sure you are using the latest Basicmicro Motion Studio. Note that a P of 2000 is way to high in the latest software. I would estimate a P value of between 5 and 20 for a linear actuator.

Also, a deadzone of 20 is pretty high. Not unheard of but I recommend starting with a deadzone of 2 to 5 on a linear actuator.

If you still have trouble tuning it please call in to support.

Re: Roboclaw 2x60 with servocity super duty linear as servo

Posted: Tue Aug 13, 2019 9:53 am
by Sazabi
Thanks for the answer!

Actually, I've already came to conclusion, that suggested in manual 2000 for P is too much. Don't have it by hand right now, but got nearly usable results with 200-500 for P, but I used ~2400 for QPPS, because that's what I got from formula seen here on forum. Shortening works just great, while extruding is a bit weird - after reaching starting point, it keeps extruding slowly and than gets back fast.
I will try suggested low P and QPPS tomorrow.
Thanks!

Re: Roboclaw 2x60 with servocity super duty linear as servo

Posted: Wed Aug 14, 2019 10:45 am
by Basicmicro Support
Show your math for calculated QPPS. I may see the mistake. Obviously, the measured speed is the best value to use for QPPS.

Everything else should be 0 when you start. Then set P to something low(5 for example). Move the position slider to a new position. The actuator should move toward the target. If it doesn't reach it the P is too low. If it reaches it by goes past and comes back then P is too high.

Once at the position if it kind of bounces back and forth randomly or not, that indicates slop in the system is causing oscillation. Set a deadzone in that case. Start with 1 and increase intill it no longer oscillates while at the target position. Only add the deadzone after you tuned the P. P alone will not cause oscillation unless it is really really high.

We recently changed the PID settings to be based on a seconds instead of PID cycles. This makes it a bit more universal compared to other companies PID settings. Old setting scan be converted by dividing by 300(for Roboclaw) and 625(if MCP). so 2000 in the old format is 6.7 in the new one.

Re: Roboclaw 2x60 with servocity super duty linear as servo

Posted: Wed Aug 14, 2019 1:04 pm
by Sazabi
Tried today with lower QPPS and P values. Having same reaction as before. Thanks for detailed description. Actually, I'm having oscillation on any P values with deadzone below 5. I dont feel there's any slope, or at least that big, in gearbox. But, I guess, I'm wrong.
I've used this formula for QPPS - 360/Degrees of pot range * (MaxPotValue-MinPotValue) * (RPM/60).
My pot runs 8.5 turns for a desired distance. So 8.5*360=3060. Maxand min values 1820-307, so 1513. RPM is the trickiest part. Full stroke is 304.8mm, max speed is 67.1mm/sec (no load, same as my tests are). Lead screw pitch is 5mm. So screw makes 60.96 rotations for 304.8mm and nut runs for 4.54sec. So it would be ~805.6rpm. 360/3060*1513*805.6/60=2384.

Re: Roboclaw 2x60 with servocity super duty linear as servo

Posted: Thu Aug 15, 2019 9:54 am
by Basicmicro Support
Electrical noise the most likely cause in that case. Add a .01uf cap from the analog signal line to ground. That should clean it up.

The pot is linear so your 360 degree value in the calculation is where you got it wrong. You need to know the number of turns the motor takes for a complete movement along the linear pot. Then divide that by motor RPM rating and divide that by 60. That will give you distance along the linear pot per second. Then you divide that distance by the full movement distance and multiple that by 2047. For example if the linear actuator moved the full distance in exactly 1 second then your QPPS would be 2047. If it moved half the distance in 1 second your QPPS would be 1023.

That is why I usually just tell people to measure the speed by moving the actuator and reading out the speed shown in Motion Studio :) .

Re: Roboclaw 2x60 with servocity super duty linear as servo

Posted: Sat Aug 17, 2019 4:53 am
by Sazabi
Ok, I'll just write down speed from Studio:))) Thanks!
Another problem. Took my second 2x60A. First one, v7, is ok, controlls one linear with pot and one motor without. Second 2x60A is v6C, just opened package. Flashed new firmware. This one will control 2 linear actuators with feedback, large servo style. One actuator reads pot values from 0 to ~750, speed 350 and works great. Another actuator pot shows values 365 to 1055. I can control it with no problem without encoder activated. But It doesnt react if I place a tick on Use Encoder box. Both pots selected as absolute. Second actuator pot selected to be in reverse. Tried both actuators on v7 driver, works with no problem. What could be the issue with v6c?

Re: Roboclaw 2x60 with servocity super duty linear as servo

Posted: Mon Aug 19, 2019 9:54 am
by Basicmicro Support
I recommend you reset the V6 unit to defaults and setup the settings again. Functionally there is no difference between the V6 and V7 board. We just changed to a new mosfet which lets us cool them better(eg no air gap).

The Enable encoder check box only enabled using Velocity/Position control with RC/Analog controls. It doesnt setup the motor to use Velocity/Position control. You still need to make sure the motor is controlled properly before enabling the check boxes.

1. Uncheck the check box. Open Position Settings screen in motion studio. Move the motor slider. Does the linear actuator move as it should?

Re: Roboclaw 2x60 with servocity super duty linear as servo

Posted: Fri Oct 11, 2019 10:17 am
by Basicmicro Support
1. You need to adjust the P value(D should be zero for most linear actuators) until moving the Position slide causes the actuator to move at full speed toward the target position and stop exactly on the target position. If the actuator starts slowing down early the P value is too low. If the actuator overshoots the ta5rget position and comes back, the P value is too high.

2. Linear actuators tend to have a lot of slop/backlash. You will probably need to set a deadzone of 2 to 5.

3. Make sure your min and max position limits are set correctly. These values will be used to map the RC signals to positions.

4. After everything is working correctly in motion studio, open General settings. Change the control mode to RC and set the Enable Encoders for RC/Analog check box for the motor channel you are using.

RC signals should now control the target position of the actuator and when the stick snapps back to center the motor will move back to center.

Note RC mode has auto calibration on by default. When the Roboclaw powers on the RC stick should be centered. If it is not the zero position will be set at whatever position the stick is currently at.

Re: Roboclaw 2x60 with servocity super duty linear as servo

Posted: Tue Oct 15, 2019 5:04 pm
by Basicmicro Tech
Please take a look at our linear actuator article for an overview on using linear actuators with RoboClaw.