Logo

Forums » Segbot » IMU models

Pages:
johndavid400
Avatar
I am going to go ahead and start a topic here about IMU selection for the Segbot. It seems as though every time I find an IMU and write some code to make it work in the Segbot, the IMU is discontinued soon after. suggestions for new IMU's or comments on anyone else's experiences would be great.
RickMcdaniel
Avatar
Yea, i wish they would stick with an IMU for awhile. The one I am experimenting with is the Sparkfun 6 DOF IGT3200/ADXL345 SEN-10121. There's a bildr tutorial at this link: http://bildr.org/2012/03/stable-orientation-digital-imu-6dof-arduino/ It has a library that makes it simple to use the IMU. The library is easy to use, but its kind of black box. I feel better when I know what the code is doing.
The Westerner
Avatar
Hi, I'm starting to build my segbot and I already have most of the components (motors, partial frame, Sabertooth 25 controller, Arduino Duemilanove). But since the recommended IMU's are mostly discontinued, I'm having to test out a number of different ones that I have, but with no success so far. These are the IMU's that I have tried: ADXL345 3-axis accelerometer MMA7631 3-axis accelerometer ADXL330 3-axis accelerometer MPU6050 3-axis accelerometer + 3-axis gyroscope I'd like to start out using the latest version of your code because it auto-calibrates the IMU's and has the option to start up in debugging mode. and I'm interested in using the MPU6050 because it is both an accelerometer and a gyro, but it seems this is a complicated IMU to configure, given that it requires its own I2C libraries. I might just get a new gyro to use with the MMA7631, but before I do. has there been any progress on finding replacement IMU's? FYI, I found that I had to delete the BYTE command from the code because it's not used in arduino 1.0.3: Serial.print(m1_speed, BYTE); Serial.print(m2_speed, BYTE); } Many thanks and looking forward to all replies!
johndavid400
Avatar
awesome, I will check that one out.
johndavid400
Avatar
Yes, when using Arduino IDE 1.0 and above, you have to change the serial commands from: Serial.print(m1_speed, BYTE); to: Serial.write(m1_speed); which writes to the serial port as a Byte. And I will be trying again to find a reliable source for a gyroscope... which I am thinking will be the one they sell at Radio Shack (Parallax 27911-RT), as it has been around for a while - even though it uses an I2c or SPI interface. I like analog sensors, but they are sadly being phased out.
ArduinoJack
Avatar
Thank you for creating this site. It's a tremendous help for building a Segbot. I have the Gyro Breakout Board - LPY503AL Dual 30°/s from Sparkfun. I'm planning to tweak the code you made for the LPY530AL. Can you direct me to which parts of the code I should work on tweaking? Thank you in advance for the help.
johndavid400
Avatar
Thanks, I started a thread about that gyroscope as Sparkfun actually sells it: href="http://prototyperobotics.com/forums/forums/segbot/topics/lpy503al-gyroscope
ArduinoJack
Avatar
Thank you for the reply. I greatly appreciate it. I'm planning to use your V3 autocalibrating code and just use the values of the MMA7361 accelerometer for the code. I will keep in touch. Thank you for starting the gyroscope thread.
bestgabe
Avatar
hi Im working on the imu code for a 6dof but im stuck , anybody success yet?
johndavid400
Avatar

which model 6DOF board do you have... can you paste a link?

I just bought a Parallax L3G4200D 3-axis gyroscope from Radio Shack, so I should have some code for that soon.

JohnNguyen
Avatar

Hi all,

I'm new in here, and I'm success to finish the Lawn-Bot by following how to in Arduino Robotics by JohnDavid400 book. Now, I want to move next project Segbot. I already have all parts as motors, Arduino Uno, etc...from last project except for IMU. Follow the book I can not find those 6 DOF anolog IMU gyros.

Any one have extra 6 DOF IMU as in the book want to sell to me ? or anything can replace it ? I'm lost now.

Thank you in advance,

PS to JohnDavid400: Do you have extra 6 DOF IMU as in your book want to share with me ? I'm very appreciated. Thanks

Steve
Avatar

I searched around and found one left in stock from a supplier in Europe just last week. It is possible to still find one.

JohnNguyen
Avatar

Steve, are you talking about the one in Gemany, right ? they show europe currency, I don't know about it. Unless some one already order from them and give comment about it.

So I got from Canada kit, hope that work:

