Anda di halaman 1dari 10

1

Final Project Report: Cart-A-Long


Michael Bigos, Jaret Doiron-LaRue, Richard Mui, Eric Wu Department of Electrical and Computer Engineering Senior Design Project 2011

Abstract---Shopping is an unavoidable part of human life beginning millenniums ago with trade. Caravans were used to transport the goods. This caravan has now evolved into the present day cart invented nearly a century ago. As society is becoming more advanced, technology has coincidely become more pervasive. The shopping cart, however, has remained largely unchanged. We envision a new age when carts will autonomously follow the consumer, allowing users the freedom to focus on what they want to buy and not what they have already decided to. Cart-A-Long is our looking glass into the future.

the consumer. This information is used to control the motors. II. DESIGN A. System Overview The system consists of IR sensors that give feedback to the Arduino which will accordingly control the stepper motors. As shown by figure 1, there are two IR sensors and two corresponding motors. These parts along with the IR emitter bracelet, worn by the user will make up the user detection system. Using the feedback obtained from the user detection system, the Arduino will feed this information to a second Arduino that will control the dc motors on the robot. The cart will run on a two wheel base with a third swivel wheel.

I. INTRODUCTION primary objective of Cart-A-Long is for greater T he convenience. Shopping is the foundation of a Capitalist society. Anything that can assist or enrich this experience would in turn help our sluggish economy. Cart-A-Long is the first step in what we believe will be the next generation of shopping carts. Cart-A-Long is a load-carrying robot that can autonomously follow the consumer while they attend to their business of shopping. This can be particularly useful in the case of handicapped shoppers whom for instance may be using crutches. Furthermore, Cart-A-Long is not limited to only grocery or retail stores. Another useful application is in factories where heavy components are moved around. A simple upgrade in the DC motors would allow Cart-A-Long to have greater load carrying capacity. Other applications include the transportation of luggage at an airport or simply moving things around the house. Our user tracking system will implement the use of infrared technology. IR sensors mounted on step motors locates the IR-emitting bracelet worn by the user, to determine both the angle and distance of

Figure 1: System Block Diagram

2 1. Vishay TSOP4038 IR detector The TSOP4038 is a 3-pin IR receiver that has a high gain for IR signals at 38 kHz. Thedetection level does not change when ambient light or strong IR signals are applied. It can receive continuous 38 kHz signals or 38 kHz bursts 2. L293D motor driver The L293 is a quadruple high current half H-bridge drivers. They are designed to provide bidirectional control over the motors for drive current up to 1A at 24V which is more than sufficient for our needs. These drivers were chosen to drive our stepper motors due to their wide spread availability and low cost. 3. Mercury Stepper Motor These are 2 phase stepper motors, that have a step size of 1.8 degree with a +/- 5% tolerance. 4. Fairchild MC7805A Voltage Regulator The MC7805 will step down the 12V from our on board batteries to maintain a constant 5V supply for the devices that require it, such as the Arduino, IR detector, stepper motor and drivers. Each MC7805 can provide a continuous 1A current. 5. Arduino Barebone Board w/ Atmega 328 The microcontrollers used in the system will calculate the position of the users IR emitting bracelet, and then the pulse width modulation to each motor to achieve that position. 6. Cytron Rotary Encoder The encoder is mounted onto the wheels to give positional feedback to the microcontroller. The encoder would output a rising edge for every eighth of a turn the wheel made. These edges could be counted by the microcontroller and were used to keep track of position and velocity. 7. L6207 DC Motor Driver The motors are chosen for their high continuous output current, as well as many built in circuit protection features such as overcurrent protection, thermal shutdown and integrated diodes. 8 12V 5.1A Lead Acid Battery This provides power to our whole system.
Figure 2: IR Triangulation

