Visio Guy

Product Support => Paul Herber's Products => Topic started by: Paul Herber on August 01, 2017, 03:59:44 AM

Title: Control system shapes
Post by: Paul Herber on August 01, 2017, 03:59:44 AM
A question on the SuperUser forum prompted me to create these simple shapes for generating control system diagrams:

http://www.paulherber.co.uk/articles/visio-articles/control-systems/ (http://www.paulherber.co.uk/articles/visio-articles/control-systems/)

No feedback required about these shapes (postive or negative).  :D
Title: Re: Control system shapes
Post by: Surrogate on August 01, 2017, 06:02:50 AM
A question on the SuperUser forum (https://superuser.com/questions/1235891/ms-visio-control-system-stencils)
just add SuperUser's hyperlink  ;D
Title: Re: Control system shapes
Post by: wapperdude on August 01, 2017, 08:48:10 AM
Those shapes are all about feedback...positive or negative...mostly negative...I'm pretty positive about that... ::)

Wapperdude
Title: Re: Control system shapes
Post by: vojo on August 01, 2017, 01:01:17 PM
nice

But wouldn't you want look at doing some actual math?   Much like Junes shapes.
I know passing values between shapes in Visio is tough...but it would make these shapes "killer shapes"
Title: Re: Control system shapes
Post by: Yacine on August 02, 2017, 05:33:15 AM
@Vojo, nice thought.
I wonder however what you would like to get automated?
A real control simulation would probably be too difficult to program. Isn't it.
Title: Re: Control system shapes
Post by: vojo on August 02, 2017, 07:30:28 AM
so if one could pass values between shapes (special connector or whatever)...you could
- create shapes (summing shape, anding shape, amplifier shape, etc)
- put actual numbers on the links
- etc

So your example diagram would have values and show an actual result

You may want to talk June, I think he did something like this a few years ago.
Title: Re: Control system shapes
Post by: metuemre on August 02, 2017, 08:32:15 AM
Hard to do but not impossible  8)

https://www.youtube.com/watch?v=TGFFnNODHdE (https://www.youtube.com/watch?v=TGFFnNODHdE)
Title: Re: Control system shapes
Post by: wapperdude on August 02, 2017, 09:24:25 AM
Haven't checked the video yet...but, the math in a control system is not simple, if you're going to do an actual modelling...LaPlace / Fourier transforms, sampling, etc.  Visio makes a nice documentation tool, but it is not an analytical tool.

Wapperdude
Title: Re: Control system shapes
Post by: Paul Herber on August 02, 2017, 09:29:02 AM
If just numbers were involved it might be possible, but the formulae used are normally very complex. I'm not sure even Excel could handle the calculations. It's more the domain of mathematical modeling software.
Title: Re: Control system shapes
Post by: wapperdude on August 02, 2017, 09:58:02 AM
For what it's worth...Excel can analyze the math.  It took about a year, part time, to develop, but I was able to create an Excel PLL analysis program back in the 90's, of course.  It was limited to 2nd order, type 3 systems as I recall.  Definitely an involved task.

Wapperdude
Title: Re: Control system shapes
Post by: Yacine on August 02, 2017, 12:34:55 PM
Agree with Paul. Tagging will be the least of the problems.
The simulation - the really interesting part - is the real issue.

I've been playing with open modelica for the last 5 years or so. Starting and stopping after some months, again and again. The models I handle (Custom made confectionery lines) are so complex and involve so many disciplines, that I cannot really elaborate by myself a working solution. Modelica has - unlike Visio - such a small community, that you cannot get useful (fast) help. Getting a budget for professional help has - this far - been beyond my engagement. So I kept trying and failing by myself again and again.

The solution Vojo suggests would (could) involve modelling the system in Visio, send it to Modelica and get back the results. A connection to Visio - altough it existed in the early days of openmodelica - is badly documented (actually "impossible").

The issue is, Modelica (or better its implementations as openmodelica, simulationX, ...) have their own visualisation tools and therefore would not require Visio.
My (preliminary) conclusion for the subject would be: If someone uses Visio for control loops, then it will always be for a "dumb" visualisation. The intelligence being in a textual explanation.
Intelligent systems will bring their own visualisation.

https://www.openmodelica.org/ (https://www.openmodelica.org/)
https://www.simulationx.com/ (https://www.simulationx.com/)

PS: control loops are - unlike fluid systems - already quite good developed in openmodelica. Really worth a look. (Wayne, Paul, ...)
Title: Re: Control system shapes
Post by: vojo on August 03, 2017, 07:40:21 AM
hey guys, what ever

Sure, modelling schrodingers equation would be difficult and sequency analysis for discrete convolution is doable but useless

But discrete systems (Z transforms, sampled data, LUTs) should not be tough (and makes the hand off the tough part

It was just a thought....

BTW if excel involved, just put the drawing in an excel sheet using excel shapes
Or if a continuous system, use python or mathlab to evaluate an equation for a countinuous system over a range
Title: Re: Control system shapes
Post by: metuemre on January 22, 2018, 10:23:49 AM
I got some free time and decided to give it a try. Results are not bad compared to Simulink ;)

(https://preview.ibb.co/hiGj8b/Simulation.png) (https://ibb.co/eX5NuG)

Problem is the execution speed. I set the speed to "40 iteration/second" which takes 25 seconds for 1000 iteration whereas it takes smaller than a second in Matlab.

I will post the sample visio file with necessary references tomorrow if someone wants to try.
Title: Re: Control system shapes
Post by: Paul Herber on January 22, 2018, 10:31:51 AM
Yes please.
Title: Re: Control system shapes
Post by: Yacine on January 22, 2018, 02:41:59 PM
+1
Title: Re: Control system shapes
Post by: metuemre on January 23, 2018, 06:56:12 AM
You can download the visio file and necessary references from the dropbox link below. Tested on Visio Pro 2013 32 Bit and Windows 7 Pro 64 Bit.  List of references are as follows;

https://www.dropbox.com/s/myeexobjw1ofxdi/Download_Package.rar?dl=0 (https://www.dropbox.com/s/myeexobjw1ofxdi/Download_Package.rar?dl=0)

- Microsoft Office Web Components 11.0 ( https://www.microsoft.com/en-US/download/details.aspx?id=22276 (https://www.microsoft.com/en-US/download/details.aspx?id=22276) )
- Scripting.Dictionary
- TWUtilities40.dll (Used for time control. Source code and more can be found at https://github.com/rlktradewright/tradewright-common (https://github.com/rlktradewright/tradewright-common))

Visio file is easy to use. Drag and drop shapes from document stencil, connect their connection points via special connector in document stencil or via connector button on Simulation Tab (you can also connect to another connector like in Simulink), change their parameters via shape data window, change simulation duration, sample interval and Start. After it finishes a trend display will automatically show up so that you can see the results. To start another simulation first Reset via button on Simulation Tab then Start again.

Time base for the calculations is 1 second and I couldn't find a way to speed things up. I'm sure someone else can improve it further with more shapes and functions.



Title: Re: Control system shapes
Post by: metuemre on January 23, 2018, 09:02:14 AM
I think I found a way to speed up the process. Revised Visio file is attached.

I fixed the execution speed to 10 ms. There are three speed modes - Normal (4 Samples per second), Fast (2 Samples per second) and x2 Fast (1 Sample per second).

For a duration of 100 seconds in Normal mode, code will collect 400 samples with 10 ms/sample speed so whole process will take 4 seconds. This will take 2 seconds in Fast mode and 1 second in x2 Fast Mode but resolution will get worse.

(https://preview.ibb.co/epkurw/Comparison.png) (https://ibb.co/jDpLWw)