Create a Controller for a Lathe by Approximating the Time Delays
Create a Controller for a Lathe by Approximating the Time Delays
The force on the cutting tool in a lathe depends on the cutting depth from the previous rotation of the work piece. This can be modeled as a internal delay in the system:
lathe = StateSpaceModel[10.Derivative[2][x][t] == -100 x[t] - Derivative[1][x][t] - 200 (f[t] + x[t] - x[t - 1]), {x[t], x'[t]}, {f[t]}, x[t], t]OutputResponse[lathe, DiracDelta[t - 1], {t, 0, 5}];
Plot[%, {t, 0, 5}]Creating a delay-free approximation for a time-delay system allows for all of the standard controller design techniques:
latheApprox = SystemsModelDelayApproximate[lathe, 3]openlooppoles = Eigenvalues[Normal[latheApprox][[1]]];
l = EstimatorGains[latheApprox, Join[Drop[Sort[openlooppoles], -2], {-4 + I, -4 - I}]];
k = StateFeedbackGains[latheApprox, Join[Drop[Sort[openlooppoles], -2], {-4 + I, -4 - I}]];
controller = EstimatorRegulator[latheApprox, {l, k}];closedloopLathe = SystemsModelFeedbackConnect[lathe, controller];OutputResponse[closedloopLathe, DiracDelta[t - 1], {t, 0, 20}];
Plot[%, {t, 0, 20}]