INTRODUCTION When we were a child and we tried to balance a broom-stick on your index finger or the palm of your hand

INTRODUCTION
When we were a child and we tried to balance a broom-stick on your index finger or the palm of your hand. We had to constantly adjust the position of our hand to keep the object upright. An INVERTED PENDULUM does basically the same thing. However, it is limited in that it only moves in one dimension, while your hand could move up, down, sideways, etc. Just like the broom-stick, an Inverted Pendulum is an inherently unstable system. Force must be properly applied to keep the system intact. To achieve this, proper control theory is required. The Inverted Pendulum is essential in the evaluating and comparing of various control theories.
An inverted pendulum is a pendulum that has its centre of mass above its pivot point. It is an inherently unstable system with highly nonlinear dynamics. It is often implemented with the pivot point mounted on a cart that can move horizontally and may be called a cart and pole. This is a system which belongs to the class of under-actuated mechanical systems having fewer control inputs than the degree of freedom. This renders the control task more challenging, making the inverted pendulum system a classical benchmark for the design, testing, evaluating and comparing of different classical and contemporary control techniques .A normal pendulum is stable when hanging downwards, an inverted pendulum is inherently unstable. Being an inherently unstable system, the inverted pendulum is among the most difficult systems, and is one of the most important classical problems and must be actively balanced in order to remain upright this can be done either by applying a torque at the pivot point, by moving the pivot point horizontally as part of a feedback system, changing the rate of rotation of a mass mounted on the pendulum on an axis parallel to the pivot axis and thereby generating a net torque on the pendulum, or by oscillating the pivot point vertically.

The inverted pendulum (IP) is one of the most difficult systems in control engineering. Due to its wide applications and pivotal role in the physical world and importance in the field of control engineering, this has been chosen as a task of choice which analyzes its model and proposes a linear compensator according to the PID control law.

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

The reasons for selecting the IP as the system are:
It is the most easily available system (in most academia) for laboratory usage.
It is a nonlinear system, which needs to be treated linear around the stable equilibrium position, without much error, for quite a wide range of variation.

APPLICATIONS OF INVERTED PENDULUM

Among some considerable applications of inverted pendulum (IP) are:

SIMULATION OF DYNAMICS OF A ROBOTIC ARM

The control system problem with robotics arms is analogous to the dynamics of Inverted Pendulum. It is simulated in the dynamics of robotic arm in the condition when the center of pressure lies below the centre of gravity for the arm so that the system is also unstable around the mean position. Thus Robotic arm behaves very much like Inverted Pendulum under this mean position condition.

MODEL OF A HUMAN STANDING STILL

It is of great importance how the ability to maintain stability while standing straight is to mankind. The central nervous system (CNS) is registered with the desired pose and is calibrated with the changes in the pose of the human body, and muscles are activated in order to maintain balance. The inverted pendulum is widely accepted as an adequate model of a human standing still (quiet standing). An inverted pendulum (assuming no attached springs) is unstable while in movement around the mean position, and is hence obvious that a feedback of the state of the inverted pendulum is needed to stabilize the inverted pendulum in the upright position.
Two models for the CNS feedback control are generally considered:
Time invariant, linear feedback control.
Linear feedback outside a threshold. No sensory feedback within the threshold.
Passive mechanisms, such as stiffness in muscles and supportive tissue, may be modeled as a spring and damper in the inverted pendulum system. The spring and damper in the inverted pendulum leads to a negative feedback loop that could be used to stabilize the pendulum, if the spring is stiff enough or in the expanded mode that is there is a force being exerted by the spring system on the bob of the inverted pendulum.

FIG 1.1 INVERTED PENDULUM WITH PASSIVE MECHANISMS MODELED AS A SPRING AND DAMPER

PROBLEM DEFINITION

