User:Medelen8/ENES100/APW Implement A

Goals for implementation performance, cost and quality
1. Finish design and building the table top platform. Acquire new miniature linear actuator and calculate the angles of force to determine steering wheel lever length. Make the lever arm long enough to allow for adequate force to be applied to turn the steering wheel. Determine the height for the wooden wedge to mount the miniature linear actuator to the table top platform. Build the wooden wedge for the tabletop platform and install onto the Power Wheel.

2. Finalize the design features for Power Wheel Platform.
 * Measure the interior of the Power Wheel.
 * Design the platform for the Power Wheel.
 * Calculate the height of the wooden wedge for the Power Wheel Platform.
 * Design attachment points for the screw motor, steering components, Arduino, and the battery.

3. Finish and adjust the code for the Arduino to allow Power Wheel to drive in a pattern.
 * Calculate the time to extend the miniature linear actuator.
 * Measure time amount of time to make 360 degree turn in Power Wheel.
 * Calculate time for the Power Wheel to make a 90 degree turn.
 * Edit the Arduino code for the Power Wheel to follow predetermined path.

4. Improve drive capabilities of Power Wheel.
 * Do more measurements of time to make turns.
 * Determine the driving speed of the Power Wheel in high and low gear
 * Adjust code to allow for turning the steering wheel as the Power Wheel is in motion.
 * Adjust code to incorporate turns and driving straight to follow path.

5. Add sensor based obstacle avoidance system.
 * Research the Ultrasonic Sensor for Arduino. Understand the limitations and capabilities of the sensor.
 * Build mount for Ultrasonic Sensor on the Power Wheel. Mount must be able to protect the Ultrasonic Sensor from collisions with obstacles in cases of failure.
 * Create Arduino code to use with Ultrasonic sensor, stop the Power Wheel when faced with an obstacle and re-engage the code once the obstacle is removed.

Implementation Plan (task allocation and work flow)
Project #2 The goal is to build a platform in the Power Wheel that will be able to drive the on a predetermined path. Certain parts were 3D printed with the aid of the MakerBot, during the week. The information gathering, testing, and assembly was done on Thursdays.

Week 1:

The first week was to acquire a new miniature linear actuator, the last one was faulty, and it was over extended and could not be retracted. Then using the table top platform, made by the past group, to test the angles of the lever arm and the miniature linear actuator. With that information, the amount of force that was exerted on the lever arm at any particular turning angle can be determined. Using the length of the miniature linear actuator, the height of the wooden wedge could be calculated. With all the information gathered and a lever length selected, the steering components could be installed on the table top platform.

Week 2:

The second week was to design the platform in the Power Wheel. Measurements were taken from the Power Wheel and used to design the platform in the Power Wheel. When the design was finalized, the platform was constructed and installed on the Power Wheel.

Week 3:

The third week was to install all the components on the Power Wheel. After the steering and the pedal components were installed on the Power Wheel platform, the battery and the Arduino were installed. The pedal pusher assembly need to be adjusted to accommodate the wooden block that attached the lower platform to the upper platform.

Week 4:

The fourth and final week of the project, the Arduino code was adjusted to make the Power Wheel drive in a predetermined pattern. The Power Wheel was taken outside and timed on how long it took to make turns and the speed driving in a straight line. The code was changed to make the Power Wheel to drive straight, make a right turn, drive straight again, make another right turn, and finally come to a stop with minimal interaction by the operator.

The ultrasonic sensor needs to be attached to the arduino to work. To attach the ultrasonic sensor, a 4-pin plug is used. The wires for the plug were not long enough to attach to the arduino from the mounting point of the ultrasonic sensor on the wooden plate. To solve the problem longer wires were soldered on to reach the arduino. After the wires were attached, heat shrink was used to protect the soldering. The extension wires that were used were all the same color, so the wires needed to be labeled to denote which wire was which. The code needed to be changed to allow for the use of the ultrasonic sensor. The arduino needs to be able to run both the original code to drive and the code for the sensor at the same time. The code for the sensor should be constantly checking if there is any obstacles in the path of the Power Wheel. When an obstacle is detected it needs to pause the driving code at the point it detects the obstacle and be able to restart the code from the same point when the obstacle has been cleared. This will be the goal for the last week of the project.

Considerations for human user/operators
There should be minimal human interaction with the Power Wheel once the Power is in motion. The Power Wheel will be able to navigate autonomously on a predetermined path, pause for obstacles, and come to a stop once completing the path. With the sensor based obstacle avoidance system, the Power Wheel will pause when faced with an obstacle and be able to resume following the path once the obstacle is removed.

The manufacturing and/or purchasing of parts
The Power Wheel, Fisher-Price Power Wheels Dune Racer 12-Volt Battery-Powered Ride-on, Green, was bought by past groups and needed no manufacturing or assembly, by the current group. The Power Wheel can be purchased for $229.00 from walmart.com. LINK The miniature linear actuator, a Firgilli Miniature Linear Actuator L16 was purchased for $70.00 from firgilli.com. LINK The screw motor, 12VDC, 78RPM Motor with Right Angle Leadscrew, was purchased for $14.95 from mpja.com. LINK The plywood, Arduino, batteries, and hardware for assembly was acquired from the engineering workshop. The Ultrasonic Sensor, Ultrasonic Sensor HC-SR04 Distance Measuring Module, can be acquired from miniinthebox.com, link, for $1.98.

