Instructables
IMG_2993.jpg
P1010049.JPG
You are never to old to learn and try new things. I think one of the best days in my life was the day I discovered the Instructables web site. It opened up a whole new world to me. This is my third instructable . I really enjoy building anything that I can ride on or get in to.
I bought an Arduino Uno and was planning on building a balancing Robot. I was really impressed with the Balancing Skate Board that was published by Xenon John. It had most of the code that I would need to build a balancing something. That something evolved from a Robot to a Sit Down Segway clone, which I named the SITWAY. I want to at this time thank John for all the help and patience he showed me in building and testing this ible.

This is my second project involving a discarded electric wheel chair. The motors have great torque and are very reliable. They use 24 volts and have great range using two U1 type garden tractor batteries. You can't go any cheaper than that. 

The build went pretty smoothly. Thankfully Xenon John pitched in and helped me modify his code to work with my wheel chair motors.
After running all the tests I felt were needed I elected to have a young neighbor take the first ride. It turned out to be a real blast. So far eight or ten people have ridden it, the youngest being 12, and the oldest 81 (me). The training wheels limit the speed by limiting the forward tilt. I plan to keep the rear training wheels on permanently because I don't need a lot o speed going backwards.

The SITWAY appears to be pretty safe, but it does not have all the built in backup systems that a real Segway has, I have only tested it on my smooth driveway at this time. I have driven over small objects, and it still stayed stable..Any one can learn to drive it in about 5 or10 minutes. With all the testing and driving we have done I have yet had to charge the batteries. The original wheel chair had a published range of 20 miles.. HAVE FUN!!!



 
Remove these adsRemove these ads by Signing Up

Step 1: MATERIALS AND COSTS


           Item                                                                        Source                                                                                         Cost

1. Donor electric wheelchair                                  Various places                                                   $50 to $200 Depending on condition
2. Arduino Uno                                                      Maker Store                                                       $30
3. Arduino Uno Proto-shield                                  Spark Fun                                                         $15
4. 5 degrees of freedom  IMU                                Spark Fun                                                         $49
5. Sabertooth 2X25                                               Dimension Engineering                                     $129
6. Two surface mount LED's                                  Radio Shack                                                     $1.29
7. Two Momentary contact switch's  (trim)             Radio Shack                                                      $1.29
     (normally open)
8. Two micro switches for Steering                        Radio Shack                                                      $3
     (normally open)
  9. Single pole single throw  power switch             Radio Shack                                                      $1
10 13X20X1/4" plate for base                                Local                                                                 $10
11. 1/2" steel tubing for seat frame                        Local                                                                 $10
12. Vinyl and foam for seat                                    Local                                                                 $4
13. Asst hook up wire                                             Local                                                                 $3
14. One can spray paint                                         Local                                                                 $3
Total                                                                                                                                                 $309 to $459

(note) I actually bought my used wheelchair for $35 at a yard sale
It was pretty beat up but the motors were good and even included
A 24 volt charger.My project cost less than $300.

Step 2: Salvaging parts from the donor wheelchair

Save the motors and drive wheels, they are usually one piece. Also salvage the connectors and wiring from the motors to the battery., leave the leads as long as possible. Keep the electronics if you want them for future use. Mine were trash. I never throw away wheels, they always come in handy. Most wheelchairs have two castoring wheels for steering, and two for stability when getting on the chair. Save the two stability wheels for training wheels on the project. Save the battery box and battery cover, you will use these. Dis-card the rest of the chair unless you think you will have use for it in the future. I threw most of it out to reduce clutter.

Step 3: Build the frame and mount the wheels and motors

I guess you could make this frame out of plywood, but I like to use steel. it's a lot stronger and welding is a lot of fun. The base is a 1/2" plate measuring 12X20". The uprights and seat frame is made of 1" steel tubing. Don't forget the 45 deg. braces in the corners. the four holes in the seat braces are for mounting the plywood seat support. The holes for mounting the motors are slotted about 6" long . At this point you do not exactly know where the C.G. will be. The motors can be adjusted fore and aft to adjust the C.G.The small wheels are used as training wheels and to keep the machine from falling over when not in use. Now is a good time to paint the frame You can make the frame any size you want. I designed this one to fit through an interior door. Cut the seat from 3/4" plywood . Pad and upholster a seat cushion to be bolted to the frame uprights.