It is virtually impossible to balance a pendulum in the inverted position without applying some external force to the system. The Carriage Balanced Inverted Pendulum (CBIP) system, shown below, allows this control force to be applied to the pendulum carriage. The AIM OF THE STUDY is to stabilize or fasten the process of stabilizing the pendulum such that the position of the carriage on the track is controlled quickly and accurately and that the pendulum is always maintained strongly in its inverted or upright position during such transversal movements.
The problem involves a cart, which is able to move forward and backward as well, and a pendulum, hinged to the cart at the bottom of its length such that the pendulum can move in the same horizontal plane as the cart. That is, the pendulum mounted on the cart is free to fall along the cart’s axis of motion which is primarily the vertical plane of movement. The system is to be controlled in such a way that the inverted pendulum remains upright and balanced, and is resistant to a step disturbance.

FIG 1.2 A SIMPLE COUPLED SYSTEM

This problem involves A SIMPLE COUPLED SYSTEM. If the pendulum starts off-center/or a position different from the mean position, it will begin to fall with the cart movement. As the pendulum is coupled to the cart, the cart will start to move in a particular direction, so this movement would cause the pendulum to move in the opposite direction to the cart which will make the pendulum to become off center. As any change to one of the parts of the system results in certain change to the other part, this is a more complicated control system than it appears at first glance. That is why , this problem is often regarded as demonstration of fuzzy control.

CHAPTER-2

LABVIEW INTRODUCTION

LabVIEW (short for Laboratory Virtual Instrumentation Engineering Workbench) is a platform and development environment for a visual programming language from National Instruments. The graphical language is named “G”. Originally released for the Apple Macintosh in 1986, LabVIEW is commonly used for data acquisition, instrument control, and industrial automation on a variety of platforms including Microsoft Windows, various flavors of Linux, and Mac OS X. The code files have the extension “.vi”, which is an abbreviation for “Virtual Instrument”. LabVIEW offers lots of additional Add-On’s and Toolkits.

2.1 LABVIEW ENVIRONMENT BASICS

LabVIEW programs are called virtual instruments, or VIs, because their appearance and operation often imitate physical instruments, such as oscilloscopes and multimeters. LabVIEW contains a comprehensive set of tools for acquiring, analyzing, displaying, and storing data, as well as tools to help you troubleshoot the code you write.

Front Panel:

When you open a new or existing VI, the front panel window of the VI appears. The front panel window is the user interface for the VI.

Controls Palette

The Controls palette contains the controls and indicators you use to create the front panel. You access the Controls palette from the front panel window by selecting View»Controls Palette or by right clicking on any empty space in the front panel window.

Controls and Indicators

Every VI has a front panel that you can design as a user interface. You also can use front panels as a way to pass inputs and receive outputs when you call the VI from another block diagram.

Numeric Controls and Indicators
The numeric data type can represent numbers of various types, such as integer or real. The two common numeric objects are the numeric control and the numeric indicator.
Block Diagram
Block diagram objects include terminals, subVIs, functions, constants, structures, and wires, which transfer data among other block diagram objects.
Terminals
Objects on the front panel window appear as terminals on the block diagram. Terminals are entry and exit ports that exchange information between the front panel and block diagram. They are analogous to parameters and constants in text-based programming languages. Types of terminals include control or indicator terminals and node terminals.
Block Diagram Nodes

Nodes are objects on the block diagram that have inputs and/or outputs and perform operations when a VI runs. They are analogous to statements, operators, functions, and subroutines in text-based programming languages. Nodes can be functions, subVIs, Express VIs, or structures. Structures are process control elements, such as Case structures, For Loops, or While Loops.
Functions

Functions are the fundamental operating elements of LabVIEW. Functions do not have front panel windows or block diagram windows but do have connector panes. Double-clicking a function only selects the function. A function has a pale yellow background on its icon.
SubVIs
After you build a VI, you can use it in another VI. A VI called from the block diagram of another VI is called a subVI. You can reuse a subVI in other VIs. To create a subVI, you need to build a connector pane and create an icon.
A subVI node corresponds to a subroutine call in text-based programming languages. The node is not the subVI itself, just as a subroutine call statement in a program is not the subroutine itself. A block diagram that contains several identical subVI nodes calls the same subVI several times.
The subVI controls and indicators receive data from and return data to the block diagram of the calling VI. When you double-click a subVI on the block diagram, its front panel window appears. The front panel includes controls and indicators. The block diagram includes wires, icons, functions, possibly subVIs, and other LabVIEW objects.
Express VIs
Express VIs are nodes that require minimal wiring because you configure them with dialog boxes. Use Express VIs for common measurement tasks. They appear on the block diagram as expandable nodes with icons surrounded by a blue field.
Functions Palette
The Functions palette contains the VIs, functions and constants you use to create the block diagram. You access the Functions palette from the block diagram by selecting View»Functions Palette.
2.2 DATAFLOW PROGRAMMING

