PDA

View Full Version : Bluetooth IO solution request



mSparks
01-24-2011, 05:56 PM
Background:
I've been playing with the idea of building a decent robot for a few years now, but previously the hardware has been nowhere near my requirements, programmer at heart, with a fairly decent electronics background from a past life and now heavily specialized in AI.

Requirements:
Basically, what I'm looking for is a fairly cheap (£100-$200) solution to control a fairly large number of servos (10 at least) via Bluetooth.
I'm thinking something along the lines of sending
"servo 1=90'"
"servo 2=90'"
"servo 3=45'"
etc etc (or some such protocol)
down the bluetooth link.
On the sensor side, I'm fairly easy, be nice to have say two separate binary ports for fault detection (power low and system fault), and a serial in to be returned down the bluetooth link for a more agile sensor module to be done at a later date (to be determined by what I can't do just using the camera), but I'm planning on driving as much as possible via a camera which I already have sorted.
It would be nice (although by no means required) if the number of servos was modular - e.g via some serial bus/PWM module combination, mostly because I only need 4 servos outs for the alpha version (2 for movement,2 for camera rotation), but once I've got the system working I want to play with some spider/bipedal etc chassis designs.

While I could.
I really, really can't be arsed building myself a bespoke version of this, I've had a google round, but nothing really seems to match what I'm looking for. If we have to go down that route does anyone want to work with me on getting it working?

darkback2
01-24-2011, 07:47 PM
Does it have to be bluetooth specifically or is some other wireless method acceptable...If you would be willing to try something different check out the xbee. Its not bluetooth, but it is a wireless solution. You could use it with a serial servo controller like the arbotix, and with a PWM servo controller like the SSC-32. Both would provide you with the ability to control multiple servos wirelessly, and I think both can read sensor data. Another option is something like the roboard or FitPC. Most people would tell you to go with the fit, then you can do all of the processing on the robot, and still have the option of sending signals to it via wifi, xbee, or bluetooth.

I know people have gotten bluetooth working with the CM-5 for example, but they seamed to do a lot more hacking than you may be willing to do.

Hope this helps.

DB

mSparks
01-24-2011, 08:58 PM
Yeah, only way I can see to hook it up to an Android mobile (Cam, wifi, 4g, GPS,gyro, gigs of storage,bluetooth, what else could a robotist ask for), since you don't get access to its USB interface afaics.
A bit more digging turned up the ARC-32 Servo Controller which looks like it will team up with the BlueSMiRF board to get me close on the hardware front, roughly in the right price range too.

I don't think it would be a great deal of work to get a decent com protocol up and running.

With all that I could probably go straight onto a fully autonomous heli chassis.

2011 is going to be great.

Xevel
01-25-2011, 05:20 AM
You could have a look at the Pololu Maestro boards for the servo controller. There are 6, 12, 18 and 24 servo versions. You can do quite a lot of stuff with it and they have a very small footprint.
This plus your BlueSMiRF and you're golden.

mSparks
01-25-2011, 07:22 AM
Thanks.
Those Pololu Maestro boards look very much like what I was thinking of to start with.
Right now I still think the potential of the ARC32 is ahead though, for two reasons
reverse kinematics.
Hook this up with the tools I built for
http://www.theborgmatrix.com/ltk/index2.php/Ragdol-Physics/32

And balancing biped and fully autonomous heli is within reach - 100odd kbs over bluetooth is a very tight margin for realtime control if it has to control each servo independantly - this is why I was thinking of the modular design.

No Input:

Having said that, these would be nice if there is a well developed 32bit processing board with a usb hub and bluetooth I could plug them into within price and weight budget.

Xevel
01-25-2011, 09:48 AM
Concerning the realtime control problem :
With the "set multiple target", at 115.2 kbps, you can set the values for 24 servos in 4.6ms, which is way faster than the update rate of the servos (20ms).

But I admit you won't be able to do invert kinematics on these Pololu boards :/

mSparks
01-25-2011, 10:29 AM
In my defence, I didn't say it wasn't possible, just that it was "tight", Maybe I'm just living in a past era still, but my understanding is the 115.2kbs is the max theoretical bit rate, when you start getting into error correction, bounce time and all that gubbins, actual throughput is much lower.
They also add together, so thats 4.6ms to set the servo positions, 20ms for the servos to update giving an update time of 24.6ms, then the servo has to get there. then it needs to feedback on the actual effect its having and make any corrections. That's a long time for a biped that just started falling over because it stood on a rock.
Farm this off through inverse kinematics and the controller can replace servo control with impulses, even complex maneuvers can be replaced with a simple command byte, and the controller can spend much more time working out whats going on instead of building servo control strings and waiting around for them to be sent.

Suppose the only question I have left atm, is does anyone know whats required to get the BlueSMiRF to com through a UART - would it connect up "out of the box" on uart pins for the arc32?

An alternative does seem to be hooking a Pololu Maestro into one of those Arduino boards.

robandix
01-25-2011, 02:47 PM
Hi mSparks,



to hook it up to an Android mobile (Cam, wifi, 4g, GPS,gyro, gigs of storage,bluetooth, what else could a robotist ask for)


