Saturday, May 10, 2014

Trial Prototype

Model of Floor Cleaner Robot


The model of FCR in SolidWork:


Figure 1: Model of FCR in SolidWorks


The model of FCR in real:





Figure 2-5: Model of FCR in real

Results and discussion

The FCR is able to successfully navigate the way to complete the floor cleaning task. It also maintains the orbit that is programmed when doing the task. Moreover, it also success in avoid some obstacles in the testing environment and can be auto stop when the finishing the task. However, compass measurement errors sometime take the FCR more time than expected to turn in right direction. Besides that, the mechanical design and PID algorithm errors also affect to FCR, make it does not move in a straight line.

In the first test case, a room with no obstacle, the FCR can be work in stable. It can be cleaning almost the area of the room, except some area near the wall. When increasing the obstacle in the room, the FCR also completes the task. But it can be seen that, in more and more complicated environment with many obstacles, the area that not be cleaned will be increase. So it is the big challenge that must be resolved in the future to make the FCR become more stable and can adapt any environment. 

The video of testing FCR prototype can be found at the following link:

Future works

After constructing and experiment the model of Floor Cleaner Robot, it can be seen that the FCR can adapt in some ease testing environment. And to make this model become more stable and adapt any working environment, there are many things to do in the future. This section discusses of the robot have not yet been implemented, but should be to complete the full functionality of FCR.

Structure

  • Self-preservation
An important feature that needs to be implemented for FCR success is that of knowing when it is in danger. This danger can come either from external sources, such as a pet or stairs, or internal sources, such as battery drain. Although relatively straight forward in nature, each of these problems can cause complications hindering overall performance.
If a curious puppy or a vindictive cat decides to investigate the robot, how will it handle itself? Although it is very low to the ground and stable on its own right, the pet could easily push the robot off its course. The robot can use the infrared sensor to determine when the pet or human come to and have the solution such as turn off system to protect human and pet or try to avoid by create the new path working. Of course, a determined animal will not be deterred by these actions, so the robot would then just aim to be still until the animal got bored. Ideally, nay owner would first acclimate the pet to the robot’s presence before letting it operate without supervision.
As for the presence of stairs in the environment, adding another short-range distance sensor to the front of the robot looking downwards would detect changes in elevation well before the robot was in danger of passing over it. Assuming that the robot is initialized on a flat surface, it can then calibrate its own sensor to determine the default value. Then any deviation can be recognized as an indicator of physical danger and avoidance routine instated
A more complicated matter is how to monitor and conserve battery levels. There are chips on the market that provide an indicator of the voltage output from a battery pack. One in particular is MAX832 chip, produced by Maxim, which can switch between two separate battery packs when necessary. This chip can also recharge the batteries when is senses the presence of an AC power source. Recognizing when battery levels are low is relatively straight forward using this off-the-shelf microchip. Getting the robot find an available AC source on its own, however, is a whole other problem.
  • Reduce size and weight of FCR
The problems of FCR are very big and heavy. FCR is difficult to clean all area of room. It cannot move under obstacles such as bed, table, and cabinet. Another hand, reducing the weight of FCR is necessary.
Solution:
      - Using small battery instead of big battery.
      - Change the design or form of FCR

Algorithm

  • Returning to home base