The programming language used in LabVIEW, also referred to as G, is a dataflow programming language. Execution is determined by the structure of a graphical block diagram (the LV-source code) on which the programmer connects different function-nodes by drawing wires. These wires propagate variables and any node can execute as soon as all its input data become available. Since this might be the case for multiple nodes simultaneously, G is inherently capable of parallel execution. Multi-processing and multi-threading hardware is automatically exploited by the built-in scheduler, which multiplexes multiple OS threads over the nodes ready for execution. Dataflow programming is a programming paradigm that models a program as a directed graph of the data flowing between operations, thus implementing dataflow principles and architecture. Dataflow programming languages share some features of functional languages, and were generally developed in order to bring some functional concepts to a language more suitable for numeric processing. Some authors use the term datastream instead of dataflow to avoid confusion with dataflow computing or dataflow architecture, based on an indeterministic machine paradigm.
A program is modeled as a series of operations happening in a specific order; this may be referred to as sequential, procedural, control flow (indicating that the program chooses a specific path), or programming. In contrast, dataflow programming emphasizes the movement of data and models programs as a series of connections. Explicitly defined inputs and outputs connect operations, which function like black boxes An operation runs as soon as all of its inputs become valid. Thus, dataflow languages are inherently parallel and can work well in large, decentralized systems.

State

One of the key concepts in computer programming is the idea of state, essentially a snapshot of various conditions in the system. Most programming languages require a considerable amount of state information, which is generally hidden from the programmer. Often, the computer itself has no idea which piece of information encodes the enduring state. This is a serious problem, as the state information needs to be shared across multiple processors in parallel processing machines. Most languages force the programmer to add extra code to indicate which data and parts of the code are important to the state. This code tends to be both expensive in terms of performance, as well as difficult to read or debug. Explicit parallelism is one of the main reasons for the poor performance of Enterprise Java Beans when building data-intensive, non-OLTP applications.
Where a sequential program can be imagined as a single worker moving between tasks (operations), a dataflow program is more like a series of workers on an assembly line, each doing a specific task whenever materials are available Since the operations are only concerned with the availability of data inputs, they have no hidden state to track, and are all “ready” at the same time.

Representation
Dataflow programs are represented in different ways. A traditional program is usually represented as a series of text instructions, which is reasonable for describing a serial system which pipes data between small, single-purpose tools that receive, process, and return. Dataflow programs start with an input, perhaps the command line parameters, and illustrate how that data is used and modified. The flow of data is explicit, often visually illustrated as a line or pipe.
In terms of encoding, a dataflow program might be implemented as a hash table, with uniquely identified inputs as the keys, used to look up pointers to the instructions. When any operation completes, the program scans down the list of operations until it finds the first operation where all inputs are currently valid, and runs it. When that operation finishes, it will typically output data, thereby making another operation become valid.
For parallel operation, only the list needs to be shared; it is the state of the entire program. Thus the task of maintaining state is removed from the programmer and given to the language’s runtime. On machines with a single processor core where an implementation designed for parallel operation would simply introduce overhead, this overhead can be removed completely by using a different runtime.
Going with the data flow
The control flow model of execution is instruction driven. Dataflow execution is data driven, or data dependent. A node that receives data from another node always executes after the other node completes execution. This is called natural data dependency.
Block diagram nodes not connected by wires can execute in any order. You can use flow-through parameters such as reference numbers or error clusters to control execution order when natural data dependency does not exist.
When flow-through parameters are not available, you can use a Sequence structure to control execution order—like a VI, the contents of a Sequence structure will not execute until data has arrived at any input terminals/tunnels. This can create an artificial data dependency in which the receiving node does not actually use the data received. Instead, the receiving node uses the arrival of data to trigger its execution.
State machines: a better way to represent

