-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hard to understand error message: Lengths of U2 (1:27) and Y1 #90
Comments
I could also mention a suggestion for improving the user experience by leaving less of the plumbing to the end user. The code above could instead look like: function mk2_block_diagram_(; inner_feedback = true, outer_feedback = true)
inertia = tag_sys(dummy_tf)
pitch_int = tag_sys(dummy_tf)
aoa_aero = tag_sys(dummy_tf)
aoa_rate_aero = tag_sys(dummy_tf)
aoa_int = tag_sys(dummy_tf)
hacker = tag_sys(dummy_tf)
elev_aero = tag_sys(dummy_tf)
props_ctrl = tag_sys(dummy_tf)
elev_ctrl = tag_sys(dummy_tf)
outer_ctrl = tag_sys(dummy_tf)
error_aoa_rate = summation(:aoa_rate, (:-, inertia))
error_pitch_rate = summation(outer_ctrl, (:-, inertia))
bd = initblockdiagram()
bd = connect(bd, :moment, inertia, :pitch_rate, pitch_int, :pitch)
bd = connect(bd, summation(
(:-, aoa_aero)
, (:-, aoa_rate_aero)
, hacker
, elev_aero
, :disturbance
)
, inertia)
bd = connect(bd, error_aoa_rate, aoa_rate_aero)
bd = connect(bd, aoa_int, aoa_aero)
bd = connect(bd, error_aoa_rate, aoa_int)
bd = connect(bd, :elev_sp, elev_ctrl, elev_aero)
bd = connect(bd, :prop_moment_sp, props_ctrl, hacker)
bd = inner_feedback ? connect(bd, error_pitch_rate, elev_ctrl ) : bd
bd = inner_feedback ? connect(bd, error_pitch_rate, props_ctrl) : bd
bd = outer_feedback ? connect(bd, summation(:pitch_ref, (:-, :pitch)), outer_ctrl) : bd
# now use the block diagram graph to create a system
sys0 = blockdiagramtosys(bd, :pitch_ref, pitch_int)
# or alternatively
sys1 = blockdiagramtosys(bd, :pitch_ref, :pitch)
sys2 = blockdiagramtosys(bd, :pitch_ref, :pitch)
# then use it...
bodeplot(sys0)
end Edit: after giving this a bit more though, I further simplified the API. Now just get rid of all the named and then drop in tags at any appropriate place in the |
That could be a bug in vcat(blocks, splitters, sum_blocks) ? |
I went through all inputs and outputs in more detail and found I believe two bugs. Though fixing those did not seem to change the outcome. I have edited the original code. |
So I was working on my first larger block diagram, and trying to get everything in place. First I was meeting error messages giving me the name of an input/output that I was able to figure out. But after sorting out all that, I was presented with the following error message, after which I am quite stuck.
I am asking in this issue if maybe the error message should be improved on?
The code for the failing function:
The text was updated successfully, but these errors were encountered: