The motion dynamics of your Z-axis robot can be expressed through the following equation:
Here, the combined effects of friction and gravity are represented as a lumped disturbance. While the friction force exhibits nonlinear behavior, resembling a mathematically-saturated function (not easily visualized in If-Else or Piecewise forms), the motion system without disturbance can be characterized as linear:
Upon taking the Laplace transform, the transfer function of the plant is derived as:
,This clearly represents a Double Integrator system. With this understanding, a classical PID controller can be designed with a specific focus on Disturbance Rejection.
From the simulation result, the amplitude (max) of the output response (red curve) resulting from a unit step disturbance is marginally below 0.0025 m. With a friction force of 50 Nm, this disturbance will induce a maximum change in height of less than 0.125 m, dissipating within the subsequent 5 seconds.
P = 1/(m*s^2)
P =
1
------
20 s^2
Continuous-time transfer function.
opt = pidtuneOptions('DesignFocus', 'Disturbance-Rejection');
[C, info] = pidtune(P, 'PID', wc, opt)
C =
1
Kp + Ki * --- + Kd * s
s
with Kp = 360, Ki = 289, Kd = 112
Continuous-time PID controller in parallel form.
info =
Stable: 1
CrossoverFrequency: 6
PhaseMargin: 60.0000
Gcl = feedback(C*P, 1)
Gcl =
112 s^2 + 360 s + 289.4
--------------------------------
20 s^3 + 112 s^2 + 360 s + 289.4
Continuous-time transfer function.
Gdl = feedback(P, C)
Gdl =
s
--------------------------------
20 s^3 + 112 s^2 + 360 s + 289.4
Continuous-time transfer function.
legend('Response to a Step Reference', 'Response to a Step Disturbance', 'location', 'East')