Sensor usage with CM-5

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
57 postsPage 2 of 41, 2, 3, 4
57 postsPage 2 of 41, 2, 3, 4

Post by sdeba » Wed Nov 16, 2011 11:24 pm

Post by sdeba
Wed Nov 16, 2011 11:24 pm

Ok. What about VCC pin you've connected. I don't really see its role. On Arduino webpage they said that to VCC there must be connected regulated voltage (5V). Can you explain it to me?

The first sensor will be gyroscope. It is relatively cheap and will be great addon to the humanoid robot.
Ok. What about VCC pin you've connected. I don't really see its role. On Arduino webpage they said that to VCC there must be connected regulated voltage (5V). Can you explain it to me?

The first sensor will be gyroscope. It is relatively cheap and will be great addon to the humanoid robot.
sdeba offline
Savvy Roboteer
Savvy Roboteer
Posts: 31
Joined: Sat Nov 12, 2011 9:00 pm

Post by i-Bot » Thu Nov 17, 2011 12:49 pm

Post by i-Bot
Thu Nov 17, 2011 12:49 pm

The diodes and resitor are for protection and are not essential to the operation of the interface. the diode will only conduct if the voltage on the data pin goes above 5V (Vcc) or below 0V (gnd). The resistor is in case two devices try to drive the dynamixel bus at the same time. The clipping off ofe the Vcc pin on the programming connector was also to prevent any nasties from the bus getting back to the PC from the dynamixel bus. I consider the dynamixel bus a fairly hostile environment ( 12V, motors, wires at risk of damage), it is also an experimental environment in our case.

The Vcc pin on the Pro Mini is thus an output in our case at 5V provided through the regulator.
Image
http://arduino.cc/en/uploads/Main/Arduino-Pro-Mini-schematic.pdf


Did you already chose a Gryo ? the analog are usually easier, but the digital more accurate. It is likely the gyro will be designed for 3.3V, so additional regulator and level conversion may be required. We chose the 5V version of the arduino since it is faster, and meets the voltage level requirements of the dynamixel bus. The 3.3V version is out of specification for the Dynamixel bus, but does still work, the Bioloid 5/6 DOF IMU from Jon runs at 3.3V.
The diodes and resitor are for protection and are not essential to the operation of the interface. the diode will only conduct if the voltage on the data pin goes above 5V (Vcc) or below 0V (gnd). The resistor is in case two devices try to drive the dynamixel bus at the same time. The clipping off ofe the Vcc pin on the programming connector was also to prevent any nasties from the bus getting back to the PC from the dynamixel bus. I consider the dynamixel bus a fairly hostile environment ( 12V, motors, wires at risk of damage), it is also an experimental environment in our case.

The Vcc pin on the Pro Mini is thus an output in our case at 5V provided through the regulator.
Image
http://arduino.cc/en/uploads/Main/Arduino-Pro-Mini-schematic.pdf


Did you already chose a Gryo ? the analog are usually easier, but the digital more accurate. It is likely the gyro will be designed for 3.3V, so additional regulator and level conversion may be required. We chose the 5V version of the arduino since it is faster, and meets the voltage level requirements of the dynamixel bus. The 3.3V version is out of specification for the Dynamixel bus, but does still work, the Bioloid 5/6 DOF IMU from Jon runs at 3.3V.
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by i-Bot » Thu Nov 17, 2011 1:04 pm

Post by i-Bot
Thu Nov 17, 2011 1:04 pm

Here is the mapping of the Bioloid IO pins to the Arduino Pro.
Code: Select all
Bioloid IO      Pro Mini       Port         Comment
Analog 0        A0              A0
Analog 1        A1              A1
Analog 2        A2              A2
Analog 3        A3              A3
Analog 4        A4              A4
Analog 5        A5              A5
Digital 0       D5              D5
Digital 1       D6              D6
Digital 2       D7              D7
Digital 3       SCK             B5         See note below
Motor 0         D9              B1
Motor 1         D10             B2
Timer_UART      D3              D3         Serial Debug output pin



SCK pin is used by the green led on the Pro Mini, and I changed it to be the status LED in the code. I did not change Digital 3 to swap over. You can use pin D2 or other free pin as digital 3 if you change the code.
Here is the mapping of the Bioloid IO pins to the Arduino Pro.
Code: Select all
Bioloid IO      Pro Mini       Port         Comment
Analog 0        A0              A0
Analog 1        A1              A1
Analog 2        A2              A2
Analog 3        A3              A3
Analog 4        A4              A4
Analog 5        A5              A5
Digital 0       D5              D5
Digital 1       D6              D6
Digital 2       D7              D7
Digital 3       SCK             B5         See note below
Motor 0         D9              B1
Motor 1         D10             B2
Timer_UART      D3              D3         Serial Debug output pin