Step 4: STEERING CONTROLLER

I originally used John's hand held steering controller, but found it was not practical for a sit down balancing machine. You need something  very rigid to hang onto when riding. The machine does a good job of balancing if you don't fight it by trying  to balance it your self..
The stick is rigid in the fore and aft position , and will move side to side in the lateral position. a compression spring centers the stick.
Two set screws provide stops, and two more act as limit switches for the two micro switches that control the steering.
This could be done simpler by mounting the micro switched on the outside of the stick, but I wanted to have them hidden inside the stick.
I have access to a vertical mill and I never miss a chance to use it.  The micro switches are available from Radio Shack for 3 or 4 dollars.

The adjustable front training wheel serves two purposes. first it keeps you from pitching forward during any sudden stops, and secondly it limits the forward speed by limiting the pitch angle until you get comfortable with riding it. The rear wheel is fixed limiting reverse travel to a safe speed.

Step 5: ELECTRONICS

Picture of ELECTRONICS
The electronics consist of the following
Arduino Uno
Shield
Sabertooth 2X25
5 Degree's of freedom IMU
Asst. LED's and switches
10K pull down resistors (5)
4 conductor cable and hook up wire

I don't like to solder directly to my Arduino. Instead I used a shield. This allows me to make solid solder connections instead of plugs that can come loose due to handling or vibrations.

A good place to begin is to solder the (5) 10k resisters to the shield. These are the pull down resisters for the balance trim, steering, and dead man circuits.

(Note) The following wires are connected to the Arduino digital pins
pin 9 is for the dead man switch circuit
pin 7 is for nose down trim  circuit
pin 6 is for  nose up trim circuit
pin 5 is for steer left circuit
pin 4 is for steer right circuit
The other end of the resisters goes to circuit ground
pin 13 connects to the S1 input of the Sabertooth Motor Controller

The following wires are connected to the Arduino Analog pins
pin 0 to Y Rate 4.5 on the IMU
pin 2 to X Rate on the IMU
pin 3 to Y Rate on the IMU
pin 4 to ZACC un the IMU
+5 volts to he Steering controller
+3.3 volts to the IMU (NOTE) do NOT apply 5 volts to the IMU
GND to the IMU

All the Analog connections can be soldered directly to the shield.
The Digital connections can be made either by plugging directly into the headers or using a connecter. I found some in the Sparkfun catalog that fit snugly into the headers (See above pic)

I found some four conductor ribbon cable at Radio Shack that worked well for me. It is stiff enough to hold it's shape, and the color coding makes life easier. You can use ribbon cable from an old computer just as well except for the color coding .

Mount the IMU to a small block either wood or phenolic to the floor of the machine at approximately the center line of the axles.
Be sure to mount it correctly.
The factory drilled mounting hole must be pointed towards the ground
The component side of the IMU must face forward
If you mount the IMU incorrectly bad things will happen.
The plate can be shimmed fore and aft to adjust for level balance

Fashion an aluminum plate to hold the power switch, and the trim and steer switches and mount it to be reached conveniently  while seated. I installed a power indicator LED (with a Pull down resister)  to verify Arduino power (12 volts)








Step 6: WIRING

P1010050.JPG
Generally wheelchairs operate on 24 VDC.. Main power is obtained from two U1 type lead acid batteries. They are used in lawn mower or lawn tractors. They are cheap ($40) and easy to get . 
There are four voltages used in this project
24 VDC for the motors
12VDC for the Arduino Uno
5 VDC for the steering and trim circuits
3.3 VDC for the IMU
 24 VDC is connected to the Sabertooth 2X25 . A power switch is installed in the negative leg. Be VERY  careful to maintain the correct polarity.
The Sabertooth will be permanently damaged if you hook it up with the wrong polarity. The warranty will also be voided.
The 12 VDC is obtained with a tap between the two batteries terminated with a plug for the Arduino power input. Do not use the USB circuit as a power source, strange things happen to the gyro when you use the USB for power.

The 5VDC and 3.3VDC is obtained from the Arduino Uno.
A 5 volt source  powers  the dead man, left and right turning, and both trim switches.
3.3 volts from the Arduino powers the IMU

