MECH 371
ANALYSIS AND DESIGN OF CONTROL SYSTEMS
Section EI-X
Group 5
Experiment 6: MATLAB/SIMULINK DIGITAL PID POSITION CONTROL WITH
ARDUINO HARDWARE INTERFACE
Experiment: April 2nd, 2021
Submission: April 16th, 2
...
MECH 371
ANALYSIS AND DESIGN OF CONTROL SYSTEMS
Section EI-X
Group 5
Experiment 6: MATLAB/SIMULINK DIGITAL PID POSITION CONTROL WITH
ARDUINO HARDWARE INTERFACE
Experiment: April 2nd, 2021
Submission: April 16th, 2021
Presented by:
We certify that this submission is our original work of members of the group and meets the Faculty’s Expectations of Originality.TABLE OF CONTENTS
OBJECTIVE 2
INTRODUCTION 3
PROCEDURE 4
RESULTS & DISCUSSION 4
EXPERIMENT 1 5
EXPERIMENT 2 6
SOURCES OF ERROR 14
CONCLUSION 15
APPENDIX 16
2OBJECTIVE
The objective of this lab is to combine all elements of previous labs to obtain a digital output.
The time response of a digital DC motor position control system will be analyzed. By doing so
the function of a digital system including the digital PID, Arduino interface and a result
comparison with the analogue system will be completed.
INTRODUCTION
The overall goal of this lab is to combine elements of previous labs with a digital interface
to obtain a digital dc motor position control. Fig 6.1 from the Lab manual demonstrates the
combination of the digital and analogue systems. This system combines analogue to digital
converters and a digital position PID controller. The PID controller for this lab provides control
using one of 4 different control options being Proportional Integral (PI), Proportional Derivative
(PD), Proportional Integral Derivative (PID) or PV results. Since the output of this PID
controller is digital it must be then converted to analog signal. This will be done using the
Arduino Uno, the Analog Converter Module and the Matlab program with the Arduino support
package. The arduino, converters and amplifiers will all be combined into an interface box.
Figure 6-2 in the Lab manual demonstrates a block diagram of the System. To explain, as the
motor rotates the position is converted via the arduino Analog input this converts the 0-5V into
an analog signal of 0-1024. This signal is then sent to the computer. Matlab is also used in
conjunction to provide a command position. using the summation an error signal is obtained and
inputted to the digital PID controller. The output of the Pid controller is then in voltage form of
-5 - 5V, this output again must be converted and shifted to be read by the arduino. The signal will
be converted to be 0 - 4090. The signal can then be outputted to the analog system. The signal
must be converted to voltage to be used by the DC Motor. In order to function it is coveted from
a 0 - 5 V to -5 - 5V.
All of the components such as the Dc-Motor, PID controller, amplifiers, output pot are all the
same as in previous labs. therefore the deadband must be overcome and the system must be
linearized. The new components to this lab are the digital components. To start the Arduino is a
cheap readily available microcontroller which uses an open source software. This allows for an
endless possibility of uses. It features a USB connection, 6 analog input ports and 14 I/O ports.
3The MCP4725IC is a 12 bit digital to analog converter. It used to convert between analog and
digital. This board features non-volatile memory. Since I2c is used to control the chip, multiple
chips can be used in unison to communicate with a master chip. The interface box is used to
house the components and allow for the source voltage to be converted to a usable voltage for
the arduino. It also converts the voltage to be used for the Pre-amp.
[Show More]