Sneak Peak: Segway guide + code
Here is a short sneak peak of a project we are working on.
When the project is finished we are going to write a guide about it, publish the code and of course make a longer video explaining the different parts and showing the Segway in action!
I can briefly say that we are using 2x 12V motors + Motorcontroller from Pololu, a 6DOF board from Sparkfun, a FEZ Rhino and a 12V battery pack.
The data from the 6DOF board is run thru a Kalman filter, whose data is used in a PID filter to regulate the motors. More details and source code will come soon!
The code can be found below:
BalancingRobot.zip
Update
More information about the finished robot can be found here: http://blog.tkjelectronics.dk/2012/03/the-balancing-robot/

Hi,
i’m building a simple seegway that is very similar to your seegway. So my compents are:
1) arduino 1
2)IMU ITG3200/ADXL345 http://www.sparkfun.com/products/10121
3)2 servo HSR-1425CR http://www.robot-italy.com/product_info.php?cPath=85_28&products_id=1826
The algorithms I’m using to balance it is PID, LQR and pole assignment. I was thinking of integrating this project into a drive this http://blog.tkjelectronics.dk/2011/09/fez-panda-ps3-controller-via-bluetooth/. What do you think? do you think is feasible?
@batista1987
Hehe, we thought about doing the same.
Though we have had some problems with the FEZ Panda not being fast enough because it doesn’t run/use Native code. This makes the wheel encoder routine a bit slow, and if it is going to do Bluetooth PS3 controller communication also it might not work.
But as you are thinking about using the Arduino, I would recommend you to use the Arduino MEGA as it has a bit more RAM which makes it able to communicate with a PS3 controller via Bluetooth, by using a USB Host shield. We will soon publish an Arduino library for this.
Best Regards
Thomas Jespersen
ok, thanks for your suggestions. what 6Dof you are using? you think that is necessary an encoder?
@batista1987
I’m using this 6DOF IMU from Sparkfun: http://www.sparkfun.com/products/10010
You should check out my other post for details: http://blog.tkjelectronics.dk/2011/06/guide-gyro-and-accelerometer-kalman-filtering-with-the-arduino/
The problem is that the robot doesn’t if the wheels are actually turning, so it’s hard for it to stay at the same place the whole time. It might start drifting to one of the sides. The encoders aren’t necessary but if you haven’t bought your motors yet, I recommend you get some with build in encoders. I’m using these from Pololu: http://www.pololu.com/catalog/product/1443, there a okay, but with noticeable backlash.
I will update the post soon with more details -- i promise
@Lauszus
unfortunately I have bought already them. According to you I can make it to work with my servant?
@batista1987
Yes you can. The video above actually haven’t implemented the encoders. So you can definitely make it work without them or you could use external encoders