SCK pin is used by the green led on the Pro Mini, and I changed it to be the status LED in the code. I did not change Digital 3 to swap over. You can use pin D2 or other free pin as digital 3 if you change the code.
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by sdeba » Thu Nov 17, 2011 11:28 pm

Post by sdeba
Thu Nov 17, 2011 11:28 pm

I'm still waiting for delivery, I hope it'll come tommorow. Anyway in package there are some diodes and resistors, so if they'll fit then I'll put them into my configuration.

VCC pin role is now clear to me, it is an output voltage of 5V.

I am thinking about this gyro: http://www.sparkfun.com/products/9801
Mainly because it is easy accessible in my country, but it has 3,3V so I'll must convert 5V to 3,3V. To do this I found this: http://www.sparkfun.com/products/8745 .Will it be good?

Thank you for pins mapping table.
I'm still waiting for delivery, I hope it'll come tommorow. Anyway in package there are some diodes and resistors, so if they'll fit then I'll put them into my configuration.

VCC pin role is now clear to me, it is an output voltage of 5V.

I am thinking about this gyro: http://www.sparkfun.com/products/9801
Mainly because it is easy accessible in my country, but it has 3,3V so I'll must convert 5V to 3,3V. To do this I found this: http://www.sparkfun.com/products/8745 .Will it be good?

Thank you for pins mapping table.
sdeba offline
Savvy Roboteer
Savvy Roboteer
Posts: 31
Joined: Sat Nov 12, 2011 9:00 pm

Post by i-Bot » Fri Nov 18, 2011 10:16 am

Post by i-Bot
Fri Nov 18, 2011 10:16 am

I hope the bits arrive for the weekend. I have limited bandwidth over weekend, but will be back next week.

The gyro and converter you describe are good. If you want to add accelerometer later, then the sparkfun 6 DOF digital combo board adds ADXL345 accelerometer to the same gyro with cost and space savings.
I hope the bits arrive for the weekend. I have limited bandwidth over weekend, but will be back next week.

The gyro and converter you describe are good. If you want to add accelerometer later, then the sparkfun 6 DOF digital combo board adds ADXL345 accelerometer to the same gyro with cost and space savings.
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by sdeba » Fri Nov 18, 2011 7:36 pm

Post by sdeba
Fri Nov 18, 2011 7:36 pm

Unfortunately the parts didn't come today. They'll be delivered on monday ;/ Have a nice weekend ;)
Unfortunately the parts didn't come today. They'll be delivered on monday ;/ Have a nice weekend ;)
sdeba offline
Savvy Roboteer
Savvy Roboteer
Posts: 31
Joined: Sat Nov 12, 2011 9:00 pm

Post by sdeba » Mon Nov 21, 2011 10:47 pm

Post by sdeba
Mon Nov 21, 2011 10:47 pm

Hi,
All parts came today. I've already soldered all needed pins and tested the board. Now I would like to build a prototype with all needed connections done etc. I'll buy gyroscope (I'm considering also 6 DOF IMU as you suggested) at the beggining of December (now I'm out of money) and then I'll be able to test it properly. In my pack there was 10x 230 Ohm resistors and 10x red leds (you said something about protection so maybe it would be useful).

Correct me if my thoughts are wrong:
- RAW pin should be connected to middle pins of Dynamixel Bus
- Pins at Dynamixel Bus on the right should be connected do GRD pin on Arduino (does it matters which one, the left GRD or right GRD on Arduino board?)
- Left pin of Dynamixel bus should be connected to TXO pin on Arduino
- VCC pin should be connected to AX Bus <-> GRD and AX Bus <-> TXO cables

And probably that's all, Am I right? ;)
Hi,
All parts came today. I've already soldered all needed pins and tested the board. Now I would like to build a prototype with all needed connections done etc. I'll buy gyroscope (I'm considering also 6 DOF IMU as you suggested) at the beggining of December (now I'm out of money) and then I'll be able to test it properly. In my pack there was 10x 230 Ohm resistors and 10x red leds (you said something about protection so maybe it would be useful).

Correct me if my thoughts are wrong:
- RAW pin should be connected to middle pins of Dynamixel Bus
- Pins at Dynamixel Bus on the right should be connected do GRD pin on Arduino (does it matters which one, the left GRD or right GRD on Arduino board?)
- Left pin of Dynamixel bus should be connected to TXO pin on Arduino
- VCC pin should be connected to AX Bus <-> GRD and AX Bus <-> TXO cables

And probably that's all, Am I right? ;)
sdeba offline
Savvy Roboteer
Savvy Roboteer
Posts: 31
Joined: Sat Nov 12, 2011 9:00 pm

Post by i-Bot » Tue Nov 22, 2011 5:28 pm

Post by i-Bot
Tue Nov 22, 2011 5:28 pm