Version 1: Uses same code as Seg-bot in Arduino Robotics book

Gyroscope: http://www.sparkfun.com/products/10099

Accelerometer: http://www.sparkfun.com/products/9269

By the way, Don't know this question is right place. In John book, the steering is use thump to turn potentiometer left to right to turn segbot. I saw some one use Lean Steering technic. Any one know how to do it ?

http://www.youtube.com/watch?v=F50Fea3My1Q

Thanks

ArduinoJack
Avatar

Hi there John,

Hope you're having a great day. I'm using your V3 Autocalibrate code and I understand I connect Digital Pin 1 of the Arduino to the Serial Input (S1) of the Sabertooth Motor Controller. I'm trying to understand each aspect of the code and I would like to know where exactly is this pin used in the code? Is it the  int engage_state = 1.  This is the only place I see 1 used in the code. I assume this is Digital Pin 1? If this is not Digital Pin 1 then which part of the code is using Digital Pin 1 to send a command to the Serial Input (S1) of the Sabertooth Motor Controller? Thank you in advance for you assistance.

JohnNguyen
Avatar

Hi, Today is 03/22/2013. Just got inform from seller who I order is discontinued item. So I'm back into square one now. Can not find Gyros for any Version in John Book.

Does any one have those item want to share to me ? thanks

johndavid400
Avatar

Hi Jack,

Good question... this might seem a bit confusing, but the part that tells the Arduino to use pin D1 is actually the first line of the setup() function:

  // Start the Serial monitor at 9600bps
  Serial.begin(9600);

This is how you start the serial communication port on the Arduino, which by default uses digital pins 0 (rx) and 1 (tx). Since the serial communication pins cannot be changed, the Arduino just knows that anytime you do Serial.write() or Serial.print(), that you want to send serial data through the transmit pin (tx = D1). If you use the commands Serial.available() or Serial.read(), you are asking the Arduino to listen for serial data from another device on the receive pin (rx = D0). All serial data transfer will be done at the speed that is declared when you start the serial montior with Serial.begin(speed) command - so the other device (the one listening for or the one sending the data) must be set to operate at the same serial speed (measured in bits per second).

In our case, the Sabertooth can be set to a number of different speeds, but I typically use 9600bps for most scenarios. My bluetooth module from Sparkfun operates at 115200bps, which is quite a bit faster and allows for more data to be sent in the same amount of time - but this sketch is only writing serial data to the Sabertooth 20 times each second so we are fine with 9600. Here is the command we use in this sketch to actually send the serial data through pin D1:

  // Serial speed values write here:
  Serial.write(m1_speed);
  Serial.write(m2_speed);

The engage_state = 1, is a variable used to hold the value for whether or not the safety engage button is being pressed on the handlebar - pressing the button allows you to start riding.

 

ArduinoJack
Avatar

Thank you for the reply John. I will thoroughly read the explanation and understand it to the best of my ability

gerrymoore
Avatar

Hi all...I'm new to the forum...based near Liverpool, UK.....and looking to build a one wheel version of the segbot...ie an electric unicycle!   I'm great with mechanics and engineering ( have my own home built CNC plasma cutter) and not too bad at electronics..but fall down on programming :-((

I have the new IMU 6050 6DOF board - very inexpensive on EBAY - and I have been trying, without sucess, to get the little teapot sketch to work as a basis to start in designing the unicycle electronics with help from the segbot code.  I'm wondering if my Arduino  duemilanova is compatible with this 6DOF board (I2C) or whether I need a later version?  I'd be grateful for any help on this as I think Digital IMU's are now the way to go and so inexpensive to buy.  So if anyone can point me to some example code that works with my Arduino.....cheers

 

johndavid400
Avatar

Hi there and welcome,

I am in the process of writing some code for the Parallax gyroscope which also uses SPI or I2c digital communication... I have it sending it's values to the Arduino, but have yet to integrate it into my Segbot sketch. As soon as I do, I will post it on here and it should be very close to what you need for your sensor. I will likely start a new thread on here for digital IMU's as they are becoming the only thing readily available.

If you are in a hurry to test it out, here is the code snippet I used to get the I2c gyro talking to the Arduino. I am thinking about creating separate gyro and accelermoter files to put into a library so that people can just include the gyro and accel file of their choosing - sort of a mix and match setup. I think it would be easier to set up that way.

Pages: