I am building a custom AGV from HEBI actuators (2x X5-9 at the front, 2 X5-1 at the back) and mecanum wheels. And my problem is, when I send a groupcommand, that they should move with 1 rad/s, the X5-9 can complete this task fully, but the X5-1 are going with like ~0.8 rad/s so the AGV is constantly drifting. I thought of getting a velocity feedback and adding the difference to the actual speed but I don't know how the professionals would do it so any tips would be appreciated.
Can I somehow "brake" the actuators which are not being used? My idea was to rotate it with something like 0.1 rad/s in the other direction, but I think that would damage the actuator in the long run no?
Thanks for the help :
With the mobile bases, it's best if you can use all actuators of the same type. The reason the actuators track differently is that the X5-9s have significantly more torque compared to the X5-1s, so they track the velocity command more easily under acceleration load and wheel friction. I don't know what actuators you have access to, but even if you can swap out the X5-1s for X5-4s, things should get a good bit better.
However, if you don't have 4 of the same actuator, it may be possible to tune the actuators to respond similarly. To start with I would try adding Velocity I gain and increasing it on the X5-1s. You may also need to raise the I-Clamp value from its default setting. It is also important to limit the overall acceleration of the system, since the X5-1s will reach their torque limits much sooner than the X5-9s.
Another thing that should help is to command positions as well as velocities. If you are currently sending just velocity commands, you can forward-integrate those commands at each timestep by your dt to get get a commanded position, and send those to the actuators as well. This will act similarly to the Velocity I gain, with the benefit that it will only 'wind up' to the proper wheel position. Note that you will now also have to tune the Position P gains as well.
We do this combined position/velocity method in our kit Matlab example code, and also make use the HEBI Trajectory API to get smooth velocity profiles. This also has the advantage of making it easy to limit the commanded acceleration of the base, which is probably important in your case. An example is here:
https://github.com/HebiRobotics/hebi-ma ... emo.m#L148
Finally, commanding positions also will help you get the 'braking' behavior you're looking for, since you're always actively commanding wheels to a certain position, even if it's stationary.
Hope this helps,
It's me again with a question
I tried to get started with the position control+velocity control strategy, and I started to experiment with the actuators.
So I write this code:
Code: Select all
while True: group_command.position = [10.0,10.0,10.0,10.0] group_command.velocity = [3.0,2.0,3.0,2.0] group.send_command(group_command)
Because in my case it goes to the position but ignores the velocity command. I even set the max velocity to +-3 for the x5-1s in the gains tab but they just started to blink orange but no real effect.
So the question is why do they ignore the velocity command? It doesn't work like this, or it has a priority in completing the commands? I also saw the matlab example you linked, and noticed that you are working with trajectory, but the idea seems the same for me, you set the velocity and the position the same time.
Sorry for the delay in replying.
The API for command actuator motion works a differently than what you're describing. Rather than command a large step in position and wait, the API is intended to be used where positions / velocities / torques (effort) are commanded continuously at a high rate (~100 Hz). To go to a position smoothly you command all the intermediate steps in in position, along with the matching velocities and torques based on the intermediate velocities and accelerations.
So for example if you went from 0 to 10 radians in 10 seconds with constant velocity (no ramp up / ramp down), you could command every 0.01 seconds (pseudocode below):
Code: Select all
pos=0.01 (rad) vel=1.0 (rad/sec) pos=0.02 (rad) vel=1.0 (rad/sec) pos=0.03 (rad) vel=1.0 (rad/sec) ... pos=9.98 (rad) vel=1.0 (rad/sec) pos=9.99 (rad) vel=1.0 (rad/sec) pos=10.00 (rad) vel=0.0 (rad/sec) <--- zero velocity now that you're stopped
One last note is that the velocity limits you are setting on gains are limits on the input and output of the low-level controllers on the actuator. If you want to physically limit the speed of the actuators in all cases, you can specify limits in the safety controllers for each actuator.
Hope this helps,