Also more of the wheel is uncovered when viewed from the side. Soles of feet just above axle line make it easier to steer than the "taller" earlier versions (see below).
Monowheel in final form until rebuilt in "surboard" style October 09.
TWIN WHEELER: More recent lightweight variant (<30lb) I built after this one wheeled machine, with same power and battery life as the original monowheel. It has twin wheels so can steer and turn on the spot. Shown here with a radio control steering unit. In the end I went back to a cable operated steering controller (better and more proportional response), but based it on a hacked Wii Nunchuck, which is ideal for the job (see link on left to Twin Wheeler).
New twin wheeler rebuilt Jan 2010 with 88 batteries embedded in the "sandwich" construction top deck. Wii Nunchuck wireless controlled.
Early photo above of the first time it functioned reasonably OK. 4 control knobs for all variables in the algorithm can be seen located on top right of this machine. These have since been removed as the code has improved.
The aim of this project is to build a skateboard type device just for fun, based on Segway self-balancing principles. Some skateboards of this type already have been built by others and links to most of the relevant webpages are listed.
It reminds me a little of the chain driven back-spinning "bouncing bomb" hanging below the Lancasters in the "Dambusters" raids.
It has turned out looking like a piece of "steampunk" technology, i.e. it looks like a cross between modern electronics and Victorian steam technology.
This is a work in progress............
BEWARE: Once you start out doing this it becomes addictive: either the thing balances or it doesn't. An all or nothing situation. There is a temptation to work and work until you can get it to balance. When it does it is very elegant and almost feels alive, when it doesn't it is just an annoying lump of metal.
Many of those who have built segway clones and self balancing robots do appear to be experienced programmers and possibly already in the IT industry. I am approaching this from another angle having maintained classic cars, being familiar with car electrics and hobby electronic projects. The last time I wrote any computer code was in "BASIC" for my Sinclair computer aged 14 years.
THE DEVELOPMENT PROCESS
Basics of the design
From all my reading of the work of others, the general idea is this:
1) A gyroscope (solid state) decides if the board is tipping (falling over) and speeds up the motor to bring the board back into balance beneath you.
2) The more you are tipping the faster it tries to do this PLUS the faster you are tipping the faster it tries to do this.
3) The problem is the gyro can “drift” with time, but on the other hand it has fast response and is quite immune to vibration. To overcome this drift we utilise a small part of the signal from an accelerometer with each “loop” of the control software. The accelerometer is good because it does not drift and knows which way is “up”, however is quite influenced by any vibration. By adding in a small part of the signal each time, we are in effect looking at the average reading over time so random vibration errors should tend to cancel out. See my links page for info on theory of self balancing systems.
4) Hardware: Lead-acid batteries. Because they are cheap and can deliver large current in small bursts if needed – and this is needed because although you need very little power to roll along a level surface, you need a big reservoir of “spare” motor power for the board to bring itself back beneath your centre of gravity if you start to tip over.
5) ATMega 32 microcontroller on a small development board from a robot webstore.
6) 4 potentiometers give manual control of 4 of the constants in the computer balance algorithm. These were initially in a hand-held controller and the idea was to “tune” the balance algorithm while standing on the board rather than changing values in the code each time. When optimum settings were found I could then convert the values found this way into the actual computer code. These analogue hardware “tricks” will hopefully allow me to keep my code relatively straightforward as I am on a rapid coding learning curve.
7) Widest Go-Kart rear wheel available (18cm wide), Go-Kart shortened rear axle, Go-Kart bearings, sprocket carrier, sprocket, chain. 420W electric motor with small drive sprocket.
8) Motor controller is the “OSMC” from the USA used by some others and developed for large combat robots.
9) Chassis sides are made from laser cut steel sheet.
Cardboard mockup to get dimensions correct. Start with wheel, then look at motor. Allow some side to side movement of motor (slotted bolt holes) to get tension on chain exactly right. "Kick ups" each end allow board to be shorter as electronics boxes go inside these, also allows you to theoretically go up hills with board tilted forwards to make it go up the hill, without front end hitting the ground. Small wheels from a skateboard mounted at each end semi-recessed limited damage early on during development process! Later on I removed these as not that useful.
I have used aluminium alloy between the two steel side plates to reduce weight a little. One side is riveted to the steel panel while the other side panel will be held on by lots of small bolts. This allows the bolted side panel to be taken off to assemble the axle, wheel and bearings more easily. As you can see I have several sizes of sprocket for the main wheel. For initial tests I have chosen to use a very large sprocket which will give me a slow top speed but much more torque at the wheel for getting up hills. I have made one design mistake here. There is no way I can inflate the tyre without removing one side of the chassis!
I have tried to create bulkheads where feasible and box sections to give strength. It would be nice to think I have created something as elegant as the monocoque frame of a 1960's Formula 1 racing car but in truth it is not quite as good as that!
To stop drilling holes through alloy and then having the bit go straight into electronics I made a handy safety device clamped to the drill bit made from the brass insert from a wire connection block.
I trimmed excess alloy from the motor to get it to fit within the 10cm deep chassis rails.Original plan was to have 2 batteries side by side and micro in a box at far end. However with this setup it is much heavier on the motor side. I have therefore moved one battery out to far end where control box would have been. Not quite as neat and tidy but better for weight distribution. Also you can see there is just enough space to fit a third battery if I want to go to 36 Volts later on (which would probably even up the weight as well).
Originally I had the 4 potentiometers built into the hand controller. Later on I moved them down into the chassis of the machine and just had a "dead man's handle" push-to-make switch in a more simplified hand controller. This is very light so if dropped (when falling off) it will cut motor but controller will not break when it hits the floor. If it does break there is only one switch to replace. Other options are footswitches of various types or a plug that is pulled out if you fall off, as found on drag racing motorbikes and jetskis.
Bearings are for 30mm tubular axle from rear of a Go-kart.
Solid steel axle at moment, very heavy, may replace with aluminium at a later date as part of a weight reduction exercise.
Wiring tidied up behind alloy channel sections as they run from one side to the other. I do not want the wheel to rub through the wiring insulation causing a disaster. Ribbon cable was difficult to route along the side of the machine and has been well wrapped in plastic tubing where it enters through holes in the frame to stop any chance of it chafing against metal edges.
After destroying my gyro by accidentally putting 12V through it, I have used an opto-isolator board from Quasar Electronics to use my logic outputs to control a 12V buzzer (>70% duty cycle warning) and some 12V LED warning lamps (low battery warning. These completely isolate the logic outputs of the microprocessor from the switched 12V items. This may seem excessive but blowing up gyros is a very expensive thing to do.
More developments October 2008:
All plug connections, especially to microcontroller board, that can be have now been soldered to increase overall reliability.
Warning system via optoisolator for low battery and excess speed also involved even more wires to/from microcontroller box. Too much spaghetti making things unreliable. Have removed all these circuits for now, trying to simplify things. This has freed up some space in the casing too (thinking of fitting an LED headlight in front end for example). I may just mount a bar of LED's on one end of board to indicate battery status, using a little off the shelf kit for this.
I decided at that time to have a compromise manual control system. I discovered that when the values for the 4 variables on the potentiometers were put into the algorithm as code, the whole machine felt much "tighter" to ride. Also having 4 potentiometers like this means there are a very large number of wires running into and out of the microcontroller box - plenty to go wrong.
Consequently I decided to use a small hand controller with a button that killed the motor if not pressed at all times, plus I included one single control for overall gain so this could be adjusted when riding. The other variables were included in the code.
Later on I was tempted to try using an old Scalextric hand controller to provide these 2 functions:
- If trigger released, machine stops.
- Squeezing trigger increases the gain.
It is pretty much designed for this job already.
- I was on the right track here, in the end the Wii Nunchuck was perfect for steering my 2 wheeled version.
Original battery level meter. Simple row of coloured LED's.
Early photo of boxed up control system. Again, it all looked neat and tidy early on. By the time you have opened each box dozens of times to modify something it won't look like this any more.
The very original hand control with 4 LED indicators, 4 balance variable potentiometers
and a safety button that would stop machine if it was ever released (i.e. if you
wanted to stop or just fell off). Worked OK but plenty to go wrong so useful in early
days to get it working but some long term reliability issues.
New layout December 08. Bigger 12 Amp-hour batteries. Programming lead shown attached.
The black lead plugs into a socket. The signal from this socket goes to +5V once per cycle of the program. This way I can use an oscilloscope to see how fast the program is looping
Photo 17/12/08 taken during fitment of a new hollow main axle tube to save some weight.
One side of chassis riveted on and the other bolted on. In this view the bolted-on side has been removed. From left to right: Microcontroller/gyro/accelerometer box, 2 main batteries,
Go-kart wheel widest available, motor, OSMC motor controller box.
I haven't measured any of this in real life yet but according to calculations, with the large sprocket diameter shown, I should get a top speed of about 7 miles per hour and a maximum lateral force at the contact point between the tyre and road of 12.3kg. This suggests that once confident riding it I could go down one size smaller on the wheel sprocket to give a top speed of around 10-12mph and still have enough torque available to get up inclines. Another thing for the future!
Update Jan 09
Produced a sequential set of build photos for www.instructables.com and was blown away by the response. Thousands of hits in first 24hrs.
Made another video for Youtube, posted at top of this page. One thing became clear, although the high ground clearance was useful for going up hills and showing off the fresh air under each end of the machine, everyone just wants to know how fast it goes.
The problem is that it is quite unstable laterally, a small pebble under centre of wheel will tilt machine violently to one side and because you are so high above axle line, this tends to tip you off sideways. What I need is to lower the centre of gravity a bit, tighten the algorithms so it stays almost perfectly level, and accept that it will not go up steep hills any more. The trade off is that you will be able to go faster on it with some confidence.
I was thinking how to make this version go up hills. If you tip it forwards into the upslope of a hill, it will ground out. I had a brainwave after thinking about it one night, why not put a switch in the hand controller to make the front tip up when you approach a hill. This just resets the accelerometer balance set point so you can then tip it forwards (from the new "tilted" balance position) without the front hitting the ground as you go up the slope.
New hand controller with tilt function, Jan 14th 09:
Red button has to be held in for machine to remain alive. Small switch at base of picture will tilt front of board up if pulled back and tilt it forwards if pushed forwards. It can be used when riding the board to fine tune the balance point to your personal preference. I also have 2 potentiometers. These set gain and "accelerator" function when you first turn machine on. When riding it they are not active as too easy to accidentally move them.
The finished new hand controller. The tilt function works really well.
View of internals prior to October 09 rebuild: Complete upgrade of internal components December 2008 to give more range. OSMC motor controller now housed in proper box on far left, two much bigger batteries installed (12 Volt, 12 Amp-hr each, previous ones were 7 Amp-hr each), microcontroller/accelerometer/gyro box moved to far right.
LED battery condition meter on left side of deck under polycarbonate cover.
This site will not be an overview that assumes a lot of coding knowledge but will be for "newbies" like me. I have had to learn both how to program in "C" and also specifically how to use this to program an AVR microcontroller. These skills will be useful to me in other aspects of my life and work while the challenge of this project gives me the motivation.
My detective work on the net has yielded a large list of links which I have listed on another page. See menu on the left. Some of them are essential reading before embarking on a project like this.
If you get fed up when things are not going well, have a look at the youtube videos of Ben Smithers, Trevor Blackwell and others!
The skateboard has a number of advantages over a segway clone
1) If it goes wrong (i.e. stops suddenly) you can jump off at a run rather than impaling yourself on the handlebars then being propelled headfirst into the ground. There may be a very good reason why all but the most self-confident Segway clone builders put their controls off to one side!
2) If designed with some thought, it could actually be made to look quite cool unlike a segway.
3) There is no differential wheel speed coding required to make it turn, I can concentrate entirely on trying to get the thing to balance.
Marty McFly Hoverboard from "Back to the Future"
Very early experiments and versions.....
Video Summer 2008
EARLY BUILD PHOTOS
It all looks so neat and tidy at the outset.
Go Kart wheel, motor and laser cut steel side panels.
In this early version I had 4 potentiometers for variables in the algorithm all in the handset so I could change them on the move. Good for development, but overcomplex for final version.
Trimming all excess alloy from motor mounting plate
Has on board voltage regulator, 10 pin plug top centre is for loading programs onto it from a PC. Rows of pins down sides are input/output ports that can be configured using software.
Accelerometer is square object in centre. It has no solder pins on it ! It is laid on board and solder is allowed to run up onto the solder surfaces on the sides. This is tricky to get right and you need a small soldering iron with a good point. Since making this a number of robotics stores now do small boards with these already mounted on them in their "sensors" sections.
Accelerometer is on left. Gyroscope is shown here as supplied in a jewelry box which is fair enough as it is an expensive item.
Early image of microcontroller being programmed from a laptop using Ponyprog software. The serial port lead comes from the same supplier as the ATMega32 development board. They also supply a CD with the AVR Studio software (where you write and test the program on your PC) and the "Ponyprog" software that then allows you to program this software into your ATMega32 board.
Creation of a wooden deck
Next project was to make it a little more like a skateboard/snowboard/whatever. Have made the whole deck flat (removed the turned up areas at each end) and mocked up using a cardboard cutout what a wooden deck might look like. All internals repositioned to get them all to fit into the now smaller volume.
Have gone back to using a hand held "dead man" switch for now.
New flat deck made of marine ply. Just needs varnish.
Small alloy angled plates added for toes of shoes to rest on during initial startup. When starting off from "tipped" position I tended to just slide off the board! Once level there is no problem. Later on I added a new more angular top deck to match angular shape of underside metalwork. Instead of these plates I fitted a toe grip similar to those found on kiteboards. This was fitted to one side only and made quite a loose fit as if I fall off I do not want my foot to remain tightly strapped to the board.
This was an experiment with blue LED's under the machine to highlight the fact that there are no wheels at either end.
NB (May 09): There is a new Wii handset coming out soon according to Wikipedia which, in addition to having a 3 axis accelerometer in it, will also have a gyro. This would be a great basis perhaps for the sensor part of a future self balancing machine.
Things I could do if money no object (this was written in 2008):
1) Rebuild frame in carbon fibre. Failing that I could do it in fibreglass with a steel stengthening panel embedded in the structure between the motor and the wheel on the chain side.
2) Better batteries, Lithium too expensive so perhaps NiMH.
3) Hub motor inside wheel would free up plenty of space to make frame smaller.
4) Another possible variant would be to have a 3 speed gearbox in the wheel hub. Thinking of the old cable operated "Sturmey-Archer" boxes found in 1970's bicycles like the "Chopper" which are small light and simple. Would need to disable the freewheel mechanism however! It would allow fast speeds on the level but give lower gearing for hills and rougher terrain.
5) Have twin wheels next to each other. This would require 2 motor controllers, 2 motors (? hub motors) but allow much better low speed turning and ability to turn on the spot.
6) Ideal power plant would be a MICE engine. This is being developed in US, has interest from the military. It is a very small, gasoline powered electricity generator. It has a magnetic piston that oscillates up and down in a coil of wire extremely fast. It therefore has only one main moving part, functions as an alternator, power output 200-500W. This would be absolutely perfect for my application, would give plenty of space for a fuel tank and turn it from a novelty into a vehicle of sorts with decent power and endurance.
MICE engine links:
Update August 08: Guess what, I asked them and they said no!