A state machine is a mathematical model of computation that describes states in a logical execution. Each state is determined by parameters based on conditions defined by the architect. Most commonly, this can be thought of as a flowchart. Based on a series on inputs, execution goes through the flowchart passing from state to state.

This is a flexible approach because you can revisit states many times throughout the execution and execution can cease during any state. You can find state machine architectures in most programming languages. LabVIEW state machines consist of a While Loop to continue the execution, a Case structure to define the different states, an enumerated constant that changes the states, and a shift register to drive the conditions between the states.

FIG 2.1 FLOWCHART FOR A FURNANCE

2.3 GRAPHICAL PROGRAMMING

LabVIEW ties the creation of user interfaces (called front panels) into the development cycle. LabVIEW programs/subroutines are called virtual instruments (VIs). Each VI has three components: a block diagram, a front panel, and a connector panel. The last is used to represent the VI in the block diagrams of other, calling VIs. Controls and indicators on the front panel allow an operator to input data into or extract data from a running virtual instrument. However, the front panel can also serve as a programmatic interface.
Thus a virtual instrument can either be run as a program, with the front panel serving as a user interface, or, when dropped as a node onto the block diagram, the front panel defines the inputs and outputs for the given node through the connector pane. This implies each VI can be easily tested before being embedded as a subroutine into a larger program. The graphical approach also allows nonprogrammers to build programs simply by dragging and dropping virtual representations of lab equipment with which they are already familiar. The LabVIEW programming environment, with the included examples and the documentation, makes it simple to create small applications. This is a benefit on one side, but there is also a certain danger of underestimating the expertise needed for good quality “G” programming. For complex algorithms or large-scale code, it is important that the programmer possess an extensive knowledge of the special LabVIEW syntax and the topology of its memory management. The most advanced LabVIEW development systems offer the possibility of building stand-alone applications. Furthermore, it is possible to create distributed applications, which communicate by a client/server scheme, and are therefore easier to implement due to the inherently parallel nature of G-code.
LabVIEW follows a dataflow model for running VIs. A block diagram node executes when it receives all required inputs. When a node executes, it produces output data and passes the data to the next node in the dataflow path. The movement of data through the nodes determines the execution order of the VIs and functions on the block diagram.
Visual Basic, C++, Java, and most other text-based programming languages follow a control flow model of program execution. In control flow, the sequential order of program elements determines the execution order of a program.

Wires

You transfer data among block diagram objects through wires. Each wire has a single data source, but you can wire it to many VIs and functions that read the data. Wires are different colors, styles, and thicknesses, depending on their data types.
A broken wire appears as a dashed black line with a red X in the middle. Broken wires occur for a variety of reasons, such as when you try to wire two objects with incompatible data types.

2.4 BENEFITS

One benefit of LabVIEW over other development environments is the extensive support for accessing instrumentation hardware. Drivers and abstraction layers for many different types of instruments and buses are included or are available for inclusion. These present themselves as graphical nodes. The abstraction layers offer standard software interfaces to communicate with hardware devices. The provided driver interfaces save program development time. The sales pitch of National Instruments is, therefore, that even people with limited coding experience can write programs and deploy test solutions in a reduced time frame when compared to more conventional or competing systems. A new hardware driver topology (DAQmxBase), which consists mainly of G-coded components with only a few register calls through NI Measurement Hardware DDK (Driver Development Kit) functions, provides platform independent hardware access to numerous data acquisition and instrumentation devices. The DAQmxBase driver is available for LabVIEW on Windows, Mac OS X and Linux platforms.

CHAPTER-3

FLOW DIAGRAM OF WORKING OF
INVERTED PENDULUM

QNET ROTPEN Configuration

Input: Device Inputs and History Signal
Output: Speed current task out, arm task out and line task out
Function: Input Configuration

History Signals

