Contact FutureLearn for Support
Skip main navigation
We use cookies to give you a better experience, if that’s ok you can close this message and carry on browsing. For more info read our cookies policy.
We use cookies to give you a better experience. Carry on browsing if you're happy with this, or read our cookies policy for more information.

Skip to 0 minutes and 2 secondsLet's look at the exercises in the third week. And we'll start with the robot keeping away from a particular object. So, here is my solution. So when the objects not seen, both motors are going forward. I've got the reverse left motor option on there, so the object will approach it. When the object just see something on the left, it turns towards it. But if the object is much closer on the left, the robot effectively runs away. Put the object speed to two and start. And we see, yes, robot is tracking it quite well.

Skip to 0 minutes and 42 secondsKey point here is that the beams are staying red, which suggests that the robot is a fixed distance away from the object, so it is tracking it. But if I then put the speed up to ten, it's no good. Even if I put the robot at the start again. Nope. It gets eaten.

Skip to 1 minute and 4 secondsSo to deal with a faster object, I had to change the speed-- effectively, I've just upped them from what we had before. So that we now have a speed of 32 for going forward, and instead of being minus six to go back, it's minus 32. And as we see the robot is managing to cope.

Skip to 1 minute and 24 secondsSo that was the first exercise. Okay, let's move on to the command example. And I won't show you the experimentation, just the results. So for this size of the web page, and if you rescale the web page, you might find you need to put slightly different numbers in. To get around the rectangular path, this is what I do.

Skip to 1 minute and 48 secondsSo it's going toward, turned right, turns right. See, we've got back to where we were.

Skip to 2 minutes and 0 secondsFor the race track, these are the commands I needed to do. So we can see forward for 146 at 15, and turn right, forward, right, forward. And we've got there. That's worked okay. But, if we put the hill track in, put the robot back, and do it, we shall find that it doesn't work. It crashed into the wall. So, to cope with the uphill bit here, I've had to go forward for a bit longer and changed some of the other numbers. And as we can see now, it's working okay, going uphill, turns right, goes downhill a bit, so it goes a bit faster, and it has succeeded.

Skip to 2 minutes and 51 secondsBut it's a bit tedious having to put in two different sets of speeds, whether you're on the flat or on the hill. If we've got control, can we do better? So, if I now put speed control on. Put some slightly different numbers in. We can see the robot is going along quite happily, turning, going uphill all right, but still going far enough up. And it gets there. And then if I have the flat track, reset the robot and obey. We shall see that the robot, with the same commands, works with the hills and with a flat, demonstrating the benefit of feedback control.

Skip to 3 minutes and 39 secondsFinally for those who had a little play with doing it by distance rather than the iterations. These are the commands who are going around the track. So forward for 460 units, turn right 90 degrees, forward, right not quite 90 degrees, because things aren't perfect. Hey, presto, we've got there. Did you do as well?

What you should expect to see in the simulations

We hope that you enjoyed playing around with this week’s simulations. If you want to find out how Richard got on when he used them, or you weren’t able to do the simulations, then have a look at this video.

Share this video:

This video is from the free online course:

Begin Robotics

University of Reading