The Process--Code and Mechanics:
Contents: Remote Control: We decided to attempt this part of the project first since we knew it was the hardest part. We knew that sending Infrared (IR) beams would be thebest way to remotely control Shrek's vehicle. So, we decided to use PicoCricket because it had excellent IR capabilites and it was easy for the audience to hold. After some discussion, we also decided on using a potentiometer because it would expand the number of movements created by remote control. The potentiometer regulates the resistance that is then reported to the PicoCricket. Five movements for the Shrek vehicle were initially decided on : forwards, backwards, right, left, and stop. We assigned a range of the resistance to each of these motions and then directed the PicoCricket to beam a certain number via IR to Shrek's PicoCricket. Here's a picture of the final code:
While our code looked excellent, we had many technical difficulties, including the not being able to send the number zero, the PicoCrickets not recieving the right numbers, the cables connecting to the PicoCricket dying, the PicoCricket for the remote control was not pointing directly at the PicoCricket for Shrek, etc. After much help, we successfully made the controller work. Later on in the process, we decided to add a touch sensor to give the Shrek vehicle a boost in speed so that it could get over the bridge easier. See The Process--Art for details about the construction of the remote controller box. Shrek's Vehicle: We first completed the code for Shrek's vehicle. The code was relatively simple: Shrek's PicoCricket would detect the numbers sent through Infrared (IR) beams incoming from the remote control and assign each number a particular motion. Next we worked on the physical parts of Shrek's vehicle. We spent many hours adjusting the gearing to get the car moving at all. Our final gearing was that the motor was attached to an eight tooth gear. This gear was connected horizontally to a fourty tooth gear, which was then connected twenty-four tooth gear below it. The twenty-four tooth gear was on the same axel as the wheel. Here's a blurry (sorry!) image of the gearing: The car would still not turn very well on our warped posterboard. Taking inspiration from Segways (two wheeled personal vehicles), we realized that making one of the motors spin forwards and the other backwards would make better turning. We implemented this design by altering the code. Here's a picture of the final code: Furthermore, after talking with the professors, we decided to forgo the front rubber wheels for a caster. The rubber wheels created too much friction for the car to turn effectively while the castor reduced the friction dramatically. After all these improvements, we realized the car was going way too fast to control effectively. We reduced the speed of the car by altering the power flowing to the wheels. However, the car needed the power when it was climbing the bridge and so we added a booster setting. See The Process--Art for details on the crafts adorning Shrek's vehicle. Puss In Boots and the Catapult: We knew that we wanted more interactive parts to our project and we decided to simulate Puss In Boots attacking Shrek, as he did in the second Shrek movie. We built two motion modules from the PicoCricket website, Stir Crazy and Catapult. The catapult took longer to build since we had to affix LEGO baskets holding small rocks at the end of the catapults. We had to change the gearing, dimensions of the catapult's shaft, and the motor several times before getting a perfect setup. We then created the PicoCricket code using edge-triggers and a light sensor to control these two motion modules. After many trials, we determined the right light threshold so that the light detector would be set off when the LED (light emitting diode) opposing the sensor was blocked. Here's a picture of the coding for the Puss In Boots and the Catapult: See The Process--Art for pictures of the final version of Puss In Boots and the Catapult covered with crafts. Dragon, Princess Fiona, and the Tape Recorder The construction of the mechanical parts of the Dragon, Princess Fiona, and the tape recorder were not that difficult. We used a HandyBoard because of the abundance of ports for sensors and motors. (We wanted to use four motors and 3 sensors for this part of the project.) We created three Chomper motion modules that would act as two wings and a mouth. We connected two chomper modules on one motor to get the wings flapping at the same time. We also built a Wobbler motion module for Princess Fiona so that she could show how happy she was at being rescued from the Dragon. Since we also wanted to show that the Dragon was happy when Donkey showed up, we attached a red LED (light emitting diode) to Fiona's motor and glued the light on the Dragon. We also created the Back-and-Forth motion module to press a tape recorder's play button so that a clip of Donkey's speech to the Dragon would play. Here's a picture of the mechanics of the Dragon and Fiona (with the LED in the foreground): In order to set off these motions, we created break beam sensors, i.e. light sensors that would detect when a bright light was no longer hitting them. We used a breadboard to plan out how we wanted our ciruit to look like and then soldered the electronics onto a circuit board. We needed three LEDs for the Dragon's break beam sensors and one for the Puss In Boots and the Catapult. Our circuit consisted of the four LED in parallel to the batteries, and each LED was in series with a resistor. We connected the light sensors that were detecting the LEDs for the Dragon to the HandyBoard. Here's some pictures of the LEDs and the sensors: See The Process-Art for the final outlay of the LEDs and the sensors. The code was much more difficult to create. We had trouble with getting the light sensors to detect the blockage of the LEDs. We ended up manually setting the light threshold when we went up for our the Exhibition. Also the Dragon would get confused multiple times and go off when the light was still hitting the sensor. We solved that problem by redownloading the program and reorienting the LEDs. Here's a picture of the final code: to dragon-seq motion-sens-1 motion-sens-2 motion-sens-3 end to motion-sens-1 waituntil [(sensor 1) < 45] waituntil [(sensor 1) > 44] flap-wings end to motion-sens-2 waituntil [(sensor 2) < 50] waituntil [(sensor 2) > 49] chomp end to motion-sens-3 waituntil [(sensor 3) < 65] waituntil [(sensor 3) > 64] tape-rec-play wait 10 flap-wings-stop chomp-stop fiona-light end to tape-rec-play d, on wait 30 d, off end to flap-wings a, on end to chomp b, on end to flap-wings-stop a, off end to chomp-stop b, off end to fiona-light c, thatway on wait 100 c, off end See The Process--Art for more pictures of the Dragon and Princess Fiona.
|