Function: It contains the information of the previous iterations and these values are considered while making the new iteration, as these acts as the base values for the new computations so that the previous balancing control action is not repeated and the upright position is achieved instantly.

QNET ROTPEN I/P’s

Input: Speed current task out, arm task out and line task out
Output: Angle parameters in theta and radians along with task out.
Function: Interface between configured inputs and hardware.

Signal Generator

Function: Generates the point by point value of a periodic signal.

QNET Construct States

Inputs: Theta and alpha radians values and signal generator values.
Output: Alpha up, theta_dot and apha_dot and gain value computed on the basis of inertia.
Function: States are constructed on the basis of inertia of the system being calculated.

Balance Control Parameters

Function: These parameters are the control parameters for the working of the inverted pendulum and according to these values gain value is manipulated.

Negate

Function: It negates the value of the input signal and the output is the compliment of the input signal.

Dither + Sine Signal

Function: It is an intentionally applied form of noise used to randomize quantization error.

Enable Balance

Function: If desired values of balance parameters are fed into the system then it enables the swing up control to control the action of balancing the inverted pendulum.

Memory Function

Function: Store the value of input signal from previous iteration.

Sub- System Configuration Dialog box

Function: Configures the behavior of parameter of a system.

Swing UP Control parameter

These are the values of electrical output parameters which are to be given to the inverted pendulum to control the action of the inverted arm so as to make it in the correct desired position and are the values of the torque and force that is fed in the form of the electrical signals.

Model Parameters

These are the values of theta_dot and alpha_dot.

Swing Up Control (QNET)

Inputs: Swing up control parameters and model parameters.
Output: Energy signal and the value of control signals computed on real time basis and then which is fed into the select function to compare with the balance parameters where the credibility of the computed signal parameters is verified and if found that the value computed is in accordance with the enable balance parameters then it is given to the Simulation time waveform and motor input.
Select function
Function: Return the value wired to the “T” input or “F” input depending upon the values of “S”.

SimTime Waveform Function

Input: The output of the select function is fed into this and the values are plotted on the waveform chart.
Output: Voltage output to change the position of the inverted arm of the pendulum and make it in the desired position.
Function: Plots a value v/s the simulation time on a waveform cha

Build Array Function

Function: Concatenates multiple array elements to an N- dimensional array.

QNET Rotpen Clear Input

Function: It clears all the previous values of the iteration done on the inverted pendulum experimental setup and is used when there is a load of the system values in the configuration box.

Disturbance

Function: This is generated by the signal generator and or the inclusion of all the disturbances from the environment in the form that they are hindering in the working of the experiment and causing the error to occur.

OUTPUTS

There are 2 types of outputs in the inverted pendulum setup

Motor output
Motor output is based on the speed of the motor of the hinge to which the inverted pendulum arm is connected and is responsible for the maximum reach of the bob of the inverted pendulum as it includes the current rating upon which the arm movement is dependent of.

Angle Output
The angle output is the measure of the 2 angles namely:

Theta
This angle corresponds to the lateral value of movement of the arm in the horizontal plane so as to make the inertia of the arm in the upright position, this jerk produced on the arm when it moves by the value of theta is responsible for the force which is exerted on the arm so make it to the upright position.

Alpha
This angle corresponds to the vertical segment angle of the inverted pendulum that is the value of the angle in the vertical direction to which arm must move in order to achieve the desired upright position. This angle is taken from the vertical standing arm of the base of the inverted pendulum. As the final value of this angle needs to be 0 degree in this case, therefore the torque according to the swing up parameters must be this much that the arm attains the upright position.

CHAPTER-4

ALGORITHM OF WORKING OF INVERTED PENDULUM

FIG. 4.1 FLOWCHART OF THE WORKING OF THE INVERTED PENDULUM.
Step 1

Measure the moment of inertia of the inverted pendulum.

Step 2

The moment of inertia of a pendulum that oscillates freely after being perturbed is given in. The frequency can be measured accurately by taking into account many samples over a large span of time. The frequency of the pendulum can be found using,

f = ncyc?(t1-t0)

