From c2a5ce821a167aabc0ecfd5542b34fdac4e6ec3c Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 21 Apr 2020 20:39:48 -0400 Subject: [PATCH] Add input_modes.md --- docs/commands.md | 15 +++++++ docs/input_modes.md | 106 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 docs/input_modes.md diff --git a/docs/commands.md b/docs/commands.md index 2d26586a..c9769e8c 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -60,6 +60,21 @@ Possible values are: * `CTRL_MODE_CURRENT_CONTROL` * `CTRL_MODE_VOLTAGE_CONTROL` - this one is not normally used. +### Input Mode +The default input mode is `INPUT_MODE_PASSTHROUGH`. +Modes can be selected by changing `.controller.config.input_mode`. +Possible values are: +* `INPUT_MODE_INACTIVE` +* `INPUT_MODE_PASSTHROUGH` +* `INPUT_MODE_VEL_RAMP` +* `INPUT_MODE_POS_FILTER` +* `INPUT_MODE_MIX_CHANNELS` +* `INPUT_MODE_TRAP_TRAJ` +* `INPUT_MODE_CURRENT_RAMP` +* `INPUT_MODE_MIRROR` + +For more information, see [input_modes](input_modes.md). + # Control Commands * `.controller.input_pos = ` * `.controller.input_vel = ` diff --git a/docs/input_modes.md b/docs/input_modes.md new file mode 100644 index 00000000..ccb88206 --- /dev/null +++ b/docs/input_modes.md @@ -0,0 +1,106 @@ +# Input Modes +As of version ###, ODrive now intercepts the incoming commands and can apply filters to them. The old protocol values `pos_setpoint`, `vel_setpoint`, and `current_setpoint` are still used internally by the closed-loop cascade control, but the user cannot write to them directly. This allows us to condense the number of ways the ODrive accepts motion commands. The new commands are: + +* `.controller.config.input_mode` +* `.controller.input_pos` +* `.controller.input_vel` +* `.controller.input_current` + +The Input Modes currently valid are: +* `INPUT_MODE_INACTIVE` +* `INPUT_MODE_PASSTHROUGH` +* `INPUT_MODE_VEL_RAMP` +* `INPUT_MODE_POS_FILTER` +* `INPUT_MODE_MIX_CHANNELS` +* `INPUT_MODE_TRAP_TRAJ` +* `INPUT_MODE_CURRENT_RAMP` +* `INPUT_MODE_MIRROR` + +--- + +## INPUT_MODE_INACTIVE +Disable inputs. Setpoints retain their last value. + +## INPUT_MODE_PASSTHROUGH +Pass `input_xxx` through to `xxx_setpoint` directly. + +### Valid Inputs: +* `input_pos` +* `input_vel` +* `input_current` + +### Valid Control modes: +* `CTRL_MODE_VOLTAGE_CONTROL` +* `CTRL_MODE_CURRENT_CONTROL` +* `CTRL_MODE_VELOCITY_CONTROL` +* `CTRL_MODE_POSITION_CONTROL` + +## INPUT_MODE_VEL_RAMP +Ramps a velocity command from the current value to the target value. + +### Configuration Values: +* `.controller.config.vel_ramp_rate` [cpr/sec] +* `.controller.config.inertia` [A/(count/s^2))] + +### Valid inputs: +* `input_vel` + +### Valid Control Modes: +* `CTRL_MODE_VELOCITY_CONTROL` + +## INPUT_MODE_POS_FILTER +Implements a 2nd order position tracking filter. Inteded for use with step/dir interface, but can also be used with position-only commands. + +### Configuration Values: +* `.controller.config.input_filter_bandwidth` +* `.controller.config.inertia` + +### Valid inputs: +* `input_pos` + +### Valid Control modes: +* `CTRL_MODE_POSITION_CONTROL` + +## INPUT_MODE_MIX_CHANNELS +Not Implemented. + + +## INPUT_MODE_TRAP_TRAJ +Implementes an online trapezoidal trajectory planner. + +### Configuration Values: +* `.trap_traj.config.vel_limit` +* `.trap_traj.config.accel_limit` +* `.trap_traj.config.decel_limit` +* `.controller.config.inertia` + +### Valid Inputs: +* `input_pos` + +### Valid Control Modes: +* `CTRL_MODE_POSITION_CONTROL` + +## INPUT_MODE_CURRENT_RAMP +Ramp a current command from the current value to the target value. + +### Configuration Values: +* `.controller.config.current_ramp_rate` + +### Valid Inputs: +* `input_current` + +### Valid Control Modes: +* `CTRL_MODE_CURRENT_CONTROL` + +## INPUT_MODE_MIRROR +Implements "electronic mirroring". This is like electronic camming, but you can only mirror exactly the movements of the other motor, according to a fixed ratio + +### Configuration Values +* `.controller.config.axis_to_mirror` +* `.controller.config.mirror_ratio` + +### Valid Inputs +* None. Inputs are taken directly from the other axis encoder estimates + +### Valid Control modes +* `CTRL_MODE_POSITION_CONTROL`