Essentials of Mechatronics  ISBN: 0-471-72341-X- ©John Billingsley 2006 - published John Wiley & Sons, Inc

6/5/index.htm - Index to simulations

Three alternative techniques are presented for the simulations.

Perhaps the most 'accessible' uses the JavaScript engine that is freely available in recent versions of such browsers as Internet Explorer and Netscape.
(With Netscape you might have to 'reload' before running the simulation)

A simple applet takes the form of a 'whiteboard' on which graphics can be drawn and plotted.  A text area within a 'form' displays the code.  This can be edited at will to modify the simulation, so that variations can be tried out with minimal 'turnaround' time.

It is a good idea to select the menu option that displays the 'Javascript Console', so that any errors will be flagged.

The second format uses Quick Basic or QBasic.  QBasic was included for optional installation in Windows versions before XP and should be easy to find.  It has the added advantage that QBasic allows direct output to the printer port, so that very similar code can be used for controlling real time experimental hardware.

The third version uses Visual Basic.  Although written in Visual Studio 6.0, the code is probably compatible with earlier versions.  The code is contained in a .frm file, the form on which the graphics are plotted.  There will be pressure from Microsoft to phase out version 6.0 and enforce upgrading to further versions.

To run the .bas and .frm versions, you may have to save the file on your local machine.  Instead of 'left-clicking' on the link, click the right-hand button on the mouse and when a menu appears select 'save as'.  To run the .htm version, you will probably have to struggle with the browser to persuade it to let you run the embedded script and applet.

These examples are as essential to understanding state variables and simulation as the text itself.  Give them a thorough workout, editing the code and trying out a range of parameters.

A first-order introduction to simulation is found here.

A set of simulations of position control are found here.