Skip to content

Commit

Permalink
tweak tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Oct 2, 2024
1 parent 57b971b commit 85bad99
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions docs/src/examples/pendulum.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ gray = [0.5, 0.5, 0.5, 1]
end
@mtkmodel CartWithInput begin
@components begin
world = W()
cartpole = Cartpole()
input = Blocks.Cosine(frequency=1, amplitude=1)
end
Expand Down Expand Up @@ -437,7 +436,6 @@ LQGSystem(args...; kwargs...) = ODESystem(observer_controller(lqg); kwargs...)
@mtkmodel CartWithFeedback begin
@components begin
world = W()
cartpole = Cartpole()
reference = Blocks.Step(start_time = 5, height=0.5)
control_saturation = Blocks.Limiter(y_max = 10) # To limit the control signal magnitude
Expand Down Expand Up @@ -479,7 +477,7 @@ Below, we add also an energy-based swing-up controller. For more details this ki
```@example pendulum
"Compute total energy, kinetic + potential, for a body rotating around the z-axis of the world"
function energy(body, w)
g = world.g
g = GlobalScope(world.g_inner)
m = body.m
d2 = body.r_cm[1]^2 + body.r_cm[2]^2 # Squared distance from
I = body.I_33 + m*d2 # Parallel axis theorem
Expand All @@ -491,7 +489,6 @@ normalize_angle(x::Number) = mod(x+3.1415, 2pi)-3.1415
@mtkmodel CartWithSwingup begin
@components begin
world = W()
cartpole = Cartpole()
L = Blocks.MatrixGain(K = Lmat) # Here we use the LQR controller instead
control_saturation = Blocks.Limiter(y_max = 12) # To limit the control signal magnitude
Expand Down

0 comments on commit 85bad99

Please sign in to comment.