How to tune motor responsiveness

There are a number of parameters in the file:
/opt/ros/kinetic/share/magni_bringup/params/base.yaml

I am interested in tuning the motor responsiveness between “smooth ramp” (as it currently is) and a more “fast ramp”. Can you provide guidance on which parameter(s) we should use for this?

Also, I’d like to try out top speed of Magni (just to see what my options are with this platform).
I could edit
/opt/ros/kinetic/share/magni_teleop/param/logitech.yaml
but I’m sure there is a better way…

What’s the best way to enable top speed for experimenting?

Thanks!

There are a number of things that limit speed by design

  1. Physical limits (how fast the motors actually can go)
  2. PWM (Pulse width modulation) limits on the motor controller
  3. Limits in the motor controller node
  4. Limits in the application that is driving the motor controller node.

Let’s tackle these one by one.

1 - The motors are designed with a certain winding structure and this limits the top speed of the robot. There are advantages to a lower speed motor in that its got more torque and is a little more efficient. We selected a motor with a speed that’s pretty standard and we felt was a good trade off. However if you want a higher speed motor that is certainly possible. Its relatively easy to swap the motors out. We have in stock have a theoretical top speed of 15kmh - that is more than 4ms. Email contact@ubiquityrobotics.com if you want to pursue tests on those.

2 - PWM is a parameter that is set in the motor-controller firmware and it is essentially the duty cycle of the transistors that provide power to the motors. The gate drivers that switch those transistors can not run at 100% duty cycle so we’ve set a PWM limit in firmware. The firmware will notify the motor-node if the PWM limit has been reached and this is notified as a message from the motor controller that you can see when the motor controller is running. We’ve put in are reasonably conservative limits - if you feel they are limiting we can do a firmware update to put in less conservative limits.

3 - The motor node has limits to velocity, acceleration and jerk. For more on these limits and how to modify them check out the motor node documentation here:

4 - Application layers sometimes have limiters for example move_basic our simple navigation node has velocity and acceleration targets in it these can be set. For more see the details in the move_basic documentation.

http://wiki.ros.org/move_basic

For 3 and 4 editing the parameters as documented will lead to top speed.

1 Like

Update: I modified the joystick params to make the Magni go faster, so I could experiment with handling forward and backward over various terrain at a fast-walk.

I modified /opt/ros/kinetic/share/magni_teleop/param/logitech.yaml as follows:

scale_linear: 0.3 --> 0.75
scale_linear_turbo: 1.0 --> 3.0

with these setting, regular speed was fine.

When I went to turbo mode (bottom button), it ran nice and quick, but then a weird thing happened.

Problem #1:
The robot stopped responding to the joystick, and just kept going for a while. I could not stop or turn.

It eventually “caught up”, and started responding to joystick commands again (in fact, it responded to a turn I had given it earlier). So, I think it must be buffering up the commands it receives for a while, or something going on with the speed control.

Problem #2:
I caught up to the robot and pushed the Motor Enable switch in to disable the wheels, but it kept going!.

I tried this several times in forward and reverse, both problems are very repeatable.

So,
Question #1: Can you provide a clear recipe for the correct way to enable the Magni to run at full supported speed when the bottom trigger is pressed? (I realize that will be slower than full motor speed due to the power constraints you explained). I looked at the parameters that can be set in the ubiquity_motor node, and it looks like there is a lot of opportunity to really screw things up, so I’d rather just get clear guidance from you experts.

Question #2: I would like to modify the speed ramp, so the robot accelerates and decelerates a little faster. I see limits on Max/Min acceleration, but not sure how to change the overall ramp ?

Question #3: Can you explain why the motor enable switch did not immediately stop the wheels?
I naively assumed the switch would immediately cut all motor power…

Please do not take the above as criticism, I am very pleased with the Magni performance and capabilities. I’m just pushing the envelope to see where the limits are!

P.S. maybe the queue_size for motor messages is too large on the motor driver node?