octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: demo for new xcos pkg


From: Mike Miller
Subject: Re: demo for new xcos pkg
Date: Mon, 7 Dec 2015 14:46:03 -0500
User-agent: Mutt/1.5.24 (2015-08-30)

On Mon, Dec 07, 2015 at 09:28:24 -0500, Doug Stewart wrote:
> @ Mike I would like you to try this for me, and then I will put it on the
> wiki.

I ran through this demo, here are some suggestions / fixes:

> 1) Install Scilab
> 2) Attached are 2 files, put them in your PWD.
> 3)Click in the zcos file to start Scilab and Xcos
>    You should see a diagram of the control system.

Necessary to do this step *before* installing the "Backdoor" module in
Scilab. If the "Backdoor" is installed first I can't get this zcos file
to load.

> 4) Open the .m file in your octave editor.
> 5) Run the .m file
>     You should see a plot that has the output of the plant
>     with no feedback, and the output of the plant in the feedback loop
>     and the control action signal that has been clipped at 5 volts.
> 6) You can then play with the PID parameters in the M file and see how
>      they affect the output.
> 7) In the loop diagram in Xcos click in the clipper box and change the
> clipping to be 10 Volts

Add a note that the box is labeled "SATURATION".

> 8) Rerun the m file and retune the PID.
> 9) Now for a little harder problem.
>      Lets change the plant parameters to (s+1) *(s=5)
>      If yo just click on the plant and try and do this,Xcos will complain
> that it doesn't know what k is,
>      so you have to first go to the Scilab main window and put k=1 there. k
> will be changed
>      from your m file later. Now you will be able to change the plant in
> both locations.

Typo, system denominator should be "(s+1)*(s+5)" right?

I did not get an error about k. Maybe because I had already run the
simulation and k was defined?

> 10) In the m file set k=5 and run the new system
> 11) Now lets add a time delay in the feedback part of the loop.
> 11.1)  Click on the wire that goes from the output of the plant back to an
> input
>             of the summing junction. This should highlight the line as
> dashes.
> 11.2) Press the delete button to delete this wire.
> 11.3) Select the "view" menu tab at the top of the Xcos diagram.
> 11.4) Select the "palette browser"
> 11.5) In the new pop up window scroll down and select and move to the
> diagram, the                                      "TIME_DELAY" box.

Note that this block is in the "Continuous time systems" category. The
default category is "Commonly Used Blocks" which does not include the
time delay block.

> 11.6) The input and outputs are on the wrong side, so we will mirror it.
>          Right click on the box and the select" format" and "Mirror"
> 11.7) Move the box to a convenient place to rewire it in the feedback loop,
> 11.8) On the left side of the delay box is an output black arrow point,
> click on this
>           and drag the mouse to the left until you are to the left of the
> summing junction box.
>           Now let go of the left button and move the mouse pointer up to
> the height of the
>           input pin of the summing box. Click the left button  to place a
> corner in the wire.
>           Now move to the input pin until you get a green box around the
> input pin.
>           Click the left mouse button again to make the connection.
> 11.9) We now have to join a wire to an existing wire.
>          Place the mouse pointer on the wire from the output of the plant.
>          The wire should be highlighted but not selected.
>           Hold the left mouse button down and start drawing a wire.
>           Join it to the input of the delay
> 12)    Double click on the delay box and change the delay to be .3 seconds.
> 13)    Save your new model with a new name.
> 14)    In the M file change the line:
>             sci_sim('sci_ap_model3.zcos');     %Running xcos simulation
>        to
>              sci_sim('newname.zcos');     %Running xcos simulation
>      14) Rerun the M file and have fun tuning the PID.

I ran through the rest of these steps smoothly, looks good!

-- 
mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]