Skip to content

Commit fce9ade

Browse files
authored
Merge pull request #8 from JuliaComputing/fbc/fix-discrete-ff-clock
Fix dropped clock connection in DiscreteCascadeFFController
2 parents 7952632 + c0a63bc commit fce9ade

5 files changed

Lines changed: 12 additions & 13 deletions

dyad/cascade_ff.dyad

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ relations
193193
connect(torque_ff, sampler_torqueff.u) {^id26}
194194
connect(sampler_torqueff.y, angle_controller.u_ff) {^id27}
195195
connect(angle_measurement, sampler_theta.u) {^id28}
196-
connect(sampler_theta.y, angle_controller.u_m) {^id29}
196+
connect(sampler_theta.y, angle_controller.u_m, clock.y) {^id29}
197197
connect(angle_controller.y, gain.u) {^id30}
198198
connect(gain.y, zoh.u) {^id31}
199199
connect(zoh.y, torque) {^id32}
@@ -354,12 +354,11 @@ metadata {
354354
"id29": {
355355
"Dyad": {
356356
"edges": [
357-
{
358-
"S": 1,
359-
"M": [{"x": 710, "y": 700}, {"x": 530, "y": 700}, {"x": 530, "y": 524}],
360-
"E": 2
361-
}
362-
]
357+
{"S": 1, "M": [{"x": 710, "y": 700}], "E": -1},
358+
{"S": -1, "M": [{"x": 530, "y": 524}], "E": 2},
359+
{"S": 3, "M": [{"x": 460, "y": 700}], "E": -1}
360+
],
361+
"junctions": [{"x": 530, "y": 700}]
363362
}
364363
},
365364
"id30": {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}]}},

generated/CascadeControlledDyadBot_definition.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ and `scripts/tune_cascade_pid.jl`, or all simultaneously with
134134
### Equations
135135
push!(__eqs, connect(square.y, firstorder.u))
136136
push!(__eqs, connect(firstorder.y, firstorder1.u))
137-
push!(__eqs, connect(firstorder1.y, controller.pos_reference))
138-
push!(__eqs, connect(plant.x, controller.pos_measurement))
139-
push!(__eqs, connect(plant.theta, controller.angle_measurement))
140137
push!(__eqs, connect(controller.torque, plant.torque))
138+
push!(__eqs, connect(plant.theta, controller.angle_measurement))
139+
push!(__eqs, connect(plant.x, controller.pos_measurement))
140+
push!(__eqs, connect(firstorder1.y, controller.pos_reference))
141141

142142
# Return completely constructed System
143143
return System(__eqs, t, __vars, __params; systems=__systems, initial_conditions=__initial_conditions, guesses=__guesses, name, initialization_eqs=__initialization_eqs, bindings=__bindings, assertions=__assertions)

generated/CascadeFFDyadBot_definition.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ the discrete-time model `DiscreteCascadeFFDyadBot` is identical except that
7777
### Components
7878
# Subcomponent world of type MultibodyComponents.PlanarMechanics.World
7979
world_overrides = __pop_subcomponent_overrides!(__overrides, "world")
80-
push!(__systems, @named world = MultibodyComponents.PlanarMechanics.World(; g=9.82, world_overrides...))
80+
push!(__systems, @named world = MultibodyComponents.PlanarMechanics.World(; g=9.82, nominal_length=0.1, world_overrides...))
8181
# Subcomponent plant of type DyadBotComponents.PlanarDyadBot
8282
plant_overrides = __pop_subcomponent_overrides!(__overrides, "plant")
8383
push!(__systems, @named plant = DyadBotComponents.PlanarDyadBot(; phi0=phi0, plant_overrides...))

generated/DiscreteCascadeFFController_definition.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ controller.
142142
push!(__eqs, connect(torque_ff, sampler_torqueff.u))
143143
push!(__eqs, connect(sampler_torqueff.y, angle_controller.u_ff))
144144
push!(__eqs, connect(angle_measurement, sampler_theta.u))
145-
push!(__eqs, connect(sampler_theta.y, angle_controller.u_m))
145+
push!(__eqs, connect(sampler_theta.y, angle_controller.u_m, clock.y))
146146
push!(__eqs, connect(angle_controller.y, gain.u))
147147
push!(__eqs, connect(gain.y, zoh.u))
148148
push!(__eqs, connect(zoh.y, torque))

generated/DiscreteCascadeFFDyadBot_definition.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ structural parameter `Ts`.
7171
### Components
7272
# Subcomponent world of type MultibodyComponents.PlanarMechanics.World
7373
world_overrides = __pop_subcomponent_overrides!(__overrides, "world")
74-
push!(__systems, @named world = MultibodyComponents.PlanarMechanics.World(; g=9.82, world_overrides...))
74+
push!(__systems, @named world = MultibodyComponents.PlanarMechanics.World(; g=9.82, nominal_length=0.1, world_overrides...))
7575
# Subcomponent plant of type DyadBotComponents.PlanarDyadBot
7676
plant_overrides = __pop_subcomponent_overrides!(__overrides, "plant")
7777
push!(__systems, @named plant = DyadBotComponents.PlanarDyadBot(; phi0=phi0, plant_overrides...))

0 commit comments

Comments
 (0)