Shop OBEX P1 Docs P2 Docs Learn Events
Homemade hardwood floor / laminate floor sweeping robot — Parallax Forums

Homemade hardwood floor / laminate floor sweeping robot

So this is something I would like to give a shot using the Prop. Basically the cheapest I can make this thing, the better. I am thinking about getting one of those roller brooms and attaching a robot to one to push it around. Sounds pretty simple to me so I want to start by thinking it all the way through before I move too fast. As of right now, I am thinking about how to charge this thing automatically. Maybe some kind of IR guided dock station....

So, should I use a ultrasonic ping sensor on a fixed position or would this bother my dog? I need this to detect objects accurately so it is a fool proof design. Don't want it getting stuck under the couch for hours while we are away. Any ideas or pointers?

Comments

  • How about an aluminum hoop, strap rolled on a press, like we did in shop class, making a basketball hoop out of round stock. Use some automotive side molding on it after your finished design, will save on the furniture legs.
  • kwinnkwinn Posts: 8,697
    So this is something I would like to give a shot using the Prop. Basically the cheapest I can make this thing, the better. I am thinking about getting one of those roller brooms and attaching a robot to one to push it around. Sounds pretty simple to me so I want to start by thinking it all the way through before I move too fast. As of right now, I am thinking about how to charge this thing automatically. Maybe some kind of IR guided dock station....

    So, should I use a ultrasonic ping sensor on a fixed position or would this bother my dog? I need this to detect objects accurately so it is a fool proof design. Don't want it getting stuck under the couch for hours while we are away. Any ideas or pointers?

    Put a conductive strips at 90 degrees to each other a corner. Robot drives forward into the corner and contacts along each side of the robot touch the conductive strips. If needed a sensor or switch turns on power when the robot is present. Simple and reliable.
  • kwinn, that makes sense and seems pretty simple. I was thinking 2 arms that stick out of the charging station, one side positive, one side negative. I will have to work on the design of the bot first. Sounds like I have a Walmart trip coming in my near future :) Going to need motors and wheels too. I was thinking old stepper motors for the drive wheels so it can accurately turn 180 degrees around to make another pass. Maybe I can purchase something from parallax for that part.
  • I would suggest "weak and slow" during development, if you plan to design for unattended operation. Also, it does not matter if it takes all day if it runs when your out for the day.

    It is very wise to think it through a bit before starting , every minute you spend planning saves multiple hours in fixing later.

    Consider the Neato robotic design https://www.neatorobotics.com/ These things are awesome but cost $500. We should be able to build these from parts for under $100. Maybe less if its a sweeper rather than a vacuum. This might be a good high level requirements target. If you only get half way it would still be awesome.

    These run a very efficient and thorough grid pattern, and have excellent obstacle avoidance.

    I believe they use a two point positioning system (the local radio thing), and a laser distance sensor on the bot to measure the room. The lasers I have are probably 10x overkill for a sweeper, but I don't know off cheaper solutions off hand.

    I don't think the ping would bother your dog, she could hear it (I can even hear it when by head is directly in front of it), but it doesn't make us crazy.

    Consider using IR LEDs and photo detector as proximity sensor rather than actual bump sensors. The guys in the robot club have good success with IR, and bumping looks clumsy.

    If you start with mobile part first, and add the sweeper part AFTER you have navigation down, you can use the really cheap Uln2003 Stepper Motor Drive driver and the 28BYJ stepper, these are extremely cheap and slow. Once you get a bot with these to navigate, you can upgrade as needed to something fancy.

  • Ok, I just bought a radioshack ultrasonic ping sensor and it works with the code for the Parallax Ping))). The distance seems to be good enough to use for this project so I guess I need to get some motors and 2 controllers next. Thanks prof_braino for the tip on the steppers :)
  • ercoerco Posts: 20,254
    I'd pass on those weak little steepers, they are cheap but weak and an exercise in frustration. Use good dc gearmotors or CR servos.
  • I already bought 4 of those steppers and controllers for $13 off Ebay and I think I can use them for testing the movement part. Once I get everything finished, I plan on getting CR servos and wheels from Parallax. Maybe Parallax will put them both on sale for me :)
  • Please post your progress. I gave up on a project where I made a ping sensor pan left and right to find the longest distance and then have the bot turn to that direction. When it got to the end of the hallway sometimes it couldn't get out of the corner.
    I just ordered a pair of nrf24L01 modules. I plan to put a pan-tilt camera on it this time.
  • I just got the servo working with the ping sensor tonight. Still waiting on the motors to come in. I can post the code to what I have so far. Still tinkering with directing the ping sensor in a certain area instead of the 30 degree range it has. I need some kind of enclosure around the sensor to keep it from picking up just the floor.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2015-11-08 05:36
    Here is the current code :
    CON
    
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    
      PING_Pin = 0                                          ' I/O Pin For PING)))
      LED_Pin = 1
      _SensorServoPin = 2
      _rightServoPin = 3
    
      DEBUG_BAUD = 9_600
    
      Sensor_Servo_Steps = 1_990
      _timeStepInMilliseconds = 5
      _updateFrequencyInHertz = 50
    
    VAR
      LONG  range
      LONG  Ping_Servo_control[200]
      LONG  Ping_Servo_Angle
    
    OBJ
    
      Pst           : "Parallax Serial Terminal"
      ping          : "ping"
      ser           : "PWM2C_SEREngine.spin"
      
    PUB Start
      Pst.Start(DEBUG_BAUD)                                 ' 1 cog
      cognew(move_ping_servo, @Ping_Servo_control)           ' 2 cogs
      pause(100)
      dira[LED_Pin]~~
    
      repeat                                                ' Repeat Forever
        range := ping.Inches(PING_Pin)                      ' Get Range In Inches
        Pst.dec(range)                                      ' Print Inches
        Pst.str(string(" - Angle : "))
        Pst.dec(Ping_Servo_Angle)
        Pst.str(String(13))
        if(range < 10)
          outa[LED_Pin] := 1
        else
          outa[LED_Pin] := 0
        pause(1)
    
    PUB move_ping_servo | frequencyCounter
    
      ifnot(ser.SEREngineStart(_SensorServoPin, -1, _updateFrequencyInHertz))
        reboot
    
      ser.leftPulseLength(200 + 0)
      pause(1000)
    
      Ping_Servo_Angle := 0
        
      repeat
        repeat frequencyCounter from 0 to Sensor_Servo_Steps step 10
          ser.leftPulseLength(200 + frequencyCounter)
          Ping_Servo_Angle := (((frequencyCounter * 100) / Sensor_Servo_Steps) * 18) / 10
          pause(_timeStepInMilliseconds)
    
        pause(200)
        
        repeat frequencyCounter from Sensor_Servo_Steps to 0 step 10
          ser.leftPulseLength(200 + frequencyCounter)
          Ping_Servo_Angle := (((frequencyCounter * 100) / Sensor_Servo_Steps) * 18) / 10
          pause(_timeStepInMilliseconds)
    
        pause(200)
    
    PUB pause(Duration)
      if(Duration > 0)  
        waitcnt((clkfreq / 1_000 * Duration) + cnt)
      return
    

    The servo I am using is an old Futaba FP-S148 that came from one of my old planes.
  • I am posting an update on what I have so far. I bought some of the High Speed continuous rotation servos and robot wheels from Parallax and have been testing everything on my computer desk. So far, I have been able to detect objects in a certain "angle" from the center point of the bot and slow down the travel speed as an object gets closer. My coding is probably not the best, but it works :)
    CON
    
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    
      PING_Pin = 0                                          ' I/O Pin For PING)))
      LED_Pin = 1
      _SensorServoPin = 2
      Left_Motor_Pin = 3
      Right_Motor_Pin = 4 
      
      DEBUG_BAUD = 9_600
    
      Sensor_Servo_Steps = 2_000
      _timeStepInMilliseconds = 7
      _updateFrequencyInHertz = 50
    
      Stop_Val = 1470
      Left_Full_Speed = 1300
      Limit_Speed_Range = 200
    
    VAR
      LONG  range
      LONG  Ping_Servo_control[200]
      LONG  Move_Servo_control[200]
      LONG  Ping_Servo_Angle
      LONG  Travel_Speed
    
      BYTE  Direction
    
    OBJ
    
      Pst           : "Parallax Serial Terminal"
      ping          : "ping"
      ser           : "PWM2C_SEREngine.spin"
      steer_left    : "pwmAsm.spin"
      
    PUB Start | shortest_range, loop_count, last_angle
      Pst.Start(DEBUG_BAUD)                                 ' 1 cog
      cognew(move_ping_servo, @Ping_Servo_control)           ' 2 cogs
      pause(100)
      cognew(move_bot, @Move_Servo_control)           ' 2 cogs
      dira[LED_Pin]~~
    
      loop_count := 0
      shortest_range := Limit_Speed_Range
    
      repeat                                                ' Repeat Forever
        range := ping.Inches(PING_Pin)                      ' Get Range In Inches
        Pst.dec(range)                                      ' Print Inches
        Pst.str(string(" - Angle : "))
        Pst.dec(Ping_Servo_Angle)
        Pst.str(String(13))
        Pst.dec(Travel_Speed)
        Pst.str(String(13))
    
        if loop_count => 4
          shortest_range := shortest_range + 5
          if shortest_range => Limit_Speed_Range
            shortest_range := Limit_Speed_Range
          loop_count := 0
        
        case Ping_Servo_Angle
          0..30:
            ' Objects in 30 deg range
            last_angle := 0
          31..60:
            ' Objects in 60 deg range
            last_angle := 1
          61..90:
            ' Objects in front left
            if range =< shortest_range
              shortest_range := range
    
            if last_angle == 1 OR last_angle == 3
              last_angle := 2
              loop_count++
          91..120:
            ' Objects in front right
            if range =< shortest_range
              shortest_range := range
    
            last_angle := 3
          121..150:
            ' Objects in 150 deg range
            last_angle := 4
          151..180:
            ' Objects in 180 deg range
            last_angle := 5
          OTHER:
    
        Travel_Speed := Stop_Val + (Left_Full_Speed * ((shortest_range * 100) / Limit_Speed_Range) / 100)
          
        if(range < 10)
          outa[LED_Pin] := 1
        else
          outa[LED_Pin] := 0
        pause(10)
    
    PUB move_ping_servo | frequencyCounter
    
      ifnot(ser.SEREngineStart(_SensorServoPin, -1, _updateFrequencyInHertz))
        reboot
    
      ser.leftPulseLength(200 + 0)
      pause(1000)
    
      Ping_Servo_Angle := 0
        
      repeat
        repeat frequencyCounter from 0 to Sensor_Servo_Steps step 20
          ser.leftPulseLength(200 + frequencyCounter)
          Ping_Servo_Angle := (((frequencyCounter * 100) / Sensor_Servo_Steps) * 18) / 10
          pause(_timeStepInMilliseconds)
    
        pause(100)
        
        repeat frequencyCounter from Sensor_Servo_Steps to 0 step 20
          ser.leftPulseLength(200 + frequencyCounter)
          Ping_Servo_Angle := (((frequencyCounter * 100) / Sensor_Servo_Steps) * 18) / 10
          pause(_timeStepInMilliseconds)
    
        pause(100)
    
    PUB move_bot
      dira[Left_Motor_Pin]~~
      outa[Left_Motor_Pin] := 0
      Travel_Speed := Stop_Val
      Direction := 0                                        ' 0 = Forward, 1 = Reverse
      pause(1000)
        
      repeat
          outa[Left_Motor_Pin] := 1
          pause_ms(Travel_Speed)
          outa[Left_Motor_Pin] := 0
          pause(20)
    
    
    PUB pause(Duration)
      if(Duration > 0)  
        waitcnt((clkfreq / 1_000 * Duration) + cnt)
      return
    
    PUB pause_ms(Duration)
      if(Duration > 0)  
        waitcnt((clkfreq / 1_000_000 * Duration) + cnt)
      return
    

    The next step is to build the frame for the test bot out of my Erector set parts and hope it fits :) I will then begin trying to figure a way for the bot to go around an object and continue in the same path it was originally traveling. If I can have the bot detect the room edges and work a pattern from there, that should be optimal. A lot to ask for, but we shall see what I come up with.
Sign In or Register to comment.