The assembly of parts into larger constructs
The plywood was then cut up to make the platform that would sit in the power wheel. The plywood is built to place the other functioning parts, such as the linear actuator, the battery, the Arduino, the wires, and the gas pedal piston. The platform, as well as the other parts, was engineered to ensure that it was easy to remove and re-install if needed. The cutting of the platform took up most of the building because the measurements had to be precise and accurate in order to function properly. The Power Wheel platform was constructed in two parts, the upper platform to attach to the mounting plate, and a lower platform for the pedal pusher assembly. The two parts were cut from ½” plywood and attached with a section of 2x4 wood stud and attached with 1 ¼” wood screws. After the platform was built, the steering assembly needed to be constructed. It consisted of three parts: the miniature linear actuator, the steering lever, and the wooden wedge. The miniature linear actuator was a part that was sourced and required no construction or assembly. The steering lever was made from the same material as the platform, ½” plywood, it was attached on either side of the steering will with U-brackets, 3” bolts, and nuts. The length of the wooden wedge was calculated with the aid of the table top platform, it was used to get sample measurements of different lever lengths and the maximum amount of force applied by the miniature linear actuator on the steering lever could be calculated. The length that was selected for the lever length was 14 centimeters, it was calculated to be able to provide sufficient amount of force to turn the steering wheel, and short enough to not restrict the movement of the steering wheel and other components. The height of the wooden wedge was calculated using measurements taken with the aid of the miniature linear actuator. The actuator was extended for seven seconds, half the stroke length, and then attached to the steering wheel lever. The distance was measured from the bottom of the miniature linear actuator to the floor of the mounting platform was measured, that distance was used to measure and construct the wooden wedge. The wooden wedge was constructed from a 2x4 wood stud, and was cut at 50° to match the angle of the steering wheel. Additionally, a lever needed to be constructed so that the linear actuator can be adjusted later, if needed. Finally, the last part that needed to be attached was the bracket and the pedal piston to the platform. The pedal pusher assembly was constructed from three parts: the pedal piston, the screw motor, and the mounting bracket. The screw motor was sourced online and required no construction or assembly. Both, the pedal piston and the mounting bracket was constructed from PLA and printed using the MakerBot. The mount for the Ultrasonic Sensor was added to the front of the Power Wheel. It was attached using the same bolt pattern as the front bumper, with the front bumper reattached back on top. This was done to help protect the Power Wheel and the components from collisions. The mounting plate extended under the front bumper of the Power Wheel and had wooden bumpers attached. The wooden bumpers were added to prevent damage to the Ultrasonic Sensor in case of a collision if the sensor based avoidance system failed. Other than these parts, the last thing that needed to go in the power wheel is the Arduino, battery, and the wires, that can make the power wheel to function as a whole.

Tolerances, variability, key characteristics
The linear actuator needed to be strong enough so that it is capable of turning right and left when it retracts and extends, respectively. To add to that, the gas pedal actuator also had to have enough force to push the gas pedal. Because these were the requirements, we had to chose actuators precisely so that the power wheel can fulfill its purpose.

It takes 86.6 newtons at 8.3 centimeters, measured by past group, is 721.27 newtons per centimeter, to turn the power wheel both ways, which means that we needed a linear actuator that can retract and extend with the same or more amount of force. As the steering wheel turns the amount of force that was applied by the miniature linear steering wheel would change, further away from 90°, the less force was being transferred to the steering lever. The length of the steering lever would be the determine the angle which the miniature linear actuator would apply force, shorter the lever the greater the angle change and greater the amount of force that would be lost. The linear actuator that was purchased for this project can hold up to 200 newtons, which completes the requirement for the linear actuator. The gas pedal actuator was not as hard to purchase because the gas pedal does not require a lot of force to push and neither does the gas pedal pusher have to work for a long time to make the actuator work.

The programming language
We used an Arduino Duemilanove and a Motor Shield to control the actuators. The code we used and tweaked was provided with the Motor Shield.

The low-level design (coding)
When both the linear actuator and the gas pedal actuator are in neutral position, in other words the linear actuator is midway,and the gas pedal actuator is not touching the gas pedal.

Commands of the code above:


 * linear actuator extending for 7 seconds and stopping: turns the steering wheel left for 7 seconds.


 * gas pedal actuator moving CW for 1.35 seconds and stopping for 5 seconds: presses the gas for 5 seconds.


 * gas pedal actuator moving CCW for 1.35 seconds and stopping : depresses the gas pedal for 1.35 and returning to neutral position.


 * linear actuator retracting for 7 seconds and stopping: returns the linear actuator to its neutral position.

