We are programming this strange construction to move in a square. This is a basic task, but it is worth doing for a robot with motors placed in different directions.
- 06 Mar 2016
Turning is moving forward.
Moving forward is turning.
That is an interesting way to program a robot. It makes you used to the idea that motors might work independently and turn in different directions, but this could again make the robot move forward.
Find the complete short course at:
- #material("Turning the motors","fllcasts_194_program.ev3","pro")
Program the robot to move in a circle. Record a video or take a picture and share it with us in the comments section below.
Tasks description, submission and evaluation are available to subscribed users.
Subscribe now to acces the full capacity and get feedback.
Previously we started with the Frankenstein robot, that had it's motors positioned in opposite directions. This makes it a little strange to program the robot so today we are going to program it to move in a square.
As you might remember we started with the first block and this block makes the robot move forward. So we are going to move forward for let's say 1 rotation and then we'll turn. We'll take one more move steering block, it's connected to ports B and C and we are going to turn with 0.5 rotations. This is moving forward, this is turning, because the motors of our robot are positioned in opposite directions. Positioning the robot.
The robot moves forward and then rotates to approximately 90 degrees. So e must rotate probably a few degrees more. So it won't be 0.5, but 0.55 rotations and then we must repeat the same program 4 times. Turning and moving in a square. In order to repeat these 2 blocks 4 times I'll just use a loop.
I'll place these 2 blocks in the loop and set a counter to the loop and it'll be 4 times. And as you remember it, we must turn for 0.54 rotations, just to try. Download and run our program.
The robot moves in a square. What I've shown you is how to program this robot when the motors in the opposite direction. It's quite interesting. You can find the instructions below for building this base of the robot and you can think of ways to extend this robot, to add different attachments and use it at the FIRST LEGO League (FLL) or World Robotics Olympiad (WRO) or any other robotics competition that you attend.