# I'm trying to understand an equation from a motor simulation $\dot w_i (u_ i ​ ,w_i,l _i ​ , \dot l _ i ​ )$

I have a simulated motor and I'm not understanding the math to control it.

This is the equation for the force of the motor, also called an 'actuator'.

$$\dot w_i (u_ i ​ ,w_i,l _i ​ , \dot l _ i ​ )$$

w is the "vector of actuator activations". I don't know what the dot mean from one to w to the other.
u is the "scalar control".
l is the "scalar length".
I see the words but I don't know what w, u, and l are here. Is this an area of physics math you might be able to point me in?

In the software, which I won't go into in depth, I can control the dynamic, which makes the motor move. I can set the Newton Meters. I can set a bias. I can set a gain. I don't know how this correlates, or is represented in the equation.
I asked the developer of the software (MuJoCo) about my motor simulation gaining higher and higher for torque for some reason and he said. "It builds up because the actuator has a state. That is what <general dyntype=... does, it gives your actuator an internal state. This state is "remembering" the previous actions because it is an integral defined by the first equation in the section."

The link to this documentation is here

The full text is here
"Actuation model MuJoCo provides a flexible actuator model. All actuators are single-input-single-output (SISO). The input to actuator ii is a scalar control u_iu i ​ specified by the user. The output is a scalar force p_ip i ​ which is mapped to joint coordinates by a vector of moment arms determined by the transmission. An actuator can also have activation state w_iw i ​ with its own dynamics. The control inputs for all actuators are stored in mjData.ctrl, the force outputs are stored in mjData.actuator_force, and the activation states (if any) are stored in mjData.act.

These three components of an actuator - transmission, activation dynamics, and force generation - determine how the actuator works. The user can set them independently for maximum flexibility, or use Actuator shortcuts which instantiate common actuator types.

Transmission Each actuator has a scalar length l_i(q)l i ​ (q) defined by the type of transmission and its parameters. The gradient \nabla l_i∇l i ​ is an n_Vn V ​ -dimensional column vector of moment arms. It determines the mapping from scalar actuator force to joint force. The transmission properties are determined by the MuJoCo object to which the actuator is attached; the possible attachment object types are joint, tendon, site and slider-crank. The latter can also be modeled explicitly by creating MuJoCo bodies and coupling them with equality constraints to the rest of the system, but that would be less efficient.

Activation dynamics Some actuators such as pneumatic and hydraulic cylinders as well as biological muscles have an internal state called “activation”. This is a true dynamic state, beyond the joint positions qq and velocities vv. Including such actuators in the model results in 3rd-order dynamics. We denote the vector of actuator activations ww. They have some first-order dynamics"

• Wow, I can sympathize with you. The documentation is quite abfuscating. Commented Mar 3, 2022 at 12:41

The equation is just a general equation dynamic equation saying that the variation of the actuator activation ($$\dot{w}$$) depends on the input (u), the current actuator activation state (w), the scalar length (l) and the variation of the scalar length ($$\dot{l}$$).

Then the l is related to physical length converting the torque to forces "It determines the mapping from scalar actuator force to joint force" (from doc)

For w, it says "This is a true dynamic state, beyond the joint positions q and velocities v." This is quite unclear what is included, but if it's a dynamic state then it includes accelerations and masses/inertia or the actuators.

• Thank you for answering. What is scalar length and what is variation of scalar length? All of these things seem very abstract, pie in the sky and I don't understand what part of it relates to the joints and forces in the model exactly. Do you use MuJoCo? I'm using different bias and gain settings on actuators. They have a part of the docs that connects the forces, joints, and masses to math, but it's not of a simple model. The learning curve is steep.
– Ant
Commented Mar 9, 2022 at 13:53
• Scalar length is just a set of numbers (only one number is you are using a single motor). In this case they say it is converting torque to forces, so it will include the gear ratio + moment length to convert it to force. Example: if your motor has a torque of 1Nm and you have gears reducing to 1/20, output torque will be 20Nm. If you attach a 25cm (0.25m) lever to the output of the gear, you will have a force of 80N (20Nm/0.25m). Here your scalar length would be 80 (m^-1). Now let's assume the lever is a linear actuator. Its length may vary, and the 80 will depend on the actuator length. Commented Mar 10, 2022 at 9:01