|
3 | 3 | ## Nonlinear Model |
4 | 4 |
|
5 | 5 | In this example, the goal is to control the angular position ``θ`` of a pendulum |
6 | | -attached to a motor. If the manipulated input is the motor torque ``τ``, the vectors |
7 | | -are: |
| 6 | +attached to a motor. Knowing that the manipulated input is the motor torque ``τ``, the I/O |
| 7 | +vectors are: |
8 | 8 |
|
9 | 9 | ```math |
10 | 10 | \begin{aligned} |
@@ -45,8 +45,8 @@ nu, nx, ny = 1, 2, 1 |
45 | 45 | model = NonLinModel(f, h, Ts, nu, nx, ny) |
46 | 46 | ``` |
47 | 47 |
|
48 | | -The output function ``\mathbf{h}`` converts the angular position ``θ`` to degrees. It |
49 | | -is good practice to first simulate `model` using [`sim!`](@ref) as a quick sanity check: |
| 48 | +The output function ``\mathbf{h}`` converts the ``θ`` angle to degrees. It is good practice |
| 49 | +to first simulate `model` using [`sim!`](@ref) as a quick sanity check: |
50 | 50 |
|
51 | 51 | ```@example 1 |
52 | 52 | using Plots |
@@ -92,9 +92,9 @@ res = sim!(mpc, 65, [180.0], plant=plant, x0=zeros(plant.nx), x̂0=zeros(mpc.est |
92 | 92 | plot(res) |
93 | 93 | ``` |
94 | 94 |
|
95 | | -The controller seems robust enough to variations on ``K`` coefficient. Moreover, starting |
96 | | -from this inverted position, the closed-loop response to a step disturbances of 10° on ``θ`` |
97 | | -is also satisfactory: |
| 95 | +The controller seems robust enough to variations on ``K`` coefficient. Starting from this |
| 96 | +inverted position, the closed-loop response to a step disturbances of 10° is also |
| 97 | +satisfactory: |
98 | 98 |
|
99 | 99 | ```@example 1 |
100 | 100 | res = sim!(mpc, 65, [180.0], plant=plant, x0=[π, 0], x̂0=[π, 0, 0], y_step=[10]) |
|
0 commit comments