Skip to content

Commit 31b33d1

Browse files
author
Brad Carman
committed
velocity reference
1 parent 4009bfa commit 31b33d1

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

scripts/app.jl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ using WGLMakie
5151

5252
kpo = SLInput(0.54; label="outer P")
5353
kio = SLInput(2.48; label="outer i")
54-
kdo = SLInput(0.0; label="outer i")
54+
kdo = SLInput(0.0; label="outer d")
5555

5656
kpi = SLInput(15.6; label="inner P")
57-
kii = SLInput(1e6; label="inner i") #TODO: put to Inf
58-
kdi = SLInput(0.16; label="inner i")
57+
kii = SLInput(1e12; label="inner i") #TODO: put to Inf
58+
kdi = SLInput(0.16; label="inner d")
5959

6060

6161
f = Figure()
@@ -69,15 +69,15 @@ using WGLMakie
6969

7070
end
7171

72-
left1(app::AppState, x) = app.v_ref[] = -1
73-
left2(app::AppState, x) = app.v_ref[] = -2
74-
left3(app::AppState, x) = app.v_ref[] = -3
72+
left1(app::AppState, x) = app.v_ref[] = -0.5
73+
left2(app::AppState, x) = app.v_ref[] = -1.0
74+
left3(app::AppState, x) = app.v_ref[] = -1.5
7575

7676
pause(app::AppState, x) = app.v_ref[] = 0
7777

78-
right1(app::AppState, x) = app.v_ref[] = +1
79-
right2(app::AppState, x) = app.v_ref[] = +2
80-
right3(app::AppState, x) = app.v_ref[] = +3
78+
right1(app::AppState, x) = app.v_ref[] = +0.5
79+
right2(app::AppState, x) = app.v_ref[] = +1.0
80+
right3(app::AppState, x) = app.v_ref[] = +1.5
8181

8282
function stop(app::AppState, x)
8383

@@ -212,6 +212,7 @@ function get_body(session, app::AppState)
212212
DOM.body(
213213

214214
DOM.div(
215+
DOM.h1("DyadBot App"),
215216
app.R,
216217
app.L,
217218
DOM.hr(), #---------------

src/cascade_planar_flat.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ end
1919
inner_controller = Blocks.LimPID()
2020
# Outer loop: velocity controller
2121
outer_controller = Blocks.LimPID()
22-
neg_gain = Blocks.Gain(k=1)
22+
# neg_gain = Blocks.Gain(k=1)
2323
# ref = Blocks.Step(height=x_ref, start_time=5)
2424
# ref = Blocks.Square(; smooth = true)
2525
# Add pi offset to inner loop reference
@@ -31,8 +31,7 @@ end
3131
# Outer loop: velocity reference -> angle reference
3232
# connect(ref.output, :r2, outer_controller.reference)
3333
outer_controller.reference.u ~ v_ref
34-
connect(plant.x_output, neg_gain.input)
35-
connect(neg_gain.output, :y2, outer_controller.measurement)
34+
connect(plant.x_dot_output, :y2, outer_controller.measurement)
3635

3736
# Add pi to outer controller output for inner loop reference
3837
connect(outer_controller.ctr_output, :u2, add_pi.input1)

0 commit comments

Comments
 (0)