Velocity Control Limit

Questions about using encoders with the Roboclaw product line
Post Reply
matteo.corno
Posts: 2
Joined: Mon Jun 01, 2020 10:18 am

Velocity Control Limit

Post by matteo.corno » Mon Jun 01, 2020 10:34 am

Good day,

I am working on a project that uses a RoboClaw and a DC brushed motor. The project requires switching from positive to negative speed as fast as possible. To command the velocity, I am using velocity control PID command 35

Send: [Address, 35, Speed(4 Bytes), CRC(2 bytes)]

Everything works fine for relatively small velocity jumps. Far larger jumps RoboClaw encounters stops controlling the motor speed. The motor simply stops.

Using command 38

Send: [Address, 38, Accel(4 Bytes), Speed(4 Bytes), CRC(2 bytes)]

seems to alleviate the issue, but I am making the response slower and it does not completely remove the problem. Similarly, if I change the PID tuning the velocity jump amplitude that determines the problem changes, but it is always there for some speed.
I have tried to apply PWM steps up to 80% Duty Cycle and both the motor and the electronics (I have a vclamp installed) manage the speed inversion with no problem. Unfortunately, the direct PWM control does not yield good speed tracking.

Is there some safety measure implemented in the velocity PID to avoid speed inversions? Is it possible to override it? In MotionStudio, there is a maximum error option, does it apply also to the PID? If so, I couldn't find the command in the documentation to disable that check.

I have tried to implement the PID manually, but unfortunately my code runs at too low a frequency to achieve the required bandwidth.

Any help would be appreciated.

Best regards

Matteo

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

Re: Velocity Control Limit

Post by Basicmicro Support » Tue Jun 02, 2020 8:03 am

I will need to see how you have setup the Roboclaw. Take a screen shot of the velocity settings and general settings screens.

Also how are you powering the Roboclaw?
What are you motor specifications?

My guess is this is a power supply issue, or you have set the velocity error limit. But please describe you rsetup in detail and provide the settings information

Email that information to support@basicmicro.com

matteo.corno
Posts: 2
Joined: Mon Jun 01, 2020 10:18 am

Re: Velocity Control Limit

Post by matteo.corno » Tue Jun 02, 2020 9:22 am

Good day,
thanks for your reply.

I have tried to run my code with the Roboclaw connected to Motion Studio. I can confirm that, as indicated by your reply and suspected in my message, the problem seems due to a Speed Error Limit fault - Motion Studio shows a speed error limit red status.

Is there a way to set this value not via motion studio but via the serial communication? In the documentation, I could only find the command code to set the maximum current limits, but not the maximum error.

Thank you for your support.

Matteo

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

Re: Velocity Control Limit

Post by Basicmicro Support » Wed Jun 03, 2020 8:08 am

You either need to disable the velocity error limit by setting it to 0 and writing the changes to the controller using Motion studio, or you need to select an acceleration rate your motor can actually achieve with less than or equal velocity error.

The error limit is constantly comparing the target velocity with the actual velocity(unless it is set to 0). If this error is larger than the set value it will fault and stop the motor. If you want that functionality you need to set a reasonable error limit AND you must always use an acceleration rate your motor can achieve. If you specify an acceleration rate higher than your motor can produce then the velocity error will grow during acceleration eventually going higher than the velocity error limit and causing exactly the symptoms you are describing.

Post Reply