Replace select instances of vel_setpoint by input_vel in docs

This commit is contained in:
Unknown
2020-04-21 20:49:18 -04:00
parent f4f4be0d6d
commit 9b2df645f9
4 changed files with 14 additions and 14 deletions
+2 -2
View File
@@ -111,7 +111,7 @@ All variables that are part of a `[...].config` object can be saved to non-volat
The ODrive can run without encoder/hall feedback, but there is a minimum speed, usually around a few hunderd RPM.
However the units of this mode is different from when using an encoder. Velocities are not measured in counts/s, instead it is electrical rad/s. This also applies to the gains. For example, `vel_gain` is in units of `A / (rad/s)` instead of `A / (count/s)`.
To give an example, suppose you have a motor with 7 pole pairs, and you want to spin it at 3000 RPM. Then you would set the `vel_setpoint` to `3000 * 2*pi/60 * 7 = 2199 rad/s electrical`.
To give an example, suppose you have a motor with 7 pole pairs, and you want to spin it at 3000 RPM. Then you would set the `input_vel` to `3000 * 2*pi/60 * 7 = 2199 rad/s electrical`.
Below are some suggested starting parameters that you can use. Note that you _must_ set the `pm_flux_linkage` correctly for sensorless mode to work.
@@ -119,7 +119,7 @@ Below are some suggested starting parameters that you can use. Note that you _mu
odrv0.axis0.controller.config.vel_gain = 0.01
odrv0.axis0.controller.config.vel_integrator_gain = 0.05
odrv0.axis0.controller.config.control_mode = 2
odrv0.axis0.controller.vel_setpoint = 400
odrv0.axis0.controller.input_vel = 400
odrv0.axis0.motor.config.direction = 1
odrv0.axis0.sensorless_estimator.config.pm_flux_linkage = 5.51328895422 / (<pole pairs> * <motor kv>)
```
+1 -1
View File
@@ -70,7 +70,7 @@ If calibration works, congratulations.
Now try:
* `<axis>.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL`
* `<axis>.controller.set_vel_setpoint(3000,0) `
* `<axis>.controller.input_vel = 3000`
let it loop a few times and then set:
* `<axis>.requested_state = AXIS_STATE_IDLE`
+1 -1
View File
@@ -337,7 +337,7 @@ If you try to increment the axis with a large step in one go that exceeds `cpr/2
### Velocity control
Set `axis.controller.config.control_mode = CTRL_MODE_VELOCITY_CONTROL`.<br>
You can now control the velocity with `axis.controller.vel_setpoint = 5000` [count/s].
You can now control the velocity with `axis.controller.input_vel = 5000` [count/s].
### Ramped velocity control
Set `axis.controller.config.control_mode = CTRL_MODE_VELOCITY_CONTROL`.<br>
+10 -10
View File
@@ -112,9 +112,9 @@ The ODrive starts in idle (we will look at changing this later) so we can enable
odrv0.save_configuration()
odrv0.reboot()
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.vel_setpoint = 120
odrv0.axis0.controller.input_vel = 120
# Your motor should spin here
odrv0.axis0.controller.vel_setpoint = 0
odrv0.axis0.controller.input_vel = 0
odrv0.axis0.requested_state = AXIS_STATE_IDLE
```
@@ -128,31 +128,31 @@ We also have to reboot to activate the PWM input.
```txt
odrv0.config.gpio3_pwm_mapping.min = -200
odrv0.config.gpio3_pwm_mapping.max = 200
odrv0.config.gpio3_pwm_mapping.endpoint = odrv0.axis0.controller._remote_attributes['vel_setpoint']
odrv0.config.gpio3_pwm_mapping.endpoint = odrv0.axis0.controller._remote_attributes['input_vel']
odrv0.config.gpio4_pwm_mapping.min = -200
odrv0.config.gpio4_pwm_mapping.max = 200
odrv0.config.gpio4_pwm_mapping.endpoint = odrv0.axis1.controller._remote_attributes['vel_setpoint']
odrv0.config.gpio4_pwm_mapping.endpoint = odrv0.axis1.controller._remote_attributes['input_vel']
odrv0.save_configuration()
odrv0.reboot()
```
Now we can check that the sticks are writing to the velocity setpoint. Move the stick, print `vel_setpoint`, move to a different position, check again.
Now we can check that the sticks are writing to the velocity setpoint. Move the stick, print `input_vel`, move to a different position, check again.
```txt
In [1]: odrv0.axis1.controller.vel_setpoint
In [1]: odrv0.axis1.controller.input_vel
Out[1]: 0.1904754638671875
In [2]: odrv0.axis1.controller.vel_setpoint
In [2]: odrv0.axis1.controller.input_vel
Out[2]: 0.1904754638671875
In [3]: odrv0.axis1.controller.vel_setpoint
In [3]: odrv0.axis1.controller.input_vel
Out[3]: 28.152389526367188
In [4]: odrv0.axis1.controller.vel_setpoint
In [4]: odrv0.axis1.controller.input_vel
Out[4]: 61.21905517578125
In [5]: odrv0.axis1.controller.vel_setpoint
In [5]: odrv0.axis1.controller.input_vel
Out[5]: -52.990474700927734
```