B. System Algorithm At the core of our design are two infrared sensors, mounted on rotating motors which are located 13.75 inches apart. The readings from these sensors will contain the core of the information our robot will use to navigate. The stepper motors will rotate 180 degrees per sweep. For each sweep, there can be three cases. The first case will be when no IR is detected. For this case, the robot should just rotate. In the second case, the sensors will first receive an angle when IR is first detected and an angle when the IR signal is lost. The average of these two angles should be the angle at which the IR source is coming from. We will therefore have two angles, one from each of the sensors. Using this data, we will be able to obtain both a relative position and direction from the robot. We can use the two angles from our sensors and the distance apart to find the intersection of these angles. First, we can convert our angles into Cartesian lines. The slopes of the lines are given by the tangent of the angle. We now have the equation of two lines. One is given by y=ax and the other by y= b(x-w) where w is the distance between our two sensors. We can then find the point of intersection by setting the two equations equal to each other and obtain a relative (x, y) point. From this point we can easily find the relative distance and angle.

At the very top of the system algorithm is the user detection system getting an angle and distance reading from the IR emitter. This block is constantly running in parallel with the other steps so decisions can be overridden by new incoming feedback. If it is unable to get a reading or gets a bad reading, indicated by no significant IR reading, the robot will simply wait where it is and perform another scan to attempt to find the user. If the system is able to get a reading, itll determine whether or not the user is standing directly in front of the system. If it

3 is, it will next determine if it is within some distance r. If yes, itll go back to the state of just taking readings. If the system is more than distance r away from the user, then it will move forward. If the user is not directly in front of the system, it will also find the distance. In this scenario, if the user is within some distance r, then it will just rotate to change its angle. While doing this, new readings will come in that will change the state of the system when it is directly in front of the user. If the system is more than the distance r, it will move forward and change direction or angle. average of first_angle and second_angle is taken. The average of the two will give us greater accuracy of when the sensors actually saw the IR source. From there, the two angles (one from each sensor) are converted to Cartesian form and the distance away from the user is represented in two variables x and y. Finally, after the the x and y positions are determined the data is sent to the other Arduino (which handles the DC motor control) using the send_data function. Within this function, the distance data in x and y are encapsulated into a single byte. The information is sent using the serial UART on the Arudino chip. The code also controls the rotation of the stepper so that if it detects a user, it will scan the sector within which that user was detected for an indefinite amount of time until it does not see the user for 4 consecutive sweeps, at which point it will resume normal 180 degree rotation. The sector which the steppers will sweep is the 50 degrees from which the last angle of the user was recorded. By allowing sector sweeping we increase the rate at which the tracking system can locate the user, by limited the amount of space it searches for the user. We can then send data to the dc motor controlling Arduino more frequently, allowing them to make changes to their speed and position more frequently and more accurately.

Figure 3: System Algorithm

Motor Controller: Once the x and y coordinates are received by the motor controlling Arduino, it uses these coordinates to control the motors. The Arduino includes a pulse width modulation function that is calculated and outputted to each motor individually to achieve the desired torque on each wheel. For feedback, encoders are attached to both wheels to monitor the rotations as the robot moves towards its target. In our initial designed controller, a proportionalderivative (PD) controller was coded to control the pulse width modulation values used to drive each motor. This controller used the error in position and the velocity of the robot to calculate desired forces in the x and y directions; it then translated those forces to torques on the wheels. Unfortunately, there was no way to determine the direction from our encoders and the robots dynamics were difficult to account for. Our controller worked sometimes, but was very inconsistent.

IR Tracking Code: The code for the tracking system uses the Arduino's interrupt pins, the triangulate function, the the rotate_Stepper function. The rotate_Stepper function is called within the main loop and runs continuously to control the rotation of the two stepper motors, making them sweep from left to right in a 180 degree arc. . We are using two interrupt pins, one for each IR sensor. The interrupt pins are configured such that it will trigger whenever, the IR sensors changes its output level, either from high to low or low to high. The sensor will first interrupt trigger when it initially sees the IR source, at this point it will record the first_angle. This is taken from the current degree of the stepper motors represented by the variable degree_of_stepper. Upon the second interrupt trigger, the IR source is no longer seen by the sensor, now it will record second_angle. Each of the sensors have an first_angle and second_angle variable. After both sensors have successfully recorded these angles, we are ready to determine where the user is using the triangulate function. Within this function the