Having the robot know where it came from and able to return to that same location is very difficult problem. There are several paths to finding a solution, but determining which path depends on several philosophical factors. For instance, the robot could “remember” where it came from, either by building a map, recording the set of moves that it took so get where it was, or by leaving breadcrumbs. What these solutions have in common is that they all require some form of memory and for meaningful information to be retained for significant duration. If the decision is made not to rely on complex memory structures, an organic approach could be implemented by installing a beacon of sorts that draws the robot back to its starting point, also the location of its battery charger.
In keeping with the smile to nature that is behavior-based AI, one must first decide if simple creatures use memory or beacons to find their home after a long day exploring. Whether animals use landmarks in the environment, remember the movements of their body, or leave signs for themselves along their path varies from species to species. The complexity of these techniques also varies, as does the reliability. For instance, human are known to navigate by landmarks, but then, we also have very large brains that can remember the details of a wide variety of objects and how to differentiate them from other, similar objects. Honeybees can communicate the locations of food sources several miles away by way of a complicated “dance” that conveys information about which direction to fly and when to turn. And the humble ant is able to lead others to food and to find its way back to its colony by depositing pheromones along its trail
Although the method used by the ant to modify its environment in a way only it personally could is simplest of the three, it is not acceptable for a robot to alter its surroundings in a physical, and therefore sense-able, way. A more practical method might be to install a beacon of sorts at the home location whose attraction supersedes that of sunlight as the batteries run down. Grey Walter took this approach when he was designing his MachinaSpecualtrix. As the batteries ran down however, the photocells became less sensitive and more brilliant sources became attractive. By design, the robots’ hutches were lit by a bright bare light bulb. Thus the hutches became the most attractive area in the environment, and the robots appeared to know to go home for sustenance when their energy levels were depleted. FCR can use an RF beacon to be guided it back to its home location based on signal strength.

Sunday, April 20, 2014

Hardware and Software Design Continue...

Software system 

  • Algorithm diagram

The path planning of mobile robot is determined and constructed like the Figure 1 and Figure 2.
Figure 1: Path working of robot when floor don’t have obstacles
Figure 2:. Path working of robot when obstacle detected

Base on the path planning, the algorithm used to control the motion of mobile robot was built.
Algorithm diagram of Slave Chip:

Algorithm diagram of Master Chip:

  • Coding


PID motor code:
void getMotorData() 
{                                                       
  speed_act1 = ((count1 - countAnt1)*(60*(1000/LOOPTIME)))/(424);         
  countAnt1 = count1;
  speed_act2 = ((count2 - countAnt2)*(60*(1000/LOOPTIME)))/(424);                 
  countAnt2 = count2;  
}

int updatePid1(int command1, int targetValue1, int currentValue1) 
 {            
float pidTerm1 = 0, intergral1 =0, derivative1 = 0;                                                           
int error1=0;                                 
static int last_error1=0;                            
    error1 = abs(targetValue1) - abs(currentValue1);
    intergral1 = intergral1 + error1/10;
    derivative1 = (error1-last_error1)*10;
    pidTerm1 = (Kp1 * error1) + (Ki1 * intergral1) +(Kd1 * derivative1);                           
    last_error1 = error1;
    return constrain(command1 + int(pidTerm1), 0, 255);
}


Sensor SRF05 code:
#define ECHOPIN 2
#define TRIGPIN 3
#define ECHOPIN1 4
#define TRIGPIN1 5
int distance,distance1;
intbuf[3];
void setup() {
Serial.begin(9600);
pinMode(ECHOPIN, INPUT);
pinMode(TRIGPIN, OUTPUT);
pinMode(ECHOPIN1, INPUT);
pinMode(TRIGPIN1, OUTPUT);
}
void get_distance()
{ digitalWrite(TRIGPIN, LOW);    // Set the trigger pin to low for 2uS
delayMicroseconds(2);
digitalWrite(TRIGPIN, HIGH);   // Send a 10uS high to trigger ranging
delayMicroseconds(10);
digitalWrite(TRIGPIN, LOW);    // Send pin low again
  distance = pulseIn(ECHOPIN, HIGH);   // Read in times pulse
  distance = distance/58;
  delay(500);
//  Serial.print("distance: ");    Serial.print(distance);
}
void get_distance1()
{ digitalWrite(TRIGPIN1, LOW);    // Set the trigger pin to low for 2uS
delayMicroseconds(2);
digitalWrite(TRIGPIN1, HIGH);   // Send a 10uS high to trigger ranging
delayMicroseconds(10);
digitalWrite(TRIGPIN1, LOW);    // Send pin low again
  distance1 = pulseIn(ECHOPIN1, HIGH);   // Read in times pulse
  distance1 = distance1/58;
  delay(500);
//  Serial.print("  distance1: ");    Serial.println(distance1);
}


