summaryrefslogtreecommitdiff
path: root/digital/avr/modules/motor/control_state/control_state.txt
diff options
context:
space:
mode:
authorNicolas Schodet2011-10-08 11:56:10 +0200
committerNicolas Schodet2012-03-06 23:16:05 +0100
commit928dc853e088849580aac368401999ea596644bb (patch)
tree7970d54f08a9e802f54c7dbbde4f91987ea5982e /digital/avr/modules/motor/control_state/control_state.txt
parent7a1417eb3cecd3b5f5b8a5c1a73e5a89d19de2d4 (diff)
digital/avr/modules/motor: add motor control system
Diffstat (limited to 'digital/avr/modules/motor/control_state/control_state.txt')
-rw-r--r--digital/avr/modules/motor/control_state/control_state.txt47
1 files changed, 47 insertions, 0 deletions
diff --git a/digital/avr/modules/motor/control_state/control_state.txt b/digital/avr/modules/motor/control_state/control_state.txt
new file mode 100644
index 00000000..68a465ba
--- /dev/null
+++ b/digital/avr/modules/motor/control_state/control_state.txt
@@ -0,0 +1,47 @@
+============================
+ motor/control_state module
+============================
+:Author: Nicolas Schodet
+
+Introduction
+============
+
+The control state provides a way to enable or disable each control module in a
+control system.
+
+Usage
+=====
+
+Use `control_state_set_mode` to enable a control mode and every lower control
+mode. For example::
+
+ control_state_set_mode (CS_MODE_SPEED_CONTROL, 0);
+
+will enable speed control, position control and blocking detection.
+
+The second argument can be used to disable a lower mode. For example, you can
+enable position control without blocking detection::
+
+ control_state_set_mode (CS_MODE_POS_CONTROL, CS_MODE_BLOCKING_DETECTION);
+
+Actually, blocking detection is always enabled, only its effect can be
+avoided (if disable, a blocked state will not disable control).
+
+Use `control_state_finished` to signal that the current high level move is
+finished. This will restore every position control and blocking detection if
+at least one position control is enabled and set the finished flag.
+
+Use `control_state_blocked` to signal a blocked state. This will disable
+every mode and set the blocked flag.
+
+The functions `control_state_is_finished` and `control_state_is_blocked` can
+be used to query those flags.
+
+When state has changed, it is usually safest to wait for the next control
+cycle before state is changed again. This is done naturally if the order of
+update functions is respected (see control system documentation).
+
+API
+===
+
+.. include:: control_state.exd