4 controlled with a unique Arduino, which actually mounts onto the pcb board. The boards have header pins for wires to allow the two Arduinos to communicate across the two systems.

Figure 4: PD Controller

The controller that ended up being used was designed to be simpler and more intuitive. The motors would only go forward, and stop once they reached their desired destination. This was determined by an initial calculation of how many rotations each wheel should have, based off of the initial x,y setpoint. Our controller consisted of two error terms. One was calculated as the difference between how far one encoder wheel has gone and how far it needs to go to reach the setpoint. This term helps keep the speed of our base at a logical speed; if the setpoint is far away, it makes the motors want to go fast, and if the setpoint is close it makes the motors want to slow down. In order to turn, one encoder value needs to be larger than the other. Our second term compares what that difference is compared to what it should be. This term mostly helps control the robots turning.

Figure 5: Schematic of DC Motor Driver

PCB board description: Our circuit board was divided up into two parts. One board contained the driver for the stepper motors for use with the tracking portion of the project. On the same board we also connect have our power regulation chips which convert the 12V from the battery into 5V to power our drivers and microcontroller. The other board contained the DC motor driver which controlled the movement and speed of our robot. We separated our circuit such that each board is a self-contained system that serves a very specific task. This allows each group member to work on both parts of the project (IR tracking and DC motor control) in parallel and simply bring the two main parts of the project together through a serial connection between the two microcontrollers, for communication. Both boards are independently

Figure 5.1: PCB for DC Motor Driver

Figure 5.2: Schematic of Stepper Motor Driver

C. Design Alternative
There were several different methods discussed for the position tracking system. There are two parts

when tracking the position: direction or angle and distance from the source.
We discussed several alternatives to infrared for determining direction. The first idea was to use RF. The distance we needed the RF reader to read, however, would require a reader that would cost upwards of $1000; well exceeding our budget. We also discussed using acoustics or sonar. Using an accelerometer on the user was another option. The acceleration from the user could theoretically give us the position of the user. We determined that error would easily accumulate making it incredibly difficult to find the position of the user unless we had a very sophisticated error checking system. There were two methods discussed for finding the distance from the user to the robot. One method was to transmit a signal, such as RF, from the robot to a device worn by the user and then the device, upon receiving the signal would transmit a signal back to the robot. This would be done several hundred times so that there would be a significant time delay that could be used to calculate the distance. Because, RF travels at the speed of light, this delay would be so insignificant in comparison to the processing time from the microcontroller that it there would be too much error. We believed that IR was the best option financially and accuracy-wise. The method decided upon was to use two IR detectors mounted on stepper motors that would rotate 180 degrees. We will be able to find the angles from these two detectors and then triangulate to find the distance to the transmitter.

Figure 5.3: PCB for Stepper Motor Driver

III. CONCLUSION Work still needs to be done before the Cart-a-Long can be used commercially. The scope of the project was limited due to budget and time constraints, so there are a few areas that were overlooked. Our system concentrated on the tracking and positioning of the robot. However, we would still need obstacle avoidance and better path planning, if Cart-a-Long were to operate in a real world setting. The system is composed of the infrared bracelet, the infrared detection and the motor controls. The IR detection triangulates to find the position of the IR source. The motor controls systems uses this position to determine the movement of the robot. Our team successfully developed each individual subsystem, but were unable to integrate them. The IR detection system is able to detect the IR bracelet. The robot moved very well to a manually inputted location. Our single point of failure was that the Arduino for the IR detection system failed to send information to the motor controls system. We were able to implement the robot well within our budget constraint of $500, the system as a whole cost only $380. With more time and resources put for things like motors and base design we can carry a much larger payload and have a sturdier platform to carry things in. Much of this project could be used or improved upon by future ECE students.

IV. APPENDIX

A. Application of Mathematics, Science, and Engineering. Material from the following courses were used: 1. Physics 151:

Figure 6.1

Determining which motor will give us our desired speed and acceleration. Determining the velocity of the wheels with the rotary encoder

2. ECE 323:

Using electronic components and soldering them. Using the oscilloscope to test the IR sensors
Figure 6.2

