You are on page 1of 24

Northeastern University

College of Engineering
Department of Mechanical and Industrial Engineering

ME 4555 Systems Analysis & Control


Final Project: Lifting

Submitted by: Group #8


Chris Balino
Sarah Deslandes
Chris Hepburn
Kristina Legget
Ceres Rafiq

Date Submitted:December 17, 2015

1
Table of Contents
1. Introduction....................................................................................................... 4
2. Theoretical and Mathematical Modeling......................................................4
2.1. Initial Derivation:........................................................................................... 4
2.2. Open-Loop Transfer Function.........................................................................5
2.3. MATLAB/Simulink........................................................................................... 5
2.4. Analysis in MAPLE.......................................................................................... 6
2.5. Root Locus..................................................................................................... 8
2.6. Frequency Response analysis........................................................................9
3. Prototype........................................................................................................... 9
3.1. Prototype Design........................................................................................... 9
3.2. Arduino Setup.............................................................................................. 12
4. Conclusion........................................................................................................ 15
5. Acknowledgements........................................................................................ 15
6. Appendix A-MATLAB Constants....................................................................16
8. Appendix B-MAPLE Code...............................................................................17
9. Appendix C-DC Motor Spec Sheet................................................................21
10. Appendix D-Group Collaboration..............................................................22

2
List of Figures
Figure 1: Initial derivation of the open-loop transfer function.......................4
Figure 2: The transfer function for the system.................................................5
Figure 3: Simulink block diagram to evaluate transfer function
performance............................................................................................................ 5
Figure 4: Actuator force output from the PID controller..................................6
Figure 5: System response to an impulse input with a PID controller..........6
Figure 6: Simplified open loop transfer function of the mathematical model
................................................................................................................................... 7
Figure 7: Value of Constants in MAPLE...............................................................7
Figure 8: Closed loop transfer function with PID controller............................8
Figure 9: Root locus plot of the transfer function.............................................8
Figure 10: Bode diagram of the transfer function............................................9
Figure 11: Calibration curve of IR Sensor.........................................................10
Figure 12: Cardboard balancing beam with card acting as weight..............11
Figure 13: Fan position and paper bushing method.......................................11
Figure 14: IR Sensor positioned within the workable range.........................12
Figure 15: Final Simulink model.........................................................................12
Figure 16: IR Senor distance calibration Simulink model..............................13
Figure 17: DC Motor calibration model.............................................................13
Figure 18: Scope outputs of implemented Simulink model...........................14
Figure 19: Final PID values................................................................................. 15

3
1.Introduction
The project that was assigned to our group was to develop a program that uses a
combination of MATLAB and Arduino to control the motion of a beam on a fulcrum.
The Arduino controls a propeller that provides an opposing force on the beam in
order to keep it horizontal. An IR sensor measures the displacement of one end of
the beam and feeds that information back into the Arduino, which then corrects for
it by changing the speed of the propeller.

2.Theoretical and Mathematical Modeling


2.1. Initial Derivation:

The first step was to mathematically model the system. When starting the
derivation of the mathematical model, the team assumed that the IR sensor and fan
were mounted under the beam that needed to be stabilized. We began by using
equations provided during lectures to find functions between an input voltage and
the output angular velocity of the DC motor. Inquiries made to Professor Sipahi
provided the understanding that since the force of the fan related to its angular
velocity was a difficult system to mathematically model, it would be simpler to
reduce the interaction to a gain relationship of some arbitrary value. The
relationship between the angular velocity of the motor and the force of the propeller
was considered to be linear and would be described by the aforementioned arbitrary
gain value. Finally, given a perfectly balanced beam, a relationship could be made
between the angle of the beam and the force of the propeller on the beam. The
derivation of the transfer functions is illustrated in Figure 1.

4
1. DC Motor Voltage to Angular
Velocity
di
V V bemf =Ri+ L
dt
V V bemf =RI + sLI

T =k ti T =k tI

J =T
b sJ=T b

2. Propeller Angular Velocity to


Force

F (s )
=k
( s)

3. Beam Force to Angular


Displacement

J b =F LmgL

s 2 J b =F LmgL
Figure 1: Initial derivation of the open-loop transfer function

Some assumptions that were made regarding the development of the transfer
functions are that the motor inductance was equal to zero, that the angular
displacement of the beam was small and that the relationship between the angular
velocity of the motor and the force of the motor was linear and constant. Under
these assumption, the three transfer function groups could then be combined to
create a full open-loop TF for the physical system, as described in the next section.

2.2. Open-Loop Transfer Function

From the equations for the system, we were able to develop a transfer function
between the voltage of the DC motor to the displacement of the beam. The transfer
function is as follows:

5
Figure 2: The transfer function for the system

