![]() |
![]() |
|
| وبلاگ جامع مهندسی برق |
IntroductionAs our final project, we decided to design and build a robot capable of vacuuming the floor of a room or area without any human interaction other than just starting the unit. We realized the need for a cheap and convenient product that can be easily used to vacuum a room on its own, saving a person valuable time.
The robot is programmed to sense the direction of a collision with an obstacle using an onboard accelerometer. If the robotic vacuum hits an object head-on, it backs up and changes direction. If an obstacle is hit at an off-angle, the robotic vacuum turns away from the direction of the impact. The robotic vacuum’s movement is based upon a random walk around a room, which theoretically will cover the entire area of a room given enough time. The robot is programmed to drive straight until an obstacle is hit. At that point, it will turn and continue driving straight until another obstacle is hit, and so on. High Level Design
Our project was inspired by an existing robotic vacuum cleaner, the Roomba®. Current robotic vacuum cleaners on the market, produced by iRobot and Electrolux, can cost up to $1700. The idea of a designing and building a device that can perform the same functions as the existing market brands on a budget of $50 was a challenge that we wanted to take on.
A block diagram for the entire system is shown in figure 3, followed by the descriptions of the components.
Figure 3. Logical block diagram of the robotic vacuum.
The 9V battery clip can hold one 9V battery. The clip contains a 3V output, which is connected to the accelerometer's Vcc connection. The Mega32 MCU is directly connected to the battery on the battery clip. The signal from the accelerometer is inputted into the MCU's analog to digital converter. The x-axis output is sent into port A0, and the y-axis output is sent into port A1 on the Mega32. After several calculations are made, the MCU sends the appropriate commands to the stepper motors and DC motor. The stepper motors and DC motor are connected to a 9.7V 3200mAh battery pack due to the current demands of the motors. The stepper motors are used to drive the robotic vacuum, so wheels are attached to the axels. The DC motor controls the spinning carpet sweeper brush.
The initial design of the robotic vacuum included two DC motors as the driving motors. However, their implementation would have been more difficult than using the stepper motors because of the requirement of additional hardware like an H-bridge for each motor to allow forward and reverse motion. DC motors are also imprecise, and it would have been very hard to determine how fast or far each wheel had turned without the use of Hall-effect sensors. Because stepper motors can be very precisely controlled, and spun backwards and forwards without the need for any circuitry other than a ULN2003 Darlington array chip, it was decided that stepper motors were ideal for this project.
Every device used in the development of our robot will have already passed IEEE compliance standards, so we do not need to worry about any such technical issues. No other standards apply to this project.
Our product, if placed on the market, would be in direct competition with similar vacuum cleaners produced by iRobot, Karcher, and Electrolux among a variety of other brands. All the products are similar in size, shape and function. However, the algorithm used by our vacuum cleaner to vacuum a room is unique to our bot. The Roomba®, iRobot’s vacuum, for example, follows a snail-shell pattern outwards from its current position and uses a type of sonar until it finds a wall to follow, after which it bounces off of obstacles in a similar manner as our robot. The Electrolux brand uses a type of radar to map a room and avoids colliding with obstacles altogether.
Back to TopHardware DesignThe body of the robotic vacuum is composed of a circular piece of foam board, onto which all the components are attached. Along the diameter of the circle are the two stepper motors and wheels. The motors are mounted to the underside of the unit with aluminum brackets and the wheels are glued onto the shaft of the stepper motors. At the rear of the robotic vacuum lies the third supporting wheel, which spins freely in all directions. All the wheels were taken from an old, broken office chair. The supporting wheel’s shaft, which points vertically, is secured with hot glue so the rear wheel does not wobble as it turns. Figure 4 shows the labeled physical components placed on top of the robotic vacuum.
Figure 6. Internal view of carpet sweeper and DC motor.
The custom PC board was built to the specifications provided on the ECE 476 web page. An AT Mega32 MCU was placed on the board to allow the robot to run completely independent of the STK500 board. The circuits necessary for the implementation of this project included an opto-isolated amplifier circuit for the DC motor, and the use of two ULN2003 Darlington high-current amplifiers for the stepper motors. Because the stepper motors are run with pulses rather than a continuous stream of current, like the DC motor, an opto-isolated circuit was not deemed necessary. Figure 7 shows the pinout diagram for the ULN2003 chip. Pins 9 and 8 were connected to the positive and negative terminals of the 9.7V battery pack, respectively. Appendix B shows the complete system schematic.
Figure 7. Pinout for the ULN2003 Darlington array chip.
The accelerometer was hot-glued to the center of the foam-board body. With this placement, accurate readings of front and side collisions would be detected. The 9V battery clip was placed off to the side to be able to power both the custom PC Board and the accelerometer. The PC Board can take anywhere from 9V to 12V for power, and the accelerometer uses 3V as its input. With these restrictions in mind, we connected the 9V battery directly to the custom PC Board, and used the 3V regulated output from the 9V battery clip to power the accelerometer. Figure 8 shows the pinout for the MMA6261 x-y accelerometer.
Figure 8. Basic connections for the MMA6261 accelerometer.
When mounting the accelerometer, we debated filtering the output signal to reduce the level of noise coming from it. The noise, as seen in Figure 9, is caused by the pulsed stepper motors and the spinning of the sweeping brush. We decided not to filter the output of the accelerometer for fears of filtering out the collision spike, and decided instead to use threshold voltages to detect collisions. The background noise of the motors can be neglected, and only if the accelerometer output passes certain threshold values is a collision detected. Figure 9 shows the x and y-axis outputs from the accelerometer, read with the oscilloscope. The top output displays the x-axis, the left and right directions of the robot, and the bottom output represents the y-axis accelerometer, the forward and backward directions, while all onboard motors are running. Clearly, the movement of the motors cause a larger amplitude signal in the y direction than the x direction. There are currently no collision spikes on the screen output, but when a collision occurs, a clear spike can be seen on the screen. The zero-g output for both axes is approximately 1.48V according to the MMA6261 data sheet, and both signals are centered around that value.
Initially, we wanted the robotic vacuum to have 4 wheels, two driving wheels and two supporting wheels. Our intention was to use a potentiometer and use the analog-to-digital converter to convert the voltage drop across the potentiometer into a precise direction for our unit. One of the main issues with achieving this goal was detecting the direction of the wheel using the potentiometer. Using a standard chair wheel, we hot-glued the metal free-spinning shaft to the wheel so that the wheel could not spin separately from the shaft. Then we glued the potentiometer to the end of the wheel and supported the potentiometer in a way such that when the wheel turned, the potentiometer dial was turned by the shaft.The main reason this approach failed was because the wheel needed to be perfectly vertical in order to spin freely without the free-spinning shaft. This was unattainable using foam board, so we machined several pieces of metal for our purposes to glue onto the foam board. Because the metal was to be mounted on foam board, and the other wheels were not perfectly aligned, this approach failed again.
Our last attempt at using a fourth wheel was to create a body for the unit machined entirely out of a circular piece of metal. This would ensure that the wheels would be perfectly aligned. However, after visiting the machine shop, the only available piece of scrap metal that was suited for our purposes was a steel “donut,” which had a hollow center. This piece of metal was machined correctly, but the weight of the entire robot proved to be too much for the stepper motors to be able to drive. Had a suitable piece of aluminum been found, the weight of the metal might not have been an issue. After this final attempt, however, the idea of determining direction was scrapped. It was decided that even with the inconsistencies in the stepper motor torques and wheel slippages, because we decided to use a random walk technique, the exact direction of the robotic vacuum was inconsequential.
Towards the completion of the project, a thin, rectangular sheet of iron was placed around the front of the robotic vacuum to be used as a large bumper, capable of hitting obstacles near to the floor and obstacles an inch above the robotic vacuum’s circuitry. This metal bumper added too much weight for the stepper motors to drive, so it was removed.
Back to TopSoftware DesignOur code uses a 4 millisecond time base to precisely determine system timing and ensure that a new analog conversion will be ready in each new interrupt. When the power is initially turned on to the system, a 5 second pause takes place before any of the motors start. Because of the sudden jerk caused by the motors, we placed an additional 2 second delay on the start of the collision detection system. The collision detection system uses Port A on the Mega32 chip, and cycles between Port A0 and Port A1, which are connected to the x axis and y axis of the accelerometer, respectively. The port switching takes place every interrupt cycle, and samples the output of the accelerometer. Threshold conditions are put in place such that if a spike output occurs from the accelerometer, the system captures the spike and ignores any consequential spikes afterward for a set amount of time. If only the y axis produces a spike, it is clear that a head-on collision has occurred. An off-center collision occurs if the y axis and x axis spike is initially above or below a certain threshold voltage. As soon as a threshold value is reached, a collision is considered to have occurred, and the ADC is ignored until the appropriate turning action is performed by the robotic vacuum. To control the DC motor that controls the brush, a pwm pulse is generated, using a 50ms period. For 5ms out of 50 ms, Port D is turned on, turning the motor on. For 45 ms out of 50 ms, Port D is turned off. Surprisingly, only this 5 ms pulse is necessary to power our motor and give it enough torque to spin nicely. The reason the motor had to be pulsed is that the motor is ridiculously powerful for its purpose, so aside from connecting it to a lower voltage power supply, which was not feasible, we had to pulse the motor. The pulsing also helped with heat issues that are explained the Hardware Design section. Two functions exist, forward() and backward(), which consist of a series of output states for the stepper motors. It is possible to spin each motor independently of the other using these two functions. Stepper Motor Data Sheet, provided in the References section, was used to determine the exact sequence of outputs to the stepper motor. In order to turn the unit after a collision, one of the wheels is set to reverse while the other wheels remains moving forwards. We actually noted that the IntelliBot group used similar stepper motor code to what we needed. Our stepper motors have a slightly different sequence than the motors used by the IntelliBot team, but they used a clever approach, which we imitated, to their forward() and backward() outputs. During a spin, the sweeper brush is turned off so as not to interfere with the spin. We calculated that there are about 48 steps per revolution, taking into account the angle per step of the motor and the circumference of the wheel attached to the motor. With that in mind, we decided not to have the robot turn exactly 90 degrees no matter what kind of collision occurs. If an off-center collision occurs, the unit will spin 80 steps, or about 75 degreees. In a head on collision, the unit will spin 110 steps, or about 103 degrees. These numbers were somewhat arbitrary, but we wanted the angles to be large enough to avoide a second collision with the same obstacle. Initial testing of the stepper control functions was performed using the STK500 board. Because the board had pushbuttons , we used the pushbuttons to test out the turning functions, as well as the optimal speeds we would want our unit to run at. Initial calibration took place before the individual components were placed onto the body of the robot. Back to TopResultsEven with our simple algorithm, our robot is able to cover large floor areas as well as find its way into and out of small corners. As the robot randomly traverses the room, the sweeper installed underneath manages to pick up a significant amount of dirt. Emptying the catch bin after a few minutes of testing is proof that although the sweeper might not be picking up everything in sight it clearly pulls in enough grime to be considered a success.
There are, of course, occasions in which the robot behaves somewhat unpredictably. Early on in testing, scope outputs of the accelerometer after a collision indicated that there would be a certain amount of uncertainty. This is because the waveform resulting from a collision is not a constant, but instead the output is a damped oscillation with significant voltage swings above and below the mean. The frequency of this oscillation, however, was relatively slow and a high sampling rate generally sufficed to catch the first spike, at which time we set a timer to ignore the rest of the oscillation, usually about 100 milliseconds. With some tuning we were able to maximize the chance of detecting the correct direction from the accelerometer. Since our algorithm is essentially a random walk through the room we decided that the occasional errors were acceptable.
Perhaps the most significant obstacle we faced was that of producing the necessary torque to reliably move the robot with the sweeper, which inherently produced a large amount of friction. That friction, combined with our less than ideal wheels, foam board chassis, and the limitations of battery power, was a huge headache at every stage of the design and remains the largest hindrance to the robot’s reliability. The help with this problem we scavenged more powerful batteries from old radio controlled cars, spent hours fussing with the height of the sweeper off of the ground, experimented with different traction methods on the wheels, and shifted weight around the body of the robot. However, the most significant design change was to add a DC motor to help drive the sweeper brush while the robot moved forwards.
Since our robot was completely self contained and running off of its own power, safety was not as much an issue as if our project utilized a house current power supply. There is, however, a relatively large amount of current sourced to the three motors which required that we use proper circuitry capable of providing that current with no danger of burning themselves, the microcontroller, or the user, of course. The robot operates with no human interaction and so the user interface consists of a simple switch. We programmed a ten second wait time after being turned on prior to starting to give the user time to put down the robot before the wheels and sweeper begin to turn.
Back to TopConclusionsSince our robot essentially mimicked the random walk algorithm incorporated in the most common commercial automatic sweeper, the Roomba, we can say from experience that the electronics required to implement such a design were certainly within our ability to reproduce for this project. However, the mechanical aspects were very difficult to perfect in our rough prototype. Since commercial robots are manufactured from robust materials it is no surprise that they would probably be more reliable than our home made sweeper robot. That being said, since the mechanical side of the project became more of a challenge as time went on if we were to do this again we would start with more robust parts, specifically wheels, and be slower to rush to the glue gun to stick things together.
We used the some of the movement and collision aspects of the Roomba, a robot sweeper that currently sells for around $300, but because we built our robot without ever having actually used or taken apart a Roomba, and also because our robot uses accelerometers to detect collisions (the Roomba uses a front bumper) our design is sufficiently different to avoid any patent or intellectual property issues. We would, however, like to thank the designers of the IntelliBot (Spring, 2003) for the help that their final report provided with stepper motor operation. The driver code that we used for our own steppers was very similar because we couldn’t see any cleaner or more efficient way to drive them.
We strove to comply in any way possible to the following ten IEEE ethical guidelines:
1. to accept responsibility in making decisions consistent with the safety, health and welfare of the public, and to disclose promptly factors that might endanger the public or the environment. Although our design is very safe because of the nature of its self contained power we were very cautious during the testing when using any significant power supply to source current to our motors. When constructing our circuit, we were careful to avoid possible short circuits across the motors which we know to be pulling the most significant current.
2. to avoid real or perceived conflicts of interest whenever possible, and to disclose them to affected parties when they do exist; Our interest was to create a carpet sweeping robot. Since we worked independently from other groups this was not in conflict with others. We documented in full the abilities and shortcoming of our project in this report. At no point did we consider bribery as a viable alternative to the completion of this project. What we learned in designing this robot will be applicable to many other projects in the future and we will be more ready at that time to contribute and improve.
6. to maintain and improve our technical competence and to undertake technological tasks for others only if qualified by training or experience, or after full disclosure of pertinent limitations. Again, this project served as a learning experience but at no time did we overstep the boundaries of safety given our current knowledge because we were working on a relatively low power consumer device.
7. to seek, accept, and offer honest criticism of technical work, to acknowledge and correct errors, and to credit properly the contributions of others; We attempted to help other groups whenever we could offer it and certainly acknowledged any criticism from others that would help us towards our final goal.
8. to treat fairly all persons regardless of such factors as race, religion, gender, disability, age, or national origin; No persons were treated unfairly during the course of this project.
At no point was the construction of our project driven by malicious motives. We hope that allowing public web access to this report with help future semesters of students interested in pursuing similar projects.
Back to TopAcknowledgementsWe would like to thank everyone from ECE 476 that spent time in the lab towards the end of the semester because everyone helped us out either morally or technically. Certainly worth mentioning however, are Professor Bruce Land, our TA Ryan Peterson, and all of the other TAs who combined to keep the lab open almost whenever I could get myself to Phillips to work and provide a continuous supply of answers to our never ending questions. Thanks also to anyone out there who puts schematics of their circuits online for the public to use (especially past 476 people, including the makers of the IntelliBot). I can’t imagine what it would be like to design a complicated system without all of the information that’s out there today. Back to TopReferencesULN2003 Data Sheet (ortodoxism.ro) MMA6261 Data Sheet (alldatasheet.co.kr) Stepper Motor Reference Sheet (allelectronics.com) |
|
صفحه نخست پست الکترونیک آرشیو |
| درباره وبلاگ |
محمد & جمال
خراسان رضوی - يزد رشته مهندسی برق اختراع برق باعث دگرگونی صنعت در ابعاد مختلف شد. برق یعنی زندگی MHM_223_it@yahoo.com Electrical engineering, sometimes referred to as electrical and electronic engineering, is a field of engineering that deals with the study and application of electricity, electronics and electromagnetism. The field first became an identifiable occupation in the late nineteenth century after commercialization of the electric telegraph and electrical power supply. It now covers a range of subtopics including power, electronics, control systems, signal processing and telecommunications. Electrical engineering may or may not encompass electronic engineering. Where a distinction is made, usually outside of the United States, electrical engineering is considered to deal with the problems associated with large-scale electrical systems such as power transmission and motor control, whereas electronic engineering deals with the study of small-scale electronic systems including computers and integrated circuits.[1] Alternatively, electrical engineers are usually concerned with using electricity to transmit energy, while electronic engineers are concerned with using electricity to transmit information. |
|
RSS
|