The goal of the second implement phase was to attach an ultrasonic sensor to the car, but before that there we several phases. The very first phase was to explore how the sensor worked. After creating the Arduino circuit, I uploaded the code to the Arduino and watched the serial monitor while putting my hand in front of the Arduino, but the serial monitor only read "0 in, 0cm". So, I thought there was something wrong with the code. I changed the numbers in the code from 9600 to 960, 2 to 20, and 5 to 50. This resulted in the serial monitor reading different symbols. I then, I looked on YouTube to see if anyone had a tutorial on how to use the ultrasonic sensor. I found a tutorial (https://www.youtube.com/watch?v=PG2VhpkPqoA) that showed a different code to work the ultrasonic sensor. So, I copied the code the video showed, which resulted in the serial monitor to give me numbers after the code was uploaded.

/Original code/

/Second code/

The second phase of the second implement phase was to get the ultrasonic sensor to work by it self when we put in the "for" and "while" statments. To do this we used this code:

Once we got his code to work after troubleshooting, we implemented this code by writing another code for the power wheel to simply drive straight. Then we substituted the delays with the ultrasonic sensor code, which had the for and while statements:

The integration of software in electronic hardware (size of processor, communications, etc)
To operate the power wheel, an Arduino Duemilanove board was used along with a Motor Shield. Pre-determined paths were written through code to make the power wheel go from point A to Point B. The Arduino Duemilanove was powered by 9v battery while the Motor Shield drew its power from a 12V battery.

The integration of software with sensor, actuators and mechanical hardware
The Arduino Duemilanove board and the Motor Shield, controlled the both the linear actuator and the gas pedal actuator. The Motor Shield has its set a commands that was used to power the actuators. When activated, these commands allowed us to control the operation of the actuators: speed, time, delay and CW or CCW. The Arduino Duemilanove also controlled the Ultrasonic Sensor which was attached in the front of the Power wheel. The Ultrasonic Sensor returns values to the Arduino, which it interprets as distance between the power wheel and the closest obstacle

Test and analysis procedures
To test the power wheel, the basic requirements are to get the power to turn right, left and go straight at some point during the drive.

Test video 1: https://www.youtube.com/watch?v=21hh1yzLZHM&feature=youtu.be

Test video 2: https://www.youtube.com/watch?v=2Y2T3db2Hew

After getting the power wheel to just drive left and then right, we designed a path on which we can prove that the power wheel can turn right, go straight, and turn left all in one drive: https://www.youtube.com/watch?v=2a6_Pu9uJX4&feature=youtu.be. Before we got to this final point, we changed the numbers the code and then tested. To keep track of what set of numbers did what, we drew a chart:

After implementing the Ultrasonic Sensor HC-SR04, we decided to test the reliability of the sensor and the stopping time for the power wheel. In these videos we had the range set at 250cm, in other words if an object is less than 250 cm, the pedal actuator will retract and stop the car.

Sensor Test Video Compilation: http://youtu.be/7n-2xBpbiek

The verification of performance to system requirements
According to the videos, the power wheel does pass the basic requirements that we hoped the power wheel would accomplish. The power wheel does turn right and it does turn left, the only issue the power wheel faces is that it takes the power wheel a wider circle to turn both ways. This results in the power wheel taking a longer time to drive and also takes up a lot of space to drive.

The validation of performance to customer needs
N/A

Sourcing, partnering, and supply chains
N/A

Possible implementation process improvements
Possible improvements would be to improve the code, to make the Power Wheel drive more accurately. The timing will needed to be adjusted so turns will be more precise. Also improvements can be made to the turning radius of the power wheel so that it does not take as long or as much space to turn than it does now.

Furthermore, the power wheel can now drive with consistent results, it can follow a path closely and now has the capabilities of stopping the Power Wheel when faced with an obstacle. Possible implementation process improvements is to better secure the components to make sure for components do not get damage from prolonged use. The wires can be encased in a conduit or some other protective shield to better shield from the environment and provide better safety when changing parts and during regular maintenance. The code can be readjusted to allow for more consistent results when stopping in front of an obstacle. As of now the code works the majority of the time, but needs to be edited to eliminate accidentally colliding with obstacles.

Next Steps
The next steps for the project will be to add: gear shift actuator, rotating mounting bracket, and a wireless kill switch. A gear shift assembly will allow the Power Wheel to go between high and low gear, and to go in reverse. As of now the Power Wheel is set in low gear, to stop wheel spin and to have constant results, engaging high gear once in motion will allow for the Power Wheel to traverse the path at a much quicker time. This will also be helpful when the Power Wheel encounters a steep incline, it can switch to low gear and have more torque to ascend the incline. Reverse will be helpful to avoid obstacles and to change driving paths. With reverse capabilities, the rotating mounting bracket can be added. The rotating mounting bracket will allow for the Power Wheel to scan side to side after it has approached an obstacle, to determine the best path needed to avoid the obstacle. With this capability the Power Wheel can avoid obstacles without having to wait for the obstacle to pass or for the obstacle to removed, further reducing the amount interaction from the human operator. The kill switch will allow for the Power Wheel to stop at any given moment if the human operator determines operation is unsafe. This will allow for the operator to stop the Power Wheel without having to chase down the Power Wheel while in motion, to avoid obstacles, or from driving into unsafe situations.