Sensor HMC5883l code:
void get_y()
{
   if (i<=0)
    {
       Vector norm = compass.readNormalize();
        y0 = norm.YAxis;
        float heading = atan2(norm.YAxis, norm.XAxis);
              float declinationAngle = -0.025;
        heading += declinationAngle;
              if (heading < 0)
           {  heading += 2 * PI; }
         if (heading > 2 * PI)
            {  heading -= 2 * PI;  }
     angle0 = heading * 180/M_PI;
         angle2 = angle0+90;
         if (angle2 >= 360)
              { angle2=angle2-360;}
           angle3=angle0+180;
           if (angle3 >= 360)
              { angle3=angle3-360; } 
           angle4=angle0+270;
           if (angle4 >= 360)
              { angle4=angle4-360; } 
           angle1 = angle0;
           if (angle1 >= 360)
              { angle1=angle1-360;}
           i = i+1;
       }
  if (i>=1)
 {
     Vector norm = compass.readNormalize();
      y1 = norm.YAxis;
      float heading = atan2(norm.YAxis, norm.XAxis);
      float declinationAngle = -0.025;
             heading += declinationAngle;
             if (heading < 0)
                {  heading += 2 * PI;  }
         if (heading > 2 * PI)
                {  heading -= 2 * PI;   }
             angle = heading * 180/M_PI;
             i = i+1;
     }
}


Code for Processing:
void cmd_process()
{   switch(count)
      {
            case 1:  {
                             motor_forward();
                             break;
                         }
            case 2:  {
                            Serial.end();
                            motor_stop();
                            delay(500);
                            if (y1<(y0-40))
                             { motor_right();
                                Serial.begin(9600);
                                break;
                             }
                            if (y1>=(y0-40))
                             {  motor_left();
                                 Serial.begin(9600);
                                 break;
                              }
                          }
            case 3:  {
                            Serial.end();
                            motor_stop();
                            delay(500);
                            motor_turnr();
                            Serial.begin(9600);
                            break; 
                          }
            case 4:  {
                            Serial.end();
                          motor_stop();
                          delay(500);
                          motor_turnl();
                          Serial.begin(9600);
                          break;
                        }
            default:{
                          motor_stop();
                          break;
                         }
           }
    }

The code for master and slave chip can be downloaded with this link below.

Sunday, March 2, 2014

Hardware and Software Design

Hardware system

  • Micro-controller (2 Arduino Uno Boards)

Arduino is a single-board microcontroller to make the use of electronics in multidisciplinary projects more accessible. The hardware consists of an open-source hardware board designed around an 8-bit Atmel AVR microcontroller, or a 32-bit Atmel AVR. The software consists of a standard programing language compiler and a boot loader that executes on the microcontroller.
Figure 1: Arduino Uno Board

Figure 2: Arduino Uno pins

  • 2 Ultrasonic sensors (SRF05)

The SRF05 is an evolutionary step from the SRF04, and has been designed to increase flexibility, increase range, and to reduce costs still further. As such, the SRF05 is fully compatible with the SRF04. Range is increased from 3 meters to 4 meters. A new operating mode (tying the mode pin to ground) allows the SRF05 to use a single pin for both trigger and echo, thereby saving valuable pins on your controller. When the mode pin is left unconnected, the SRF05 operates with separate trigger and echo pins, like the SRF04. The SRF05 includes a small delay before the echo pulse to give slower controllers such as the Basic Stamp and Picaxe time to execute their pulse in commands.
Figure 3: Ultrasonic sensor SRF05

Mode 1 - SRF04 compatible - Separate Trigger and Echo:
This mode uses separate trigger and echo pins, and is the simplest mode to use. All code examples for the SRF04 will work for the SRF05 in this mode. To use this mode, just leave the mode pin unconnected – the SRF05 has an internal pull up resistor on this pin.
Figure 4: Ultrasonic sensor SRF05 Mode 1