Bolt the Sabertooth, the IMU mounted to a block, and the Arduino Uno and it's shield to the floor of the frame
Connect the motors to the Sabertooth. The left motor connects.  to M1A and M1B. The right motor to M2A and M2B.
S1 on the Sabertooth connects to Arduino pin 13. Connect Sabertooth ground to Arduino ground. This completes the Sabertooth wiring for now. These connections will be verified during the Motor test procedure a little later. Be sure and set the Sabertooth DIP switches for Simplified Serial operation. Set switches 1,3,5, and6 to the on position Switches 2, and 4 are set to the off position. These settings support using lead acid batteries.

Route the five wires from Digital pins 4,5,,and 9 plus a 5 VDC source to the steering handle.
Connect the 5 volts to one side of the two momentary on steering switches and to one side of the dead man switch.
Connect the other side of the switches to the wires coming from Arduino pins 4, 5, and 9.

Route the wires from Arduino pins 6, and 7 to the little plate with the trim switches. Connect one side to 5 VDC and the other to Arduino pins 6, and 7.Route the wires from the main power switch to this plate and attach them to a 40 amp SPST switch. Install a surface mounted LED indicator and power it with 5VDC to ground through a 10k resistor.

Install the batteries using the battery box or covers you salvaged from the wheelchair and this pretty much completes the basic construction of the project.. If you saved the charging plug from the wheel chair, install it in a handy place and wire it up to the 24 VDC source. Pad and upholster a seat cushion to be bolted to the frame uprights.


Step 7: MOTOR TEST

Picture of MOTOR TEST
P1010067.JPG
Now that the wiring has been completed, it is time to test the communication between the Arduino  and the Sabertooth.
IMPORTANT!!! Maker sure the Sabertooth DIP switches are set for Simplified Serial operation.
Raise the machine up on blocs high enough for the wheels to clear the floor and can spin freely.
Open the Motor Test notebook sketch. Copy and paste this sketch to a new Arduino sketch. Upload the new sketch to your Arduino.
This sketch only uses digital pins 9 and 13. (Dead man and serial input to the Sabertooth)
Turn on the main power switch and depress the Dead man switch. Both motors should start turning in the same counter clockwise direction. If they don't, reverse the wires going to the  M1 or M2 connections on the Sabertooth. Both motors should slowly increase in speed in 10% increments from stop to 50% and then from 50% to stop.

Step 8: THE FIRST TEST RIDE

Now that you know that the motors are turning in the right direction, and communicating with the Sabertooth, it is time to upload the full rocker switch code to the Arduino.. Copy the full test sketch into a new Arduino sketch and upload it to your Arduino.
This is a good time to exercise extreme caution as these motors are very powerful and can run across the room and do bad things.
This code makes use of a TIP START routine that lets the machine start gently at first and then after about 5 seconds comes up to full power.. With the machine tipped to its parked position turn on the  master switch. Count to five slowly. This allows the IMU to calibrate itself.
Next depress the dead man switch. (Note) I installed an LED to light up when pin 9 the dead man circuit is activated. Slowly bring the machine to an approximately level position. If all goes well the machine should balance it's self. Any time you sense a problem let go of the dead man and the machine will stop. If you De-activate the dead man you will have to start from the beginning and go through the TIP START routine again. Make these first tests with out getting on the machine. Tip the machine forward and backward a little and see if the machine tries to move accordingly Try a gentle turn in both directions. If all goes well you are ready for the first test ride.

Do not take the first ride when you are alone. Have some one there to help you if something goes wrong. At my age my bones are getting pretty brittle so I let my best friends teen age son do the honors. We made him wear a helmet and we brought him up to level after the TIP START by hand. He did a great job and mastered the machine in just a couple minutes.
For this first test we used the hand held controller that Xenon John uses in his skate board. It became obvious that for the SITWAY we would need a different control method. I built the new joy stick out of 1" steel tubing. Like the original Segway you need something to hang onto. The joy stick houses the two steering switches and the dead man circuit. The stick does not move in the fore and aft plane, the only movement is from side to side. This system really works well and has not given me any trouble. I moved the trim switched to a little aluminum plate mounted whitin reach of my left hand.

Step 9: ADDING 3D PRINTED OBJECTS