Where L is the length from the fulcrum to the end of the beam, Kprop is the
constant that describes the dynamics of the propeller, JB is the moment of inertia of
the beam, m is the mass applied to the beam to create a disturbance, and g is the
acceleration due to gravity. Jd, R, Kt, and K1 are all properties of the DC motor taken
from the spec sheet for the Faulhaber 3890-018 CR DC micromotor.

2.3. MATLAB/Simulink
Once a transfer function was developed, a Simulink program was created to check
that the response of the systems would be as expected. A PID controller was used
as a control loop feedback mechanism to adjust the input based on the error
between the input and the reference set point. The controller gains for this iteration
were tuned to the system to find the optimum values. Figure 3 shows the Simulink
block diagram that was created to evaluate the transfer function:

Figure 3: Simulink block diagram to evaluate transfer function


performance

In this system, an impulse is added to disrupt the system. The PID controller has
gains of 0.00999, 0.006321 and 0.002391 for proportional, integral and derivative,
respectively, and a filter coefficient, N, of 484.7. Figure 4 shows the actuator force
output from the PID controller and Figure 5 shows the output response of the
transfer function.

6
Figure 4: Actuator force output from the PID controller

Figure 5: System response to an impulse input with a PID controller

As expected, the system is disrupted due to the impulse, as seen by the fluctuation
in the graph, but the PID controller immediately corrects for the disturbance and
brings the system back to equilibrium. This shows that with these particular gains,
the system is stable. The constants used to calculate the transfer function can be
found in Appendix A.

2.4. Analysis in MAPLE

7
Maple was an essential tool in confirming if variations of the beam, propeller, DC
motor, and IR Sensor were stable. An initial design iteration involved the DC motor
and propeller being below the balancing beam. Using the assumptions outlined in
Sections 2.1 and 2.2, Figure 6 demonstrates how the team arrived to the simplified
transfer function for this set up.

Figure 6: Simplified open loop transfer function of the mathematical


model

The values for the variables are as follows in Figure 7:

Figure 7: Value of Constants in MAPLE

The team then used a PID controller to see how the system would act. Figure 8
shows the new closed loop system Transfer Function.

8
Figure 8: Closed loop transfer function with PID controller

The characteristic equation of the new closed loop system was then solved for the
Ki, with the Kp and KD values given to the team from the Simulink tuning action in
the PID controller. This new Ki value was then used in the Simulink model and a root
locus plot of the system was created using MatLAB.

2.5. Root Locus

Figure 9: Root locus plot of the transfer function

From the root locus plot, shown in Figure 9, the poles were determined to be at
-4.78 on the real axis and at -144 j72.5, with the dominant pole being at -4.78.
There is one zero on the real axis at -4.18, which means there are two asymptotes.
The root locus is located between -4.18 and -4.78 on the real axis. This plot also

9
confirms the stability of the system since all of the poles are left of the imaginary
axis.

2.6. Frequency Response analysis

Figure 10: Bode diagram of the transfer function

From the open loop transfer function of the mathematical model, a bode plot was
derived, shown in Figure 10. From this bode plot, it is clear that the cutoff frequency
of the system is around 3102 rad/s. From this cutoff frequency, it is clear that the
phase angle is -225. If the open loop transfer function was stable without the PID
controller, this phase angle would be above -180. This bode plot proves that a PID
controller is required to stabilize the system.

3.Prototype
3.1. Prototype Design

The initial prototype was constructed out of wood planks with a steel bar acting as
the fulcrum. Testing showed that the weight of the wood balance beam was too
great for the fan to overcome. The rotational inertia of the beam was large enough
that any small amount of imbalance on the beam sent it crashing into the fan with
no chance of it being lifted by the force of the fan. It was also noted that some of

10
the friction between the steel shaft and the wood shaft supports was probably
contributing to the lifting resistance.

The second prototype design was our attempt to use a balance beam we knew
would be lift-able by the fan. A piece of cardboard was cut into a rectangular shape
and laid on the fulcrum beam to check if the fan could lift it. To avoid the friction of
the steel on wood contact from the last prototype, two slits were cut into the
cardboard around the center of mass where the steel shaft would sit. A thin sheet of
paper was folded over on itself to make it more rigid and then fed through the two
slits around the steel shaft creating a facsimile of a pillow block bearing. With the
system assembled we were able to confirm that the fan was able to lift the
cardboard balance beam though we found creating an imbalance on the beam still
remained a huge issue. Light items like nuts and washers created huge imbalances
even when placed close to the shaft, causing the beam to once again crash into the
fan. Finally, we were able to create an acceptable amount of imbalance on the beam
by taping a thin paper metro card to the beam close to the balance point.
Implausibly, something as light as a card sized piece of paper was enough to tip the
beam while still allowing the fan to lift the beam and move it through the full range
of positions necessary for properly balancing. Finally the positioning of the IR sensor
needed to be decided based on the range of the sensor where its readings were
closest to linear. We located the data sheet for the IR sensor online and were
provided a chart of Analog Voltage Out vs Distance to Object. Figure 11 showed a
strong linear response between 0cm and 5cm. This meant that the IR sensor needed
to be placed relatively close to the beam for it to always read linearly and not
interfere with the balancing.