Mode 2 - Single pin for both Trigger and Echo:
This mode uses a single pin for both Trigger and Echo signals, and is designed to save valuable pins on embedded controllers. To use this mode, connect the mode pin to the 0v Ground pin. The echo signal will appear on the same pin as the trigger signal. The SRF05 will not raise the echo line until 700uS after the end of the trigger signal. It has that long to turn the trigger pin around and make it an input and to have the pulse measuring code ready. The PULSIN command found on many popular controllers does this automatically.

Figure 4: Ultrasonic sensor SRF05 Mode 2

Calculating the distance:
The SRF05 Timing diagrams are shown above for each mode. It only needs to supply a short 10uS pulse to the trigger input to start the ranging. The SRF05 will send out an 8 cycle burst of ultrasound at 40khz and raise its echo line high (or trigger line in mode 2). It then listens for an echo, and as soon as it detects one it lowers the echo line again. The echo line is therefore a pulse whose width is proportional to the distance to the object. By timing the pulse it is possible to calculate the range in inches/centimeters or anything else. If nothing is detected then the SRF05 will lower its echo line anyway after about 30mS. The SRF04 provides an echo pulse proportional to distance. If the width of the pulse is measured in uS, then dividing by 58 will give you the distance in cm, or dividing by 148 will give the distance in inches. uS/58=cm or uS/148=inches. The SRF05 can be triggered as fast as every 50mS, or 20 times each second. It should be waited 50ms before the next trigger, even if the SRF05 detects a close object and the echo pulse is shorter. This is to ensure the ultrasonic "beep" has faded away and will not cause a false echo on the next ranging.
Connection with Arduino Uno Board:
Figure 5: SRF05 connect with Arduino Board

The position of two SRF05 sensors on the robot:

Figure 6: Position of sensors SRF05 on chassis

Two sensors SRF05 were placed in front of the FCR for avoiding obstacles purpose. It is shown in the Figure 6 by the Solidworks program.

  • Digital Compass (HMC5883l)
The Honeywell HMC5883L is a surface-mount, multi-chip module designed for low-field magnetic sensing with a digital interface for applications such as low-cost compassing and magnetometry. The HMC5883L includes our state-of-the-art, high-resolution HMC118X series magneto-resistive sensors plus an ASIC containing amplification, automatic degaussing strap drivers, offset cancellation, and a 12-bit ADC that enables 1° to 2° compass heading accuracy. The I2C serial bus allows for easy interface. The HMC5883L is a 3.0x3.0x0.9mm surface mount 16-pin leadless chip carrier (LCC). Applications for the HMC5883L include Mobile Phones, Netbooks, Consumer Electronics, Auto Navigation Systems, and Personal Navigation Devices. 

The HMC5883L utilizes Honeywell’s Anisotropic Magneto resistive (AMR) technology that provides advantages over other magnetic sensor technologies. These anisotropic, directional sensors feature precision in-axis sensitivity and linearity. These sensors’ solid-state construction with very low cross-axis sensitivity is designed to measure both the direction and the magnitude of Earth’s magnetic fields, from milli-gauss to 8 gauss. Honeywell’s Magnetic Sensors are among the most sensitive and reliable low-field sensors in the industry. 

Figure 7: HMC5883L

Arrow indicates direction of magnetic field that generates a positive output reading in Normal Measurement configuration.

Mode of operations

Continuous-Measurement Mode:
During continuous-measurement mode, the device continuously makes measurements, at user selectable rate, and places measured data in data output registers. Data can be re-read from the data output registers if necessary; however, if the master does not ensure that the data register is accessed before the completion of the next measurement, the data output registers are updated with the new measurement. To conserve current between measurements, the device is placed in a state similar to idle mode, but the Mode Register is not changed to Idle Mode. That is, MD[n] bits are unchanged. Settings in the Configuration Register A affect the data output rate (bits DO[n]), the measurement configuration (bits MS[n]), when in continuous-measurement mode. All registers maintain values while in continuous-measurement mode. The I2C bus is enabled for use by other devices on the network in while continuous-measurement mode.

