Line Following Robot

5

Introduction

As part of control engineering the mechanical engineering students and the manufacturing & design engineering students undertook a project to build a small robot that could follow a solid white line around a race track.

I got the opportunity to be the group manager for this project with a team of seven of us. I had a great team of mechanical and manufacturing engineers which all had comprehensive skills in different areas of engineering.

As group manager I divided  the project into sub modules and then grouped each member into sub-teams to work on these modules I felt this way it would keep everyone working, help them to use their combined skills effectively and overall help me to manage the project as a whole. We had our first meeting in the canteen of the college and then after that communicated our meetings through a Facebook page I set up.

I collected each part of the project and wrote a technical report which contained three parts:

  • The control theory and calculations
  • The robot and an assembly manual
  • Evidence of group work

When the project was finished our lecturer Dr. Nigel Kent had us make our robot do a time lap around the track. All times from each team was recorded and the winner was taken out to lunch.

In the end our team came 3rd with a track time of 16 seconds, the best time was 13 seconds by another team, who it was believed, was able to achieve this time with a more powerful battery

This project was designed to help all students with the theory of control engineering by giving them a practical application to apply the theory.

The aim in terms of the control aspect of this project was to get the governing equations, calculate the motor constants Km (motor size) and Kb (the back emf) and then using a high speed camera capturing the rotation of the robot to plot angular velocity and position by change in position and angular velocity.

Values were then put into an open loop function in Labview to create graphs. These graphs were compared to the excel graphs to find J (inerta).

The robot consisted of PVC plastic base with two motors, two wheels, battery pack and a microcontroller module sourced from pololu.com

Governing Equations

For the governing equations it was needed to derive the transfer function for the line following robot. Robot uses differential voltage to adjust its angular position. The angle orientation Ɵ (theta) is the difference between where the robot is going and where it should be. Since the motor output is mainly governed by Torque, This was the starting point to derive the transfer function

T=J dW/dt

T=Km[Ve(t)-Vb(t)]

Where Km=Motor Constant,Ve=Differential Voltage,Vb=Back Emf
T=J dW/dt=Km[Ve(t)-Vb(t)]
J dW/dt=KmVe(t)-KmVb(t)
KmVe(t)= J dW/dt+KmVb(t)

Converting into the Laplace domain
KmVe(S)= JS W(S)+KmVb(S)
Vb=Kb W(t)
KmVe(S)= JS W(S)+KmKbW(S)
KmVe(S)=W(S)[JS+KmKb]
W(S)=KmVe(S)/(JS+KmKb)

The following became the governing equation for this project:
(W(s))/(Ve(s))=(Km/J)/(s+KmKb/J)

Km, Kb and J were still unknown so these needed to be found.

If Km/J=K,KmKb/J=a
Then (W(S))/(Ve(s))=K/(S+a)

For a unit step input
Ve(S)= 1/S
»W(S)=1/S×K/(S+a)

Using residue method to convert back to time domain:
Poles @ S=0,S= -a
W(t)=R1+R2

R1= [1/S×K/(S+a)×(S+a)×e^St ]S=-a

R1= [1/S×K×e^St ]S=-a

»R1= [-K/a×e^(-at) ]

R2= [1/S×K/(S+a)×S×e^St ]S=0
R2= [K/a×e^0 ]
»R2= K/a
W(t)= K/a-K/a×e^(-at)
W(t)= K/a [1-e^(-at) ]
K=Km/J,a=KmKb/J
=(Km/J)/(KmKb/J) [1-e^(-KmKb/J t) ]=1/Kb [1-e^(-KmKb/J t) ]

Integrating W(S) will result with O(S).

1/S is the integration function for Laplace:

(Θ(s))/(V(s))=K/(S+aS)

Desired angle:

3

For proportional control:

Θo/Θi=  G/(1+GH)=  KpK/(S^2+aS+K_p K)

Robot

Line following robot

Line following robot

A Robot was built in order to validate the software model. The program to control the robot was written in an arduino scripting environment. Reflection of ambient light in the room was reflected off the white strip on the track and captured by the robots light sensors. The control program in the motor varied the position of the robot by varying the voltage across the two motors.

Line following robot

Line following robot

Closed Loop Software Model

Shows the lab view software model

Shows the lab view software model

Shows the lab view logic for the open loop software model explaining each block

Shows the lab view logic for the open loop software model explaining each block

Shows the lab view logic for the open loop software model explaining each part

Shows the lab view logic for the open loop software model explaining each part

Both motor constants were calculated as:
Km=0.0639
Kb=1.389
J was found to be:
J=0.01

J was determined by the robot being placed under a high speed camera. Position is plotted against time on a graph in excel. Angular velocity was also plotted against time. These graphs were then compaired to the labview graphs. J was found through a process of trial and error. A correct J value would cause the graphs to match up exactly.

High speed camera graph - Angular velocity vs Time

High speed camera graph – Angular velocity vs Time

High speed camera graph - Position velocity vs Time

High speed camera graph – Position velocity vs Time

The motor constants Km, Kb and the interta J were subbed into the open loop equation to gain the following graphs. These graph confirm that the open loop function and the constants determined are in line with the position and angular velocity plotted against time.

Labview graph - Position velocity vs Time

Labview graph – Position velocity vs Time

Labview graph -  Angular velocity vs Time

Labview graph – Angular velocity vs Time

Labview graph -  Closed loop with proportional gain set to one

Labview graph – Closed loop with proportional gain set to one

Conclusion

  • Open and closed loop functions can accurately model control systems
  • These functions can be used to accurately predict and modify the behaviour of any control system by means of either Proportional, Differential or Integral control (Or a combination of the three, PID control)
  • These control systems can be used to regulate the behaviour of a variety of systems, in this case a Line following robot
Advertisements

What's your response?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: