Pedal theory part 2 (in work) - ChrGri/DIY-Sim-Racing-FFB-Pedal GitHub Wiki

Dev section (in work)

Model 1:

A kinetic model of the foot and pedal is depicted below

The foot is modeled as a second order system. It has two masses, $m_\text{f}$ and $m_\text{f2}$, a damping coefficient $b_\text{f}$ and a spring stiffness $k_\text{f}$. When the foot is compressed $(x_\text{u} - x) > 0$, $F_\text{f}$ points to the left, as indicated by the arrow. Similarly, when the compression is dynamic, $(\dot x_\text{u} - \dot x ) > 0$, the velocity depending damping force $F_\text{f}$ points to the left. The acceleration depending forces points oposite the direction of $x$ and $x_\text{u}$.

In total, we define: $F_\text{u}$: Target force applied by the user $F_\text{p}$: Force induced by the pedal $F_\text{f}$: Force induced by the pedal $x$: horizontal position $x_\text{u}$: offset target position $m_\text{f}$: foot mass parameter $m_\text{f2}$: second foot mass parameter $b_\text{f}$: foot friction parameter $k_\text{f}$: foot stiffness parameter $x$: position of the foot or pedal $x_\text{u}$: position induced by the user

Collecting all the forces gives us: $F_\text{u} - F_\text{p} - F_\text{f} - F_\text{f2} = F_\text{u} - F_\text{p} - m_\text{f} \ddot x - b_\text{f} (\dot x_\text{u} - \dot x) - k_\text{f} (x_\text{u} - x) - m_\text{f2} \ddot x_\text{u} \overset{!}{=} 0$

The control-loop objective is to control the pedal position such, that (a) it follows the user defined force-travel curve and (b) the force response is fast, but does not start to oscillate.

Model 2:

$F_\text{u} - F_\text{a} - F_\text{v} - F_\text{x} = F_\text{u} - m_\text{a} \ddot x_\text{u} - b_\text{f} (\dot x_\text{u} - \dot x) - k_\text{f} (x_\text{u} - x) \overset{!}{=} 0$

Model 3:

Collecting all the forces gives: $-F_\text{p} - m_\text{f} \ddot x + b_\text{f} (\dot x_\text{u} - \dot x) + k_\text{f} (x_\text{u} - x) \overset{!}{=} 0$.

Solving for the pedal force: $F_\text{p} = - m_\text{f} \ddot x + b_\text{f} (\dot x_\text{u} - \dot x) + k_\text{f} (x_\text{u} - x)$.

For the sake of simplicity we set $\dot x_\text{u} = x_\text{u} = 0$, which gives $F_\text{p} = - m_\text{f} \ddot x - b_\text{f} \dot x - k_\text{f} x$.

The objective is to make the pedal force $F_\text{p}$ follow the predefined force vs. travel curve $F_\text{t}(x)$:

From the above model we see, that moving positive in $x$ will reduce the spring induced force ($F_\text{x}=-k_\text{f} x$) from the foot, since $k_\text{f} > 0$.

For easier parameterization, lets define the constant $b_\text{f}$ with respect to the critical damping as: $b_\text{f} = \zeta * b_\text{crit.}$

Where $b_\text{crit.} = 2 * \sqrt{m_\text{f} * k_\text{f}}$.

$\zeta$ can take values such as: $0$: No damping $1$: critical damping $>1$: over damping .

Passive pedal simulation

Lets try simulate a passive pedal first. A python script to simulate the passive pedal can be found here. In the simulation, at $0.2s<t<1.5s$ a user induced leg travel $x_\text{u}$ of 0.05m is applied. This travel, loads the coil and damper resulting in a force applied to the mass $m_\text{f}$. The pedal resistive force depends on the current pedal position $x$. When this force is smaller than the coil and damper induced force on the mass, the mass moves towards the pedal.

The left side plots show the dynamic states of the pedal, whilst the right hand side plot shows the pedals force-travel curve and the force breakdown

In the first plot, one can see a slight difference between the user induced travel and the actual pedal travel at steady state, e.g. at 0.75s. This is caused by the foot model spring beeing slightly compressed. One can image, that in real life, applying some travel to the leg, will likewise result in some travel loss due to foot compression.

Simulation

A Python script to simulate the closed-loop response can be found here.

The script simulates the dynamic model of the foot and includes the PID interaction of the pedal. The top right plot shows the target force-travel curve parameterized.

The top left plot shows the foot/pedal position over time.

The middle right plot shows the forces, whereas $F_{user}$ is the force intentionally applied by the user, resulting in a desired position change of the pedal. $F_{target}$ is the target force taken from the force-curve, when the pedal is at position $x(t)$. $F_{servo}$ is the force outputed by the servo. The left center and left bottom plots show the velocity and acceleration of the pedal. The right bottom plot shows the force deviation.

In the begining of the simulation, the pedal/foot is at 0m and 0N steady state. After 0.2s, the user applies a fixed foot presure of 500N, ultimately causing a position, velocity and acceleration change by the FFB pedal.

The simulation takes into account the foot parameters $m_f$, $b_f$ and $k_f$ and the PI-parameters. Try playing around with the parameters to see how the impact the simulation. Especially adjusting the PI parameters might give you valuable insight in the tuning process of the real pedal.

Open-loop behavior

Assuming no feedback loop, meaning all PID parameters are zero, we can see the foot response model. The user applies some force, resulting in a compression of the foot. The foot spring model is gets loaded and the compression builds up over time.

Closed-loop behavior