You are on page 1of 6

ELEN90055 – CONTROL SYSTEM – WORKSHOP 4 – REPORT

SAATWICK MATHUR – 842660

VISHAL ANAND SHINDE – 822507

YILIU LIU - 796643

1. Introduction
The aim of this workshop is to design and implement a feedback control system in order to balance an
inverted pendulum attached at the front of the LEGO MINDSTORM EV3 robot and to maintain it at
an upright position without any disturbances while the robot is in motion. To this end, a gyro
measurement of the angular rate of pendulum is available. The upright position is to be maintained in
the presence of disturbances that act on the pendulum particularly, an impulsive disturbance applied
manually to the top of the pendulum and a disturbance acting on the base of the pendulum due to the
motion of the robot corresponding to steering (reorientation of the heading).

2. System Modeling
The small signal dynamics about the pendulum on the vertical position are given by:
ml2 θ̈ = τ − bθ̇ + mglθ (Equation from Workshop4 handout)

where m is the equivalent pendulum mass in (kg), l is the length in (m), b is the coefficient of viscous
damping in (N.m.sec/rad) which we obtain by placing the robot upside down and swinging the
pendulum when the robot is static, τ is the motor torque in (N.m), g is the acceleration due to gravity in
(m/sec2) and θ is the angle in (radians). With τ = Kti = Kt R (v − Kb ˙θ), and taking the Laplace
transform gives -:
Θ(s) Kt /R
= K K (rad/V)
V(s) (s ×ml +s×(b+ t b )−mgl)
2 2
R

Accounting for the “percentage full power” units of the motor command and the gyro sensor and the
encoder angle measurement units, the transfer function obtained from motor command to the pendulum
angle in degrees is expressed as -:
Θdeg (s) 9 180 Kt /R
V% (s)
= 100 ∙ ∙
π (s2 ×ml2 +s×(b+KtKb )−mgl)
(deg/p.c.f.p.).
R

By taking the physical measurements, we get m = 0.25kg, l = 0.23m, b = 0.017. Using the stalled
characteristics, analysis of the electrical side( with back emf = 0) yield -:

Kt = 0.192N.m/A, R = 11.5 ohms, Kt/R = 1.66*10-2N.m/V. Using no load characteristics, analysis of


1
the electrical side yields Kb = 𝜔 ∗ (𝑣 − 𝑅 ∗ 𝑖) = 0.297V.sec/rad

Now to set the parameters we follow a two step procedure as expressed below -:

1. Initially the pendulum is placed upside down in a stable position with the robot being static.
Manually, the pendulum is pulled to the horizontal level making it parallel to the edge of the
table and then it is released. This is done to obtain the pendulum angles corresponding to various
time instances.

Figure 1: Output for the real model


2. We then developed a Simulink model (shown below) to adjust the G(s) to fit the pendulum
output and subsequently obtaining the viscous damping coefficient (b) = 0.017. The simulation
result shown below depicts the blue curve corresponding to the Simulink model and the yellow
curve corresponding to the real system.

Figure 2: Simulink model of the pendulum system

Figure 3: Output of Simulink model


The source of difference between the observed behaviour and the modelled behaviour lies in
the delay in releasing in the pendulum from the horizontal position with angle different from
what model in Simulink uses. Also, the Simulink model does not assume the surrounding
conditions like air resistance while the actual simulation is affected by them and thus we
observe that the transients reach the steady state in less time as compared to the Simulink model
in which transients are oscillatory in nature with decreasing amplitude right till the end of
simulation duration.

3.Controller Design
The task of controller design is aimed to achieve the following specifications as listed below-:
40π
 internal stability with a phase margin of at least 180radians;

 the aforementioned regulation and disturbance rejection objectives;


 a complementary sensitivity function bandwidth of no more than 50 rad/s.
To obtain lower bound on the value of K, we sketch the root locus of the system
0.0866
G(s) =
0.013225∗𝑠2 +0.0049302∗𝑠−0.5635

Figure 4: Root Locus of G(s)

As it can be seen from the root locus, K> 6.5 for the system to be stable. In the next step we sketch the
Bode plots of G(s) with different values K(6.5, 7,8,10,11,12,50) in order to analyze the corresponding
phase margins.
Figure 5: Bode diagram of G(s) with different values of K

By choosing the value of K=8 and observing the bode plot as shown below, the phase margin of the
system is approximately equal to 1 and thus to match the desired phase margin, we choose our controller
to be in the form of a lead compensator as it pushes the phase up and by setting the parameters we will
be able to achieve the desired phase margin.

Figure 6: Bode Plot of System when K=8

The lead compensator used is in the form -:


Ts + 1
C(s) = K , α ∈ (0,1)
αTs + 1

We add 40 degrees to the existing phase margin and the new phase margin is chosen to be 50
1−sinϕ 1
degrees. Also we ωc=ωmax = 6 rad/s. We get α = 1+sinϕmax = 0.132, Hence T = ωmax = 0.459.
max √𝑎
Ts+1 3.67s+8
So our controller transfer function is C(s) = 𝐾 αTs+1 = 0.06s+1

3.67s+8 0.0866
Hence, C(s)G(s) = 0.06s+1 ∗ 0.013225∗𝑠2 +0.0049302∗𝑠−0.5635

The bode plot of the open loop transfer function is shown below:

Figure 8: Bode Plot of system after adding compensator

From the Bode plot it can be seen that the specification of phase margin <= 40 degrees is being
achieved.

4. Implementation and Testing


We applied the designed controller to our EV3 robot. On executing the Run command, the robot was
found to be moving with the pendulum remaining in an upright position. To check the robustness and
disturbance rejection characteristics, during the motion of the robot, the pendulum was manually
disturbed from its equilibrium position. It was found out that after decaying and small amplitude
oscillations, the pendulum was able to regain its equilibrium without hampering the motion of robot.
The output of the simulation is shown below -:
Figure 9: Output of system

The blue curve represents the simulated behavior while the yellow curve represents the real behavior.
By choosing the controller parameters and by observing the results, it is validated that the desired
specifications are met. The system overall matches the criteria of desired phase margin, internal stability
and complimentary sensitivity. As it can be seen that there is a visible difference between the real and
simulated behavior. This affirms that the reference tracking is not completely effective. This could
possibly be due to the time delay of the sensor or measurement disturbance.

5. Conclusion
The overall objective of this workshop, which was to design and implement a feedback controller to
balance an actuated inverted pendulum mounted on the robot has been met. This workshop helped the
team members in translating the knowledge obtained in regard to designing of feedback control systems
into practical application. Estimating the parameters by placing the robot upside down helped the team
to understand the need to be more innovative when it comes to designing. It was well established and
seen physically that the use of Lead Compensator type controller will result in an increase in phase
margin. However, the controller can further be optimized to make it more robust. For future references,
the parameters should be selected in order to achieve relatively higher phase margin that just 40 degrees.
Also due to the time constraint, we could only analyze the robot when it is in “drive” mode. To check
the robustness of our designed feedback control system and to optimize it further, it is recommended to
test the designed controller under “steer” mode as well, which would further help in analyzing which
parameters are required to be changed or if a completely different type of compensator should be used.

You might also like