PDA

View Full Version : Bioloid General I/O Board



JonHylands
01-28-2008, 02:51 PM
Hi everyone,

I made one of these boards for myself a while back, and decided to do a short production run of them (very short).

http://forums.trossenrobotics.com/gallery/files/1/3/2/0/bioloid_io_small.jpg

There is some initial documentation for this board on my wiki site (http://www.bioloid.info/tiki/tiki-index.php?page=General+IO+Board)...

The basic specs:

6 ten-bit A/D inputs
4 digital I/O pins
two motor control PWM outputs (switchable between sign magnitude and locked anti-phase)
two bus connectors for daisy chaining
If you have any comments or questions, please let me know. Barring any big issues, I expect to have these boards available in a week or two at my online store (http://www.huvrobotics.com).

- Jon

Alex
01-29-2008, 08:50 AM
Very nice work Jon!!

I was hoping you'd release this board to the public. It's something that the bioloid system is in dire need of for improving the autonomous navigation capabilities.

Are each one of these individually addressable within the bioloid system just as the AX-12's are so you can use multiple boards on the line?

Pardon my ignorance if this is a totally stupid question as I'm not an EE expert. So according to your wiki, we can use 5V analog sensors with your board?

JonHylands
01-29-2008, 09:18 AM
Alex,

There are no stupid questions :-)

Yes, you can change the ID of this board, and use 1 or 10 of them on the bus (or more, if you desire).

It works exactly the same way as the AX-12 does, in terms of how you use it. You can use READ_DATA and WRITE_DATA in the same way. The ID for the board is in the same place (in fact, all the common registers are in the same place) as the AX-12.

And yes, you can use up to six 5 volt analog sensors with this. Probably any of the 3-pin phidget analog sensors will plug right in, provided the cables are (Data Power Ground) oriented and you don't need external components...

- Jon

Alex
01-29-2008, 11:52 AM
There are no stupid questions :-)

aw, thanks Jon;) I do feel like an idiot sometimes asking certain questions because I know quite a bit about software and Phidgets, but when it gets down to EE and Mechanical Engineering stuff, it's hit or miss.

Anywoo, that's great news! I was hoping it was the same interaction as the Bioloid system.

Regarding the Analog Sensors, here's a pic of the pinout on the Phidgets analog sensors. I think it's the standard pinout, but again, not an EE guy:

http://www.trossenrobotics.com/images/forums/AnalogWireEnd.jpg

JonHylands
01-29-2008, 12:01 PM
Yes, those will plug right in. The only real issue is mechanical - you will need a jumper header, since both my analog sockets and the phidgets plugs are female. The other issue is my plugs are 0.1" spaced side to side, so if you wanted to plug in more than 3, you would need to make a small jumper cable instead of just a header for each plug, since the phidgets plugs are so bulky...

- Jon

JonHylands
01-29-2008, 12:07 PM
Here's a picture of a phidgets cable plugged into my board, along with the type of header required to allow it to plug in... (just a standard Molex 0.1" 3-pin header)

http://forums.trossenrobotics.com/gallery/files/1/3/2/0/phidget_bioloid.jpg

- Jon

Alex
01-29-2008, 12:21 PM
Nice! Like you said though, that little clip on the Phidget analog cable gets in the way when you connect more than three. A small jumper cable is probably a pretty easy solution, but have you tried using standard servo cables instead of the Phidget analog cables? If so, can you connect them next to each other on your board?

There is always the option of snipping the connector and soldering leads on to the end of the wire:)

JonHylands
01-29-2008, 12:47 PM
Yes, you can plug in six standard servo cables directly, using the 3-pin headers like in the picture. If you snip the end off, you can solder the header directly to the wires, and plug that in (which is how I always do it).


- Jon

sciguy14
11-22-2009, 11:13 PM
It looks like they are now producing a board just like this one for sale on this site.

Could I use 3.3V analog sensors with this? In other words, would changing the voltage regulator both adjust the power going to the sensors, and the reference voltage that is used for the ADC?

JonHylands
11-23-2009, 07:19 AM
The board for sale on this site is in fact this one. The headers have been changed to a more standard male header on the board.

I don't offer the option of 3.3 volt regulator anymore - technically speaking you're not supposed to interface a 3.3 volt chip (the AVR) with a 5 volt UART signal (the bus).

If you want one specifically for 3.3 volt sensors, let me know, and I'll make one and stick a 3.3 volt regulator on it. I can't be responsible for anything that happens with the AVR in that case, though.

