Shop OBEX P1 Docs P2 Docs Learn Events
PropBOE-Bot — Parallax Forums

PropBOE-Bot

Duane DegnDuane Degn Posts: 10,588
edited 2012-06-20 06:47 in Robotics
Someone on the Propeller forum asked about code for using the new PropBOE with a BOE-Bot.

My wife is planning on using a PropBOE-Bot in the Expo's line following contest so I thought I'd pass along some of the code we're writing.

I don't really have any pictures yet since the BOE-Bot is presently in pieces as we experiment with making tires out of Sugru (so far it's not working very well).

I'm attaching to files PropBOE-Bot files. The first one is used to calibrate the continuous rotation servos on the BOE-Bot.

Load the program into EEPROM (in case the servos make the Prop reset) and adjust the pots in the servos until the wheels are both stationary and silent.

The second file is a quick servo demonstration. The robot drives forward for a second and a half and the drives backwards.

It's not much, but hopefully it will show how to control the BOE-Bot's servos with a Propeller.

Edit(3/11/15): Warning, the code attached is an old version. There are likely better options available.
I plan to upload this program or an improved version to my GitHub account
If there isn't code similar to what is attached here on my on GitHub, send me a message and I'll make and check for any improved versions of the code.

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-24 21:24
    Reserved 1 of 2.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-24 21:25
    Reserved 2 of 2.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-03-25 16:06
    Please see this thread for information on PropBOEBasic. I'm working towards a similar level of functionality as BoeBotBasic from the ObEx, but with the BoeBot extensions cleaned up a little and allowing the I/O pins involved to be explicitly specified. There's support for servos and a PING as well as I2C devices like a gyroscope or compass.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-25 21:50
    Mike Green wrote: »
    Please see this thread for information on PropBOEBasic.

    Thanks for the link Mike. I'll likely use parts of your code in my project.

    I personally don't want to program in Basic. I've gotten used to Spin and PASM so I feel more comfortable using these languages when programming.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-25 22:17
    It has been a tough day for my PropBOE-Bot.

    I shorted out a LiPo battery against the PropBOE's 9V connector. I've explained what happened in this thread. Fortunately Ken is going to send me a new board so this setback should delay this project very much.

    My first attempt at Sugru tires didn't turn out very well. They looked okay to start with. I used aluminum foil to keep the Sugru from sticking to the plastic wheels. My plan was to remove the Sugru tire after it had hardened. I was hoping the Sugru tire could then be slipped on and off the wheels whenever desired.

    attachment.php?attachmentid=91013&d=1332737716

    But the thickness of the tire wasn't uniform around the circumference of the wheel. I thought I had a brilliant idea on how to true up the tire. I inserted a 4-40 nylon bolt through the wheel and added a couple of nuts to hold the bolt secure. I then mounted the bolt in my drill press. My "brilliant" idea was to carefully hold an X-acto knife up to the tire to trim away the areas that were too thick.

    SugruTire120325c.jpg


    Even though I thought I was being very careful to hold the blade parallel to the tire, when the blade would engage the with the Sugru, the Sugru would pull the knife toware the wheel. I soon had a mangled tire.

    attachment.php?attachmentid=91015&d=1332737764
    The Sugru had sat overnight and was no longer shapeable, but it was still softer than its final state. I thought this softer state would make it easier to remove material.

    If I attempt another Sugru tire, I'm either try shaping the material while it is still soft or I'll wait until it has reached it's final hardness and then use sandpaper to remove extra material.

    I doubt I'll make another attept at a Sugru tire anytime soon.

    I'm using Li Ion batteries as the power source with this robot. Here's a picture of the bot with its wheels off.

    attachment.php?attachmentid=91016&d=1332737785

    One feature I hope to add soon to this robot (besides wheels) is to interface it with a radio control receiver so I can use my Spektrum radio equipment with it.
    863 x 397 - 173K
    444 x 379 - 86K
    605 x 468 - 107K
    660 x 656 - 223K
  • Martin_HMartin_H Posts: 4,051
    edited 2012-03-26 05:50
    Duane, sorry to hear about all the problems you had over the weekend. I never heard of sugru before, I guess you learn something new every day.
  • TtailspinTtailspin Posts: 1,326
    edited 2012-03-26 07:11
    Wow, how far did the Blade fly? I am glad you got to keep your fingers...
             *                                                    *
           *   *                                                  * *
         *       *                                                *   *
       *           *                                              *     *
     X-Acto or Parting tool bevel                   Single bevel
    
    For future reference, Use a Single Bevel and keep the flat side off the material, using the Bevel side will help prevent
    the blade from digging into the material...

    You sure are hard on the equipment... :)


    -Tommy
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-03-26 07:28
    I would imagine you'd have better luck truing the wheels with a fine rasp/micro-plane/sanding stick rather than a blade. Like Tommy said, you're lucky the blade didn't snap and fly. In turning (as in lathe work), there can be tremendous forces applied to the tool, work piece and tool rest, especially if the blade takes the opportunity to dig into the work.

    Be careful with spinning things and sharp tools!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-26 12:52
    Thanks Martin, Tommy and Rick for the support and advice.

    In hindsight, I deserve a lot of ribbing for trying something this dumb. Fortunately I still have all 9.9 fingers. (The 0.1 was lost in a similar bonehead machining experiment.)

    I'm attaching my latest PropBOE software. Unfortunately with the present state of my PropBOE and my BOE-Bot, I haven't been able to test it very well.

    The software should let you control a PropBOE-Bot with the right stick of a mode 2 radio control transmitter.

    The rx lines need resistors of at least 3.3K ohm when connecting them to the PropBOE. I'm using 10K resistors since I have a lot of them.

    Here's a little bit of a schematic on how to connect the RC receiver to the Propeller.
            RC Receiver
                                 5.0V
          ┌────────────────┐      
          │         Power+ ├──────┘
          │         Ground ├────────────────┐
          │         THRO   ├───── P0      
          │         AILE   ├───── P1
          │         ELEV   ├───── P2
          │         RUDD   ├───── P3
          │         GEAR   ├───── P4
          │         AUX1   ├───── P5
          └────────────────┘  10KΩ (all resistors) 
    

    The program uses Jason Dorie's RC_Receiver_6 object to read the pulse lengths from the receiver.

    Edit: I fixed some comments with this version of code.

    Edit(3/27/12): The attached code has severe bug. The left wheel doesn't turn as I expected it to. I'm fixing the code now. If you're one of the three who downloaded this code you have my apology.

    Edit(3/11/15): Warning, the code attached is an old version. There are likely better options available.
    I plan to upload this program or an improved version to my GitHub account
    If there isn't code similar to what is attached here on my on GitHub, send me a message and I'll make and check for any improved versions of the code.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-27 16:41
    I received my replacement PropBOE this morning.

    Thanks Ken for sending it so quickly.

    I tested out the code I posted yesterday and it didn't work as I had expected. The left wheel doesn't turn when it should.

    I'm fixing the code now and I'll post an updated version sometime soon.

    I sorry to those who might have tried my buggy code (it looks like the code was only downloaded three times).

    Once I have the robot obeying commands from the RC system, I'm hoping to add a "record" and "play back" feature that will record the robot's movement to the uSD card.

    I know one of erco's robots can record its path and repeat the same path without outside aid. Hopefully soon, I'll also have a robot with this ability.
  • TtailspinTtailspin Posts: 1,326
    edited 2012-03-27 18:26
    I snagged a copy, I just wanted to see what I could learn... I learned much from your code Duane, thank you.
    I like the "no brainer" idea of putting a DAT with the program name right on top, it's even zero terminated too...:thumb:

    Hopefully I will come home from UPEW with a brand new PropBOE. so I can try out your code for real...



    -Tommy
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-27 19:47
    Ttailspin wrote: »
    I snagged a copy, I just wanted to see what I could learn... I learned much from your code Duane, thank you.
    I like the "no brainer" idea of putting a DAT with the program name right on top, it's even zero terminated too...:thumb:

    Hopefully I will come home from UPEW with a brand new PropBOE. so I can try out your code for real...



    -Tommy

    I often forget which version of code is loaded into a Prop's EEPROM. I started adding the program name in a DAT section at the top of the program so can display the program name to a terminal or some other display. I often include the program name in a SD file as well so I know which program generated the file.

    So others don't have to download the whole program to see what we're talking about, I've copied the first few lines of the program here:
    DAT programName byte "PropBoeBot120326h", 0 ' This will let me know what program is loaded in the Prop.
    CON
    {{
      ******* Public Notes *******
      Use PropBoeBotWheelCalibration to calibrate
      your BOE-Bot's continuous rotation servos.
    

    I don't think this particular program displays "programName" anywhere since it doesn't have a why to display text.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-27 20:47
    I found the bug that was messing up the left servo and fixed it. I also fixed another small bug.

    This code should let one drive a PropBOE-Bot with RC equipment.

    I hope no one realizes this could probably be done without any microcontroller by using RC equipment with mixing capability.

    This is just a stepping stone to bigger and greater things that do require a microcontroller and not just any microcontroller but a multitasking microcontroller.

    Edit(3/11/15): Warning, the code attached is an old version. There are likely better options available.
    I plan to upload this program or an improved version to my GitHub account
    If there isn't code similar to what is attached here on my on GitHub, send me a message and I'll make and check for any improved versions of the code.
  • Ken GraceyKen Gracey Posts: 7,386
    edited 2012-03-27 22:15
    Duane Degn wrote: »
    I received my replacement PropBOE this morning.

    Thanks Ken for sending it so quickly.

    You're very welcome. I'm hoping to see some success on the line following contest!

    Ken Gracey
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-07-13 18:28
    Ken Gracey wrote: »
    You're very welcome. I'm hoping to see some success on the line following contest!

    Ken Gracey

    My intention was to use this in the line following contest. I had forgotten how the BOE-Bot needs a pretty flat surface to drive on. I'm wondering if this will be able to drive on asphalt.

    One thing I've wanted to do with a robot for a long time is to record the robot's movements and then play the movements back like erco has done with one of his robots. I thought using a SD card with the PropBOE would be a good way to do this.

    Here's a video of the PropBOE-Bot first driving in a figure 8 with me attempting to control it with an RC transmitter followed by the PropBOE-Bot repeating the course autonomously.



    The servo speeds are recorded 50 times a second so the second (autonomous) figure 8 matches my manual controlled route pretty closely.

    I had hoped to come up with some sort of menu system so one could select which recording to play back. Presently only the last recording will be played back. I think a menu system will need to wait while I get some line following sensors made.

    Edit(3/11/15): Warning, the code attached is an old version. There are likely better options available.
    I plan to upload this program or an improved version to my GitHub account
    If there isn't code similar to what is attached here on my on GitHub, send me a message and I'll make and check for any improved versions of the code.
  • dmagnusdmagnus Posts: 271
    edited 2012-04-18 16:50
    I was going to send you a PM but thought there just might be somebody as cheap as I am. I downloaded your code, etc and I have a BOE-BOT and a Prop BOE, so I want to try out your neat software. I have an ELEV-8 with a DX-8/R8000 but I don't really want to spend another $130 on another receiver for the DX-8. I have a couple of old 72mhz FM radios out in the shop but they are 4 channel radios so don't have a gear switch. I'm wondering if I couldn't use the rudder (left stick horizontal) to turn the recorder on/off. Of course, I have to find batteries for the transmitter. I think I can run the receiver off the Prop BOE (won't the servos cables power the receiver?)
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-04-18 17:19
    dmagnus wrote: »
    I was going to send you a PM but thought there just might be somebody as cheap as I am. I downloaded your code, etc and I have a BOE-BOT and a Prop BOE, so I want to try out your neat software. I have an ELEV-8 with a DX-8/R8000 but I don't really want to spend another $130 on another receiver for the DX-8. I have a couple of old 72mhz FM radios out in the shop but they are 4 channel radios so don't have a gear switch. I'm wondering if I couldn't use the rudder (left stick horizontal) to turn the recorder on/off. Of course, I have to find batteries for the transmitter. I think I can run the receiver off the Prop BOE (won't the servos cables power the receiver?)

    Hobby King sells some inexpensive receivers that work with Spektrum radios.

    A four channel radio should work fine. You just need to adjust the code to use the rudder channel to turn the record on and off.

    I think the receiver object needs to be told there are only four channels. I beleive there is a mask with the pins to use sent as a parameter to the receiver's start method.

    The receiver isn't actually connected directly to any of the servos in this setup. In order to control the servos indenpedent from from the receiver during playback, the servos need to be connected to the Prop. The receiver is also connected to the Prop. The Propeller mixes the the aileron and elevator channels and sends the appropriate pulses to the two servos.

    Since none of the servo are connected to the receiver, the receiver needs to be powered from the PropBOE.
  • xanaduxanadu Posts: 3,347
    edited 2012-04-18 21:14
    Epic! It is like a teach pendant :)
  • dmagnusdmagnus Posts: 271
    edited 2012-04-19 06:50
    Ok, thanks, pretty much what I thought. Now I just have to figure out which transmitter goes with which receiver - seems like the crystals are all different in them. I wonder if there is someplace other than Hobby King that sells inexpensive receivers - I really don't want to wait a month. I'll take a look around... Thanks

    Quote: Since none of the servo are connected to the receiver, the receiver needs to be powered from the PropBOE.

    Actually, that's what I meant, that I could power the receiver from the PropDOE...
  • dmagnusdmagnus Posts: 271
    edited 2012-04-20 17:14
    Ok, on the way home yesterday I stopped and got a AR6115 receiver for my DX8. I figure with all these motors I have laying around I will probably build a park flyer foamy for my grandson so I will be able to use it there, too.
    I put everything together and wired it up as per the diagram below. After checking for servos centered (perfect) I loaded the version (e) program and gave it a whirl. After determining that I haden't properly bound my new receiver, it got it going. But it does some funny stuff. I'm trying to figure out all of the lights and stuff, but I did get it to repeat a pattern that I drove. NEAT! As soon as I get it perfected, I'll do some video!
    Thanks!
    Don
  • dmagnusdmagnus Posts: 271
    edited 2012-05-07 10:58
    Just thought I'd post an update on my PropBOE-Bot. As I said, I was having some strange happenings. It would stop and reset when I went from forward to reverse and vice-versa. It would stop unexpectedly and reset. It was driving me nuts. Since my ELEV-8 is currently down for lack of gear legs, this last weekend, I got the bot out and did some checking. As it turns out, I had some of the resistors legs touching each other randomly. I would move the bot and the resistors would move, or I would touch them inadvertently and short them together. Makes for some really weird activity!
    I fixed that and it works flawlessly! Perfectly repeats complicated maneuvers that have been "recorded". My grandkids are going to get a kick out of it.
    Now I want to put the same software to work on my Stingray and try to figure out how to integrate the "smarts" from the Pings.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-05-07 11:33
    dmagnus wrote: »
    Perfectly repeats complicated maneuvers that have been "recorded".

    This is great! I was also pleasantly surprised at how well the recorded maneuvers played back.

    I got tired of my resistors continuously shorting each other out so I added heat shrink tubing to a dozen of them. You can see some pictures of he breadboard friendly resistors in this post.
  • ercoerco Posts: 20,254
    edited 2012-05-07 13:51
    @Duane: That's encoder-free playback, right? All the more impressive if you're just recording and playing back the pulsout stream. Repeatability depends on quality servos, like the Futaba units Parallax uses on the BoeBot.

    BTW, the weight on the "caster ball" affects maneuverability a lot. When I built Ken's Flame-BoE-Bot, the aerosol can shifted the CG way up high. To prevent tipping from standard maneuvers, I had to put a lot more weight on the caster ball, which doesn't really caster. It's just a ball that must skid sideways. I did the Figure 8 challenge with the stock BoeBot, then modded it with the flamethrower. Afterward, it was nowhere close to a Figure 8, it only did about half a circle, since it was skidding so much with the extra traction. Long story short, I added a real caster.

    So as people mod their bots with batteries and heavier accessories, they may have to re-record their paths using encoder-free means.
  • Jim the HermitJim the Hermit Posts: 79
    edited 2012-06-20 05:20
    That was cool. It records servo speed 50 times a second?! How much memory does it have?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-06-20 06:47
    That was cool. It records servo speed 50 times a second?! How much memory does it have?

    Yes, it records the servo speeds 50 times a second.

    I was using an 8GB uSD card, so it has a lot of memory. IIRC each sample takes 11 bytes of memory, so theoretically the uSD card should be able to record four or five months of servo speed data.
Sign In or Register to comment.