Figure 11: Calibration curve of IR Sensor

Figure 12, Figure 13, and Figure 14 show the entire prototype for this project and
accurately depict how close the IR Senor needed to be to the cardboard beam to
receive an accurate reading.

11
Figure 12: Cardboard balancing beam with card acting as weight

Figure 13: Fan position and paper bushing method

12
Figure 14: IR Sensor positioned within the workable range

3.2. Arduino Setup

Figure 15: Final Simulink model

Figure 15 is a screenshot of the final Simulink model for this project. As shown in the
figure, a PID controller was implemented in order to control the position of the
beam. The Arduino Analog Read is the input from the IR sensor, and this value was
converted from bits to voltage (5V/1024bits), then subtracted from the reference
voltage value of 3.08V, corresponding to the beams horizontal position.

13
Figure 16: IR Senor distance calibration Simulink model

This reference voltage was calibrated using the IR Distance Calibration Simulink
model shown in Figure 16. This program was set to read the value from the IR
sensor, convert this from bits to voltage (5V/1024bits), and write this to the MATLAB
workspace as a variable over a time of about 30 seconds. This was done in order to
get a more accurate readings, since the sensor was not very precise and would yield
values between 3.02-3.16V. The 3.08V reference value was found by using the
mean() function on the simout variable.

14
Figure 17: DC Motor calibration model

The error was then sent to the PID controller, and a corresponding action was
produced. The action was added to a constant motor speed of -193.8 bits, since the
DC motor only accepts values of magnitudes ranging from 0 to 255. The initial
motor speed corresponds to the necessary speed in order to maintain the beam at a
horizontal position with no disturbance. This was calibrated using the DC Motor
Calibration model shown in Figure 17. The slider shown was varied until the upward
force from the DC motor/propeller was enough to keep the beam horizontal. Finally,
the motor speed value was passed through a saturation block to prevent any
damage to the DC motor, since this essentially sets the upper and lower limits of
the value going into the DC motor block. The direction of the DC motor was set
using a -1 constant.

15
Figure 18: Scope outputs of implemented Simulink model

The model also had a few scopes at various locations, including at the sensor
reading, the corresponding error, and finally the action produced by the PID. These
can be shown in Figure 18. In this figure, the upper left graph is of the IR Sensor
output, the bottom left is the error in the height if the beam from horizontal, and the
graph of the right shows the motor output based on the error in height. The PID
gains were fine-tuned using via trial and error methodology, and a screenshot of
this is shown in Figure 19.

Figure 19: Final PID values

4.Conclusion
The learning point of this project was to see that mathematical simulations, though
very helpful when trying to achieve a basic understanding on how the system will
react to an input, is not identical to the reaction of a physical system. As we could
see in Figure 5, the output of the mathematical system, in theory, the motion from a

16
balanced beam to an unbalanced beam back to a balanced beam should be smooth
and with the presence of no overshoot. However, Figure 18, the output of the
physical model, tells a completely different story. It is clear that the process back to
a balanced beam is not smooth at all and requires the IR Senor and propeller to
work together to see if the propeller applied too much force, causing an overshoot.
One change that the group would make to our physical model to make the output
closer to that of the mathematical model, would be to change the IR sensor for a
more sensitive one. Based on the calibration curve of the IR sensor, Figure 11, the
team had to work within a very small distance between the IR sensor and the beam
for there to be a linear correlation between the IR sensors reading and voltage input
of the DC motor. The team was not able to keep the beam in that distance range
during the experiment, which resulted in the propeller not applying the correct
amount of force to the beam all of the time to keep it balanced.

5.Acknowledgements
Our group would like to acknowledge funding and support from the Department of
Mechanical and Industrial Engineering, and also MathWorks for providing funding to
develop the project.

17
6.Appendix A-MATLAB Constants
Kt=0.0318;

L=0.305;

K1=0.0318;

Jd=1.65*10^-5;

JB=(0.0635*.305^2)/12;

g=9.81;

Kprop=2;

R=0.21;

b=0.1;

m=5.67*10^-3;

18
8.Appendix B-MAPLE Code

19
20
21
22
9.Appendix C-DC Motor Spec Sheet

23
10. Appendix D-Group Collaboration
Group Member Responsibility
Chris Balino Simulink coding for Arduino
Sarah Deslandes Finding open loop transfer function,
mathematical modeling in Simulink
Chris Hepburn Building prototype, Simulink coding in
Arduino
Kristina Legget Finding open loop transfer function,
mathematical modeling in Simulink
Ceres Rafiq Finding open loop transfer function,
mathematical modeling in MAPLE

24

You might also like