Where ncyc is the number of cycles within the time duration t1-t0, t0 is the time when the first cycle begins, and t1 is the time of the last cycle. Enter the measured number of cycles and the time duration as well as the calculated frequency and inertia.

Step 3

Calculate the discrepancy between the calculated inertia and that calculated analytically.

Step 4

Update the model parameter values as well as the pendulum’s moment of inertia just calculated in last step. If the poles are located in the right hand plane then the system is considered to be unstable.

Step 5

The state is constructed that is the value of the alpha (vertical angle) and theta (horizontal angle) is set using signal generator. This state is constructed using the data input from the previous stage where the inertia of the system was identified and thus the values of angular parameters are set.

Step 6

The balance control parameters are calculated based on the state constructed in the previous step. In this stage a check of signals is taken as if the balance control parameters are working and meeting the specifications for the upright position of the IP and they are working properly on the system and meeting the requirements, we move on to design inverted pendulum.

Step 7

The balance control parameters are implemented and if t the swing up control otherwise we go back to re- calculate the balance control parameters.

Step 8

In this stage the swing up control is implemented using the balance control parameters and this swing up control is in accordance with the enable balance. This is in the form of the electrical signals and is fed to the setup to move so that the desired upright position is achieved.

Step 9

If the swing up control implementation satisfies the desired values of the enable balance parameters, that is the condition of the desired values of balance parameters is checked, then the select output corresponds to the implemented swing up control and the simulation time waveform is produced on and the appropriate values of voltage and angle output is observed on the system.

Step 10

But if the swings up implementation don’t match the desired values of the enable balance parameters, the swing up control gain/design is tuned in iterative manner, until the correct values are received.

Step 11

The gain should be setup properly, if it is too high the pendulum can swing up too rapidly and cause the balance control have difficulties “catching” the pendulum in order to balance it. On the other hand the gain has to be sufficient to drive the pendulum within ± 30 degree of its upright position. Finally the pendulum can self erect in one swing with a properly tuned controller.

CHAPTER-5

MODELLING OF INVERTED PENDULUM

FIG. 5.1 FLOWCHART OF THE WORKING OF THE INVERTED PENDULUM
The free body diagram of an inverted pendulum mounted on a motor driven cart is shown in Fig. 11, 2, 3, 4. The system equations of this nonlinear dynamic system can be derived as follows. It is assumed here that the pendulum rod is mass-less, and the hinge is frictionless. In such assumption, the whole pendulum mass is concentrated in the centre of gravity (COG) located at the center of the pendulum ball. The cart mass and the ball point mass at the upper end of the inverted pendulum are denoted as M and m, respectively. There is an externally x-directed force on the cart, u(t), and a gravity force acts on the point mass at all times. The coordinate system considered is shown in FIG 5.1, where x(t) represents the cart position, and ?(t) is the tilt angle referenced to the vertically upward direction.

FIG 5.2 THE FREE BODY DIAGRAM OF AN INVERTED PENDULUM MOUNTED ON A MOTOR DRIVEN CART

A force balance on the system in the x-direction can be written as

M (d^2 x )/(dt^2 )+m (d^2 Xg)/(dt^2 )=u (1)

where the time-dependent centre of gravity (COG) of the point mass is given by coordinates (Xg , Yg ). For the point mass assumed here, the location of the center of gravity of the pendulum mass is

Xg = x + l sin ?, Yg = l cos ? (2)

where l is the pendulum rod length. Substituting (2) into (1), we have

(M + m)x ? ? ml sin ?? ?^2 + ml cos ?? ? = u. (3)
In a similar way, a torque balance on the system is performed. FIG 5.2 shows the force components acting on the system. The resultant torque balance can be written as:

(Fx cos ?)l ? (Fy sin ?)l = (mg sin ?)l (4)
Where Fx =m (d^2 Xg)/(dt^2 ), and Fy = m (d^2 Yg)/(dt^2 ) the force components in the x and y directions, respectively.

FIG 5.3 FORCE COMPONENTS ACTING ON THE SYSTEM

After manipulation, (4) is written as:

