PID control algorithm is used in most advanced motion control application for increased accuracy and efficiency. There are three control loops that can be controlled using a PID controller which are torque, velocity and position respectively. In vehicles which do not have the electronic controls do not have the linear motion though same power is transferred independently to the wheels. The non-linear motion of the vehicle is caused mainly by the mechanical vibrations and the difference in the surfaces in which the vehicle operates.
Hence, for minimizing deviation of vehicle from straight direction a closed loop PID controller that changes the power input the motors of the vehicle based on the change in their rotation [1]. Basically, the PID controller minimizes the gap between the measured power and the desired power to the wheels to maintain linear motion by changing the control inputs of the system. In this assignment, the vehicle is a brick escalator which moves in an incline plane from base to about 10 meters of height in full loaded condition [1].
The angle of inclination of the plane is about 45 degrees and the cart is moved through the rails installed in the inclined plane. The PID controller is installed in an Arduino board and the controller settings as specified below is written in MATLAB environment as given in the later sections [2]. The Arduino board is installed in the brick cart and the total weight of the cart is 200 kgs.
Aim:
The aim of the assignment is to move the loaded brick cart from base through the rails in the inclined plane to the top of the plane which is 10 meters above the ground. PID control system must be employed to control the movement of the brick cart.
Method:
The PID controller is designed in the Arduino board installed in the brick cart that provides signals and supply voltage which drives the motors of the engine coupled with the cart wheels. Hence, at first the hardware design of the PID controller components are is installed in the Arduino board followed by electric motor with supply installations in the cart [2]. Then the MATLAB programming is done in some capable machine and the motion of the cart will be controlled remotely via some signal transmitter installed in the machine and signal sensors installed the cart and work with the hardware system in synchronism.
The inclined track followed by the brick cart is given by following schematic diagram.
The programming of the PID controller is done in the trainsim.m MATLAB file with the given environmental conditions and the initial conditions of the brick cart.
Hence, the force balancing equation of the brick is
Fnet(t) = Fd(t) – Ff(t) – Fg(t)
Here, Fd(t) = driving force of the cart engine = Kpe(t) + KI eI(t) + KD eD(t)
Where, e(t) = error in driving force in proportional control part at time t.
eI(t) = error in driving force in integral control part at time t.
eD(t) = error in driving force in derivative control part at time t.
Kp, KI and KD are the proportional, integral and derivative constants which are needed to be determined to move the cart at the top of inclined plane satisfying the conditions given above.
Ff(t) = the dynamic friction force acting on the cart opposite of its motion = bv(t) = 1000v(t).
v(t) = velocity of the cart at time t.
Fg(t) = force due to gravity acting opposite of the carts moving direction = m∗g∗sin(θ)
MATLAB code:
function [error,F_drive] = trainsim(Kp,Ki,Kd
%% PID controller coefficients
% Kp = proportional
% Ki = integral
% Kd = derivative
% 350 50 10 (chosen PID values)
%% physical parameters
m = 200; % mass of train in kgs
b = 1000; % coefficient of dynamic friction in N-s/m
d = 10; % distance between point A and B
alpha = 45; % incline angle (degrees)
g = 9.8; % acceleration due to gravity
F_reaction= m*g*sind(alpha);
%% simulation time
T = 50; % simulation time
dt = 0.01; % simulation resolution
N = T/dt +1;% number of samples
%% simulation variables
t=0:dt:T; % time vectors
v=zeros(1,N); % velocity
a=zeros(1,N); % acceleration
x=zeros(1,N); % distance traveled
F_net=zeros(1,N);% net force
e = d*ones(1,N); % error
eI=0;
for(n=2:N)
%% Process
a(n) = F_net(n-1)/m; % train acceleration
v(n) = v(n-1) + 0.5*(a(n-1)+a(n))*dt;% train velocity
x(n) = x(n-1) + 0.5*(v(n-1)+v(n))*dt;% distance traveled
%% Feedback error
e(n) = d-x(n); % end value indicates the amount by which the cart overshoots final height
%% Control
format short
eI = eI + 0.5*(e(n)+e(n-1))*dt; % integral
eD = (e(n)-e(n-1))/dt; % derivative
F_drive = Kp*e(n) + Ki*eI + Kd*eD; % driving force in Newton
F_friction = b*v(n-1); % friction force in Newton
F_net(n) = F_drive – F_friction – F_reaction;% net force in Newton
end
error = e(end);
figure
plot(t,a,’b-‘,t,v,’k-‘,t,x,’r-‘)
xlim([0,15])
ylabel(‘dynamic position of distance,velocity and acceleration’);
xlabel(‘time (s)’);
legend(‘acceleration in m/s^2′,’velocity in m/s’,’distance in m’)
title(‘Dynamic characteristics of brick cart at time t’)
grid on
The chosen values of the coefficients KP, KD and KI are calculated by trial error method such that it satisfies all the environmental and boundary conditions of carts velocity, position, acceleration.
Result and Discussion:
The modified trainsim.m file is executed in the MATLAB command window and the results are given below.
>> [error,F_drive] = trainsim(350,35,10)
error =
-0.0011
F_drive =
1.3857e+03
Hence, it is clearly visible that the cart attains its destination at about 15 seconds after the launch from the base point. During its runtime its velocity is always under 2 m/sec, acceleration goes below 0.2 m/s^2 in less than 0.4 seconds and the driving force to the cart in the first 10 seconds is approximately 1385.7 N. The cart do not overshoot the destination height of 10 m, whereas it undershoots by approximately 1.1 mm, the amount which can be neglected.
Conclusion:
Hence, the MATLAB programming of the PID controller settings is performed appropriately as most of the environmental and brick cart’s dynamic conditions are met and it is proved that the cart can be successfully delivered in its destination with the calculated coefficients of PID controller. Although, the acceleration exceeds its limitation of 0.2 m/s^2 for the first 0.4 sec (approx.), it can be assured that the time interval is much smaller to execute significant disturbance in the dynamics that can partially unload the brick cart. The initial acceleration for sufficiently small time interval is necessary to provide the driving force that will drive the cart in its later course. Therefore, it can be concluded that PID controllers can be used to control the motion of dynamic bodies for better performance and outcomes.
References:
[1] “Drive with PID Control – MATLAB & Simulink Example – MathWorks India”, In.mathworks.com, 2018
[2] P. Pal and R. Dey, “Optimal PID Controller Design for Speed Control of a Separately Excited DC Motor: A Firefly Based Optimization Approach”, The International Journal of Soft Computing, Mathematics and Control, vol. 4, no. 4, pp.
Essay Writing Service Features
Our Experience
No matter how complex your assignment is, we can find the right professional for your specific task. Contact Essay is an essay writing company that hires only the smartest minds to help you with your projects. Our expertise allows us to provide students with high-quality academic writing, editing & proofreading services.Free Features
Free revision policy
$10Free bibliography & reference
$8Free title page
$8Free formatting
$8How Our Essay Writing Service Works
First, you will need to complete an order form. It's not difficult but, in case there is anything you find not to be clear, you may always call us so that we can guide you through it. On the order form, you will need to include some basic information concerning your order: subject, topic, number of pages, etc. We also encourage our clients to upload any relevant information or sources that will help.
Complete the order formOnce we have all the information and instructions that we need, we select the most suitable writer for your assignment. While everything seems to be clear, the writer, who has complete knowledge of the subject, may need clarification from you. It is at that point that you would receive a call or email from us.
Writer’s assignmentAs soon as the writer has finished, it will be delivered both to the website and to your email address so that you will not miss it. If your deadline is close at hand, we will place a call to you to make sure that you receive the paper on time.
Completing the order and download