Control strategy 4 implementation #64
-
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Qiang, To address your questions, I'm assuming you're running the latest version of the hebi-matlab-examples repository on Github. For working with single actuators, the best place to start is with the basic examples for the X-Series actuators.
The best practice is to make a Gains XML File for your work and set it every time you run your code. An example of doing this in the Matlab API can be found here. The gains format is cross-API, so your settings can be easily loaded into the other APIs if you wind up switching later on. I've noticed now that the example gains file in the matlab examples is for Strategy 3. Sorry, we will fix this shortly. Since your actuators are X8-16s (the example is for an X5-1), you'll want the default gains for that model, which you can find here.
All the strategies can be used with trajectory tracking, or individually for position / velocity / torque, or any combination of the two. By my (probably limited) understanding, Strategy 4 is doing impedance control at the joint level based on commanded positions. The P and D gains are a spring and damper based on the actuator position that commands a torque to the inner torque loop. In addition to the position P and D parameters, you might find it useful to increase the P gain on effort (torque) if you would like the actuator to be more responsive. You can also implement impedance control yourself at the API level and command efforts to the actuator. In terms of admittance control, we would do this at the API level, but we don't have any examples.
In Scope there is a slider at the top that controls the feedback frequency for plotting. This also controls the feedback frequency when you take logs from Scope. Since the actuators are already doing realtime control at the joint level at 1 kHz, we have found that there isn't much benefit from running faster than ~200 Hz at the API level. But feel free to explore. From Windows, you can reliably get feedback and send commands up to about 600 Hz, and on macOS and Linux you can get all the way up to 1 kHz. Hope this helps,
|
Beta Was this translation helpful? Give feedback.
-
:D :D :D Those replies are really helpful.
|
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for these suggestions. I did try using the Scope to reduce the PD gains to zero for position control under strategy 4, and also increase the P gain for effort control, although the impedance did reduce, there was still some impedance when I rotated the motor and when P gain for effort control increases to around 3, the motor was shaking either I was rotating it or not. I really appreciate your help. --Qiang
|
Beta Was this translation helpful? Give feedback.
-
Setting the P or D gains too high on the effort loop (or any of the others) will cause shaking / buzzing due to sensor noise. If you want to more fully remove impedance from the effort/torque loop, you can lower the P/D gains, and instead use the integral I-term, Ki (units of PWM / Nm Error * sec). This will make the motion of the actuator much more fluid, but too much of it will cause overshoot in torque, just like it does with other controllers. There also a saturation term, I-Clamp (units of PWM), that can be tuned to prevent integral windup and overshoot. When tuning these gains and control parameters viewing the tracking of the effort commands and feedback live in Scope is very useful. To increase the time resolution on the plots and better see what's going on during tuning it may also help to increase the the Plot Frequency in Scope from the default 100 Hz to something higher, like ~300 Hz. Hope this help,
|
Beta Was this translation helpful? Give feedback.
Qiang,
To address your questions, I'm assuming you're running the latest version of the hebi-matlab-examples repository on Github. For working with single actuators, the best place to start is with the basic examples for the X-Series actuators.
The best practice is to make a Gains XML File for your work and set it every time you run your code. An example of doing this in the Matlab API can be found here. The gains form…