Single-Measurement Mode:
This is the default power-up mode. During single-measurement mode, the device makes a single measurement and places the measured data in data output registers. After the measurement is complete and output data registers are updated, the device is placed in idle mode, and the Mode Register is changed to idle mode by setting MD[n] bits. Settings in the configuration register affect the measurement configuration (bits MS[n])when in single-measurement mode. All registers maintain values while in single-measurement mode. The I2C bus is enabled for use by other devices on the network while in single-measurement mode.

Idle Mode:     
During this mode the device is accessible through the I2C bus, but major sources of power consumption are disabled, such as, but not limited to, the ADC, the amplifier, and the sensor bias current. All registers maintain values while in idle mode. The I2C bus is enabled for use by other devices on the network while in idle mode.



Sunday, January 26, 2014

Mechanical Design Continue...

Cleaner and pump system

  • Cleaner system

The cleaner systems consist of two wiping disks and one wiping bar which placed below the chassis. The wiping disks were made from hard rubber with 14cm diameter of each disk. The rotating of the wiping disks was controlled by the 24V-12W DC motor through the pulley systems which design in Solidworks program (Figure 1). The task of wiping disks is taking dry foam rubber for dry cleaning.


Figure 1: Wiping disks

The wiping bar was made by aluminum. It was design for wet cleaning. The foam rubber in the wiping bar will be moist by the water received from pump system through the small pipe (Figure 2).

Figure 2: Wiping bar

  • Pump system

The pump system consists of water tank and small water pump which place on the chassis of the FCR (shown in Figure 3). The water tank was made from aluminum with the dimension 50mm × 210mm × 125mm. It can contain 1.3l water and detergent for cleaning task. This combination will be transmitted from the water tank to a wiping bar through a small pipe by a 12V-6W water pump. The water pump was controlled by a microcontroller to optimize the system.

Figure 3: Pump system


Figure 4: Position of pump and cleaner system on the chassis




Sunday, January 19, 2014

Mechanical Design

Based on the working purpose, the structure of the Floor Cleaner Robot must be strong, durable and balance. The four wheeled locomotion will be chosen for this robot prototype. In which two motorized wheels in the rear, two steered wheels in the front; steering has to be different for the two wheels to avoid slipping and skidding (Figure 1).

 Figure 1: Mobile robot wheels arrangement

Moreover, in order to assemble working mechanisms (such as water tank, battery, motors, wiping system, etc.) more conveniently, the aluminum frame structure was a considerable solution. For easier in floor cleaning the mobile robot must have a low center bias and the structure also must be compact and low. From those characteristic, the dimension of the FCR was estimate about 30cm in high, 30cm in width and 40cm in length. The more design detail will be discussed below.

Sunday, January 5, 2014

Basic Idea

Floor cleaning job took away a lot of time, especially in the big room, soft carpet, and wood or marble floors. It is also difficult to clean tortuous in the house like space underneath the table, bed, etc. According to those reasons, and the indispensable demand of life, the idea of design a mobile robot which cleans the floor was formed.
A Floor Cleaner Robot (FCR) is an autonomous robot that take care the house floor cleaning task. Its duty is cleaning almost the floor area of the house in the shortest time and can determine when the task completes.
The robot is designed to be easily modifiable for a given application. It is constructed using traditional prototype techniques that allow it to be built quickly and inexpensively. A novel design is utilized for the vehicle’s suspension. This design is simpler, cheaper, and more easily customized than traditional system that perform the same task.
It will plan the working path by itself to accomplish the cleaning task quickly. A new approach to obstacle avoidance is used, based on ultrasonic sensor signals. Besides that, it also using digital compass to navigation in the working environment.