this exactly was my motivation to start the robandix (robot and android) project wth my robandix NXT Hero
(http://forums.trossenrobotics.com/showthread.php?t=4553)

The NXT has the BT interface builtin.
But of course i wanted to expand this concept to other platforms.

Last weekend i got my bioloid pk.

And to connect the CM510 to my Android HTC Hero i use an BlueSerial RS-232 Bluetooth Adapter with integrated batteries (http://www.blueserial.com/).
Works great.
This is the birth of robandix bioloid Hero :veryhappy:

robandix

parallax
01-26-2011, 10:34 AM
A great bluetooth option would be the BlueSMiRF modem:

BlueSMiRF (http://www.sparkfun.com/search/results?term=bluetooth&what=products)

The difference between the first two options in the link above is that one is designed for use with an external antenna. They would both require some soldering to get running (as they both will require a male or female header depending on your application). They are easy to interface with a Lynxmotion SSC-32 servo controller or something like the Basic Micro ARC32 servocontroller/microcontroller. I have had some great luck with both of these combinations.

Here is a complete tutorial on how to do it with an SSC32:

Tutorial (http://www.lynxmotion.com/images/html/build117.htm)

The SSC-32 is easy to command and fits the bill for your description in the first post of this thread. Commands basically are composed of the servo/s you want to move, where you want to move it to and (optionally) how fast you want it to try and get there. If you are going to use a standard hobby servo, the SSC-32 is a great servo controller. Used in conjunction with the BlueSMiRF and you have an easy way to make a bot.

The ARC32 will give you much more flexibility- it's a damn nice microcontroller which has (almost) all of the capabilities of the SSC-32 in terms of flexibility for servo control. It is certainly possible to connect the BlueSMiRF to it's UART (I'm looking at that combination sitting on my desk right now :) ) If you want some specific instructions, I would be happy to write them up for you.

I used the BlueSMiRF/SSC-32 combination on my first robot (a hexapod) and did all of the "thinking" for it on my laptop. The modem is plenty fast enough for updating 18 servos at once, and if you have any experiences with serial communication it will be a breeze to work with. I just wish I had been a better programmer at the time so that I could have taken advantage of all of the flexibility this combination made available to me. Oh well- C'est la vie! It was a learning experience.

My current hobby project uses the ARC32 and BlueSMiRF combination- I couldn't be happier with it (although admittedly I am still hunting for a nice C library that will do everything I want to use with it- Basic kinda makes me puke a little in my mouth :robotindifferent: ).

So just in summary- If you are thinking of using hobby servos and want an easy way to command your bot from a PC or other bluetooth capable device, the SSC-32/BlueSMiRF combination might be a good option for you. If you are looking for a little (okay...MUCH) more power under the hood than the SSC-32, the ARC32/BlueSMiRF combo is a good option. It is certainly possible to connect it through UART and it can handle some IK on it's own.

Just my two cents and my experience- I Hope that helped!

mSparks
01-26-2011, 01:41 PM
thanks Parallax, just the recommendation I needed.

I'm now keenly awaiting delivery of an ARC32 and BlueSmirf gold.

Re the "C Library"

spec me up what you want & can't find, and I'll see what I can do when they arrive (international shipping, so no rush).

I've not looked at the basicMicro IDE yet, so I've no idea whats in there, bit annoyed it looks like its windows only, but I shouldn't need to spend a great deal of time in it so no biggie.

parallax
01-27-2011, 06:40 PM
Glad to be of help! :) I think you will be happy with the results!

In terms of a C library for the ARC32 and other Basic Micro products, there are few library options for out there (most of which don't implement some of the higher level functions you would find as part of their native Basic implementations). Here is an example of the libraries I am talking about:

C Library by MinionBuilder of Lynxmotion (http://www.lynxmotion.net/viewtopic.php?f=4&t=6136)

Thanks to MinionBuilder's efforts, we have something to work with. However, what would be *beautiful* (especially for the ARC32) is a C library that would implement or imitate some of the advanced servo commands that are native to the board in Basic; commands that take advantage of the boards hardware driven servo control and allow for complex coordinated movement. See pages 14-17 of the ARC32 Data Sheet (http://downloads.basicmicro.com/downloads/datasheets/servo_controller_robot_B0010.pdf) for specific examples of what I am talking about. These are some of the great things about the board. All of that flexibility and ease of use built into a 32 bit micro *with* a built in servo controller *with* support for 32 servos *and* controlling them takes *less* than +/- 1% of its computational time. Whew! ;)

Maybe the library I linked above would be a good starting point towards such a goal. I know there are a ton of people out there that would be very grateful if you could put one together.

My personal thought on this is that most of the people that are using these boards are perfectly happy programming them in Basic, which may be why we haven't seen a better C offering yet although I may be totally wrong about this. However, over at the Basic Micro forums the topic comes up occasionally and each time it seems to turn into a debate about the pros/cons of Basic vs. C. There seems to be an initiative from the dev's to make a board that will support Arduino style C out of the box without the need for any different libraries/IDEs/etc. et al. (here's a link (http://forums.basicmicro.net/wish-list-f500/arduino-t9371.html) to that discussion if you're interested on reading up on it) but there's no word on the status of that project.

As far as I have been able to tell (and if I AM wrong, someone *please* tell me :) ), although these boards can be programmed in C, there isn't much in the way of libraries/support out there yet.

So we are left programming them in Basic and doing the rest of our work in the language of our choice. Not that that's a bad thing: the smoothest and nicest IK I have ever seen on a robot was done in Basic (BlackWido, Pheonix, A-Pod, etc) on micros like these. I, for one, would just like another option that I'm more comfortable in.

parallax
01-27-2011, 07:56 PM
I don't mean to double post but I just got a message on another forum pointing me to this:

Xan's Phoenix code in C running on Bap28... (http://www.lynxmotion.net/viewtopic.php?f=8&t=6196) by Kurte

This may also be of help in working on some C libs for the ARC32.

I'll stop psuedo-thread jacking now ;) If anything else comes of this I'll start a new thread about it.

mSparks
01-28-2011, 07:47 PM
No "psuedo-thread jacking" taken, much appreciated, Looking at the work Kurte has done on the ARC32, and MinionBuilders BAP40 library pinned on the BasicMicro site it seems like building up a fairly solid C library for the ARC32 could be a bit of fun (+ not much more than bug fixing and documentation), as long as I don't have to crack out the oscilloscope and a million other electronics tools I'll be happy.
Both the Bluesmirf and ARC32 have now shipped, and are on their way across the Atlantic to me, not much else I can do until they arrive.

KurtEck
01-30-2011, 08:45 AM
FYI - I had not played at all with the C code since September, but since, it looked like there may be a few more people interested, I tried it out again. Last few days I have been playing around with some enhancements in the code, like having my servo implementation handle offsets as well. (That is you tell the system that a certain servo has an offset of X and it uses it, such that your code does not have to remember to add or remove it. I first started playing with my CHR-3 which has a SSC-32 and Arc32 and got it working some and then went to my Arc32 based phoenix which only has the Arc32. I did the same back in September, but then I had a separate project/directory for it. This time I did it in the same code base, with ifdefs. So far it appears to walk OK, can run sequences that I store in the Phoenix EEPROM, still need to tweak the rotate/translate code, to probably have them wait until the previous move completes. This works for both PS2 and my DIY XBee remote control. Currently debugging why my Debug monitor code that uses the hardware serial port connected to the USB serial port does not appear to be detecting new characters coming from the debug terminal. Once I have that figured out, I will probably post updated code up at Lynxmotion.

Edit: As for being stuck with only using Basic, for the fun of it, I have also ported Xan's phoenix code over to a couple of different platforms, including the Arduino Mega and a Propeller, there are threads about these on the Lynxmotion forum.

Note: I do most of my postings up on Lynxmotion(KurtE), but also monitor here and BasicMicro.

Kurt

djsures
03-23-2011, 12:09 PM
Background:
I've been playing with the idea of building a decent robot for a few years now, but previously the hardware has been nowhere near my requirements, programmer at heart, with a fairly decent electronics background from a past life and now heavily specialized in AI.

Requirements:
Basically, what I'm looking for is a fairly cheap (£100-$200) solution to control a fairly large number of servos (10 at least) via Bluetooth.
I'm thinking something along the lines of sending
"servo 1=90'"
"servo 2=90'"
"servo 3=45'"
etc etc (or some such protocol)
down the bluetooth link.
On the sensor side, I'm fairly easy, be nice to have say two separate binary ports for fault detection (power low and system fault), and a serial in to be returned down the bluetooth link for a more agile sensor module to be done at a later date (to be determined by what I can't do just using the camera), but I'm planning on driving as much as possible via a camera which I already have sorted.
It would be nice (although by no means required) if the number of servos was modular - e.g via some serial bus/PWM module combination, mostly because I only need 4 servos outs for the alpha version (2 for movement,2 for camera rotation), but once I've got the system working I want to play with some spider/bipedal etc chassis designs.

While I could.
I really, really can't be arsed building myself a bespoke version of this, I've had a google round, but nothing really seems to match what I'm looking for. If we have to go down that route does anyone want to work with me on getting it working?

EZ-B! :) http://www.ez-robot.com/Shop/View.aspx?id=1

Class 2 (2.5 mW, 4dBm) Bluetooth
10 Meters (30 feet) Range
Supports iRobot Roomba
Includes PC USB Bluetooth module
Includes Bluetooth antenna
Firmware is pre-loaded and tested
Supports Arduino Sensors & Peripherals
Color Vision Tracking Support
Voice Recognition and Voice Synthesis
8 Analog to Digital Converters
20 Uart Serial Ports
20 Digital Input/Output Ports
14 Servo Ports
MIDI Instrument Connection
TellyMate Connection
Includes Visual Basic and C# .Net SDK
Operates at 40 mhz
5 Volt regulator protects the chip
Powerful 3.5 amp 5 Volt regulator powers the bus
Powered 3 wire connector for all bus I/O
Lifetime firmware and SDK updates