stepFunction_CircuitDiagram_physicalSystem
stepFunction_CircuitDiagram_physicalSystem
paper
The image represents a PID-controlled ball levitation system designed to stabilize the vertical
position of a ball within a glass cylinder by controlling airflow. The setup includes the following
key components:
1. Ultrasonic Sensors
o Two ultrasonic sensors are used to measure the position of the ball inside the glass
cylinder. These sensors provide real-time feedback on the ball's height, which is
crucial for maintaining its levitation.
2. Arduino UNO
o The Arduino UNO microcontroller serves as the system's brain, processing inputs
from the sensors and adjusting the fan's speed to stabilize the ball at a target
height. It likely runs a PID control algorithm.
3. Potentiometers:
o Three potentiometers are shown, which may be used to manually adjust control
parameters such as Proportional (P), Integral (I), and Derivative (D) gains of the
PID system.
4. System (Fan and Glass Cylinder):
o The fan, located at the bottom of the glass cylinder, produces airflow that levitates
the ball. The Arduino controls the fan's speed by varying the voltage, ensuring
that the ball hovers at a desired position.
o The glass cylinder serves as the confined space where the ball levitates, ensuring
airflow is directed upward.
Working Principle
1. The ultrasonic sensors detect the ball's height and send position data to the Arduino.
2. The Arduino calculates the error between the desired position and the actual position of
the ball.
3. Using a PID control algorithm, the system adjusts the fan's speed to correct the ball's
position:
o Proportional (P): Corrects the position based on the immediate error.
o Integral (I): Eliminates cumulative errors over time.
o Derivative (D): Dampens oscillations by predicting the error trend.
4. The fan's speed increases or decreases to balance the ball's position at the target height.
The setup demonstrates the effectiveness of a PID controller in real-time control applications,
ensuring stability and precision while compensating for environmental interferences and
hardware limitations.
The Arduino UNO serves as the system's controller, reading
data from two ultrasonic sensors that measure the ball's
position in real time. Three potentiometers are used to
manually adjust the PID control parameters: Proportional (P),
Integral (I), and Derivative (D). An NPN transistor regulates
the speed of a DC fan using a PWM signal from the Arduino,
providing airflow to levitate the ball. A diode protects the
circuit from voltage spikes, while a 0.1µF capacitor stabilizes
the power supply. A push button is included for control, and
an LED with a 470Ω resistor indicates system status.
The circuit connects components to the Arduino UNO to implement a PID-controlled ball
levitation system. Two ultrasonic sensors detect the ball's position, with TRIG and ECHO pins
connected to Digital Pins 9(hand position), 4(ball position) and 10 (hand position), 7(ball
position), respectively, providing real-time feedback. Three potentiometers adjust the PID
parameters (P, I, D), with their wiper pins connected to A0, A1, and A2. A push button on
Digital Pin 5 allows user interaction.
The Arduino outputs a PWM signal from Digital Pin 3 to control fan speed through an NPN
transistor, with a 470Ω resistor at its base. The fan connects to a 24V power supply and GND
through the transistor, while a back diode protects against voltage spikes, and a 0.1µF capacitor
stabilizes the power supply. A status LED on Digital Pin 2 provides visual feedback via a 470Ω
resistor.
PID TUNING USING MATLAB SIMULINK VS SIMULATION OF PHYSICAL
SYSTEM
Obtaining over damped, critically damped, and under damped by varying kp, ki and kd.
Under-damped refers to a system’s response of the system that overshoots its target value before
settling, with oscillations gradually decreasing over time. An underdamped system typically occurs when
the damping ratio (ζ) is less than 1. This results in a response that takes longer to stabilize and may
oscillate several times before reaching the desired setpoint.
Setting the Proportional value kp=2, while ki=4 in Integral and the Derivative kd =1 in our system, it
arrives on the under-damped response (see fig 3.2).
In obtaining the over-damped response the Proportional, Integral and Differential, must be set
to
kp=1.2 , ki=0.6∧kd =0.4
.
kp=3 , ki=0.8∧kd=1.5
Ts=3.589
4 4 4
Ts= ; Wn= ; Wn= =1. 1145
Wn Ts 3.589
2 2
w n =1.1145 =1 .2421
1.2421
G(s)=
¿¿
1 .2421
G(s)= 2
s +2 .229 s+1 . 2421