Lesson 7: Speed, Slack and Instant States

This final lesson will present more representations on states, in addition to linear and hold states.

Every state referenced in <automata> has to be defined in the <states> section:

<sname angles = "t1A1, t2A2,..."/>

where sname  is the name of the state, and actions on that state are specified by attributes. In the current version of the specification, only "angles" are defined. Future extensions to other types of actuators and actions are easy to make. The elements in "angles" specifies the state vector, where Ai is an mathematical expression and ti is an optional quantifier, describing the type of action. When t  is omitted, linear interpolation between the current angle and A  is assumed. Symbols #, ~, @ and : for t  represent speed, slack, hold and instant move, respectively, for the corresponding joint. When t  is absent, a linear interpolation from the current joint angle to A  is assumed.

Slack States

Sometimes it is desirable to have a slack state for a module. A slack state is such that the joint angle is compliant to external forces. If the motor is back-drivable, no control would be in slack state. If the motor is not back-drivable, active slack state can be implemented using control. A slack state is represented by ~A  where A  is the exit angle for the joint when the module exits the slack state.

Slack states are often used in loops to overcome over-constrained situations due to errors. Fig. 6.1 shows a loop gait with extra slack states.

Figure 6.1 An example of slack states used in loop gaits: loop_slack.xml

Speed States

Speed states are normally used with sensors to control the direction of motion given sensor conditions, for example, move forward at speed 1 until the sensor value exceeds threshold. One can also design a simple closed loop feedback control using the sensor readings. A speed state is represented by #A  where A is the speed, i.e. A  degrees per automaton cycle. Here speed is relative to automaton period so that the gait would keep the same when its period changes.

The following code shows an example to control a snake with its head always up facing forward. Such a gait is useful if a camera is mounted at the end module. Fig. 6.2 is the robot specification with neck and head segments. Fig. 6.3 shows a gait that regulates the neck and the head modules to certain directions specified by the parameters.

Figure 6.2 A snake with neck and head segments, each with an accelerometer: snake_with_head.xml

Figure 6.3 A snake head-up gait using speed control: snake_headup.xml

Instant States

Many control strategies use continuous functions, e.g., sin(2πt), or step functions, etc. One can approximate continuous traces by discrete states, but with the introduction of instant states, continuous traces can be represented directly. An instant state is represented by :A  where A  is the desired joint angle at that instant of time. If A  is a constant, step functions can be represented; if A  is a function of its phase, any continuous trace can be represented. Fig. 6.5 shows three examples of  continuous automata, "step", "wave", and "sin", where "step" and "sin" can only be represented when instant states are introduced.

Figure 6.5 An example of instant states with logical sensor "phase" for representing continuous traces for joints: snake_continuous.xml

Exercise 7.1 Write a conforming snake or loop gait using touch sensors and all the techniques you have learnt. [Hard]


< Previous Lesson

Index