PropBOE-Bot
Duane Degn
Posts: 10,588
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.
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
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.
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.
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.
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.
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.
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.
the blade from digging into the material...
You sure are hard on the equipment...
-Tommy
Be careful with spinning things and sharp tools!
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.
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.
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.
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:
I don't think this particular program displays "programName" anywhere since it doesn't have a why to display text.
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.
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.
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.
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...
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
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.
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.
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.
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.