mx ?cos ? + ml? ?= mg sin ?. (5)

Equations (3) and (5) are the equations defining this system. These two equations are manipulated algebraically to have only a single second derivative term in each equation. Finally, we may derive the system equations describing the cart position dynamics and the pendulum angle dynamics, respectively. Thus we have:

x ? =(u+ml(sin?) ? ?^2-mgcos?sin?)/(M+m-m cos^2 ?) (6)

? ? =(u cos?-(M+m)gsin?+ml(cos?sin?)? ?^2)/(ml?cos?^2 ?-(M+m)l) (7)

Equations (6) and (7) represent a nonlinear system which is relatively complicated from a mathematical point of view. The following subsection presents the standard state space form of these two nonlinear equations.

dx/dt = f(x, u, t). (8)

x1 = ?, x2 = ? ? = (x1) ? , x3 = x, x4 = x ? = (x3) ?. (9)

final state space equation for inverted pendulum system may be written as:

dx/dt = d/dt ?([email protected]@[email protected]) = d/dt ?( [email protected] ? [email protected]@x ? ) = ?([email protected]@[email protected]) (10)
Where

f1 = x2 (11)
f2 = (ucosx1-(M+m)gsinx1+ml(cosx1sinx1)?x2?^2)/(ml?cos?^2 x1-(M+m)l) (12)
f3 = x4 (13)
f4 =(u+ml(sinx1) ?x2?^2-mgcosx1sinx1)/(M+m-m?cos?^2 x1) (14)

If both the pendulum angle ? and the cart position x are the variables of interest, then the output equation may be written as:
y = Cxory = ?([email protected])=Cx = ?(1&0&0&[email protected]&0&1&0)?([email protected]? [email protected]@x ? ) (15)

Equations (10) and (15) give a complete state space representation of the nonlinear inverted pendulum-cart dynamic system.
After linearization of nonlinear system equations about the upright (unstable) equilibrium position having initial conditions as x 0 = 0, 0, 0, 0T, the linear state-space equation is obtained as:

x ?=Ax+Bu
Where x=?x,x ?,?,(?) ??^T
The state feedback around u= -Kx leads to
x ?=(A-BK)x
where K is derived from minimization of the cost function
J= ??(x^T Qx+u^T Ru)dt

where Q and R are positive semi-definite and positive definite symmetric constant matrices, respectively.
After Linearization, the system matrices to design are as follows:

A = ?(0&0&1&[email protected]&0&0&[email protected]&22.374&-0.274&[email protected]&36.209&-0.0703&0)

B = ?([email protected]@[email protected])

C = ?(1&0&0&[email protected]&1&0&[email protected]&0&1&[email protected]&0&0&1)

D = ?([email protected]@[email protected])

These values are calculated for a particular set of balance control parameters and for a particular swing up control.
Timing noted for the balancing of the inverted pendulum from the equilibrium position to the upright position as observed is:

0-18 sec
18-32 sec
32-44 sec
44-54 sec
54-63 sec
63-73 sec
73-82 sec
82-91 sec
91-101 sec
101-112 sec

So the average outcome for the balancing of the swing up control is near about 9.5 sec.

CONCLUSION

The experience of working on the classical problem of Inverted Pendulum is great. It is an ideal exercise to show one’s talent as control engineer. The practical work has gone a long way in helping us understand and develop an insight into the designing of control systems.
The stabilization and tracking control of inverted pendulum system are attained successfully using Quanser ROTPEN instrument. The use of QNET ROTPEN for calculating control parameters is simple and provides good convergence towards optimal values. A comparative study has been carried out and the obtained results are quite acceptable. This exercise provides a chance of designing a controller that has a good dynamic behaviour. Both swing up and stabilization problems have been studied. Energy based control is used for swinging up the pendulum, and much faster swing up of the pendulum is obtained using energy based control. The state space analysis of the linear modelling of the inverted pendulum was studied and the values of A,B,C,D matrices were calculated based on the mathematical modelling of the inverted pendulum linear analysis and the timing of the balancing of the inverted pendulum was observed.