TL;DR
An actuator network is a small neural network trained on logged data to predict the torque a real joint delivers, given the recent history of its position errors and velocities. A simulator that assumes motors respond instantly predicts the wrong torques, and a learned actuator model closes that gap without anyone writing down the motor's physics. It was introduced for the ANYmal quadruped robot in 2019.
Builds on: Robot Dynamics, PD Control, Feedforward Neural Network, Supervised Learning · Leads to: learning agile legged locomotion in simulation
Where it's used
Legged locomotion on ANYmal (2019). ANYmal is a medium-dog-sized quadruped robot. Its control policies were trained entirely in simulation, with an actuator network inside the simulator, and then run on the physical robot without tuning on hardware. The paper reports that the robot ran 25 percent faster than the previous speed record, and that it could recover from falls, including by rolling its body over. The network is the piece that made the simulator faithful enough for this transfer. Learning agile and dynamic motor skills for legged robots is the paper that introduced it.
The alternative it replaced. An analytical model of a series elastic actuator, following Gehring and colleagues, contains nearly one hundred parameters that must be estimated from experiments or read from datasheets, and many manufacturers do not publish enough detail to fill them in. The ANYmal authors estimate that building such a model would take at least three weeks, even with a similar model in the literature. Collecting data for an actuator network took under four minutes, and tuning its input window often took less than a day.
Where it may fail. Some actuators are not independent. Hydraulic actuators that share a single accumulator have coupled dynamics, and learning each one separately may not reach enough accuracy. For those systems one larger network that sees several actuators at once is the more likely fit.
How it works
Here is the idea on one joint, traced from logged data to the torque the simulator applies.
flowchart LR A["Log position error, velocity and torque at 400 Hz"] --> B["Stack current and two past samples"] B --> C["Actuator net: 3 hidden layers of 32 units"] C --> D["Predicted torque for the simulator"] D --> E["Compare with measured torque and adjust weights"] E --> C
- Measure what the joint does. Drive the joint with a simple repeating foot motion while logging three things: the position error (the commanded position minus the actual position), the joint velocity, and the Torque measured by a sensor. The paper logs at 400 samples per second. Check: one sample every 2.5 milliseconds, so 400 samples per second.
- Build the input window. For each sample, take the current reading and the readings from 0.01 and 0.02 seconds earlier. At 400 Hz those are 4 and 8 samples back. Check: three times two values gives 6 numbers per joint.
- Pass the window through the network. Each of the 6 numbers feeds a layer of 32 neurons. Each neuron takes a weighted sum of its inputs and bends it with softsign, a smooth S-shaped function. That repeats for three hidden layers, and a final output gives one torque. Check: the shape is 6 inputs, then 32, 32 and 32 hidden units, then 1 output.
- Compare with the measurement. Take the gap between predicted and measured torque for each sample, square it, and average over the data. Toy numbers: measured torques of 1.0, 2.0 and 3.0 Nm, predicted 1.2, 1.7 and 3.5 Nm. The gaps (predicted minus measured) are +0.2, −0.3 and +0.5. Check: the squares sum to 0.04 + 0.09 + 0.25 = 0.38, and 0.38 divided by 3 is about 0.127 Nm².
- Adjust the weights. Gradient descent nudges every weight in the direction that lowers the average error, and the loop repeats over the dataset. Check: after many passes the error on the training data stops falling.
- Test on data it has not seen. About 10 percent of the samples are held back. The paper's average error on these is 0.740 Nm, against a torque sensor resolution of 0.2 Nm. Check: 0.740 divided by 0.2 is 3.7, so the average error is a few sensor steps wide, against 17.8 steps for the ideal model (3.55 divided by 0.2).
- Put it in the simulator. At each simulated step the network takes the joint's recent history and returns the torque applied to the simulated body. This replaces an ideal actuator, which would produce whatever torque is commanded at once. Check: the paper reports about 12 microseconds to evaluate the network for all 12 joints, which matters because training a complicated policy needs hundreds of millions of simulated samples.
The learned torque includes effects the ideal model leaves out: communication delay, friction, and the motor's own internal feedback loops. All of them leave a trace in the history window, and that is why a window of past samples matters. A single snapshot of error and velocity cannot show lag.
The math
For one joint, let be the position error at time (target minus actual) and the joint velocity. Write s for the spacing of the history. The input window is six numbers:
Step 3 in symbols: the network
The bend used at each hidden neuron is softsign:
Its output always lies between and , it is nearly a straight line for small , and it flattens for large . The paper chose it over tanh because it is cheaper to compute, with about the same validation error.
Three hidden layers and a linear output give the prediction:
Here is a matrix, and are , and has 32 entries. Counting weights and biases gives , so the whole network has roughly 2,400 parameters.
Step 4 in symbols: the loss
With samples and measured torques , the training loss is the mean squared error (Mean Squared Error):
For the toy numbers in step 4, and , so .
Step 5 in symbols: the update
Let stand for all the weights and biases, and for the step size. Each pass updates
which is one step of Gradient Descent. The gradient points uphill in the loss, so subtracting it moves downhill.
Step 6 in symbols: validation
The same loss is computed on the held-out samples, . The paper reports an average validation error of 0.740 Nm for the learned model and 3.55 Nm for the ideal model, which is the comparison that shows what the learned model adds.
Worked examples
- Position error rad and weight . Weighted sum: . Check: no bias term in this toy.
- Softsign of : . Check: the result lies between and .
- Output weight : torque Nm. Check: a positive error gives a positive torque.
- Interpretation: a straight-line model with the same weights would give 4 Nm. The bend halves the response to a large error, and it does so smoothly.
Suppose the log of position errors at 400 Hz reads, at samples 0 to 8: 0.00, 0.02, 0.04, 0.05, 0.06, 0.06, 0.05, 0.04, 0.03 rad.
- Sample spacing: 1 divided by 400 is 0.0025 s. Check: 0.01 s divided by 0.0025 s is 4 samples, and 0.02 s is 8 samples.
- Current sample, index 8: rad.
- One step back, index 4: rad. This is s.
- Two steps back, index 0: rad. This is s.
- The window is . The most recent change is rad/s, and the earlier change was rad/s.
- Interpretation: the error rose and then fell, so the joint has turned around. A single reading of 0.03 rad could not tell the network this, but the window can.
- Data volume: about 4 minutes at 400 Hz is roughly 96,000 samples per actuator, and 12 actuators give about 1.15 million. Check: the paper reports more than a million samples.
- Validation: the learned model's average error is 0.740 Nm and the ideal model's is 3.55 Nm. Check: 3.55 divided by 0.740 is about 4.8, so the ideal model is almost five times as wrong.
- Test on locomotion data, which is harder: the learned model reports 0.966 Nm, and the ideal model 5.74 Nm. Check: 5.74 divided by 0.966 is about 5.9.
- Interpretation: the ideal model's error is large because it ignores delay and lag. The learned error is about a fifth of the ideal error on validation data and about a sixth on the harder locomotion data, though it is still several sensor steps wide.
- Try it: the torque sensor resolves steps of 0.2 Nm. How many sensor steps is the learned model's test error of 0.966 Nm?
Answer: 0.966 divided by 0.2 is 4.83, so the test error is about 4.8 sensor steps.
Common mistakes and tradeoffs
- It is tempting to think an actuator network is a physics model with a neural network bolted on. In fact it has no physical parameters to read off. It learns the whole chain from command to torque, including delay and internal feedback, and its individual weights do not mean anything on their own.
- It is tempting to think a learned actuator model works everywhere. In fact the training data came from foot motions at 1 to 25 Hz with 5 to 10 cm amplitude, plus manual pushes. Motions outside that range are extrapolation, and the paper stresses that the excitation has to cover a wide range of frequencies or the model produces unnatural oscillation.
- It is tempting to think a longer history always helps. In fact a window that is too sparse misses high-frequency dynamics, above about 100 Hz in the paper's account, and a window that is too dense overfits and costs compute. The window length is tuned against validation error.
- It is tempting to think a model trained for one robot transfers to another. In fact the paper trains one network per actuator because it assumes independence, and it warns that coupled actuators may need a single larger network.
| Approach | What it needs | Accuracy on the joint | Where it fits |
|---|---|---|---|
| Ideal actuator (torque at once) | Nothing | Poor: 3.55 Nm average error in the paper | Quick prototypes and first simulations |
| Analytical actuator model | Many parameters, measured or read from datasheets | Good if the parameters are right | Well-documented actuators with known physics |
| Learned actuator network | Logged data at a high rate and some tuning | Close to sensor resolution in the paper | Black-box motors with independent joints |
History
The idea that a neural network can stand in for actuator dynamics is older than legged robots. Nikzad, Ghaboussi and Paul published "Actuator dynamics and delay compensation using neurocontrollers" in 1996, and Nguyen-Tuong and Peters used local Gaussian process regression to learn robot dynamics in 2008, both cited by the ANYmal paper.
The hardware that made modelling hard had a long history of its own. Series elastic actuators, which add a spring between motor and load, were described by Pratt and Williamson in 1995. The analytical model that the ANYmal paper sets against its network follows the SEA modelling work of Gehring and colleagues.
The 2019 ANYmal work brought the pieces together. Hwangbo and colleagues trained controllers in a fast simulator, used a small learned actuator model inside it, and transferred the policies to the robot. It caught on because the expensive step, training, could run on ordinary computers in simulation rather than on the robot, and because learning the actuator replaced weeks of manual modelling.
Recap
- A real joint is a chain of delays, friction and internal feedback loops, and a simulator that ignores them predicts the wrong torque.
- Logged data at 400 Hz gives input and output pairs. A window of current and past position errors and velocities holds the information the network needs.
- A small multi-layer network with softsign, trained by mean squared error and gradient descent, learns torque as a function of that window.
- Checked on held-out data, the model sits within a few times the sensor's resolution and is cheap enough to run inside the simulator.
- Read next: Learning agile and dynamic motor skills for legged robots, which introduced the network, and Domain Randomization, because a simulator with an accurate actuator still differs from the real world in other ways. For the alternative of fitting a physical model, see System Identification.
Check yourself
QuestionWhat is the input to the actuator network for one joint, and why does it include past samples?Show answer
QuestionCompute softsign at z = 3 and at z = −3. Why does this bend keep the output bounded?Show answer
QuestionWhy does the validation check compare the learned model with the ideal model as well as with the sensor's resolution?Show answer
QuestionA team wants an actuator network for a new robot, but their data covers only slow motions at 1 to 2 Hz. What should they expect, and what would they do?Show answer
Sources
- Hwangbo J, Lee J, Dosovitskiy A, et al. (2019). Learning agile and dynamic motor skills for legged robots. arXiv. https://arxiv.org/abs/1901.08652
- Tobin J, Fong R, Ray A, et al. (2017). Domain Randomization for Transferring Deep Neural Networks from Simulation to the Real World. arXiv. https://arxiv.org/abs/1703.06907