top of page
Search

2024; Robot Control: Friction Model, DOB and Residual Observer

  • Writer: Guining Pertin
    Guining Pertin
  • Oct 31, 2024
  • 5 min read

About the Project

I took a course called EE683: Robot Control by Professor Min Jun Kim at KAIST during my 2nd semester. One good thing about the course was the bi-weekly assignment which had one specific part where the students were free to implement any algorithm and provide simulation results. I ended up implementing a lot of the techniques and models learned in the course. These are a series of blog posts that cover some of those sections since I felt like it was worth sharing.


Note that all of these are implemented from scratch, with very few sections requiring MATLAB toolboxes. Also note that just because the specific part was in the report, it does not mean that it worked perfectly; given more time, I would've probably improved it, especially with regards to gain tuning for controllers.


All the work was done in MATLAB and the files will be shared soon on Github. If I have more time, I will also reexplain everything in simpler words.


You can download this full report here:

Friction Model


In this study, I implement LuGre friction model for disturbance on a flexible joint double pendulum system. Then I design the disturbance observer on the linear motor dynamics and a residual observer on the nonlinear link dynamics to estimate external disturbances.


FJR and controller

I reuse the nonlinear double-pendulum system with flexible joints I implemented from the previous post . Here the joint torque τ_j was modeled as a spring with stiffness K_j . With q = [q_1, q_2]^T , θ = [θ_1, θ_2]^T , state x = [q, ˙q, θ, ˙θ]^T , control u = [τ_m1, τ_m2]T , friction τ_f = [τ_f1, τ_f2]^T and external disturbance τ_ext = [τ_ext1, τ_ext2], the state space representation is

ree

I will be using the Tomei PD controller from previous post here which is given by

ree

LuGre Model

I model the friction using LuGre model following [2]. First, the Coulomb friction and Stribeck effect is modeled using g(v) = f_c +(f_s −f_c) exp(− |v/v_s|^α), where v_s is the critical velocity, and α controls the shape of the effect. Now in LuGre model, we assume there are bristles between the surfaces in contact. The bristle state is represented by z with its own dynamics and the final model is given as

ree

where σ_0, σ_1, σ_2 are bristle stiffness, damping(from bristles) and viscous friction coefficients. I use parameters (σ_0, σ_1, σ_2) = (102, 0.9, 0.1), (f_c, f_s, v_s, α) = (1, 0.5, 0.2, 0.5), which acts independently on each joint of the double pendulum (θ_1, θ_2), to give torque vector τ_f .


The two left figures below shows g(v) vs v, and f_ss vs v for different values of α = (0.5, 1, 2) (r,g,b). Horizontal lines represent fs and fc. The right figure shows the full LuGre model acting on the system, where red is τ_f and blue is ˙θ. Note that these are scaled down for the figure.

ree

Disturbance observer (DOB)

System where d is added to input. K is just controller
System where d is added to input. K is just controller

The basic idea behind DOB is to estimate the total control input u actually received by the system. In most cases we assume the disturbance d is additive on the input side on the system (if not, we can transform it to the input side). This gives u = u_c + d, where u_c is from the controller. If we know u and u_c, we can find the input disturbance as d = u − u_c. Now, the question is how do we find u?


Basic DOB
Basic DOB

Consider we have a system P(s) = Y(s)/U(s) providing output y, in a closed loop with a controller that provides control u_c. If we invert the system as P^{−1}(s) = U (s)/Y (s) and use measured y as input to this inverted system, we get back the original u. However, the inverted system is non-causal, depending on future inputs. To implement it, we actually add a low-pass filter Q(s) along P^{−1} and u_c to get a slow moving disturbance estimate ˆd (dhat). By subtracting this from the control input, we get u = u_c + d − ˆd, which can remove any disturbance d within the frequency range of Q(s).


In practice, we perform these calculations on the nominal system P_n(s) instead. The DOB in turn estimates both external disturbance and deviation from nominal behavior. With the compensated input, the disturbance is mitigated and the system also P(s) tends to behave like our nominal model P_n(s). This is useful when we design controllers on nominal model P_n(s) instead of trying to accurately estimate actual system.


Robust internal-loop compensator (RIC)

ree

The RIC structure is another equivalent way of representing DOB, which doesn’t consider inverting the dynamics. The key idea is that if we have a nominal model P_n(s), we can simulate the forward dynamics to estimate the required output ˆy, while the actual system P(s) generates output y. Then, using the error ˜y = y − ˆy, we design a controller C(s) that ensures ˜y → 0, i.e. the actual system tends to behave like nominal system and in turn also compensates the disturbance. We will be using this idea further since it is easier to extend to time domain equations.


DOB on linear motor dynamics

Since the actuator dynamics is linear, we can directly apply the linear disturbance observer in RIC structure (since we have state space equations, this is easier) as

Full structure
Full structure

To implement this, first consider p = B ˙θ, then simulate the nominal model as ˙ˆp = u − τ_j . Then using ˆτ_f = L_1(p − ˆp) we can ensure ˆτ_f → τ_f , i.e. p → ˆp, implying the system starts to mimic nominal model


Residual observer on nonlinear link dynamics

Until now, we have considered compensation of disturbance acting the linear motor dynamics. If the disturbances are acting on the nonlinear link dynamics, a similar RIC structure can be used for non-linear disturbance observers. Residual-based observer is similar to RIC but used for estimating disturbances/faults rather than compensation.


Consider disturbances acting on the link-side dynamics as τ_ext. Then taking ˙p = M ˙q and a nominal estimate ˙ˆp = C^T ˙q − g + τ_j + ˆτext, the external disturbance can be estimated using ˆτ_ext = L_2(p − ˆp) by simulating the nominal link model to get ˆp. This estimate is also called the residual vector

Results

Simulated with K_P = [10, 0; 0; 10], K_D = [5, 0; 0, 5]; L_1 = L_2 = [50, 0; 0; 50]


  1. Controller only: The black dashed lines show reference, dashed-dotted red lines is the controller without friction and solid blue lines is the same controller when friction is present. It is clearly visible that the controller works perfectly without friction but once friction enters the system it fails to stabilize.

    ree
  2. With DOB: The plot shows that the tracking works exactly like it was in the absence of disturbance. The plot below shows DOB(blue) exactly compensating friction(red)

    ree

    As soon as the velocity values stabilize, the friction dies down to 0.


  3. Residual observer: Now I add external disturbance on link dynamics as τ_ext = [0.2 sin(2πt ∗0.1); 0.2 cos(2πt ∗ 0.2)] (shown in red) while the above DOB is still running for motor dynamics. The residual observer estimates the link disturbance (shown in blue), including the amplitude and frequency and can be used for fault detection. This is possible because this joint torque can be estimated outside the actuator dynamics in simulation.

    ree

    For a fixed disturbance τext = [10, 5], there is a steady state error on joint position (red). I found that I can compensate for this disturbance by directly providing back the estimated disturbance into the control input (blue).

    ree

References

1. P. Tomei, “A simple PD controller for robots with elastic joints,” in IEEE Transactions on Automatic Control, vol. 36, no. 10, pp. 1208-1213, Oct. 1991


2. K. J. Astrom and C. C. de Wit, “Revisiting the lugre model,” IEEE Control Systems Magazine, vol. 28, no. 6, pp. 101–114, 2008

 
 
 

Comments


"The best way to predict the future is to invent it" ~ Alan Kay

bottom of page