You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We will attempt to stabilize the pendulum in the upright position by using feedback control. To design the contorller, we linearize the model in the upward equilibrium position and design an infinite-horizon LQR controller using ControlSystems.jl. We then connect the controller to the motor on the cart. See also [RobustAndOptimalControl.jl: Control design for a pendulum on a cart](https://juliacontrol.github.io/RobustAndOptimalControl.jl/dev/cartpole/) for a similar example with more detail on the control design.
398
+
We will attempt to stabilize the pendulum in the upright position by using feedback control. To design the controller, we linearize the model in the upward equilibrium position and design an infinite-horizon LQR controller using ControlSystems.jl. We then connect the controller to the motor on the cart. See also [RobustAndOptimalControl.jl: Control design for a pendulum on a cart](https://juliacontrol.github.io/RobustAndOptimalControl.jl/dev/cartpole/) for a similar example with more detail on the control design.
392
399
393
400
### Linearization
394
401
We start by linearizing the model in the upward equilibrium position using the function `ModelingToolkit.linearize`.
395
402
```@example pendulum
396
403
import ModelingToolkit: D_nounits as D
397
404
using LinearAlgebra
398
-
@named cp = Cartpole()
405
+
@named cp = Cartpole(use_world = true)
399
406
cp = complete(cp)
400
407
inputs = [cp.u] # Input to the linearized system
401
408
outputs = [cp.x, cp.phi, cp.v, cp.w] # These are the outputs of the linearized system
0 commit comments