3. ECE 354: A large portion of this project was programming the IR detection system and the motor controls in C programming language. 4. CMPSCI 603 + ECE 580:

Designing a motor controller for a 2-wheel differential drive robot.

B. Design and Performance of Experiments, Data Analysis and Interpretation A crucial part of the system was getting accurate IR readings from our sensors. The first test we ran had the IR-Detection System return the angle at which it detected the IR. For this experiment, the IR was placed at 90 from the sensor. The independent variable was the distance at which the IR was placed from the sensor. Figure 6.1 and 6.2 show the results. From the data, we notice a trend of an error of about six to seven degrees. For the next experiment, the distance of the sensor away from the infrared led was kept at six feet while the angle at which the IR led was varied. For this experiment, triangulation was also performed from the angles received. There wasnt any conclusive evidence for a correlation between the error of the angle and the angle of the IR led was facing the IR sensor.
Figure 6.3

Figure 6.4

8 to use by people from all age groups. This means that there must be simplicity at the user level. There is also a health and safety constraint. Although wed like the robot to travel at high speeds, it is autonomous and thus capable of becoming out of control. Precautions were taken to limit the speed so that any possible fault in the AI will most likely not lead to injury. Therefore, the robot attempts to travels with the user at a comfortable walking pace of 3 mph. In order to ensure that the user is not lost by the robot, the pattern and angular velocity of the stepper motors was strategically chosen. Assuming the user will not exceed 3 mph, to prevent the user from being able to leave the range of the sensors before a reading is taken, the motors sweep 180 degrees in .9 seconds or less which corresponds to 33.3 rpm. Since our robot is designed to carry groceries, the motors were chosen to haul potentially heavy loads. This required careful consideration when choosing which motors to use to achieve the optimal balance of power, torque, speed, and acceleration. They have enough rpm to move the robot at 3 mph which corresponds to 166 assuming 6 in. diameter wheels. We also wanted the robot to be able to accelerate to this speed in less than 3 seconds, which influenced our choice for the torque of the motor. D. Multi-disciplinary Team Functions

Figure 6.5

Figure 6.6

C. Design of System, Component or Process to Meet Desired Needs within Realistic Constraints The system requirements include the requirements of the infrared detection system and the requirements of the robot system. For the infrared detection system, the user wears a bracelet surrounded with IR LEDs around the ankle. The bracelet is lightweight and has an active life of about 4 hours. The system involves human interaction so the bracelet is safe and comfortable. The infrared detection system detects the infrared bracelet at a distance of 10 feet. The robot attempts to stay within 4 feet of the user. The robot's battery life is approximately 2 hours. Our system has a few limitations initially in order to keep the project within our realistic capabilities with respect to time and budget. The real-world constraint weve putting on our system is the environment in which this system will be operating in. Cart-A-Long will be used in an open/empty room. This restriction simplifies the project, because we didnt have to address the concerns of interference from walls. Also, we did not have to be concerned with obstacle avoidance. As a consumer device we also desire for our robot to be easy

Michael Bigos, EE&CSE: Implemented the IR scanner and algorithm to determine position and direction. Jaret Doiron-LaRue, CSE: Researched motors for base movement and worked on calibrating IR detectors/receivers with Eric. Worked on IR Detection System and Motor Controls. Richard Mui, CSE: Maintained the teams website. Constructed IR Bracelet. Collected and analyzed data. Eric Wu, EE: Researched IR sensors, stepper motors, and motor drivers. Designed PCB and worked on IR Detection System.

