Pid Writeup
Pid Writeup
Rachel Straughn
Group Members: Jasmine Graham, Yiming Li
March 17, 2017
BIOEN 337, Section C
Materials
• Breadboard
• Wires
• Power MOSFET, such as NTD3055-094-1G (low
threshold voltage, minimum 1 A capacity), $0.34
Figure 1. Schematic of the circuit used for the heating
• 22 Ω resistor, rated for 2W, $0.99
element and for the detection of the heating element. Rth,
representing the thermistor, was connected to the 22Ω
resistor using heat sink compound and heat-shrink shown below, where the user may tune the constants
tubing. Rth is initially 10kΩ at room temperature, resulting such that the system outputs the desired response
in an equal voltage drop initially across Rth and Rfixed. The for the chosen biomedical application:
voltage across the thermistor will change as its 𝑡
𝑑𝑒(𝑡)
temperature increases, resulting in a different error value 𝑢(𝑡) = 𝑘𝑝 𝑒(𝑡) + 𝑘𝑖 ∫ 𝑒(𝜏)𝑑𝜏 + 𝑘𝑑
0 𝑑𝑡
calculated in LabView. The output from LabView is then
In this lab, the PID control was implemented using
sent back out through the DAQ to the MOSFET, where the
LabView, a visual system design platform, and then
power through the heated resistor will be controlled.
sent to the circuit as a voltage through a DAQ.
However, before the controlled voltage is
A Proportional-Integral-Derivative (PID)
passed to the circuit, it passes through a sub-VI that
Controller is a type of feedback system that
outputs a pulse with modulation (PWM). The PWM
measures an error value 𝑒(𝑡) from the difference
controls the average power through the circuit so
between a set point (usually controlled by the user)
that the power does not need to be set to the exact
and a measured output value. Depending on the size
value at all times. PWM controllers have outputs that
of this error, the controller will work to correct that
are either on at full power or off, with the duration
error using a sum of proportional, integral, and
of the on time determined by the error value. For
derivative terms relating that error.
instance, the on time will be larger when the error is
The proportional term yields an output term
10°C than when the error is just 0.2°C. These pulses
that is proportional to the error value, and can be
are usually quite fast, occurring several times per
adjusted such that 𝑃 = 𝑘𝑝 𝑒(𝑡), where 𝑘𝑝 is the
second, but the resistor acts as a low-pass filter and
proportional constant. In other words, the
it is virtually impossible to know that power (or heat)
proportional term brings the system output close to
has been applied in pulses at distances away from
the set point, but with purely proportional control,
the point of application. When the PWM is off, the
the output will never quite reach the set point. The
resistor cools passively by dissipating heat to the
integral control term integrates the error over time,
environment around it.
meaning it depends on both the magnitude and
duration of the error multiplied by the integral
𝑡
constant 𝑘𝑖 : 𝐼 = 𝑘𝑖 ∫0 𝑒(𝜏)𝑑𝜏. The integral control
component eliminates the steady-state error that
occurs with purely proportional control, but because
it sums all of the past errors, is prone to overshoot
Figure 2. General block diagram of the feedback control
the set point and oscillate before eventually settling
system utilized in this lab. The Sum, Controller, and Duty
on the set point. The derivative term calculates the
Cycle steps were implemented using LabView. The
rate of change of the error and multiplies it by the ‘System’ block represents the system’s intrinsic response,
𝑑𝑒(𝑡)
derivative constant 𝑘𝑑 : 𝐷 = 𝑘𝑑 𝑑𝑡
. The derivate which can be understood through its transfer function.
control works to predict system behavior and
dampen overshoot and oscillations caused by the Before the group designed a brand new
integral term, thus resulting in the system reaching LabView VI, this lab involved using and
steady-state faster than without derivative control. understanding a series of VIs supplied by the
The resultant governing equation of PID control is teaching staff. The fist, titled ‘PWM application.vi,’
was used for obtaining files indicating the voltage constant amplitude around the set point. The derivative
output with a control ramp voltage input. This file control ensures that the amplitude of these oscillations
contained a sub-VI implemented the pulse with does not increase.