To spruce up the project I decided to add some caps and plugs to the frame to make it look a little better' The deadman switch is round and did not fit very well into the square hole of the joystick.. I designed a cap to attach it using "123D". I also printed out four plugs to cover the holes from the 1: tubing forming the frame. Not really necessary, but it looks good.. I am always looking for good uses for the 3D printer.

Step 10: CONCLUSION

I built the SITWAY entirely out of steel, mainly because I had the steel available and I love to weld. It could be built out of wood, but I don't think it would be quite as substantial.. This is an on going project. I am still tweaking the code to get the smoothest performance. I will publish improvements as the are ready. The present code will at least assure that the machine will Balance, Move, and Steer.

This version is a little slow at this time and that is alright by me for now. I plan to raise the front wheel a little for more forward speed.
Eventually I might eliminate the front training wheel all together when my confidence factor builds up.

The most important to learn is that the machine should balance you, not the other way around. Try to remain in a stiff position and let the machine do the work instead of fighting it.

SAFETY SAFETY SAFETY I take baby steps with any changes I make If you try to go too fast, this thing could hurt you. There is a lot of power with these motors. I have not tried to navigate over any large objects as yet. I plan to test it by running it over a 2X4 and see what happens.

It is a fun project. The neighborhood  kids are crazy about it and zip around the yard with ease. Thar's the main reason I have limited the speed for now. The wheel chair motors are very frugal with battery use. I have actually run on 12 VDC. It was a little sluggish but operated just fine.




1-40 of 69Next »
charlie82653 months ago

Mickydee

Great Instructable! I have made a similar segway type unit using wheelchair motors. I cannot get it to balance by its self. Can you tell me what PID parameters you used to get yours to balance?

Thanks Charlie

anooooos4 months ago

wonderful

Awesome work sir!! I am really happy to see you putting your experience for such innovative work & sharing it with people.
I am trying to build a self balancing scooter for my son, But here in India I am not able to find Sabertooth 2X25. So trying to figure out a way using high power transistors (2N3055) to drive motor. Will share the details once I am through with it.
I wanted to know how is the motor connected to the wheels. If possible please share the images of motor connected to wheels & also the specifications of the motor.
Once again thanks for sharing.

The motor and wheel are all in one unit from a powered wheelchair. There is also a gearbox included in this mechanism which means the motors spin quickly but the wheels turn slowly (but with a lot of turning force). If you can find a powered wheelchair to look at you will see what I mean.

Thank you very much sir!
XenonJohn6 months ago

Hi all,

The analog output IMU's are proving to be very hard to find now. I have finally managed to get a self-balancer working with a DIGITAL IMU that is easily available from Sparkfun. I have used snippets of code from all over the web to get it to work. I posted an Instructable on it here, with Arduino code, in case it helps anyone who is unable to obtain one of the older IMU's. Have tested it on my self-balance skateboard and it works fine.

http://www.instructables.com/id/Arduino-Self-Balan...

John

pabz961 year ago
hi we Ecuador mechatronics students interested in your project we design and the programming code as we need for a project grade so beneficent a donation
I built a stand up segway based off this code and everything works except that when it goes forward, it will eventually slow down and not keep a constant speed although I'm still leaning forward. any ideas on what values I can modify to fix this?
N_Settle911 year ago
Mickydee I'd like to thank you and Xenon John both for two great instructables. As an Electrical Engineering student the Sitway seemed like an awesome project. I still have to build my frame, but i have all my electronics wired up on a test board to work out the code before building the frame. For those who are looking for a replacement for the sparkfun 5 dof IMU I have found one, the balance point isn't quite the same but it is almost plug and play with your code. Here is the IMU I am using http://www.dhgate.com/gy-66-idg655-adxl335-module-5dof-module-twin/p-ff8080813c8a9352013d15d2c35b77d9.html
Have just added a link to that IMU to my Instructable. Thank you very much for finding it. Many people are having trouble getting hold of analog IMU's so this will help them a lot.

John
eyhseow1 year ago
Dear Mickydee

I have just bulid the hardware for self balancing electric skateboard using Arduino Uno to control with 5DOF IMU (IDG655 ADXL33). I have encouter some problems: -
1. When I tilted the scooter too much, it will fly off. Is there any code in the program to prevent the scooter from flying off if it is tilt too much?
2. When the scooter fly off, it took quite a bit of time to ‘recover’ to it balancing position if I were to tilt it to the opposite direction. Anywhere in the code where I can change to have the scooter tilt back faster?