You could connect 230 ohm resistors and LED to the D5, D6, D7 pins to try the digital outputs from Roboplus task.

Adding the protection is advised, but if not then.
- RAW pin should be connected to middle pins of Dynamixel Bus
- Pins at Dynamixel Bus on the right should be connected do GND pin on Arduino (either on is OK, they are connected on Arduino.
- Left pins of Dynamixel bus should be connected to TXO pin on Arduino

If you add protection then
- RAW pin should be connected to middle pins of Dynamixel Bus
- Pins at Dynamixel Bus on the right should be connected do GND pin on Arduino (either on is OK, they are connected on Arduino.
- Left pins of Dynamixel bus should be connected to TXO pin on Arduino via a 47 ohm resistor
- Add diode from left pin of Dynamixel bus(anode) to VCC on Arduino(cathode)
- Add diode from left pin of Dynamixel bus(cathode) to GND on Arduino(anode)
You could connect 230 ohm resistors and LED to the D5, D6, D7 pins to try the digital outputs from Roboplus task.

Adding the protection is advised, but if not then.
- RAW pin should be connected to middle pins of Dynamixel Bus
- Pins at Dynamixel Bus on the right should be connected do GND pin on Arduino (either on is OK, they are connected on Arduino.
- Left pins of Dynamixel bus should be connected to TXO pin on Arduino

If you add protection then
- RAW pin should be connected to middle pins of Dynamixel Bus
- Pins at Dynamixel Bus on the right should be connected do GND pin on Arduino (either on is OK, they are connected on Arduino.
- Left pins of Dynamixel bus should be connected to TXO pin on Arduino via a 47 ohm resistor
- Add diode from left pin of Dynamixel bus(anode) to VCC on Arduino(cathode)
- Add diode from left pin of Dynamixel bus(cathode) to GND on Arduino(anode)
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by sdeba » Tue Nov 22, 2011 7:37 pm

Post by sdeba
Tue Nov 22, 2011 7:37 pm

Ok, so I'll add protection. Can I use any type of diodes?

I'll make the connections this week and order 6 DOF IMU on monday. So I'll be testing the whole thing next week ;)
Ok, so I'll add protection. Can I use any type of diodes?

I'll make the connections this week and order 6 DOF IMU on monday. So I'll be testing the whole thing next week ;)
sdeba offline
Savvy Roboteer
Savvy Roboteer
Posts: 31
Joined: Sat Nov 12, 2011 9:00 pm

Post by sdeba » Fri Nov 25, 2011 1:59 pm

Post by sdeba
Fri Nov 25, 2011 1:59 pm

I've received Molex Spox sockets and 47R resistors today, so I'll make the board later this day and I'll try to test it as you suggested using 230Ohm resistors ;) As I posted before on Monday I'll order 6DOF sensor ;) I am curious if this board (arduino etc.) will be accessible from RoboTask? ;)
I've received Molex Spox sockets and 47R resistors today, so I'll make the board later this day and I'll try to test it as you suggested using 230Ohm resistors ;) As I posted before on Monday I'll order 6DOF sensor ;) I am curious if this board (arduino etc.) will be accessible from RoboTask? ;)
sdeba offline
Savvy Roboteer
Savvy Roboteer
Posts: 31
Joined: Sat Nov 12, 2011 9:00 pm

Post by i-Bot » Fri Nov 25, 2011 2:16 pm

Post by i-Bot
Fri Nov 25, 2011 2:16 pm

I did not try it, but I assume it will work under RoboTask using the Dynamixel custom function to read and write.

Don't forget the Sparkfun level converter and the 3.3V regulator when you order IMU.
I did not try it, but I assume it will work under RoboTask using the Dynamixel custom function to read and write.

Don't forget the Sparkfun level converter and the 3.3V regulator when you order IMU.
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by sdeba » Fri Nov 25, 2011 2:26 pm

Post by sdeba
Fri Nov 25, 2011 2:26 pm

http://www.sparkfun.com/products/8745 - this one will convert levels and regulate voltage to 3,3V , Am I right?

What about diodes used for protection, can it be any type of diodes?
http://www.sparkfun.com/products/8745 - this one will convert levels and regulate voltage to 3,3V , Am I right?

What about diodes used for protection, can it be any type of diodes?
sdeba offline
Savvy Roboteer
Savvy Roboteer
Posts: 31
Joined: Sat Nov 12, 2011 9:00 pm

Post by i-Bot » Fri Nov 25, 2011 4:10 pm

Post by i-Bot
Fri Nov 25, 2011 4:10 pm

The http://www.sparkfun.com/products/8745 will convert the logic levels from 3.3V to 5V. You will use the two TX circuits becasue the SDA and SCL are bidirectional. You also need a 3.3V regulator. It could be like this :
http://robosavvy.com/store/product_info ... cts_id/318
though a smaller one would be better given the small current required.

