Print
PDF
17
November
2011

The Segway

I originally posted the theory behind the control software for my Segway back in January, over 11 months ago. As most of you expected at the time, I was indeed working on building my own Segway. I finished the darn thing back in May, and am finally getting around to uploading pictures and documentation of the project.

 

The first step of the mechanical aspect of the Segway was to weld a base plate which the rider stands on. I used a plate of 3/16" steel with reinforcements of 1/2" square tubing welded on the back. You can also see where I drilled and cut out holes for mounting the motors.


 

The next step was to weld brackets for the handlebars.


The handlebars are held to the base plate using four brackets.


Handlebars and motors mounted.


The wheelchair motors I used had 24v electronic brakes on them. For my application, I needed to disable the brakes.


I could have just applied 24v across the brake solenoid, but why waste the power? By taking out the bolts that hold the brake to the motor body, the entire brake was able to spin freely of the motor, effectively disabling them. This also meant that if I ever wanted to use the brakes in the future, all I have to do is put the bolts back in.


The wires to the brake also had to be cut to allow it to spin freely. I made sure to leave enough length to be able to easily solder them back together if I ever need to.


I'm using two 12v 17Ahr SLA batteries to power the motors and electronics (via a BEC), loaned to me by my local FIRST robotics team, team 3142.


The final step on the frame was to weld brackets to hold the batteries in place and hooks to mount the battery strap.


The brains of the project: an Arduino Uno running software based on the control theory, taking measurements from a 5DOF IMU and driving the motors. The LCD screen shows the current angle of the board.


The motor drivers I used: 2 Pololu 18v25 drivers. They will control up to 25 A continuously without a heatsink.


Testing the control electronics with a single small motor.


The completed electronics board ready to be mounted to the Segway for testing.


The control board mounted to the underside of the base plate (the IMU should be as close to the axis of rotation as possible) with all the high power wiring done.


The power wiring is connected to the batteries through a 30A circuit breaker which doubles as an on/off switch.


Here the segway is held perfectly level and raised off of the ground via 4x4 blocks for sensor calibration. Since the vehicle batteries must be powering the Arduino for the most accurate ADC readings, it's rasied off the ground to make sure it can't run away during testing. The laptop is connected to the board to calibrate the sensor values.


Last but not least - you need some way to steer the darn thing. Since I was running out of time, I simply used a potentiometer mounted to the top of the handlebars to control the differential steering.


Comments 

 
0 #5 Richard 2012-05-13 08:01
Thank you for the info.

It is called Technical Cybernetics and not many universities can offer that (I believe Berkley got it). It is basicly control design. I have choosen to specialize within robotics. It is pretty fun!
Quote
 
 
0 #4 Chris 2012-05-12 00:45
Quoting Richard:
I got a quick question about the motor controller though. I assume it is USART communication? Just wondering how you communicate with it? Didn't see any commands in the datasheet for the motor controller. Is it just simply (for instance) MOTOR=1024 (assuming 10bit) and the motor goes full speed? I have used Parallaxs motor controllers before and they had built-in commands for wheither the motor should be go in reverse, stop etc.


Hi Richard,

Thanks for the kind words - what do you study specifically?

As for the motor controller, it just takes a simple PWM input, nothing fancy. The product page (www.pololu.com/.../758) has a wealth of information on ways to interface.

-Chris
Quote
 
 
0 #3 Richard 2012-05-10 11:38
First off, great site! You my friend should study cybernetics (as me) :)

This really got me inspired to make my own segway. I got a quick question about the motor controller though. I assume it is USART communication? Just wondering how you communicate with it? Didn't see any commands in the datasheet for the motor controller. Is it just simply (for instance) MOTOR=1024 (assuming 10bit) and the motor goes full speed? I have used Parallaxs motor controllers before and they had built-in commands for wheither the motor should be go in reverse, stop etc.
Quote
 
 
0 #2 Chris 2012-03-12 13:48
Hi Glenn,

I will not simply give you my code, as that would not really allow you to LEARN how it is done. However, check out this instructable which helped me to understand the basics when I was first starting out with the Segway: instructables.com/.../Segstick

Do not be afraid to use Google and teach yourself things that you don't understand. There is a wealth of information out there about home-built segways, Arduino programming, and the control theory concepts used in this project. If you have never programmed using the Arduino language, I would suggest you follow some beginner tutorials on the Arduino before trying this, unless you have prior experience programming embedded devices. Don't hesitate to contact me using the link at the bottom of the page if you need help with anything else.

-Chris
Quote
 
 
0 #1 Glenn 2012-03-07 08:21
Hi,

I'm a student from belgium and trying to make also a segway. but I don't know how to start on the software, and I see that you use IMU 5DOF and adruino uno just like we do. know is my question can i see the code, because I have never programmed in arduino.

Thanks
Quote