1 ASME - Robots for Relief Student Design Competition _____________________ Final Project Report Presented to: Sebastian Y. Bawab, Ph.D. Colin Britcher, Ph.D. Professor of Mechanical and Aerospace Engineering Frank Batten College of Engineering and Technology Old Dominion University ______________________ In Fulfillment of the Requirements for: MAE 435 - Project Management and Design II _______________________ By Mechanical Engineering Students: Ryan Kenny Rosalyn Lopez Mark Sodusta Michael McDermott Aaron Fuentes Austin Priest Advised By: Thomas Alberts, Ph.D. 4/21/2015 2 Table of Contents 1) ABSTRACT.................................................................................................................................................. 5 2) INTRODUCTION ......................................................................................................................................... 6 3) CHASSIS ..................................................................................................................................................... 8 3.1 INTRODUCTION ................................................................................................................................... 8 3.2 PRELIMINARY DESIGNS ....................................................................................................................... 8 3.3 METHODS .......................................................................................................................................... 11 3.4 CONCLUSION ..................................................................................................................................... 14 4) TRACKS .................................................................................................................................................... 16 4.1 INTRODUCTION ................................................................................................................................. 16 4.2 METHODS .......................................................................................................................................... 17 4.3 CHALLENGES AND SOLUTIONS .......................................................................................................... 21 5) TRACK ARTICULATION SYSTEM ............................................................................................................... 21 5.1 INTRUDUCTION ................................................................................................................................. 21 5.2 METHODS .......................................................................................................................................... 21 5.3 CHALLENGES AND SOLUTIONS .......................................................................................................... 22 6) PAYLOADS MECHANISM ......................................................................................................................... 23 6.1 INTRODUCTION ................................................................................................................................. 23 6.2 PRELIMINARY DESIGNS ..................................................................................................................... 23 6.3 CHALLENGES AND SOLUTIONS .......................................................................................................... 26 7) ELECTRONICS AND PROGRAMMING ...................................................................................................... 28 7.1 POWER DISTRIBUTION ...................................................................................................................... 28 7.1.1 INTRODUCTION .......................................................................................................................... 28 7.1.2 METHODS ................................................................................................................................... 28 7.1.3 CHALLENGES AND SOLUTIONS .................................................................................................. 29 7.2 COMMUNICATION ............................................................................................................................ 29 7.2.1 INTRODUCTION .......................................................................................................................... 29 7.2.2 METHODS ................................................................................................................................... 29 7.2.3 CHALLENGES AND SOLUTIONS .................................................................................................. 31 3 8) RESULTS .................................................................................................................................................. 34 8.1 COMPETITION RESULTS .................................................................................................................... 34 8.2 DISCUSSION OF RESULTS................................................................................................................... 34 9) DISCUSSION ............................................................................................................................................ 36 REFERENCES ................................................................................................................................................ 39 APPENDICES ................................................................................................................................................ 42 APPENDIX 1 - GANTT CHART ................................................................................................................... 42 APPENDIX 2 - BUDGET............................................................................................................................. 43 APPENDIX 3 - ASME ROBOTS FOR RELIEF PROBLEM STATEMENT .......................................................... 44 APPENDIX 4 - ARDUINO CODE ................................................................................................................ 47 4 List of Figures Figure 2-1 - Course Schematic ...................................................................................................................... 6 Figure 3-1 - Planing Monohull Concept ........................................................................................................ 9 Figure 3-2 - Pontoon Hull Concept ............................................................................................................... 9 Figure 3-3 - Rectangular Welded Chassis ................................................................................................... 10 Figure 3-4 - Expanded Welded Chassis ....................................................................................................... 12 Figure 3-5 - Tapered Welded Chassis ......................................................................................................... 13 Figure 3-6 - Gear Motor Mounting Plate .................................................................................................... 13 Figure 3-7 - Axle Bushing ............................................................................................................................ 14 Figure 3-8 - Final Chassis Concept with Internal Components ................................................................... 15 Figure 4-1 - Track skeleton with Xbee Wireless Motor Relay ..................................................................... 18 Figure 4-2 - Expanded Design of Final Track Drive System ......................................................................... 19 Figure 4-3 - Detail Design of Track Drive System ........................................................................................ 20 Figure 5-1 - NEMA Stepper Motor Articulation System ............................................................................. 22 Figure 5-2 - Gear Motor Track Articulation System .................................................................................... 23 Figure 6-1 - Final Payload Delivery System ................................................................................................. 26 Figure 7-1 - Wiring Schematic ..................................................................................................................... 31 Figure 8-1 – Final Course……………………………………………………………………………………………………………………….35 Table 8-1 - 2015 ASME SDC Results ............................................................................................................ 34 5 1. ABSTRACT The goal of this project is to design and build a small scale prototype capable of transporting granular humanitarian aid to disaster stricken areas inaccessible by conventional means. The project’s success will be measured by how well the team competes in the American Society of Mechanical Engineers (ASME) Student Professional Development Conference. The design features an articulated track arm system in which four independent motors give the vehicle its off-road driving capabilities. A gravity fed hopper system delivers the humanitarian aid and an Arduino-based control system actuates all electronic components. Each track arm has the ability to rotate a full 360 degrees to assist with climbing through rough and obstructed terrain. The payload storage consists of a funnel with a sliding hatch operated by a DC motor. A Playstation®3 controller operates the robot via Bluetooth and will manipulate the entire drivetrain and all motors used for the payload dispensing mechanism. A SolidWorks model and 3D-printed prototype of the chassis will allow us to ensure the integrity of the design. 6 2. INTRODUCTION When a natural disaster such as a hurricane or a tornado passes through an area, it leaves destruction in its wake. Unfortunately, some residents of affected areas will not have a chance to evacuate and will be left in hard to reach places where humanitarian relief cannot be delivered by rescuers due to the uneven terrain and tight spaces caused by debris. An example of this situation is the Philippines after Typhoon Haiyan in November 2013. In order to help these individuals, robots can be used to transport aid materials while rescuers make the area safe to reach victims. The American Society of Mechanical Engineers (ASME) Robots for Relief Student Design Competition’s (SDC) purpose is to design and build a scaled-down prototype robot that is capable of navigating variable terrains to transport supplies to disaster victims. The ASME Robots for Relief team must construct a robot capable of transporting a max granular material payload through a course that contains a series of obstacles including water, sand, and steps of varying elevation (Figure 2-1). Figure 2-1 - Course Schematic 7 The team must design their robot so that it minimizes energy consumption and runs the course as fast as possible with a max payload to get a high score in the SDC. The scoring of the competition is based on the amount of payload delivered, the time taken to complete the course, and the energy capacity of the robot. The robot must fit inside the 25 cm × 25 cm × 30 cm size constraints in order to simulate hard to reach places. This means that a robot must be designed to be small and fast while maintaining a maximum payload capacity and being energy efficient. In order for the team to succeed in this competition, previous relief robot designs and all-terrain vehicle designs will be looked at to base and even improve upon their own design in terms of robot material selection [1], traversing terrain [2], and energy capacity[3]. Various robot designs were looked at to fit the SDC’s requirements. The final design that was determined to be most successful at crossing the obstacle course was a chassis with four articulating track arms and a watertight payload delivery system. The implementation of elongated track-arms allowed the robot’s electronics to be protected from water hazards. Parts at risk of being wet were modified to be water-resistant to not jeopardize the robot’s functions. The track design gave the operator more control over the vehicle over rough terrain and also combined the mechanics required to climb the stairs and cross the water. 8 3. CHASSIS 3.1 INTRODUCTION When designing the main chassis for the robot, several different factors needed to be considered. The main design factor for determining the overall shape of the chassis was whether or not the robot would be floating or driving through the water but the overall size constraints of the chassis limited us to a design no larger than the overall dimensions of 25đť‘šđť‘š × 25đť‘šđť‘š × 30đť‘šđť‘š. Several initial designs were created in SolidWorks (Dassault Systemes Corp, Waltham, MA) to evaluate both methods of completing the water obstacle. Several aspects needed to be taken into consideration when designing the robot’s main chassis; the need to carry a large payload, being easily modifiable to account for unforeseeable errors, and having a material that is strong enough to be tapped into and mounted on were important factors to account for. 3.2 PRELIMINARY DESIGNS A planing monohull (Figure 3-1) at low speeds affects the pitch and heave [13] of the vessel. Steering is directly related to planning which depends on how deep the craft is sitting in the water and how drastic the bow to stern rotational motion is. The more severe the pitch, and more intense the heave, the more difficult it became to manipulate or steer the vehicle in the water. A shallow mono-hull design is not stable enough when the vessel is designed with a high center of gravity. For an application that carried a payload on its deck, a shallow hull could not be used due to the high center of gravity. 9 Figure 3-1 - Planed Monohull The use of a double-hull or pontoon hull (Figure 3-2) is an alternative to the monohull design type. The advantage of using a pontoon type hull was due to the fact that there are two individual hulls. The vessel could be kept in a straight line when navigated through the water as compared to a mono-hull design which is harder to keep straight. The distance between the pontoons was directly proportional to the stability of the vessel and the depth at which the vessel sits in the water [5]. The problem with a pontoon hull was that it took up more room on the vehicle than one pontoon. The pontoons had to be completely sealed with an epoxy [6] in order for them to achieve the buoyancy required for the vehicle. The limited space on a pontoon type hull meant less room for the motors or payload delivery system that needed to be integrated into the chassis. Although two pontoons are much more stable than a mono-hull design, the increase in drag adversely affects the speed of the vessel. Figure 3-2 - Pontoon Hull 10 The hulls would have been made out of thin gauge sheet metal aluminum 6061 alloy. The precipitation hardened alloy would have given us the strength and density needed for flotation and stability. Several downsides to these designs included the need for a propulsion system and rudder, limited space for mounting the hardware, creating a low center of gravity to prevent capsizing, and the need for necessary structural integrity in order to mount all of the components to it. The alternative to floating the vessel across the obstacle focused on using articulating tracks which lifted the chassis of the vehicle above the water line to protect it from the elements. A rectangular shaped chassis with 5mm×5mm (Figure 3-3) square tubing was created as a platform for the vehicle's components. With four articulating tracks on each corner of the chassis, the vehicle had the ability to travel through the water. Elongated tracks eliminated the need for waterproofing all electronic components. A track design gave the operator more control over the vehicle and it gave the vehicle the capability to climb out of the water quickly. Although the hull design allowed for the vehicle to float through infinitely deep water, it did not account for traversing in-water obstacles. Figure 3-3 - Initial Welded Chassis 11 After weighing the pros and cons of each design, the chassis was considered to be the most cost effective, structurally sound, easily modifiable design. It was universally understood that the chassis would continually evolve as the designs for the different components were created and added, which became a major factor in the selection process. Other factors that led to this decision were the fact that it would eliminate the need for a propulsion system or rotor to travel and steer through the water. 3.3 METHODS After selecting the chassis type design for the frame, the next consideration that needed to be made was the type of tubing to be used. Several different options were proposed, such as 3D printed ABS plastic, 5mm and 7mm solid 6061 Aluminum Alloy bar stock, and 6061 Aluminum Alloy hollow tubing. After 3D printing an ABS plastic prototype chassis, it was determined that it could not hold up to the stresses that would be applied to the robot nor would the ABS plastic a good medium for mounting hardware on, or tapping in to. The 3D printed ABS easily split along the printed layers when it was drilled through and stripped the threads easily. It also did not provide the modulus of rigidity (340000 psi) [7] needed support the rest of the robot. The selection was narrowed down to using 6061 Aluminum Alloy which provided a sufficient modulus of rigidity (3.9 × 106 đť‘ťđť‘ đť‘–) [7] for the robot. There were two different types of aluminum stock considered for the design; solid 5mm × 5mm bar stock and 7mm × 7mm aluminum tubing with 1mm wall thickness. The aluminum tubing would allow significant weight 12 reduction but also reduced the stiffness of the robot. Another downfall to using hollow tubing was the inability to drill and tap into it and apply enough holding torque on each screw. The solid 5mm×5mm aluminum bar stock was determined to be the most effective material for the chassis. It has the highest modulus of rigidity and yield strength of 35,000 psi [7], the largest holding torque for bolts and screws, is the easiest to weld and most readily available material. The initial chassis was modeled using a box type design (Figure 3-4) and a relatively short height. Figure 3-4 - Expanded Rectangular Welded Chassis 13 As the design evolved, the chassis needed to be modified to support a larger payload funnel and wider track arms. This was done by increasing the height from 75mm to 92.4mm with an angled upright support (Figure 3-5). The angled support allowed for an increase in width of the track arms while keeping within the size constraints. Figure 3-5 - Tapered Welded Chassis Once the initial chassis design was finalized, motor mounts were added to caddy-corner sides of the frame (Figure 3-5) and holes were added in strategic locations to mount the motors mount (Figure 3-6) , axle bushings (Figure 3-7) and Plexiglas top. Figure 3-6 - Gear Motor Mounting Plate 14 Figure 3-7 - Axle Bushing 3.4 CONCLUSION When ordering materials to fabricate the chassis, it was discovered that 7mm×7mm bar stock was unavailable and 8mm×8mm was much cheaper and more readily available. The design was then changed to accommodate the more accessible bar stock. The downside of using a thicker bar stock was the increase in weight that the 8mm × 8mm introduced on the chassis. The chassis went from 410 grams to 470 grams. It was determined that after fabrication and testing of the robot on the course, that 6mm × 6mm bar stock could have been substituted instead. This change would have reduced the mass by 60 grams which would have reduced the weight needed to be lifted by the arm articulating motors and reduced the depth that the robot sunk into the sand. 15 The final chassis assembly incorporated all of the electrical components, articulating arm motors, payload delivery system, battery and wiring (Figure 3-8) Figure 3-8 - Final Chassis with Internal Components 16 4. TRACKS 4.1 INTRODUCTION The second component considered was a method to propel the vehicle through the water. The "Eccentric Paddle Locomotion Mechanism" [8] and the "hybrid wheel-leg concept" [9] could be applied to the hull design concept. The "Eccentric Paddle Locomotion Mechanism" [8] used eccentric fins to paddle through the water and to walk on the ground. The "hybrid wheel-leg concept" [9] used two retractable paddles integrated in to each of the four wheels that propelled the vehicle through the water and then retracted when it approached land. The issues with a paddle type propulsion system consisted of limited mobility through sand and the vehicle's height constraint when needed to climb steps. These significant downfalls eliminated them from being viable options when selecting a propulsion method. Because the robot was tasked with transitioning over sheer, cliff-like obstacles, as well as the requirement for it to traverse a section of uneven sand terrain, the logical choice for the propulsion system was a system using rubber tracks. Tracks offer a large surface area for the distribution of the vehicle’s weight and by using a rubber material, high coefficient of friction could be taken advantage of to climb the robot into and out of the water section as well as scaling the stairs of unknown heights. The ability of a tracked robot to move efficiently over loose or rough terrain is directly related to how the weight is distributed from the suspension through the tracks and onto the driving surface [10]. The optimization of this value, known as the mean weight distribution, alongside with the specific shape ratio determines the success of vehicle maneuverability [11]. 17 A system of four independent tracks was chosen to allow for increased versatility of motion. Calculations were performed to determine the torque necessary for each track as well as the revolutions per minute (RPM) necessary for controlled and efficient execution of the course. Additionally, most tracked vehicle designs include a tensioning system to ensure that the tracks remain tensioned and engaged with the drive sprockets [12]. A significant advantage of track propulsion systems is their ability to climb sheer obstacles that are much higher than the vehicle itself. A mathematical model was developed to predict the size of track necessary to climb stairstep style obstacles [13]. Independently driven tracks must actuate drive motors to move the treads with equal velocity so the vehicle can be driven in a straight line. This is done through a closed-loop power control module that regulates the specific voltage into the drive motors on each side of the vehicle [14]. 4.2 METHODS A SolidWorks model was made used to evolve the basic design of the track arms. The two outer plates were separated by cylindrical supports and sprockets to transfer rotational motion to the track material were placed at each end. The overall length of the tracks was decided by the necessity for them to rotate a full 360 degrees while remaining in the prescribed design constraints. After finalizing the computer model, computerized numerical control (CNC) machining was used to mill the flat components from four millimeter aluminum sheet stock. The original design was based around a small brushless "pancake" motor that could fit inside of the drive sprocket of the track assembly. The control commands were to be transmitted through 360 degrees “slip disks.” A design change was made in an attempt to increase control accuracy using an Xbee wireless motor relay. The microcontroller and its associated power source would be 18 mounted inside the track (Figure 4-1). However, it was then discovered that the pancake motors would be woefully underpowered for the torque requirements of the track drivetrain. A motor selection process based on the below calculations of required RPM and online motor torque calculator [21] was performed to select motors that would fit inside the existing skeleton and still deliver the necessary torque to the drive sprocket. Figure 4-1 - Track Skelton with Xbee Wireless Motor Relay 19 â—Ź Assuming one minute for non-forward motions and the requirement for a roundtrip, the robot was assumed to need to drive forward at 24.05 track revolutions per minute. â—Ź Motor speed is 90 revolutions per min (RPM), but with gear reductions was driving track at 31 RPM. â—Ź These motor specifications were also for 6 volts of supplied power, and since 12 volts were supplied, motor speed will be faster than the necessary rate. A system consisting of the direct current gear motor, two bevel gears, and two spur gears was designed to fit inside of the track skeleton and drive the track (Figures 4-2 and 4-3). The round components of the track arms such as the sprockets, gear axles and track supports were machined by hand on a lathe from various diameters of round aluminum stock to necessary measurements. Figure 4-2 - Expanded Final Track Design with Gear motor and Gear train 20 Figure 4-3 - Detailed Final Track Drive Mechanism After multiple track tensioning systems were considered, including a scissor-lift type device, and an ‘up-and-over’ system, a simple screw-in-slot was designed and was manufactured accordingly. These designs will be used instead of a traditional track tensioning system due to the rules for the ASME student design competition which preclude the use of springs. Research was also done on belt materials and suppliers. A 5-ply rubber belt was chosen from McLeod Belting Company of Chesterfield, Virginia. When the raw material was cut to length, it was discovered that the material was too stiff to turn around the relatively small radius of the sprockets. This was avoided by peeling all layers on the back of the rough rubber 5th ply to leave an elastic and malleable track, capable of keeping tension and turning much easier than the original raw belt. 21 4.3 CHALLENGES AND SOLUTIONS In addition to issues that arose in the fabrication stage, several issues arose in the testing stages leading up to the competition. During testing, it was found that the polished aluminum sprockets struggled to stay engaged with the rubber tracks after sand was introduced. This was solved by applying an adhesive-backed grip tape to the drive sprockets. As testing progressed, it was realized that overall weight would play a substantial role in the ability of the track system being able to complete the competition course. Weight reduction measures, such as hollowing and drilling out excess material in the sprockets, resulted in 2 ounces per track of reduced weight. Overall the design evolution of the tracks was minimal as the original size specifications were very close to the maximum allowable dimensions. 5. TRACK ARTICULATION SYSTEM 5.1 INTRODUCTION As part of the previously mentioned design, it was necessary for the four track arms to rotate in pairs, for example the two front tracks had to rotate in concert. This feature would be essential for the vehicle to scale any obstacle larger than the diameter of the drive sprockets. 5.2 METHODS The motor initially was selected as a National Electrical Manufacturers Association (NEMA) 14 with a stall torque of 19 ounces. Since the space is limited within the chassis and weight has to be put into consideration, the drivetrain was limited to two motors which will use spur gears to rotate the front and rear axles connected to the robot’s track arms. [5-1] After the 22 initial NEMA 14 motors were ruled out, new 369:1 ratio DC gear motors were chosen to be mounted in parallel with the articulation axle (Figure 5-1). Figure 5-1 - NEMA 14 Stepper Motor Arm Articulation Design The gear ratio was determined by size constraints rather than speed and torque requirements. It was decided that the gear motors has more than sufficient torque at the output shaft of the planetary gearbox, and that speed would be electronically regulated by the computer code of the robot. The last component designed and manufactured was a small aluminum axle collar used to keep the articulating axle centered between the two chassis bushings. 23 Figure 5-2 - Final gear motor Arm Articulation Design 5. 3 CHALLENGES AND SOLUTIONS An additional issue discovered was the compromising of the both the spur gear and hub set screws after repeated testing under the full weight of the robot. This was rectified by drilling tapped M3 holes through the component (hub or gear) and the axle, and putting a screw through both to secure them from rotation. 6. PAYLOAD MECHANISM 6.1 INTRODUCTION Materials considered for the design of the delivery mechanism of an amphibious robot must have properties to protect the vehicle from harsh conditions such as wind, rain, 24 temperature, and/or mechanical damage [15]. The payload system must be made of a material that can endure rough terrain and withstand dynamic, reversible loading [16]. If the cargo becomes contaminated, the aid could cause illness and/or death [17]. Compatibility to the type of aid being delivered [18] and being able to be strategically integrate the mechanism into the robot to prevent excess bulking which would hinder the vehicle’s maneuverability [19] is essential when designing a delivery mechanism. 6.2 PRELIMINARY DESIGNS Several methods were considered to hold and deposit the payload. One of the other designs considered was a gumball machine like mechanism that would have a motor rotate the mechanism to deposit the payload at the end of the course. This was not selected due to the complexity of the design and the prolonged time it would take to deposit the payload. An eggshaped hopper with a butterfly valve closing off the bottom was a design that was also considered. At the end of the course, the butterfly valve would open to deposit the load. This method was dismissed after realizing that the butterfly valve would not be able to open without first having to lift the payload to force the valve open. Depending on the size and weight of the payload, the motor used to operate the valve would require enough torque to lift the load and enough holding torque to prevent the load from forcing the butterfly valve open. Another design that was considered was a simple hinged door that would open once the payload mechanism was hovering over the hole at the end of the course. Since the robot is roughly the same size as the top step that has the hole at the end of the course, in order to accurately deposit the load into the hole without spilling any on the sides, the robot should be as close to the step as possible and not 25 raised up too high. Because the robot should be crouched low to the hole, it was deemed that there was insufficient space to fully open the hatch. After designing the entire payload mechanism in SolidWorks with trial and error, the method chosen to deposit the material was a trap door at the exit of a funnel located within the center of the chassis. This system was chosen over the several other designs due to its ease of operation and its predicted use of small amounts of electricity. The final design incorporated a sliding door release mechanism which would allow for a high mass-flowrate through the opening, reducing the amount of time needed to unload all of the contents. A sliding latch door located at the top of the hopper allowed for the payload mechanism to be hand loaded at the beginning of the course. Due to the complex design of the payload system and to save time in terms of fabrication, both the top and bottom funnels making up the 3.89 U.S. cups hopper were 3D printed using acrylonitrile butadiene styrene (ABS) plastic. By 3D printing the hopper, multiple parts of the robot were able to be manufactured in parallel together. ABS plastic was also determined to be a lighter material than aluminum due to its lower density which allowed us to make the walls of the hopper thick enough to prevent bending while still keeping the weight to a minimum. The thickness of sheet metal required to make the hopper strong enough to prevent bending would cause the hopper to be heavier than using ABS plastic. Also, because of the competition’s size restrictions of the robot and the trap door mounted directly to the hopper, the dimensions of the funnel needed to be made with extreme precision which could not be achieved by the welding of sheet metal. 26 The operation of the trap door involved a DC motor mounted to the side of the bottom funnel. The DC motor had a 32 tooth spur gear at the end of its 4 mm shaft which connected to a 1:1 gear ratio gear rack attached to the top of the trap door. To attach the trap door to the funnel, custom made L-brackets were mounted to the sides of the bottom funnel and slots were designed in the trap door to allow the door to slide along the brackets. The sides of the chassis were left exposed to allow the trap door to open fully. In an effort to conserve space, the Arduino microcontroller was mounted to the side of the top funnel. Figure 6-1 - Final Payload Delivery Mechanism 6.3 CHALLENGES AND SOLUTIONS One of the first issues that were encountered was the choice of motor used to operate the trap door. A servo motor was originally chosen but was determined to be insufficient due to its lack of range of motion. Servo motors can only rotate a set number of degrees before it stops 27 which would not allow the trap door to open all the way fully. A DC motor was selected to replace the servo motor because it does not have a set number of rotations before it stops. Once the motor and motor mount were selected and inserted into the payload mechanism assembly in SolidWorks, it was discovered that the teeth on the spur gear and the gear rack did not match up. Simple geometry showed that the DC motor needed to be angled away from the funnel by seven degrees. To fix this, the bottom funnel of the hopper was designed to angle outwards by seven degrees in the spot where the motor mount would go. This orientated the motor to allow the spur gear to perfectly match up with the gear rack. During the fabrication process, machining the trap door proved to be an issue as well. The slots in the trap door that were used to mount to the door to the L-brackets were not able to be machined with the door as one piece. Using SolidWorks, the trap door then had to be broken up into two separate pieces. The two pieces were then held together using a total of seven screws: four screws in to side and three screws in the bottom. Once the payload mechanism was machined, 3D printed, and assembled, the mechanism was tested out to see if the motor had enough torque to open and close the trap door. The motor was able to open the trap door but only after the trap door was manually moved slightly to help the motor get started. To fix this problem, about 1 mm worth of material of the slot in the trap door that slid along the L bracket was machined off to reduce friction. This then allowed the trap door to open and close by its own power. Now that the motor was able to open and close without any assistance, the payload mechanism was mounted into the chassis. The chassis was made to be 1 mm thicker than what 28 was originally designed in SolidWorks due to the sizes of material available for purchasing. This extra material proved to be a problem because the design had extremely small design tolerances because of its size restrictions. The motor mounted to the size of the funnel no longer fit inside of the chassis. To open up room within the chassis for the motor to fit, a Dremel was used to take around 2 mm worth of material off of the chassis in the spot the motor will be mounted. During the testing and programming phase after the robot was assembled, the 300 RPM DC motor was determined to be too fast. The code used to operate the robot, was dependent on time to control how long each motor would run when a command is given. Because of the high RPM of the DC motor, a sufficient time was difficult to be calculated for the motor to run or open and close the trap door. After some research, a new 20 RPM motor of the same size was found and used to operate the trap door. The new lower RPM was far easier to program to allow for the trap door to open and close smoothly without the door running off of the tracks. Finding a motor of the same size prevented issues in altering the design of the already built robot. 7. ELECTRONICS AND PROGRAMMING 7.1 POWER DISTRIBUTION 7.1.1 INTRODUCTION The power distribution of the robot has to be capable of powering the entire system independently and will need to use a rechargeable battery due to competition requirements. It also has to be flexible, due to hardware requirements of both 5V and 12V to be handled simultaneously. The energy capacity of the battery pack must contain the lowest possible milliAmpere hours (mAh) which is part of calculating the overall score in the competition. 29 7.1.2 METHODS The choice of battery was made after a preliminary selection of a DC motor combination. The minimum voltage output necessary was 12 volts, since this voltage was required for some, but not all, motors. Other voltages were possible, but anything higher than 12 volts required stepping down the voltage for all of the motors, and anything lower would have required a stepping up of the voltage for almost half of the motors. Stepping up or down the voltage was a possibility, but doing so created possible inefficiencies within the system such as increased heat emission, and could damage components, hindering functionality and ultimately, performance and overall score. A 12 volt nickel-metal hydride (NiMH) battery pack was chosen due to the availability, low cost, and consistent use in small size robotics. The separation of currents is handled by a solderless breadboard. Breadboards are rectangular, plastic boards that are made up of 400 connection ports. These ports are arranged in separate rows that transmit signals or electricity independent from the other rows. This allowed us to handle both currents simultaneously, and made access to the different currents very easy. 7.1.3 CHALLENGES AND SOLUTIONS The 22 gauge wire selected was not capable of maintaining a secure hold within the breadboard, creating possible connection issues with vibrations and losses of functionality of components. Multiple wire connections required a means of protection of the battery and electronic components from water damage. Adding a piece of bare wire inserted with the actual wire to increase the thickness of the wires and maintain an efficient connection within the breadboard. A waterproofing epoxy spray 30 was used to prevent water damage to electronic components and wires. Additionally, the epoxy helped keep wires connected. 7.2 COMMUNICATION 7.2.1 INTRODUCTION To get the robot through the course, there needed to be a way to send commands to the robot to maneuver through and complete the course. This was completed by means of an Arduino microcontroller, Bluetooth dongle, Playstation®3 controller, and motor drivers. The Arduino microcontrollers are relatively inexpensive, easy-to-use, open source, and widely available. The platform being open source means that installing code can be done with a free programmer from their website. The communication hub for the robot was chosen to be developed using the Arduino Mega 2560 microcontroller board which is similar to the Arduino Uno. The difference between the two boards was that the Mega provided more input connection ports which allows more ports to be used as output pulse width modulation (PWM) signals. The motor drivers were an essential part of the electronic controls design. They are able to process multiple input voltages that allow for versatility in using a DC motor. A motor driver, or similar alternative, is required to change the direction and speed of a DC motor. Most models of motor driver also allow for an outside current other than the common current delivered from the Arduino to power the motor. 7.2.2 METHODS Since the robot only needed to move forward, backward, and turn, each track motor does not need to be moved independently. The controls for moving the track motors were divided to 31 the left and right sides which limited the amount of wires needed to be plugged directly into the breadboard. Since the breadboard delivers power in each column, this meant that each side of the robot only required 4 wires (Motor Signal 1, Motor Signal 2, PWM, Standby). An example of the wiring of the robot is shown in Figure 7-1, which shows the wiring required for each of the 4 dual motor drivers. Motor Signal 1 and 2 (MS1, MS2) provide the signal that determines which direction the motor will turn. As seen in the code (Appendix 4), if MS1 is HIGH (5 volts travelling through the wire) and MS2 is LOW (no volts travelling, ground) then the motor will spin clockwise. If MS1 is LOW and MS2 is HIGH, the motor will spin counter-clockwise. The standby wire sends a function that allows a driver to be put into a low-power mode. When the standby is LOW then the driver doesn’t pull power, when it is HIGH the driver can pull voltage from the common current being supplied by the Arduino Mega board and the motor current. Pulse width modulation (PWM) signals vary the voltage being sent through the wire, which can be interpreted by a motor driver to vary the power output of the motor. Figure 7-1 - Wiring Schematic 32 The method to generate inputs to control the robot was chosen to use a PS3 controller that sent signal over Bluetooth radio frequencies to a USB Bluetooth receiver dongle. This dongle is connected to the Arduino via a USB host shield. A host shield is a circuit-board that physically connects to other boards using the pins available to send signals from a USB input device to an Arduino board and then out to motors or other components. The USB host shield used took the signals that were input from the PS3 controller, and stored a program downloaded from the internet that translated them into something that the Arduino Mega could interpret. Other methods of control could have been used such as traditional RC car controller and a computer, but they would have also required a shield. A Playstation®3 controller was available to us, allowing us to save money on a new controller. 7.2.2 CHALLENGES AND SOLUTIONS DC Motors work with only 2 wires which are necessary to move the motor, one wire supplying current and the other for ground. The issue is that the robot requires more than one direction of movement and motors at different speeds. A dual motor driver takes input signals and power from a single source and distributes those among multiple DC motors. With PS3 controller the robot was able to be programmed using one input for two track arm motors. A previous design called for a wireless communication system to transmit information from the chassis of the robot to the individual track arms. This was meant to ensure that the arms would be able to rotate 360 degrees without any wires being wound on the articulating axles and preventing any rotations. Due to the incorrect calculations for the required motor torque, the space reserved for the Xbee communication system became a space for a new motor and 33 gearbox. Wires were used to transmit power and signals to the track arms, but now they included quick-release clips so that wires wouldn’t be damaged if the tracks were rotated too far. This had the added benefit of eliminating coding for the Xbee controllers, and battery capacity, creating more time for testing and reducing the energy capacity helping the scoring. 34 8. RESULTS 8.1 COMPETITION RESULTS Table 8-1 - 2015 ASME SDC Results 8.2 DISCUSSION OF RESULTS The student design competition attracted 20 entries from the Eastern United States and Europe. Of the 20 entries, 19 robots attempted to deliver a payload and none were able to deliver an uncontaminated payload within the 3 allotted minutes. Although three robots cleared all obstacles of the course, none made a successful round trip and delivered their payloads in the allotted time. This was due to the complexity of the course (Figure 8-1) and the size of obstacles compared to the relatively small maximum dimensions. The ramp’s obstacles, which included 35 nails and blocks of wood, caught sections of the robot’s chassis preventing them from moving forward. The water hazard proved to be too deep for some of the competitor’s entries, as multiple robots had their trial end there. The sand pit was not as hazardous an obstacle for the robots that made it there, but wasted a lot of their time maneuvering their way through it. Figure 8-1 – Final Course 36 9. OVERALL DISCUSSION The purpose of this project was to design and build a variable terrain robot capable of climbing stairs, crossing water, and delivering a payload of relief supplies to a determined location via remote control. This simulated an environment similar to one found after a natural disaster, like a typhoon or tornado, where people in need are in dangerous or cramped spaces that would be difficult and hazardous to access. Robotic aid creates the capability to safely transport supplies to these areas, helping people that may have had to wait hours or even days for relief. This project focused on developing technologies for a scaled-down prototype of a robot that can complete these tasks. After the completion of the competition, hindsight of robot performance and comparisons to design features of other entries, several key areas of the robot could have been improved or rectified which would have led to a dramatic increase in performance. The improvements can be broken into mechanical modifications and electrical/control system changes. Among the mechanical system improvements, work could be done to increase track surface area which would directly benefit traction and stability, and therefore climbing ability. By increasing the chassis rake, that is the difference in width between the top and bottom of the chassis, a wider track could have been easily accommodated. This modification would have added not only added more surface area for the track, but would allow more space inside the track skeleton for drive components (gear motor, bevel and spur gears). In the same vain, by removing the taper of the individual track arms, the robot would have been more stable when standing straight up, as well as, had more traction when driving with just the lower section of the tracks. 37 The tracks also suffered from lack of friction between the drive sprocket and the rubber track even after an application of adhesive grip tape described above. This issue could be easily solved with tabs to keep track aligned or by adding sprockets with teeth to stay engaged with the track material in both a longitudinal (in line with track centerline) and latitudinal (side to side sliding motion) direction. The last major mechanical improvement is related to the inability of the track articulation system to maintain a track arm angle between 0 and approximately 75 degrees. This was due to a larger component of the robot weight vector being directed outside of the track arms. Therefore, the resulting normal force applied a torque through the track arm back to the articulation system. This feedback torque was greater than the holding torque of the gear motor and spur gear system. This issue could be resolved electrically by providing more electrical power to the gear motor via a larger motor drive, or mechanically by using a worm gear-spur gear system which prevents a feedback torque from reaching the DC motor due to mechanical friction. Electrical issues that need resolution are minimal, but could lead to much greater robot efficiency. There are two methods of giving input to the electrical system. As discussed above, analog and digital signals have specific benefits and drawbacks. The chosen control device only had six analog inputs while the design could have been more efficiently controlled with eight. With this fact, a new controller would have been helpful. The other electrical shortcoming was the energy capacity of the battery. Since the scoring was based on battery capacity, a higher score would have been obtained if an appropriately sized battery was incorporated. This could be easily fixed by performing an electrical requirement study to determine proper battery size based on the energy needs of all components. 38 The last improvement would offer protection to both the electrical and mechanical systems rather than just the electrical systems. A shield around the articulation system would ensure proper gear meshing by preventing sand or foreign debris from becoming lodged in the gears. Additionally, a cover for both the Arduino and breadboard circuits would protect them from water and sand contamination. Several limitations were observed during the project. Insufficient experience with CAD software amongst team members limited the part-modeling process. Because of this lack of experience, high volumes of design workload had to be completed by a few team members, while the rest of the group learned to use the software. This resulted in a couple of weeks where there was a backlog of modeling work, while not much other work was able to be completed at that time. Another limitation included the need for a small motor to fit the design’s dimensional requirements that was powerful enough to carry a large payload while minimizing energy consumption. Many 12 volt NiMH batteries had large milliAmpere per hour ratings which affected the total performance of the robot in terms of the scoring for the competition. These high capacity batteries limited the selection of batteries able to be chosen. The accuracy of the 3D printer is another limiting factor when designing small, intricate parts for the tracks. Based on the prototype, the 3D printer has a difficult time accurately creating parts that are one to two millimeters thick. 39 11. REFERENCES [1] M. Guedes, "ARES-III: A versatile multi-purpose all-terrain robot," in IEEE 17th Conference on Emerging Technologies, Piscataway, NJ, USA, IEEE, 2012. [2] T. Fujita, "Development of a rough terrain mobile robot with multistage tracks," in 2013 16th International Conference on Advanced Robotics (ICAR ), 25-29 Nov. 2013, Piscataway, NJ, USA, 2013. [3] C. Chenghui, "Advanced traction rechargeable battery system for cableless mobile robot," in Proceedings 2003 IEEE/ASME International Conference on Advanced Intelligent Mechatronics (AIM 2003), 20-24 July 2003, Piscataway, NJ, USA, 2003. [4] L. Mak, A. Kuczora, and A. S. Re, "An empirical method for the estimation of towing resistance of a life raft in various sea states," in 26th International Conference on Offshore Mechanics and Arctic Engineering 2007, OMAE2007, June 10, 2007 - June 15, 2007, San Diego, CA, United states, pp. 41-51, 2007. [5] R. L. M. Mallari and K. I. Matveev, "Effect of hull gap on pressure distribution under PAR platform," International Journal of Aerodynamics, vol. 1, no.2, pp. 161-168, 2010. [6] G. Pisanich and S. Morris, "Fielding an amphibious UAV: development, results, and lessons learned," in 21st Digital Avionics Systems Conference. Proceedings, 27-31 Oct. 2002, Piscataway, NJ, USA, pp. 8-14, 2002. [7] Engineeringtoolbox.com, 'Modulus of Rigidity', 2015. [Online]. Available: http://www.engineeringtoolbox.com/modulus-rigidity-d_946.html. [Accessed: 20- Apr- 2015]. [8] S. Yi, M. Shugen, and L. Xin, "Design of an eccentric paddle locomotion mechanism for amphibious robots," in 2010 IEEE International Conference on Robotics and Biomimetics 40 (ROBIO), 14-18 Dec. 2010, Piscataway, NJ, USA, pp. 1098-1103, 2010. [9] A. S. Boxerbaum, M. A. Klein, J. E. Kline, S. C. Burgess, R. D. Quinn, R. Harkins, et al., "Design, simulation, fabrication and testing of a bio-inspired amphibious robot with multiple modes of mobility," Journal of Robotics and Mechatronics, vol. 24, no.4, pp. 629-641, 2012. [10] H. Guo and N. Li, "Tracked Vehicle Suspension Technology and Its Prospects for Military Applications," in 2011 Second International Conference on Digital Manufacturing and Automation (ICDMA 2011), 5-7 Aug. 2011, Los Alamitos, CA, USA, pp. 1372-4. [11] M. Tatsuro and T. D. Thai, "Influence of track shape ratio to turning characteristics of a tracked vehicle running on soft terrain," in Proceedings of the 34th Japan national conference on geotechnical engineering., July 21, 1999 - July 23, 1999, Tokyo, Japan, 1999, pp. 1877-8. [12] J. Matej, "Terrain-adaptive auxiliary track tensioning system for tracked vehicles, "Journal of Computational and Nonlinear Dynamics, vol. 8, 2013. [13] A. H. Rajabi, A. H. Soltanzadeh, A. Alizadeh, and G. Eftekhari, "Prediction of obstacle climbing capability for tracked vehicles," in 2011 IEEE International Symposium on Safety, Security, and Rescue Robotics (SSRR 2011), 1-5 Nov. 2011, Piscataway, NJ, USA, pp. 128-33. [14] Z. Yuan, Z. Chengning, S. Fengchun, and W. Jingbo, "Power control of dual-motor electric drive for tracked vehicles," Frontiers of Mechanical Engineering in China, vol. 5, pp. 67-72, 03/ 2010. [15] M. Frejek and S. Nokleby, "Design of a small-scale autonomous amphibious vehicle," in Electrical and Computer Engineering, 2008. CCECE 2008. 41 [16] M. Guedes, "ARES-III: A versatile multi-purpose all-terrain robot," in IEEE 17th Conference on Emerging Technologies, Piscataway, NJ, USA, IEEE, 2012. [17] D. Williams, "Contaminated Water," Chemistry & Industry, vol. 77, no. 6, pp. 43-43, 2013. [18] B. Chevalier, G. Combe and P. Villard, "Experimental and Numerical Study of the Response of Granular Layer in the Trap-Door Problem," in Powders and Grains 2009. 6th International Conference on Micromechanics of Granular Media, USA. [19] T. YuHon, T. BoonYew, D. Tan, W. ZhenYang, T. ChingSeong and T. YongChai, "Design Considerations of Autonomous Amphibious Vehicle (UTAR-AAV)," in Sustainable Utilization and Development in Engineering and Technology (STUDENT), 2010. [20] A.S. Pandey, B.M.K. Chaubey, C.S.K. Srivastava, D.R. Pal, “XBee Based Device Control With Feedback,” International Journal of Advanced Technology & Engineering Research, vol.2, 2012. [21] C. Benson. (2012, February 1). Drive Motor Sizing Tutorial [Web]. Available: http://www.robotshop.com/blog/en/drive-motor-sizing-tutorial-3661 42 APPENDICES APPENDIX 1 - Gantt Chart 43 APPENDIX 2: Budget Final Expenditures Component Cost Per Item Quantity Total Cost Motors NEMA-14 Stepper Motors Pancake Motors DC Gear Motor Motor Mount Track Motors Gears 16 Tooth Gear Beam Gear Rack 55 Tooth Spur Gear 72 Tooth Spur Gear 16 Tooth Bevel Gear 24 Tooth Bevel Gear 54 Tooth Spur Gear 28 Tooth Spur Gear Bearings Miniature Aluminum Base Mounted Ball Bearings ABEC-3 MR74ZZ Steel Bearings Batteries 12V / 1600 mAH Ni-MH Rechargeable Battery 3.6 Volt Coin Cell Battery Xbee Communication System Xbee Trace Antennae USB Connector Motor Driver 1A Dual cuteDuino Pro Mini Raw Materials 3/4" x 3/4"x6" Aluminum Bar 3/8"x1"x12" Teflong Rectangular Bar 3/4"x4"x24" White Delrin Rectangular Bar 4mmx40mmx6' Aluminum Rectangular Bar 1-3/8" Diameter, 1 foot long White Delrin Rod 4mmx40mmx1' Aluminum Rectangular Bar 8mmx8mmx3' Aluminum Rectangular Bar 8mmx8mmx6' Aluminum Rectangular Bar Metric Aluminum Threaded Hex, 25mm length, M3 Competition Expenses Registration Hotel $13.87 $69.88 $24.99 $6.99 $25.54 2 4 1 1 4 $35.71 $340.77 $24.99 $6.99 $102.15 $12.99 $5.99 $21.57 $24.90 $12.25 $12.25 $17.65 $17.65 1 1 2 2 4 4 4 4 $12.99 $5.99 $43.14 $49.80 $49.00 $49.00 $70.59 $70.59 $18.62 $3.06 4 12 $74.48 $36.71 $29.99 $2.95 1 20 $29.99 $59.00 $24.95 $1.50 $10.95 $6.00 5 4 4 4 $124.75 $6.00 $43.79 $24.00 $3.27 $28.38 $54.72 $16.04 $10.05 $4.01 $4.86 $8.24 $0.87 1 1 1 1 1 1 2 1 40 $3.27 $28.38 $54.72 $16.04 $10.05 $4.01 $9.72 $8.24 $34.80 $53.00 $176.00 Total Cost 7 1 $371.00 $176.00 $1,976.66 Remaining Funds $23.34 44 APPENDIX 3: ASME Robots for Relief Problem Statement 45 46 47 APPENDIX 4: Arduino Code #include <PS3BT.h>//Loads library that allows Arduino Mega to connect to Bluetooth Dongle #include <PS3USB.h> #include <MotorDriver.h> USB Usb; BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so PS3BT PS3(&Btd,0x00,0x1A,0x7D,0xDA,0x71,0x13); // This will also store the bluetooth address - this can be obtained from the dongle when running the sketch boolean printTemperature; boolean printAngle; //////////////////////////SETUP/////////////////////////////////////////////////////// //////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////// void setup() { //Declares what pins will be used, and what their use will be (Input/Output) Serial.begin(115200); //115200 pinMode(3,OUTPUT); //BLUE BUNDLE 1 pinMode(5,OUTPUT); //BLUE BUNDLE 2 pinMode(6,OUTPUT); //BLUE BUNDLE 3 pinMode(9,OUTPUT); //BLUE BUNDLE 4 pinMode(10,OUTPUT);//BLUE BUNDLE SOMETHING pinMode(11,OUTPUT); //BLUE BUNDLE 5 pinMode(7, OUTPUT); pinMode(8, OUTPUT); pinMode(12, OUTPUT); pinMode(13, OUTPUT); //Bundle 1 - Right F/B pinMode(22,OUTPUT); //Red pinMode(23,OUTPUT); //Green pinMode(24,OUTPUT); //Orange pinMode(25,OUTPUT); //Bundle 2 - Left F/B pinMode(28,OUTPUT); //Red pinMode(29,OUTPUT); //Green pinMode(30,OUTPUT); //Orange //Bundle 3 - DOOR OR ARM ROTATOR BACK pinMode(34,OUTPUT); //Red pinMode(35,OUTPUT); //Green 48 pinMode(36,OUTPUT); //Orange //Bundle 4 - DOOR OR ARM ROTATOR BACK pinMode(40,OUTPUT); //Red pinMode(41,OUTPUT); //Green pinMode(42,OUTPUT); //Orange //Bundle 5 - Arm Rotator Front pinMode(46,OUTPUT); //Red pinMode(47,OUTPUT); //Green pinMode(48,OUTPUT); //Orange pinMode(44,OUTPUT); pinMode(45,OUTPUT); pinMode(49,OUTPUT); if (Usb.Init() == -1) { Serial.print(F("\r\nOSC did not start")); while(1); //halt } Serial.print(F("\r\nPS3 Bluetooth Library Started")); } ////////////////////////////////////////////////////////////////////////////////////// /// void loop() { Usb.Task(); if(PS3.PS3Connected || PS3.PS3NavigationConnected) { digitalWrite(25,HIGH); //Was used for 5 volts of Common Current Power digitalWrite(24,LOW); digitalWrite(30,LOW); digitalWrite(36,LOW); digitalWrite(42,LOW); ////////////////////////////////////////////////////////////////////////////////////// ////////////LEFT STICK if(PS3.getAnalogHat(LeftHatY) > 137) //DC 1 forward/reverse { analogWrite(46,255); // BLUE, POWER/SPEED CONTROL digitalWrite(30,HIGH); //ORANGE digitalWrite(28,LOW); digitalWrite(29,HIGH); } if(PS3.getAnalogHat(LeftHatY) < 115) { analogWrite(46,255); // BLUE, POWER/SPEED CONTROL digitalWrite(30, HIGH); //ORANGE digitalWrite(28,HIGH); digitalWrite(29,LOW); } if(PS3.getAnalogHat(LeftHatY) > 115 && PS3.getAnalogHat(LeftHatY) < 137) 49 { analogWrite(30, LOW); } } if(PS3.PS3Connected || PS3.PS3NavigationConnected) { ////////////////////////////////////////////////////////////////////////////////////// /////////RIGHT STICK digitalWrite(25,HIGH); if(PS3.getAnalogHat(RightHatY) > 137) //DC 1 forward/reverse { analogWrite(45,255); // BLUE, POWER/SPEED CONTROL digitalWrite(24, HIGH); //ORANGE digitalWrite(22,HIGH); //RED digitalWrite(23,LOW); //GREEN } if(PS3.getAnalogHat(RightHatY) < 115) { analogWrite(45,255); // BLUE, POWER/SPEED CONTROL digitalWrite(24, HIGH); //ORANGE digitalWrite(22,LOW); //RED digitalWrite(23,HIGH); //GREEN } if(PS3.getAnalogHat(RightHatY) > 115 && PS3.getAnalogHat(RightHatY) < 137) { analogWrite(24, LOW); } ////////////////////////////////////////////////////////////////////////////////////// //////////////////////// //Analog button values can be read from almost all buttons if(PS3.getAnalogButton(L2_ANALOG) > 0 || PS3.getAnalogButton(R2_ANALOG) > 0) { Serial.print(F("\r\nL2: ")); Serial.print(PS3.getAnalogButton(L2_ANALOG)); Serial.print(F("\tR2: ")); Serial.print(PS3.getAnalogButton(R2_ANALOG)); } if(PS3.getButtonClick(PS)) { Serial.print(F("\r\nPS")); PS3.disconnect(); } ////////////////////////////////////////////////////////////////////////////////////// ///TRIANGLE if(PS3.getButtonClick(TRIANGLE)) {Serial.print(F("\r\nTraingle")); //ARM ROTATOR BACK CW analogWrite(10,255); digitalWrite(12, LOW); digitalWrite(13, HIGH); delay (250); //CONTROLS HOW MUCH TIME MOTOR RUNS (IN ms) analogWrite(10,LOW); //digitalWrite(12,LOW); digitalWrite(13, LOW); } /////////////////////////////////////////////////////////////////////////////////CROSS 50 if(PS3.getButtonClick(CROSS)) {Serial.print(F("\r\nCross")); //ARM ROTATOR BACK CCW analogWrite(10,255); digitalWrite(12, HIGH); digitalWrite(13, LOW); delay (250); //CONTROLS HOW MUCH TIME MOTOR RUNS (IN ms) analogWrite(10,LOW); digitalWrite(12,LOW); //digitalWrite(13, LOW); } //////////////////////////////////////////////////////////////////////////////////CIRC LE if(PS3.getButtonClick(CIRCLE)) {Serial.print(F("\r\nCircle")); analogWrite(10, 0); } ////////////////////////////////////////////////////////////////////////////////SQUARE if(PS3.getButtonClick(SQUARE)) {Serial.print(F("\r\nSquare")); } ////////////////////////////////////////////////////////////////////////////////////// UP if(PS3.getButtonClick(UP)) //ARM ROTATOR FRONT CW {Serial.print(F("\r\nUp")); //NEEDS TO BE LOWERED SPEED. 250 IS JUST FOR TESTING // BLUE, POWER/SPEED CONTROL analogWrite(9,255); //digitalWrite(36, HIGH); digitalWrite(8, LOW); digitalWrite(11, HIGH); delay (250); //CONTROLS HOW MUCH TIME MOTOR RUNS (IN ms) analogWrite(9,LOW); } /////////////////////////////////////////////////////////////////////////////////////R IGHT if(PS3.getButtonClick(RIGHT)) // {Serial.print(F("\r\nRight")); } /////////////////////////////////////////////////////////////////////////////////////D OWN if(PS3.getButtonClick(DOWN)) //ARM ROTATOR FRONT CCW {Serial.print(F("\r\nDown")); //NEEDS TO BE LOWERED SPEED. 250 IS JUST FOR TESTING // BLUE, POWER/SPEED CONTROL 51 analogWrite(9,255); //digitalWrite(36, HIGH); digitalWrite(8, HIGH); digitalWrite(11, LOW); delay (250); //CONTROLS HOW MUCH TIME MOTOR RUNS (IN ms) analogWrite(9,LOW); } ////////////////////////////////////////////////////////////////////////////////////LE FT if(PS3.getButtonClick(LEFT)) {Serial.print(F("\r\nLeft")); //////////////////////////////////////////////////////////////////////////////////L1 if(PS3.getButtonClick(L1)) //DOOR CLOSE {Serial.print(F("\r\nL1")); analogWrite(6,255); digitalWrite(42, HIGH); digitalWrite(40, HIGH); digitalWrite(41, LOW); delay(6000); } ///////////////////////////////////////////////////////////////////////////////////R1 if(PS3.getButtonClick(R1)) {Serial.print(F("\r\nR1")); analogWrite(6,255); digitalWrite(42, HIGH); digitalWrite(40, LOW); digitalWrite(41, HIGH); //DOOR OPEN //digitalWrite(46, LOW); //digitalWrite(47, HIGH); delay (6500); //CONTROLS HOW MUCH TIME MOTOR RUNS (in ms) } // ////////////////////////////////////////////////////////////////////////// if(PS3.getButtonClick(SELECT)) { Serial.print(F("\r\nSelect - ")); Serial.print(PS3.getStatusString()); } if(PS3.getButtonClick(START)) { Serial.print(F("\r\nStart")); printAngle = !printAngle; } if(printAngle) { Serial.print(F("\r\nPitch: ")); Serial.print(PS3.getAngle(Pitch)); Serial.print(F("\tRoll: ")); Serial.print(PS3.getAngle(Roll)); } else if(PS3.PS3MoveConnected) { 52 if(PS3.getAnalogButton(T_ANALOG) > 0) { Serial.print(F("\r\nT: ")); Serial.print(PS3.getAnalogButton(T_ANALOG)); } if(PS3.getButtonClick(PS)) { Serial.print(F("\r\nPS")); PS3.disconnect(); } else { if(PS3.getButtonClick(SELECT)) { Serial.print(F("\r\nSelect")); printTemperature = !printTemperature; } if(PS3.getButtonClick(START)) { Serial.print(F("\r\nStart")); printAngle = !printAngle; } if(PS3.getButtonClick(TRIANGLE)) { Serial.print(F("\r\nTriangle")); PS3.moveSetBulb(Red); } if(PS3.getButtonClick(CIRCLE)) { Serial.print(F("\r\nCircle")); PS3.moveSetBulb(Green); } if(PS3.getButtonClick(SQUARE)) { Serial.print(F("\r\nSquare")); PS3.moveSetBulb(Blue); } if(PS3.getButtonClick(CROSS)) { Serial.print(F("\r\nCross")); PS3.moveSetBulb(Yellow); } if(PS3.getButtonClick(MOVE)) { PS3.moveSetBulb(Off); Serial.print(F("\r\nMove")); Serial.print(F(" - ")); Serial.print(PS3.getStatusString()); } } if(printAngle) { Serial.print(F("\r\nPitch: ")); Serial.print(PS3.getAngle(Pitch)); Serial.print(F("\tRoll: ")); Serial.print(PS3.getAngle(Roll)); } else if(printTemperature) { Serial.print(F("\r\nTemperature: ")); Serial.print(PS3.getTemperature()); } } } }