9 E. Identification, Formulation and Solution of Engineering Problems A problem we encountered was the interference from other infrared sources. To minimize interference, we used the same techniques that household remotes use, which is to pulse the emitters at a certain frequency, and utilize a bandpass filter at the detector. By doing this we not only minimize IR noise, but made our parts selection a lot easier, due to the multitude of off the shelf detectors and emitters used for televisions and remotes. Determining the position of the user was also a very difficult task. It was vital that we could track the user with a high level of accuracy. We increased the accuracy though a number of different ways such as changing around the shielding or our IR detectors and changing our tracking algorithm. The shielding allowed us to concentrate the detection angle into a very narrow width, so it was much more precise. Our algorithm was improved such that it calculates multiple points of detection and uses an average to get a more accurate position. The result was an improvement from about +/1 foot of accuracy at 4 feet distance, to about 4 inches of accuracy at the same distance. Furthermore, we needed the tracking system to work as quickly as possible, so it can relay new positions to the robot. This was improved by sweeping sectors that the user was last in, instead of doing a full 180 sweep. informally, based on who was working with whom at the time. We would less occasionally have full group meetings in which we would discuss the coming couple of weeks and what needed to be done. H. Understanding of the impact of engineering solutions in a global, economic, environmental and societal context. Our project aims to influence manufacturers of shopping carts to design and produce Cart-A-Long with greater capabilities such as obstacle avoidance and the ability to operate with signal reflections from walls, and the ability to carry heavier payloads that may be a burden to carry normally. This will make the shopping more enjoyable which in turn will have a positive impact on society. This will have a direct impact on the economy. Our technology has special applications for the physically impaired whose shopping experience may be hindered by their limited mobility. We created a survey via SurveyMonkey.com asking two questions shown in Figure 6. The results from the poll indicate that the majority of people believe that Cart-A-Long will be helpful to their shopping experience. This poll also indicates that 30.3% of people would go shopping more often with such a technology. Using random sampling, the poll should be an accurate representation of the much larger population. If this is the case, then Cart-A-Long could be part of the solution to the economic crisis. I. Application of material acquired outside of coursework. 1. The product manuals and datasheets (1,2, 3, and 4 listed under references), were used to help us understand how to use each component. 2. The use of Arduino embedded system technology. Knowledge of using this was acquired while working at M5. 3. Learning HTML coding from online resources to program the team website. We also had to learn how to upload a website concurrently. 4. Designing PCB

F. Understanding of professional and ethical responsibility During the development of this system, we knew we had to implement obstacle avoidance in the environment we wanted our system to operate in. This was necessary to ensure the safety of other people in the area. This problem was avoided by forming constraints in the environment in which this system would operate in; this being an open room. Further constraints were added to the robot to improve safety, such as limiting the speed to about 3mph, so that it will not cause serious injury upon impact with a person. G. Team Communication There are weekly scheduled team meetings at 2:30p.m. on Fridays with our SDP advisor: Professor Pishro-Nik. During these meetings, we discuss the progress that has been made and any questions or concerns are addressed. Due to the fact that we live closely to each other, we often would meet

10 J. Knowledge of Contemporary Issues The economy of the United States has been sluggish for the past few years. The United States is over 13 trillion in debt. Many companies are cutting jobs. With no trust in the economy, Americans are shopping with less frequently. The poll we took shown in Figure 7 shows that a significant portion of the population would want to shop more if Cart-A-Long was available. REFERENCES: [1] Infrared Emitter Datasheet http://www.sparkfun.com/datasheets/Components/L TE-302.pdf [2] Infrared Detector Datasheet http://www.vishay.com/docs/81926/tsop4038.pdf TR-301.pdf [3] Stepper Motor Datasheet http://www.sparkfun.com/datasheets/Robotics/SM42BYG011-25.pdf [4] Atmega 128 Datasheet http://www.datasheetcatalog.org/datasheet/atmel/2467S. pdf [5] DC Motor Guide http://lancet.mit.edu/motors/motors3.html#tscurve [6] Differential Drive Robot Movement Tutorial http://rossum.sourceforge.net/papers/DiffSteer/DiffSteer. html

K. Use of modern engineering techniques and tools 1. We used the Arduino embedded system platform to program the algorithm for infrared detection. It controls the stepper motors and takes information from the motors and sensors to determine the angle and distance of the user. 2. Used a multimeter to get measurements on output of the infrared sensor. This is the only way to find whether the sensor is reading or is unable to read any IR. 3. Used function generator to input AC voltage with custom amplitude and frequency.

Figure 7

Anda mungkin juga menyukai