Introduction
1. Basic Operation
ENG5009 Advanced Control 5 Laboratory 1 Worksheet
For the lab assignment you will be using a model of a 4 wheeled robot. This model will be available on the ENG5009 Moodle page under the Lab and Assignment section.
The model is called: full_mdl_motors.m which is described in Model_Description_Rev1
In addition, there is a simple simulation file, run_model.m, that can be used to run the model. This
file can be used as the starting point for your assignment.
Further files that may be of interest are:
drawrobot.m: this file draws a representation of the robot on to a given figure
WallGeneration1.m: supports the development of obstacles
ObsSensor3.m: A function that provides a forward looking sensor that returns the nearest objects on the right and left handside of the robot.
The first stage is to learn how to use the model and the simulation file.
Straight Line motion Set Vl and Vr to 6 Run the simulation
Insert a plot of the x distance travelled answer grid
Turn counterclockwise Set Vl to -6 and Vr to 6 Run the simulation
Insert a plot of the psi angle answer grid
Turn Clockwise
Set Vl 6 and Vr to -6 Run the simulation
Insert a plot of the psi angle answer grid
Complete a short forward, turn left, forward, turn right manoeuvre
To achieve this, you need to create a simple time based controller that alters the Vl and Vr values as and when required. For example, you could use an if statement or a switch statement to alter the variables at particular time steps:
if(outer_loop > (1/dT)) Vl = -6;
Vr = 6;
end
Which would result in Vl becoming -6 and Vr becoming 6 1s into the simulation. Insert a plot of the x/y position in the answer grid
2. Running the Model with a Fuzzy Controller
Develop a fuzzy controller that allows the robot to avoid obstacles, based on the tutorial example.
To include the obstacle detection:
sensorout = ObsSensor1(xi(19),xi(20),[0.2 0],xi(24),Obs_Matrix); And remember to draw your walls:
plot(wall(:,1),wall(:,2),’k-‘); plot(wall2(:,1),wall2(:,2),’k-‘);
Provide a plot of the path of the system using the tutorial example.
Comment on the behaviour of the system.
Comment on any changes you would make to improve the performance of the system. Provide a plot of the path of the system with the changes you have implemented
3. Running the Model with a Neural Controller
In the lecture we discussed a very simple Neural network controller that should be able to drive the robot forward while avoiding obstacles.
The first stage is to create a neural network controller based on the figure below and using the values calculated in the tutorial. Once this is done you are able to apply it the model.
Figure: Simple Neural Network to create
T1
0.3
T2
0.3
w1
0.05
w2
0.35
w3
0.35
w4
0.05
A hint for this would be: %———————————————-% % Neural Control
[Vl, Vr] = NeuralControl1(LeftS, RightS, NeuralPara); %———————————————-%
Provide a plot of the path of the system using the tutorial example. Briefly comment on the behaviour of the system.
Using the weights obtained in the lecture, test the Neural Network within an obstacle and compare the performance to the expected.
Note: For test 3 and 4 an assumption is made that you can go backwards.
Test
1
2
3
4
T1
0.3
0.3
0.15
5
T2
0.3
0.3
0.15
5
w1
0.05
0.15
-0.2
1.39
w2
0.35
0.6
0.6
3.83
w3
0.35
0.6
0.5
4.79
w4
0.05
0.15
-0.2
1.59
Briefly Comment on any changes you would make to improve the performance of the system.