- Jon


- Jon

sciguy14
11-23-2009, 09:15 AM
But is the only change that you would make be switching the regulator, or would it involve something else? I already ordered this board, but want to be able to use 3.3V sensors while still getting the full resolution. I can swap out the regulator myself if that's all it takes.

JonHylands
11-23-2009, 09:39 AM
That is the only change. Note that the regulator is soldered to the board now.

Make sure you note the orientation of the regulator - when the regulator is in the top-left corner of the board, voltage in is on the left pin, voltage out is on the right pin, and ground is the center pin.

- Jon

sciguy14
11-23-2009, 09:55 AM
Ok, that sounds like the best solution. So changing that regulator will also change the reference for the ADC, so I'll still get the same resolution?

Hypothetically, if I wanted to use both 5V and 3.3V sensors, I suppose I could also just use a non-inverting amplifier on the 3.3V outputs before bringing them into the 0-5V ADC.

JonHylands
11-23-2009, 10:24 AM
Yes, that is correct - Vcc is the analog reference.

- Jon

sciguy14
12-02-2009, 01:35 PM
Would you be willing to release the C code that you used in the atmel? I'd like to make a few modifications to it to perform some processing before data gets sent to the CM-5

JonHylands
12-02-2009, 02:00 PM
Its already released - you can get it here: http://svn.hylands.org

Its under /avr/bioloid-io

- Jon

sciguy14
12-02-2009, 02:40 PM
awesome thanks!

sciguy14
12-27-2009, 02:42 PM
Forgive me for my ignorance, but I'm having a bit of trouble figuring out how to read values from my analog sensors hooked up to the I/O board. Suppose I wanted to read from my sensor connected to analog input 5, what address and length do I use with the READ command? I see that the first 5 bits are header header id length error, and it seems the data follows that, but I'm not entirely certain what I'm looking for. Is the sensor value reported as an 8bit binary value? Thanks!

JonHylands
12-27-2009, 05:30 PM
Here's the online manual:

http://www.bioloid.info/tiki/tiki-index.php?page=Bioloid+IO+Board+Documentation

So, to read from analog port 5, you would read the 16 bit value from control table address 36 and 37 (0x24 and 0x25).

- Jon

sciguy14
12-30-2009, 12:22 AM
awesome! Thanks again!

sciguy14
12-30-2009, 12:25 AM
Here's the online manual:

http://www.bioloid.info/tiki/tiki-index.php?page=Bioloid+IO+Board+Documentation

So, to read from analog port 5, you would read the 16 bit value from control table address 36 and 37 (0x24 and 0x25).

- Jon

So is Port 5 (H) an 8 bit value showing the High Bits, and Port 5 (L) an 8 bit value showing the low bits?

JonHylands
12-30-2009, 06:51 AM
So is Port 5 (H) an 8 bit value showing the High Bits, and Port 5 (L) an 8 bit value showing the low bits?

Yes, that is correct. The maximum value is 1023, and if port 5 had that value, the result would be:

0x24 - 0xFF
0x25 - 0x03

So, you take the high byte, multiply it by 256, and add the low byte.

3 * 256 + 255 = 1023

- Jon

sciguy14
01-22-2010, 04:18 PM
Hi again Jon, still having a tad of trouble interpreting this. I'm running the command "rd 36 2". Which returns something like this...


[CID:122(0x7A)] rd 36 2
->[Dynamixel]: 255 255 122 004 002 036 002 089 LEN:008(0x08)
<-[Dynamixel]: 255 255 122 004 000 138 000 247 LEN:008(0x08)
Is 138 the low Byte and 247 the High Byte? Because the value for the high byte seems to be far too large. Am I interpreting the numbers wrong? Thanks again for being so patient with me.

JonHylands
01-22-2010, 05:27 PM
Hi again Jon, still having a tad of trouble interpreting this. I'm running the command "rd 36 2". Which returns something like this...


[CID:122(0x7A)] rd 36 2
->[Dynamixel]: 255 255 122 004 002 036 002 089 LEN:008(0x08)
<-[Dynamixel]: 255 255 122 004 000 138 000 247 LEN:008(0x08)
Is 138 the low Byte and 247 the High Byte? Because the value for the high byte seems to be far too large. Am I interpreting the numbers wrong? Thanks again for being so patient with me.

No, 138 is the low byte, and 0 is the high byte. 247 is the checksum...