I am using code from XenoJohn from instructables website. Please help.

Thanks.
akeonly1 year ago
After half an hour reading your instructables, I have to say you're awesome in Thai. สุดยอด!
seadoogsx1 year ago
Hi Mickydee,
Sparkfun IMU Part # SEN-11072 is retired now 03/18/2013. I'm very appreciated if you have other to replace it. Thanks
rlarios1 year ago
Nice job, sir ! I read the book about the development of segway which was very descriptive with all aspects of it. There's a lot of work on something like this and I can only say that you are awesome !
mickydee (author)  rlarios1 year ago
Thank you very much. I appreciate your thoughts. This is a great community, and every one seems to work together. This is my first attempt at a self balancing project, and I owe most of my success to Xenon John and his balancing skateboard and his software.
Mickydee
seadoogsx1 year ago
Hello Mickydee,
I read your project and very impressive to me. Today is 03/14/2013. I can not find 5 degrees of freedom IMU from SparkFun. I already have wheel chair motor, Arduino Uno, Sabertooth 2X25 etc... Can you help me, where can I find 5 degrees of freedom IMU or something replace it. And the code to work with.
Thanks, have nice day.
mickydee (author)  seadoogsx1 year ago
Xenon John has researched this problem and says that Sparkfun is now stocking a replacement IMU Part # SEN-11072. He says that it will work perfectly with the existing code. I am going to order one and try it out.
Good luck on your project. I am working on an improved machine and it should be ready soon
Mickydee
startree1 year ago
so very cool!! I need to learn about arduino so I can make stuff like this - especially for my aging parents. They'd be way too proud to use a wheelchair but this might just be the thing...
(removed by author or community request)
It's disappointing to see comments like this in Instructables. Surely you can see that it's for people who rise to challenges, technical or otherwise, and enjoy sharing the journey.
I know, I was just making a joke. I realize now that it was not a nice comment to post. sorry about that.
I am a disabled vet. I tried to do some camping / hiking with my wife and daughter on several occasions and have been demoralized with having to have to two carry me back - literally! I am not ready to throw the towel in and go with a power scooter or wheel chair. I am currently trying to build my own Segway Clone and have everything except the Sabertooth Motor controller which is another issue and the matter of money. This "Sitdown" idea of a Segway will actually be very helpful in my case. I still concider myself young, but have a spinal injury that has forced me from standing (let alone hiking or going out to the state parks which I love). This "Sitdows" SgWay Clone is an awesome idea , Thank You Mickydee! Awesome Job!
Have just built a segway clone with a unicycle seat on it and handlebars.

One issue with a seat is that if you fall off because it tips forwards, you can just jump off forwards and end up standing on ground, holding handlebars low, below the level of your waist, with the rest of the segway behind you. So far so good.

Problem is, as this happens, the seat punches you in the back!

This maybe why regular Segway does not have a seat. Good example of why you have to eventually build something to find these sorts of things out.

Maybe I need a very well sprung long-travel telescopic seat mount.................

John
mickydee (author)  joegeek2 years ago
I think the Sabertooth is worth waiting for.I looked into building my own controller and found that the parts would be almost as much as buying the Sabertooth. Plus you get the many choices of input , from PWM (for RC control) to the adjustable serial input used by this project.
REMEMBER this is not a full fledged Segway with all it's back-up circuits, so it will not be as stable in rough conditions such as the woods or trail riding.
It is a fun project though and can give you hours of fun building, testing , and riding.
Thanks for the comment
Mickydee
Your joke is funny, but joegeek has a point that it is good for disabled people.
You obviously are young enough to not have back problems.
Why is the motor driver so expensive, and why can't you use one under $30 like the official motor shield?
mickydee (author)  4lifenerdfighter1 year ago
These motors draw around 15 amps at peak. Even if you use the 350 watt Chinese motors you will have the same problem. The cheaper shields will only tolerate around 2 amps. Also the Sabertooth has so many options that make your life easier. I thought about building my own drivers but the parts alone would cost almost as much.
If you are going to build this I would suggest you bite the bullet and buy the Sabertooth.
WOW!
realy good
Congrats on being a finalist!
Great job - You've also inspired me (69) to post some of my projects!
I also have a wheelchair I got at a garage sale with very similar wheels and motors to yours and would like to construct a "Sitway". However, when I turn the wheels there's about 5 degrees of "slop" before they engage the motor/gearbox, and I'm thinking that there's no way it can maintain stability with that much slop. Do your wheels have that much slop?

