Running the GUI
Using the GUI
The purpose of this Graphical User Interface (GUI) is to allow the user to view an animation of the Inverted Pendulum system with the step response plot. This allows the user to see the correlation between the plot and the systems physical response.
The animation and GUI are based on the Inverted Pendulum: State-space example. This method was used because we can easily return the cart position and pendulum angle as well as their respective velocities. For more information on the system model please refer to the Inverted Pendulum: Modeling page.
Once these files are copied into your MATLAB directory, simply enter the following command:
invGUINeither of the other two files need to be run from the command window, they will be called separately by the GUI. The following figure should appear on your screen after the command has been executed:
The first group of controls contains the RUN, REPEAT, and CLEAR buttons. These controls perform most of the work in the GUI.
REPEAT - The purpose of this control is to re-plot the response and re-run the animation. It uses the results from the previous simulation done by the RUN button. This is especially useful for the non-linear simulation, which can take some time to run.
CLEAR - This control clears the both plots. If the plots are not cleared then during the next run the step response will be plotted on the same plot. This is useful if you want to see graphically the difference changing some values makes.
An example of the animation and response plot are shown below. As you can see, both the cart's position and pendulum's angle were plotted in the step response plot.
The next group of controls allows you to set the weighting factor of the Q matrix for the LQR design method utilized in the animation. For more information on LQR and weighting factors for this problem click here.
THETA FACTOR - This editable text field weight's the pendulum's angle. Similar to the x weighting factor, making this larger will quicken the pendulum's response.
Feel free to change the weighing factors to see what happens!
This group of controls allow you to change the step input command.
This group of controls contains checkboxes that allow the user to change various features of the GUI.
PLOT SEPARATELY - By checking this box the step response plot is graphed in its entirety before the animation is run.
REFERENCE INPUT - This box is automatically checked when the GUI is run. By un-checking it the user removes the reference input term, Nbar, from the simulation. The reference input is used to correct steady-state errors common to full-state feedback systems.
NON-LINEAR SYSTEM - This checkbox allows the user to switch the model from the linear representation used throughout the tutorials to the non-linear representation of the system. Through the non-linear system the user may get a better idea of what actually happens in the system. For instance, the linear representation will allow the ball to move faster than is physically possible, when seen in the non-linear system the user will see that this actually is unstable.
REMEMBER, this GUI is intended to be an interactive learning tool that will allow the user to get a feeling for how some basic control techniques and ideas are represented in the real world. Therefore, the user is encouraged to PLAY around with this tool to enhance their understanding of controls.