The diode should be 1N4148 or similar. Schottky is OK. Proper protection diodes are better but usually surface mount. Power diodes are not good due to high capacitance.

I just saw this IMU which has regulator and level converter built in, also a 3 axis magnetometer.
http://www.pololu.com/catalog/product/1265
The http://www.sparkfun.com/products/8745 will convert the logic levels from 3.3V to 5V. You will use the two TX circuits becasue the SDA and SCL are bidirectional. You also need a 3.3V regulator. It could be like this :
http://robosavvy.com/store/product_info ... cts_id/318
though a smaller one would be better given the small current required.

The diode should be 1N4148 or similar. Schottky is OK. Proper protection diodes are better but usually surface mount. Power diodes are not good due to high capacitance.

I just saw this IMU which has regulator and level converter built in, also a 3 axis magnetometer.
http://www.pololu.com/catalog/product/1265
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by sdeba » Fri Nov 25, 2011 6:31 pm

Post by sdeba
Fri Nov 25, 2011 6:31 pm

This IMU from Polulu is really great. It is cheap, it has voltage regulator and level converter and it is available in my local store. Unfortunately they are waiting for delivery now, so I'm waiting for their reply when it'll be available. If it won't happen soon (next week;]) then I'll consider buying SparkFun IMU OR just simple 3 axis gyroscope from Polulu with regulator etc. on board ;) What is real point in having accelerometer on robot?

How about accesibility of all this modules while programming? Is reading state of IMU from Polulu much different than from SparkFun IMU? Where I can find those libraries for Bioloid CM-5 programming?
This IMU from Polulu is really great. It is cheap, it has voltage regulator and level converter and it is available in my local store. Unfortunately they are waiting for delivery now, so I'm waiting for their reply when it'll be available. If it won't happen soon (next week;]) then I'll consider buying SparkFun IMU OR just simple 3 axis gyroscope from Polulu with regulator etc. on board ;) What is real point in having accelerometer on robot?

How about accesibility of all this modules while programming? Is reading state of IMU from Polulu much different than from SparkFun IMU? Where I can find those libraries for Bioloid CM-5 programming?
sdeba offline
Savvy Roboteer
Savvy Roboteer
Posts: 31
Joined: Sat Nov 12, 2011 9:00 pm

Post by i-Bot » Sat Nov 26, 2011 11:59 am

Post by i-Bot
Sat Nov 26, 2011 11:59 am

Accelerometers are usually best for measuring the pitch and roll angle of the robot. The gyro measures angular velocity, but suffers from significant drift. If you integrate the output of the gyro to get angle, the drift is very bad.

Gryo is best for making corrections to robot angle when encountering uneven ground or external forces. The drift however can be a problem if not cancelled, causing the robot to lean.

Reading robot pitch and roll angle from the accelerometer is good for detecting fallen and getting up in the right direction. Accelerometers detect accelerations other than gravity, so are prone to noise when in motion, so not so good for balance.

In higher end IMU, the mutiple sensor outputs are mixed together to give best accuracy and response for measuring both angle and angular velocity. The mixing is usually done with a Kalman or a complimentary filter.

Magnetometer can also be mixed to get an accurate yaw angle, but sensor placement is important due to servo motors.

Both IMU can are I2C, so can use the HUV or similar I2C code, the actual libraries for the gyro and magnetometer will need translating over from existing Arduino libraries. To the CM-5 and Robotask the different sensors usually appear as custom dynamixel memory values for X,Y, and Z, gyro and accelerometer readings.
Accelerometers are usually best for measuring the pitch and roll angle of the robot. The gyro measures angular velocity, but suffers from significant drift. If you integrate the output of the gyro to get angle, the drift is very bad.

Gryo is best for making corrections to robot angle when encountering uneven ground or external forces. The drift however can be a problem if not cancelled, causing the robot to lean.

Reading robot pitch and roll angle from the accelerometer is good for detecting fallen and getting up in the right direction. Accelerometers detect accelerations other than gravity, so are prone to noise when in motion, so not so good for balance.

In higher end IMU, the mutiple sensor outputs are mixed together to give best accuracy and response for measuring both angle and angular velocity. The mixing is usually done with a Kalman or a complimentary filter.

Magnetometer can also be mixed to get an accurate yaw angle, but sensor placement is important due to servo motors.

Both IMU can are I2C, so can use the HUV or similar I2C code, the actual libraries for the gyro and magnetometer will need translating over from existing Arduino libraries. To the CM-5 and Robotask the different sensors usually appear as custom dynamixel memory values for X,Y, and Z, gyro and accelerometer readings.
i-Bot offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

PreviousNext
PreviousNext
57 postsPage 2 of 41, 2, 3, 4
57 postsPage 2 of 41, 2, 3, 4