Eric
mickydee (author)  esotericeric2 years ago
I have some "slop", but not as much as you are experiencing. Mine seems to achieve a stable balance.
I built this thing as a low cost project, and that is the reason for using the used wheelchair . If you want to get tighter balance you should use a chain drive system.
I have thought about repacking the gear box with heavy grease to smooth out the
gear lash. I plan to rebuild mine using a chain drive system and larger wheels.
This was my first attempt at building a "self balancing" vehicle, and am learning as I go. It's a fun project. Go for it. You wont be sorry
Try using the 300-400 watt motors from china that come with a 6:1 (approx) reduction gearbox and chain sprocket built in.

http://www.ebay.com/itm/24V-350W-Electric-Motor-W-Gear-9T-Sprocket-24-Volt-350-Watt-MY1016Z3-/180734270314?pt=Motorcycles_Parts_Accessories&hash=item2a149a1b6a&vxp=mtr

Part code number is MY1016Z3

Almost zero backlash in the reduction gears.

The chain sprocket keyway eventually works loose as not really designed to be going from forward to reverse all the time. In the end I took end plate off and welded the chain sprocket on using burst of MIG, then sprayed it with my anti-spatter spray to cool it, had a cup of coffee and left it for 30 min to cool, then another small burst and so on, to make sure I did not cook the outer bearing. Works fine now. This way you can use a bigger wheel without resorting to a massive chain sprocket on the wheel.

Once you are moving along the slop becomes less relevant as more like varying the trottle to make a bike do a wheelie.

Is an issue when balancing in one place. If you set the gain too high machine will start to oscillate as gyro detects the sudden jolt as gears move (backlash). Can still make it work OK but with lower gain the machine feels a bit "mushy" as you ride it. Can sometimes overcome problem by having low gain around +2 to -2 degrees of tilt for example, then increase the gain a little as tilt angle increases (and so after any backlash from any recent change in direction has been taken up by the gearbox) to tighten up the ride.

Best solution would be motor with a toothed belt drive to wheel. Working on something now but not as easy as it sounds.
XenonJohn2 years ago
Good news.
Sparkfun have just released an updated version of their 5dof analog output IMU.

IMU Analog Combo Board - 5 Degrees of Freedom IDG500/ADXL335

Part number SEN-11072
So, everything is OK again.

John
armstrod2 years ago
Beautifully written sir, you get my vote. I generally just browse the site looking for ideas to get the brain ticking over, but yours was enough to make me log in and vote. The combination of a beautifully built device, fully specced out parts list and an instructable that presents a complicated device in a completely accessible manner has me truly impressed, and a little envious!

(It was the 45 degree braces and slotted motor mount holes that really caught my eye though. Hallmark of an Engineer. I will be keen to see your next instructable!)
jgeidl2 years ago
This, like so many balancers, use the 5 Degrees of Freedom IMU that is no longer available. Has anyone tried the replacment IMU that Sparkfun sells
Clone of Sparkfun 5dof IMU found on ebay:

GOOD NEWS EVERYONE
This clone IMU on eBay looks exactly like the SparkFun 5dof analog output IMU that they have now discontinued. Price is good too.

http://www.ebay.com/itm/190478609162?ssPageName=STRK:null:IT&_trksid=p3984.m1542.l2649


This may help a few people.

John
Hi,
For anyone who wants to take the plunge and have a go with a 6dof Sparkfun DIGITAL IMu I have just attached some code to page 53 of my skateboard instructable. Not fully tested yet but all the values it gives seem smooth and about right.

http://www.instructables.com/id/edit/?instructableId=E3C1NR6G6MPQ5EM#instructableId=E3C1NR6G6MPQ5EM,stepId=SZGO7T3GZKE1JXL

John
mickydee (author)  jgeidl2 years ago
I think Xenon John has looked into them, I don't know how far he has gotten.
1-40 of 69Next »