- Jon

sciguy14
02-04-2010, 12:15 PM
Jon, Thanks for your help so far. I'm trying to take some readings now with the Bioloid Behavior Control Programmer. I'm printing values to the screen that I'm taking in from an IR sensor on AI 0 and a gyroscope on AI 1.

The values don't seem to be continuous from 0 to 1023, with jumps of as much as 200 from 300 to 500. It also seems that the same number values are repeated consistently. For example if moving the gyroscope around, it seems only about 4 or 5 unique numbers are every shown as its output. I've attached the program and would be grateful if you could take a peak at it.

JonHylands
02-04-2010, 12:41 PM
Sorry, I wouldn't know what to do with a BPG file. I assume it has something to do with the normal Bioloid software suite, which I have never used or even installed.

Do you know how often you are polling the analog value from the I/O board? It updates the control table internally from the A/D ports 100 times per second.

Do you have an oscilloscope? If so, you can watch the sensor output directly using that, to see if the problem is with your sensor or with the BPG program. I would be very surprised if there was a problem with the I/O board, because there are lots of them out there, with lots of people using them with no issues (at least not any that I've heard).

- Jon

sciguy14
02-04-2010, 01:31 PM
Thanks for the quick response.

I've replicated the functionality in pseudocode below:



START

IR_H = 0;
GYRO_H = 0;
IR = 0;
GYRO = 0;

LOOP
IR_H = value(122:27) * 256;
IR = value(122:26) + IR_H;
GYRO_H = value(122:29) * 256;
GYRO = value(122:28) + GYRO_H;
printToScreen(IR);
printToScreen_newline(GYRO);
ENDLOOP

ENDPROGRAM



Because the program is looping on the Atmega Chip in the CM-5 which runs at 16MHz, i think we can safely assume that it is polling often enough.

I have tested these sensors with an oscilloscope, and both work as expected.

JonHylands
02-04-2010, 02:31 PM
Okay, I plugged in one of my I/O boards to my USB board, with an Analog ADXRS300 gyro sensor on analog input 0.

I ran it for a few seconds, updating at 10 times per second, holding the gyro in my hand and spinning it back and forth at different rates. This is the collection of values I got:

506 519 557 518 508 458 478 532 533 550
456 484 500 486 459 503 515 502 569 509
489 493 451 513 508 594 508 509 511 451
488 526 505 522 509 513 531 498 507 504
477 504 552 500 541 489 481 473 494 497
487 535 523 595 541 495 442 511 574 491
454 480 595 497 430 530 631 502 347 521
592 574 394 424 647 673 437 255 518 811
498 204 408 819 735 196 354 399 565 632
631 545 490 357 339 383 564 785 631 501
403 324 503 541 564 533 495 444 589 509
472 482 498 524 510 525 517 513 511 507
507 515 458 452 481 489 500 556 517 506
514 504 503 472 505

This is those values graphed using my graphing software:

1726

I see a lot of noise in the sensor, but I don't see anything like what you're reporting... What specific sensor are you using?

- Jon

iBot
02-05-2010, 06:38 AM
I am not sure how BCP does its calculations or the data types of the variables.

Try printing the 8 bit values too and check the calculation is correct. Strange things sometimes happen when converting data types.

Are the values coming from the AD converter ?

You could also read position values from one of the servos using similar code, and test by using the servo as a control to change the value.

JonHylands
02-05-2010, 07:05 AM
The values are 10 bit values, because they are directly from the A/D.

- Jon

sciguy14
02-05-2010, 11:42 AM
Hmm, your results certainly do look better than mine...

Here is the gyro I'm using:
http://www.sparkfun.com/commerce/product_info.php?products_id=8370

The analog output is just hooked right up to your board. I'm gonna test out the gyro a bit more later today and see if I can figure it out a bit better.

To confirm though, I am doing the math correctly on the inputs, right?


IR_H = value(122:27) * 256;
IR = value(122:26) + IR_H;
GYRO_H = value(122:29) * 256;
GYRO = value(122:28) + GYRO_H;
printToScreen(IR);
printToScreen_newline(GYRO);

JonHylands
02-05-2010, 11:53 AM
Yep, you are doing the math correctly.

If you would like to return the board, I can do some testing with it or send you a new one...

- Jon

iBot
02-07-2010, 05:04 PM
Are you doing the math correctly ? Maybe not in the the strange world of BCP !

Did you try the test I suggested using BCP ? You might gain enlightenment.

Try IR=value(122:26), some BCP reads from dynamixel devices seems to return 16 bit values automatically.

JonHylands
02-07-2010, 05:29 PM
Are you doing the math correctly ? Maybe not in the the strange world of BCP !

Did you try the test I suggested using BCP ? You might gain enlightenment.

Try IR=value(122:26), some BCP reads from dynamixel devices seems to return 16 bit values automatically.

Yeah, good point - at the very least, you should be testing the 4 distinct 8-bit values (IR_L, IR_H, GYRO_L, GYRO_H) without combining them together, and see what values you're getting...

- Jon

iBot
02-08-2010, 05:48 AM
I recall having similar problems when I built a dynamixel compatible servo with 24 bit resolution. I also then had to use memory locations in different ways to the AX12. Decided to use BCP for a quick and dirty test on CM5. I don't remember the CM5 or BCP version, but I was getting some read results in 8 bit and some in 16 bit format.

Also had a problem with random errors, because though the Dynamixel bus read was atomic within a single read transaction, it was not across reads, so I was occasionally getting one byte of AD read n and one byte of AD read n+1.

Eventually decided not to use BCP for this because the internal operation was not clear.

JonHylands
02-08-2010, 07:08 AM
That's a good point - I always assumed that you would be reading a 16 bit value directly in one shot. That's certainly how I do it with my software, and it (the board) is definitely atomic inside a single read.

Definitely worth looking into...

- Jon

sciguy14
02-10-2010, 12:45 PM
I've run the test you've suggested, and I'm getting some weird data, though it does look like the raw data is 16 bits. What do you use instead of the BCP? I'm not a very big fan of it either...

JonHylands
02-10-2010, 12:55 PM
I use my USB board, connecting the bus directly to a PC...

- Jon

sciguy14
02-10-2010, 12:58 PM
Oh I see, I need to be able to download the program onto the CM-5, so I guess I don't have a ton of options... I guess I'll just keep trying to mess around with it...

sciguy14
02-10-2010, 01:04 PM
There is some kind of strange overlap going on. If I just print 122:27, which is the High output from my IR sensor, I get a value that goes from 0 to 64,000. Moving the IR sensor alters this value very very slightly. But, moving the gyroscope that I have on Port 1 (address 28 and 29) causes that number to fluctuate all the way down to 0 and back up.

EDIT
Also, just printing 122:26, the low value from the IR sensor, I get values that range quite nicely from 0 to about 670. They approach 670 as I bring it closer and closer to a surface.

So is the issue just that when I call 27 it is combining that data with the data from 28?

ANOTHER EDIT
The same holds true with the Gyro. Reading just the low values, I get full, good range from 0 to 1024. I suspect the reason I can't get all the way to 1024 with the IR just has to do with the voltage levels it outputs. Though I can use a rail-to-rail opamp if I want to fix that...

Do you think I just need to be looking at the LOW values and calling it a day?

DresnerRobotics
02-10-2010, 01:26 PM
Oh I see, I need to be able to download the program onto the CM-5, so I guess I don't have a ton of options... I guess I'll just keep trying to mess around with it...

Try an arbotiX (http://www.trossenrobotics.com/p/arbotix-robot-controller.aspx)? All the cool kids are doing it! :D

iBot
02-10-2010, 02:20 PM
Yes, just stick with the low values and you should be fine. Don't add the high value.

It is not that BCP doesn't work, it is just that the internals like this are not documented and that makes it a pain.

If you now have the data you need, move on.

sciguy14
02-10-2010, 06:00 PM
The arbotix board does look pretty awesome, I might just have to try it out!

I'll use the low values for the sensors. I know I've been a bit of pain, so thanks for being so patient and helping me out! I learned a lot!

James Puddicombe
01-08-2011, 03:52 PM
Hi Jon,

Are you able to say what is the recommended maximum draw for the motors from the i/o board? Is it acceptable to power small motors directly, or are you anticipating that they would receive power through some 'amplification' mechanism?

Many thanks,
James

James Puddicombe
01-09-2011, 04:23 AM
OK - am now realising just how stupid that question was! Of course I need to connect the output to an H-bridge. I'm thinking of using one based on the L298, http://www.solarbotics.com/products/k_cmd/

Has anyone tried this?

JonHylands
01-11-2011, 07:27 AM
James,

I haven't used it with an L298, but it will certainly work okay - I've used the L298 in other projects.

- Jon