Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Set PID gains from command line #46

Open
naoki-mizuno opened this issue Mar 25, 2018 · 4 comments
Open

[Feature Request] Set PID gains from command line #46

naoki-mizuno opened this issue Mar 25, 2018 · 4 comments

Comments

@naoki-mizuno
Copy link
Contributor

naoki-mizuno commented Mar 25, 2018

It would be nice to be able to set the PID parameters from the command line utilities i.e. dynamixel and p2-dynamixel. Example usage:

$ p2-dynamixel set-gain-pos-p --id 1 80
$ p2-dynamixel set-gain-vel-i --id 2 20
$ p2-dynamixel st-gain-pos-i --id 3 30
Error: ProH54200S500 does not support setting the Position I gain

Currently, we can get/set the gains using:

# Read position P gain for ProH54200S500
$ p2-dynamixel read --id 1 2 3 -a 594 -s 2 --timeout 0.3
# Write
$ p2-dynamixel write --id 1 2 3 -a 594 -s 2 -v 80 --timeout 0.3 

but it'd be nice to have a command for that.

Dynamixel Pro addresses:

Name Address
Pos P 594
Vel P 588
Vel I 586

MX-106 (and probably MX Series Protocol 2):

Name Address
Pos P 84
Pos I 82
Pos D 80
Vel P 78
Vel I 76
@naoki-mizuno
Copy link
Contributor Author

It would be even nicer if we could set this in dynamixel_control_hw's YAML file. Maybe like:

dynamixel_control_hw:
  serial_interface: /dev/ttyUSB0
  baudrate: 57600
  # ...
  servos:
    first:
      id: 1
      gains:
        pos:
          p: 30
          i: 10
          d: 0
        vel:
          p: 40

@dogoepp
Copy link
Member

dogoepp commented Mar 26, 2018

You're right, it would be nice to add these fields in the command line utility, as well as (most of) the others. I'm thinking on possible angles to add all these fields at once. If you have ideas, it's welcome.

However, I'm not sure about about integrating it in dynamixel_control_hw. It seems to me to not be the right tool to configure the actuators. One reason is that we wouldn't check if the configuration went well. Also, we would be writing this EEPROM at every startup, which is useless and a (limited but useless) wear of the EEPROM.

Nonetheless, I'm open to discussion and I agree that the current way to configure the servos is not really satisfying. Maybe we could do a configuration tool using ROS ? It could also understand YAML configuration, should you want it.

Besides, have you already tried Dynamixel Workbench?

@naoki-mizuno
Copy link
Contributor Author

I'm thinking on possible angles to add all these fields at once

I'm not too sure about adding all the fields to the command line utility. I would say it may clutter the subcommands help message too much, and I think just the ones that will be used frequently should be added (maybe min/max voltage limits, homing offset, and other limiting fields).

we would be writing this EEPROM at every startup

IIRC, the PID gains are stored in the RAM so it gets reset every time. I'm not sure what the rationale behind this is, but I believe being able to set the gains to appropriate values every time ros_control is brought up reduces the amount of task for the users. Just out of curiosity, how do you guys set the PID gains for your application?

Besides, have you already tried Dynamixel Workbench?

Last time I checked, they didn't have a ros_control interface, so I ended up not using it. I needed ros_control because I wanted my programs to work both on Gazebo and the actual manipulator.

@dogoepp
Copy link
Member

dogoepp commented Mar 27, 2018

Adding fields

The fields you use regularly depends on your usage of the actuators. I personally use the mode switch rather regularly, but almost never the other fields. Therefore, any choice of which parameters to support would be arbitrary.
I don't mind adding a few field, but doing so I might go the extra step to support most, if not all, parameters.

Anyway, I'm a bit busy with other things right now. It would need to wait for some time.

Setting PID parameters

I had forgotten that the PID parameters are set in the RAM. You're right.
This topic should be tracked in an other issue at dynamixel_control_hw.

Dynamixel Workbench

It seems to still lack this interface. I just saw it yesterday and thought that their dynamixel configuration soft seemed cool so I was curious to know if you had tried. Doesn't solve your issue, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants