This digital design challenge uses the Lego Mindstorms NXT programmable robotics kit. The main component in the kit is the brick-shaped computer called NXT Intelligent Brick. The cricket has a 100x60 pixel monochrome LCD and four buttons that can be used to navigate a user interface using hierarchical menus. It has a 32-bit ARM7TDMI-core Amtel AT91SAM7 S256 microcontroller with 256 KB of FLASH memory and 64 KB of RAM, plus an 8-bit Amtel AVR Atmega48 microcontroller. It also has a speaker and can play sound files at sampling rates up to 8 kHz. Power is supplied by a Li-Ion rechargeable battery and charger.
|
The digital technologies design brief is to use the robot to imitate a reverse parking and then return to the starting point within an area of 9 x 40cm x 40cm squares. The task requires the creation of a simple algorithmic solution and the accompanying programme that implements it. This design brief requires problem-solving and needs to follow a process of:
The first step in the process was to plan a route by breaking movements down into smaller steps. The image below shows the movements required broken down into 3 steps (decomposition). Each of these movements will need to undergo the process of problem solving using logic to further decompose each step to code algorithms.
- Analysing the problem
- Designing a solution
- Coding the program
- Testing the program
- Evaluating the solution
The first step in the process was to plan a route by breaking movements down into smaller steps. The image below shows the movements required broken down into 3 steps (decomposition). Each of these movements will need to undergo the process of problem solving using logic to further decompose each step to code algorithms.
The next step was to find out the distance of a physical movement for the robot. A movement was inserted and several checks were made before downloading the move. The image below shows the first move block. The checks made are annotated on the image.
The results from this move can be viewed by clicking on the TEST 1 button below. The result shows that the single movement physically moved the robot about half a square or 20cm.
Using the new knowledge that 1 rotation will move the robot about 20cm, an estimation was made about the number of rotations required for the robot to move forward for about 2 squares. The rotations were changed to 4 and this successfully moved the robot 2 squares. This sequence of instruction that is repeated until a certain condition is reached is called a loop as shown in the image on the left.
To complete the first movement, a curve was required. Another move that met the curve requirements was inserted. Problem-solving was required to determine the steering direction and curve size. Based on the prior knowledge that the upward arrow means the robot moves forward and the robot uses both the B and C motor to steer forward, it was determined that the B motor would make the robot execute a right curve. The curve size was determined by the degree of use of the B motor as well as the duration of the B motor use. When turning, the robot’s wheels travel along a curved path. The shape and angle of the turn is determined by how far each wheel travels along that path. The image below shows the algorithm so far and the result of these downloaded to the robot can be viewed by clicking on the TEST 2 button below the image.
Movement 2 required the robot to reverse for a little less than 2 block spaces. A loop that included a wait time of 3 seconds was included to make the reverse authentic. Just as a driver would check their surroundings before reversing, the robot was programmed to do the same. The reverse movement was then inserted. The downward arrow had to be selected to ensure the robot reversed, the steering in both motor B and C was selected to ensure no curve in the reverse and the loop was repeated for 3 rotations based on the earlier finding of the distance created by 1 move. The final action of the movement was set at brake. After testing, it was discovered that the reverse movement was set at the same power as the forward movement. In making the task more authentic, in reality a reverse movement is usually slower than a forward movement so the power was lowered to 50 and this successfully completed the second algorithm. The image below shows the coding of the second movement before the power was adjusted. Click on the TEST 3 button under the image to view all the algorithms after the power adjustment.
For the final movement, the robot was required to pull out of its parking space by moving forward about 2 blocks, and return back to its starting point by making another curve. Creating this algorithm required the use of knowledge from the 1st and 2nd movements regarding distance, direction and curve angle. To pull out of the parking space the robot had to be programmed to make a forward movement at a lower power, just as you would exercise caution by driving out of a parking space in the real world. A pause was then required as a check for any oncoming traffic before the curve was initiated. Once the curve had been completed, another movement to get the robot back to the starting point completed the sequence. Some experimentation with the sound palette showed that sounds could be programmed into the sequence. These can be heard after the robot performs its first curve where is says “you’re good” and again at the end of the sequences where it applauses to signify completion of the challenge. The image below demonstrates the algorithms or sequence of steps used to code the robot to complete the task. The TEST 4 button below the image shows a video of the successfully completed challenge.