Easy build self balancing electric skateboard

 by XenonJohn
Featured
FHM32FKH0A00H1P.LARGE.jpg
CompositeUpload.jpg

What is it?
Twin wheeled skateboard that works like a Segway.  Electric skateboards exist already - motors on rear wheels. The plan here was to build something like a Segway but in the form of a skateboard. It knows which way is "up" via a combination of gyroscope and an accelerometer sensors, using a complementary (not complimentary) filter which reads and combines data from both 100 times per second. Steering by a simple rocker switch in hand controller (or a rewired Wii-Nunchuck as in photos if you are more ambitious).
Upper photo is original budget version with two lead-acid batteries and solid wheels. Lower photo is 2013 version, with pneumatic tyres and Headway LiFePO4 batteries which was built to see how far you could push this overall concept.

What's new on this Instructable?
FORUM: A nice person has started a forum on this topic. Just posted the first message to get it going. 1/6/13
www.selfbalancingskateboard.com

- Working on code to use the new Sparkfun 6dof DIGITAL IMU. FIRST VERSION ATTACHED 8th March 2012 TO PAGE 53. Only tested as sensor/arduino but prints out believable angles etc, have posted it for those who want to experiment with it.

VERY IMPORTANT NEWS 27/4/13:
Thomas Feminella has almost managed to get a Unicycle working with Sparkfun DIGITAL 6DOF IMU, Arduino and SyRen motor controller. YouTube vid here: 
http://www.youtube.com/watch?v=mEee1iI6emE&sns=em
Examples of his code are here on an Arduino forum: http://arduino.cc/forum/index.php?topic=153496.0

NOTE: Since this instructable was made, analog IMU's which just output a voltage from each accelerometer and gyro axis have stopped being made as hobby boards by Sparkfun. This is a pity as all you had to do was read the voltages on the analog input pins of your arduino.

IMPORTANT NOTE May 15th 2013: You CAN, AGAIN, buy an analog IMU here on ebay: 
http://www.ebay.com/itm/181004141876?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

Polulu also still sell accelerometers and gyros with analog outputs. They may work if set to their most sensitive ranges if anyone wants to try them:
http://www.pololu.com/catalog/product/1252
http://www.pololu.com/catalog/product/1270

May 2013: I am building a new skateboard. Photos here:
https://sites.google.com/site/onewheeledselfbalancing/Home/18-2013superskate

How does it stay level?
It controls the wheel motors so the wheels always stay under your centre of balance, like balancing a broomstick on your fingertip. This in engineering terms is called a "PID" control system and is used for all sorts of things. For example think of the 300+ feet high Apollo rockets used in the moon landings..........
Q: How come they didn't just fall over when they took off? They took off incredibly slowly for the first few seconds, tailfins would have no effect, far slower than Shuttle launches.                Watch this video
It takes a full 10 seconds just to get to 100m and clear the launch tower:
http://www.youtube.com/watch?v=_PEGi3k6yNQ
A: They had engines mounted on gimbals (swivelling joints) hydraulically controlled by a PID control system (lots of analog electronics I think involved too). 

Background:
In 2008 I saw a YouTube video by Ben Smithers of his one-wheeled self balancing skateboard whizzing around a car park in Norwich UK. http://www.robosys.co.uk/       Video: http://www.youtube.com/watch?v=HGbbag9dklU
It turns out he was a Lotus cars controls system engineer - which makes sense.
Also see Trevor Blackwell's site: http://www.tlb.org/eunicycle.html
Meanwhile I wanted to teach myself microcontroller programming and, totally underestimating the task, thought this would be a great fun way to do this. I built several machines some with one wheel and some with two. Advantage of two wheelers is that they turn more easily and can turn and balance even when stationary - which is fun.

Why an Instructable?
Having learned lessons the hard way I thought it would be worth redesigning the project around an Arduino microcontroller, then seeing how low-cost and easy-build I could possibly make it. Clearly something like this is not for the complete Arduino beginner, nor is it that "easy" however this is about as easy as a self-balancing machine is realistically ever going to get.

Skills:
Projects like this lend themselves to being built as a team. Some examples below were built as college projects. There are
i) some electronics (not making circuit boards, just wiring and soldering) to master,
ii) some mechanical fabrication; this version is designed to require no welding, just nuts bolts and some woodwork. Wheel/sprockets/axles/bearings come as a unit (electric scooter rear wheel assemblies).
iii) some programming; the programs (Arduino sketches) you need, including those to help debugging, are attached (P43 - 47).
There are; IMU tester, motor tester, balances-nothing-else, rocker switch steered and potentiometer steered code examples.

How much does it cost?
I realised when costing them up that the cost of a self balancing robot would only be a little lower than that of a ride on machine, therefore I went for a ride-on machine! Robot motor/gearbox combinations are pretty expensive.
For me the cost was about $300 equivalent PLUS whatever batteries you choose to use. I recommend starting with lead-acid batteries then make improvements later once you have a working machine. Lithium batteries etc are expensive!

Why do it?
i) For the challenge of doing something original. Most things have been invented, indeed self-balancing machines have been invented. Segway skateboards have been invented in principle BUT there is huge room for improvement.
ii) Making something that is practical and intuitive to ride is quite a challenge in terms of both electronics/software and fabrication/packaging. Cannot all be done on a computer. Eventually you have to actually build something then incrementally improve it. Despite the myth of "Eureka" moments, the truth is that this is how most innovations come about, by slow incremental development and hard work. Edison did not invent the lightbulb. He developed the first practical lightbulb.
iii) To educate yourself. You will learn a huge amount.
iv) These things are really good fun to ride! I have taken this to 2 UK Maker Faires now and both times people are wanting to have a go. Last time the BBC cameramen who also had an exhibit politely waited until the end of show, then they too asked to try it out.

This instructable:
There are a large number of pages in this. This is deliberate, if you are serious about building one then you need every single step documented with no gaps.

Additional information:
I have documented all my machines both good and bad on another website here:
http://sites.google.com/site/onewheeledselfbalancing/
I have a page of links to dozens of other self-balancing projects from around the world here:
http://sites.google.com/site/onewheeledselfbalancing/Home/links-to-other-self-balancing-projects

Can I do this as a beginnner?
The fabrication has been deliberately kept really simple.
The soldering between sensors and arduino board needs to be good quality!
If you are new to Arduino I would recommend buying an Arduino starter kit. These come with some ancillary sensors etc and a set of about 12 tutorials. Work through them all (about 2 days work) and read a beginners book to Arduino. You will then be ready.

Can I build a SegwayTM clone?
Yes. Australian SciTech group have built a very low cost machine using a version of the Arduino code from this Instructable:
http://www.instructables.com/id/Self-Balancing-Scooter-Ver-20/
Here also is the Thatch No-Way Segway using my code almost unaltered: http://www.youtube.com/watch?v=R4ax3N0UW38

Has anyone else built one of these?
Ages currently range from 12yrs to 81yrs.
This Instructable is over a year old now, so yes indeed, people have. Here are a few I know of:
1)   Skateboard:    http://www.youtube.com/watch?v=kSW7YXLCjqk
2)   Skateboard:    http://www.youtube.com/watch?v=u-uUidBZEnM
3)   The Velociryder:  http://www.youtube.com/watch?v=xvfUIxusPZw&feature=player_embedded
4)   Great board video - Buffalo State College senior project: http://www.youtube.com/watch?v=FEaTxahyQxc
5)   Another board based on this Instructable:  http://www.youtube.com/watch?v=vhbH_AmIKZA&feature=related
6)   A board based on old FIRST robotics parts + code from this instructable (FIRST robotics was started by Dean Kamen who also invented the Segway, to encourage youth to get interested in engineering):   http://www.youtube.com/watch?v=Vh9LpNQ_S0k&feature=related
7)   Carbon fiber racing car seat with 2 - the SciChair: http://www.youtube.com/watch?feature=player_embedded&v=HtivH7INpZ4
8)   Carey's self-balancing platform, good video:   http://www.youtube.com/watch?v=ngMJcxeB7og
9) Really cool video (on clifftop path by the sea): Skate auto-balancé http://www.youtube.com/watch?
10) The KSLURP board from Malaysia: http://www.youtube.com/watch?v=x3O2NkjJOlg
11) The MIT Seboard, video clip: http://www.youtube.com/watch?v=zZQb-w_wyhM
12) The SITWAY sit-on machine by the 81year old gentleman above, with video: http://www.instructables.com/id/SITWAY/
13) This one has nothing to do with me but is such a really cool inspirational project I include it here, the TILTER skateboard, with hub motors and a suspension system: http://www.youtube.com/watch?v=WsYukdSO64A&feature=player_embedded
14) New one wheeler from team cosmos with some technical information and video here: http://teamcosmos.com/skateone/index.shtml


NOTE:
You build these at your own risk. If tilted they WILL accelerate to correct the tilt. If you are not on the board, this means it can fly across a room or into your head. This is why you have to have an emergency hand switch that cuts the power if you let go of it. If it develops a fault it does not have multiple redundant systems like a real segway, most likely you will fall off! The code is not guaranteed against any bugs. If you don't believe me here is a video of Clint Rutkas developing a similar machine, also featuring some holes it punched in the walls of his apartment!    http://vimeo.com/2013773

Have fun. Treat it as an adventure. Once you get it to balance there are many ways to improve it.

John



 

 
Remove these adsRemove these ads by Signing Up

Step 1: Parts

Partsonfloor.jpg
Here are the parts laid out on floor
1-40 of 533Next »
zaki4484 says: Jun 12, 2013. 12:53 PM
Hi,

I'm using a wii nunchuk as the controller. My question is, should I put resistor at pin 9 for the deadman switch?

Thanks
XenonJohn (author) in reply to zaki4484Jun 16, 2013. 4:35 PM
If I wrote this Instructable again I would set the internal pullup resistors in the Arduino to HIGH which can be done using software, and then make it so when you pressed the deadman it would pull the Pin down to ground (GND). i.e. when deadman not being pressed the Pin "sees" +5V and when it is being pressed the pin "sees" 0V. That way you would not need any extra resistors. The Sci-Tech group have done it that way in their version of the software.
As my code is written for this instructable at present, pressing the Deadman connects 5v to the Input Pin. The rest of the time, when the deadman button is not being pressed, the pin is pulled "down" to GND via the resistor.
If I changed it now it would confuse everyone even more!

John
zaki4484 says: Jun 15, 2013. 8:22 AM
Hi,
Can anyone tell me the specific instructions to run this part?
Is it the same as the Just Balances part where I need to put one end of the skateboard to the floor, count to 5, slowly bring it level and it will start balancing? If so, when exactly do I step on the skateboard? What is the purpose of the balance point toggle switch? What is the "softstart function"? When exactly can I pull out the USB from the Arduino? I know I ask too much, but I really need to know so I won't screw it up..

Thank you :)
XenonJohn (author) in reply to zaki4484Jun 16, 2013. 4:28 PM
You put one end on floor, let us say the left side, and wait approx 5 secs while it takes zero readings for the gyro. Then stand on the end that is on the ground with, in this case, your left foot. Press deadman switch in. Put right foot on board, then slowly bring it level. When about level the self-balance algorithm engages.
It has to be like this else, when you pressed the deadman in, while board was tipped, it would shoot off across the floor as it tried very hard to become level.
Softstart: This means when slef-balancing first engages, the overall "gain" of the software starts low then gradually increases to a target value. This stops it being too violent when you first bring it level.
The first time you do this I would lean forwards on a desk with both hands (deadman in one of them) and support about half your weight on your hands. If board then goes crazy just lean forward some more and lift your feet right up out of the way!
John
zaki4484 says: May 28, 2013. 8:25 PM
Hello John,

I am using 24v 350w electric scooter motor. Do you think that the 350watt motor is good for this project? because apparently that is the only motor that I could get from my supplier.
I have tested with a RoboClaw 2 channel 30amp motor driver. It burned out the first time I tried.
Do you think that the motor driver burned out possibly because of the high peak current (80amp) of the 350w electric motor?
XenonJohn (author) in reply to zaki4484Jun 2, 2013. 10:46 AM
If you hold a motor so it cannot turn, it will draw a very large current. For these projects you need reduction gearing so lots of torque, low top speed. Easiest way is a chain but segways for example have gearbox.

350watt motors would be fine, but do have to have the correct reduction as in the examples in the instructable.

John
nboyajian says: May 28, 2013. 9:32 PM
Hi there XenonJohn! Really great page you have assembled here! I have been working on a self balancing skateboard with my friend for the past 6 months or so and we have been using tons of your advice. Here is a photo of our board.

http://imgur.com/jaxF4Yv

We used a digital IMU and have the board fully balancing and rideable. We are still fine tuning the software to optimize the ride but we are happy with how far we have been able to come.

As you requested in a previous comment on this page I have set up a forum for this group to use. You can find it at www.selfbalancingskateboard.com I will post many pictures and videos of my own board very soon. Thanks again!
XenonJohn (author) in reply to nboyajianJun 1, 2013. 4:06 PM
Thanks for setting up the forum. Have noted it at top of the front page of this instructable.
It has no messages yet so I just posted one!

Your board looks great. If you used a digital IMU could you share the code with us or do an Instructable? There are many people out there who would benefit from it, see all messages below, instead of having to scour the globe via the web looking for an old-stock analog IMU.

Best wishes

John
kennyng says: Apr 23, 2013. 12:20 AM
Hi XenonJohn and friends,

I am amazed by the self-balancing skateboard and had tried to make it myself. The instruction is very clear and I really learn a lot from the thread.

I am in the stage of using “ Just Balances Codes “ and got stuck. The skateboard that I built doesn’t not response fast to the angle tilted. When I tilted the skateboard from side to side, I can see from the serial window that values under Motor1percent and Motor2percent change from + to – and – to +. But once it hit -100 or 100, it will stay at this value for a pretty long time even I had tilted the skateboard to the other direction.

Can anyone help me on this problem. Really wanted to have it working. Thank you so much in advance.

Kenny
XenonJohn (author) in reply to kennyngMay 15, 2013. 3:32 PM
If you hold it tilted one way, there is a value (the cur-Speed) term that increases according to how LONG (in time) it has been tilted that way, the I in PID. This accumulates until it eventually is sending 100% power to motors to try to make it go the other way and become level again.
If testing machine off the ground, i.e. with wheels in the air, you then tilt it other way and it takes a moment or two for this accumulator to decrease and then go the other way. If you rock it back and forth past the centre balanced point (as in real self-balancing) this term never really accumulates to a significant value.
This feature is used to go up slopes, you hold board slightly tilted (but still balancing) and the power slowly increases until it starts to go up the slope.

You can set the cur-speed term to zero in the code as it will still balance OK on level ground just using the P and D parts of "PID"

Alternative is to just try the machine with wheels on the ground and stand well to one side.

Does anyone fancy setting up a self-balancing segway/skateboard Arduino forum? There are so many Q and A's here now, and quite a few working boards out there too, we should all really just be helping each other out.with problems as a community of builders because the collective knowledge is out there now. I have no idea how you set up a forum.

John
XenonJohn (author) in reply to kennyngMay 15, 2013. 2:59 PM
It has no concept of position, only whether it is level or not. All it does is try to stay level by applying power in one direction or the other. Note, it does not apply a set speed, merely applies power which is not quite the same thing. Therefore it has no concept of speed either, only how much power is being applied as a percentage between 0 and 100% in either direction.
You can alter the balance point so it almost stays in one place, but it will never do so perfectly.
To give it "knowledge" of position, you would fit wheel speed encoders which tell arduino how fast wheels are rotating, then modify code so it stays balanced but also keeps the average wheel speed over time at or close to zero. This would make it more or less stay in one place.
If you are riding it you essentially do this manually by leaning a bit one way then the other.
If wheel encoders failed with you on it, - dirt on the optical encoder for example, there would be unpredictable behaviour as computer would then follow the "rubbish in, rubbish out" maxim and who knows what it would try to do.

John
zaki4484 says: Mar 26, 2013. 2:02 AM
hi,
I'm just wondering, is it possible if we don't use hand controller?
I mean like, we only need to use body motion to move the skateboard.
Thanks!
XenonJohn (author) in reply to zaki4484May 15, 2013. 3:19 PM
If you just have one wide wheel, then you can ride it like snowboard and turn by tyre deformation.

With 2 wheels fixed on the same axle with just one motor, if you have pneumatic tyres AND wheels fairly close together AND tyres medium-soft, then by leaning you will compress the inner tyre and so start to turn. Soft tyres mean more power required to run the machine however.

Finally, as in my "pneu-skate" you could fit pressure sensitive resistors on the deck and use your heel versus toe foot pressure to steer the machine (2 motors one for each wheel). This takes some experimentation to get right but did work. Hint: Put rubber pads over the resistor pads.

Very finally, look at the "Velocyrider" project where the foot platform for the trailing foot could actually be tilted by moving the foot. This was attached to a steering potentiometer which steered the machine.

So the answer is yes it can be done, but you need to be prepared to experiment a little. Nothing wrong with that. As Einstein said, "If we knew all the answers it would not be called research would it?"

John
sgovaerts says: Apr 11, 2013. 11:29 AM
Hey John

First of all: thank you for this amazing tutorial! :)
I was just wondering if you have to use the sabertooth. Can you also use a dual-channel motor drive module like this one, in combination with 2 300W motors?

http://www.benl.ebay.be/itm/High-Power-50A-Dual-Channel-motor-drive-module-Arduino-Compatible-and-library-/130717806584?pt=LH_DefaultDomain_0&hash=item1e6f636ff8

These are its specs:
Peak current (Load): 50A
Recommend max working current(Load): 20A
Power VCC (Load): 0V~30V
Recommend power vcc(load) : 12V ~ 26V
Control VCC: 4V~12V
Control TTL Voltage; 2.5V ~ 12V

Thanks in advance!
Stijn
XenonJohn (author) in reply to sgovaertsMay 15, 2013. 3:12 PM
It is peak 50A on ONE channel. This suggests it is peak 25A if using both channels. Nominal is 20A (it does not say per channel so nominal may be 10A per channel if both channels used separately).
Also no heat sink, you have to add your own.
No safety cut out if it overheats, it just melts essentially.

So, it is cheap so it may be worth taking a chance with it. Do not cry if it burns out however! It would probably be OK for a machine running gently on flat level ground. I have seen a small mini-Segway type machine run with a 2 x 10 Amp Sabertooth power controller but that was running slowly on a very smooth floor.

You get what you pay for with motor power controllers. The sabertooth and other similar robot controllers are expensive but they also have shut down circuits that help protect them if they get too hot. This means in the long term they may end up cheaper.

I have blown up several low cost controllers over the years and now realise that a good quality one will actually cost you less money over the long term.

Hope this helps.

John
him2anshu says: May 12, 2013. 3:04 AM
Can you please add the 6DOF digital code again please, its been removed again, or mail me at hemu.rockz@gmail.com
XenonJohn (author) in reply to him2anshuMay 15, 2013. 2:53 PM
See the note I have added to the title page. I would if I were you modify the code of Thomas Feminella as he has a unicycle self balancing using a digital IMU. Therefore he is the most advanced person so far as regards getting anything capable of carrying a human to self balance using a digital IMU and Arduino.

I am making a new compact board with an old analog IMU, pneumatic tyres and decent battery pack, but when it is built, I will then start investigating a digital IMU seriously to see if I can get it to work, based very much on his code.

John
eyhseow says: May 9, 2013. 1:51 AM
Hi All

My self-balancing likes to move left and right and doesn’t stay still in one position. Anywhere in the code where I can change to make it stay still?
Please help. Thanks.
eyhseow says: Mar 15, 2013. 1:41 AM
Dear Xenon John

Any update on on the SIXDOF digital unfinished code?

Thanks.

Regards
William Seow
XenonJohn (author) says: Mar 2, 2013. 9:15 AM
HI everyone,

Been away from this for a while. Still working on balancing machines though.
The specimen, UNFINISHED and UNTESTED attempt at reading a digital IMU (using Arduino V22 by the way) on step 53 has just been put back. For some reason it keeps disappearing, it is not because I remove it deliberately or anything.
Needs someone with proper training as programmer to write some software not just to read a digital hobby IMU, for which examples do exist, but then also run self balancing code without disrupting the reading of the digital IMU......which I have not been able to do yet. Whenever I add in the self balancing code, my data stream from the IMU locks up now and then.
For now all my projects are using analog IMU's from earlier projects.

All the best,

John
Pizzapie500 says: Sep 5, 2012. 8:22 AM
Hey, I got to the Just Balances point, but mine isn't balancing. I did the accsum thing, however it continues to violently waver up and down. Also it drifts a little bit forward. Any ideas?
Tim003 in reply to Pizzapie500Sep 9, 2012. 2:52 PM
Hello Pizzapie500,

Does your Just Balance act like this http://www.youtube.com/watch?v=MJLbAxnqPfE (video) ?

Also, my deadman switch is acting weirdly. When pressing the deadman switch, the wheels start spinning but as soon as I release the deadman switch, the wheels keep spinning instead of stopping. Does anyone have any idea on what the problem is?

Thanks,
Tim003
Pizzapie500 in reply to Tim003Sep 9, 2012. 6:01 PM
Yep. That's the exact problem, except I don't have to tilt it that far to engage tilt start. Did you figure out a solution? Your deadman switch is probably short circuiting. I had the same problem with my wii nunchuck.
Tim003 in reply to Pizzapie500Sep 9, 2012. 6:18 PM
Hi.

Well, that was a one time problem. Normally I just tilt it until it is horizontal and the TILT START engages.

I did not figure out a solution as of yet. I am still working on it but it seems that I am not using a resistor for the deadman switch, which might be the problem... Is that what you are referring to when saying " Your deadman switch is probably short circuiting. I had the same problem with my wii nunchuck. ".

If so, I will only be able to try with a resistor tomorrow since I currently do not have a 1500Ohm resistor.

Thanks,
Tim003
Tim003 in reply to Tim003Sep 10, 2012. 3:31 PM
Hi again,

My deadman switch is now working correctly. But the Just Balance code still does not work (by that, I mean that the robot doesn't self-balance at all).

Pizzapie500 in reply to Tim003Sep 10, 2012. 4:29 PM
Hey, so I guess now we're at the same standpoint now. We both are stuck at the Just Balance :( I'm going to try changing the values in the code, and I'll tell you if it works.
Tim003 in reply to Pizzapie500Sep 10, 2012. 5:24 PM
Thanks! I will also do my part by trying to change some things in the code.
Pizzapie500 in reply to Tim003Sep 11, 2012. 5:31 PM
Cool! I seem to have a problem with the deadman switch again. What did you do to fix it? Also XenonJohn commented this, "increase derivative gain constant (0.5 at present) so that when you tilt it one way it rapidly corrects in a damped sort of way, i.e as it get back closer to balance point the force of the correction drops off so it rapidly corrects without overshooting or oscillating". I haven't tried it yet, but it might help.
Tim003 in reply to Pizzapie500Sep 11, 2012. 6:15 PM
I'll try to do that tomorrow morning.

Here is a picture of what I did.

https://www.dropbox.com/s/z3m8vkhdwi3pvmc/IMG_20120910_160508.jpg

I got a 10K resistor, "tied" it to pin 9 wire and plugged the other side of the resistor to GND (ground). If you can't seem to understand what I did, I can take a few more pictures.

Thanks,
Tim
Pizzapie500 in reply to Tim003Sep 12, 2012. 5:13 PM
Oh, so that's what i did wrong! I only used a 2.2k resistor... Will try that in like 30 minutes. Good luck with the script! I have a lot of homework to do, so I can't play with the values tonight.
Tim003 in reply to Pizzapie500Sep 14, 2012. 12:54 PM
I tried to change the value but it did not change anything. I am not sure what value John is talking about. There are two 0.5 values. Do you have an idea?
Pizzapie500 in reply to Tim003Sep 14, 2012. 3:55 PM
I think he's talking about the overallgain target because it's under "setup variables". It turns out that it wasn't the resistor to ground that I needed, it was that the Nunchuck pressure sensor I had was broken. Now i'm just using a momentary switch as the dead man. Going to try the values tonight and the weekend.
Tim003 in reply to Pizzapie500Sep 16, 2012. 12:59 PM
I'll try that tonight.

Did you try changing the values already?
Pizzapie500 in reply to Tim003Sep 16, 2012. 5:25 PM
Tried switching my accsum to 344 and changing the derivative gain to .7. Unfortunately, it's acting like a bucking horse.
Tim003 in reply to Pizzapie500Sep 16, 2012. 6:34 PM
Can you do something for me (and everyone else on this website). Could you copy and paste your serial data on here? I will put mine on her tomorrow. We should compare our data.
Pizzapie500 in reply to Tim003Sep 17, 2012. 4:44 AM
Some data of a bucking horse:

balancegyroDegrees:-5.30 X-accdeg:1.48 overallAngleofTilt:0.816,9\n
balancegyroDegrees:-32.82 X-accdeg:-7.80 overallAngleofTilt:1.306,9\n
balancegyroDegrees:51.03 X-accdeg:4.02 overallAngleofTilt:5.676,9\n
balancegyroDegrees:56.18 X-accdeg:13.83 overallAngleofTilt:-0.726,9\n
balancegyroDegrees:33.36 X-accdeg:37.07 overallAngleofTilt:0.806,9\n
balancegyroDegrees:-2.00 X-accdeg:22.00 overallAngleofTilt:0.195,10\n
balancegyroDegrees:-4.23 X-accdeg:-2.18 overallAngleofTilt:5.676,8\n
balancegyroDegrees:-12.07 X-accdeg:3.98 overallAngleofTilt:5.266,9\n
balancegyroDegrees:81.01 X-accdeg:-18.59 overallAngleofTilt:16.106,9\n
balancegyroDegrees:-15.99 X-accdeg:-22.78 overallAngleofTilt:14.156,9\n
balancegyroDegrees:-60.26 X-accdeg:1.15 overallAngleofTilt:6.765,9\n
balancegyroDegrees:11.07 X-accdeg:20.36 overallAngleofTilt:7.285,9\n
balancegyroDegrees:0.46 X-accdeg:16.95 overallAngleofTilt:6.696,8\n
balancegyroDegrees:-5.61 X-accdeg:11.45 overallAngleofTilt:5.996,9\n
balancegyroDegrees:2.77 X-accdeg:17.20 overallAngleofTilt:5.536,9\n
balancegyroDegrees:-1.00 X-accdeg:9.65 overallAngleofTilt:4.977,9\n
balancegyroDegrees:8.68 X-accdeg:1.77 overallAngleofTilt:5.325,9\n
balancegyroDegrees:3.92 X-accdeg:16.83 overallAngleofTilt:5.575,9\n
balancegyroDegrees:0.69 X-accdeg:-1.89 overallAngleofTilt:5.776,9\n
Tim003 in reply to Pizzapie500Sep 17, 2012. 8:58 AM
Ok. I can't really verify anything right now (I m in class) but it seems that everything is working fine for you. Here is why:

"However when you tilt the board so accel values go +ve, the gyro values should TRANSIENTLY go more +ve also.

They will go transiently -ve as accel angle goes -ve when you are tilting it the other way.

If this happens then you have your accel and gyro mounted correctly!"

From my past paste of the data (http://pastebin.com/LpUd3PFp) it seems that my IMU is having trouble getting it's values right. I'll find out more about it as soon as I am back.
Pizzapie500 in reply to Tim003Sep 17, 2012. 1:05 PM
I think that we're doing different codes. I was using the Just Balances code. This is my IMU tester code data:

3,9
\n
balancegyroDegrees:7.07 accelDegrees:-1.11 overallAngleofTilt:1.90 accsum: 345.29
3,9
\n
balancegyroDegrees:5.23 accelDegrees:0.49 overallAngleofTilt:2.92 accsum: 343.43
3,9
\n
balancegyroDegrees:6.53 accelDegrees:2.26 overallAngleofTilt:4.35 accsum: 341.38
3,9
\n
balancegyroDegrees:6.76 accelDegrees:3.61 overallAngleofTilt:5.84 accsum: 339.81
4,9
\n
balancegyroDegrees:5.00 accelDegrees:6.57 overallAngleofTilt:7.06 accsum: 336.38
3,9
\n
balancegyroDegrees:0.46 accelDegrees:7.92 overallAngleofTilt:7.73 accsum: 334.81
3,10
\n
balancegyroDegrees:-4.61 accelDegrees:6.90 overallAngleofTilt:6.93 accsum: 336.00
3,9
\n
balancegyroDegrees:-6.76 accelDegrees:5.71 overallAngleofTilt:5.48 accsum: 337.38
3,9
\n
balancegyroDegrees:-2.38 accelDegrees:3.82 overallAngleofTilt:4.58 accsum: 339.57
3,9
\n
balancegyroDegrees:-4.92 accelDegrees:3.49 overallAngleofTilt:3.65 accsum: 339.95
3,9
\n
balancegyroDegrees:-6.69 accelDegrees:2.26 overallAngleofTilt:2.18 accsum: 341.38
3,9
\n
balancegyroDegrees:-9.15 accelDegrees:0.00 overallAngleofTilt:0.12 accsum: 344.00
4,8
\n
balancegyroDegrees:-6.99 accelDegrees:-2.83 overallAngleofTilt:-1.81 accsum: 347.29
4,9
\n
balancegyroDegrees:-9.45 accelDegrees:-4.27 overallAngleofTilt:-4.10 accsum: 348.95
4,8
\n
balancegyroDegrees:-6.92 accelDegrees:-6.44 overallAngleofTilt:-5.95 accsum: 351.48
3,10
\n
balancegyroDegrees:-9.61 accelDegrees:-8.99 overallAngleofTilt:-8.32 accsum: 354.43
3,9
\n
balancegyroDegrees:-2.92 accelDegrees:-10.59 overallAngleofTilt:-9.39 accsum: 356.29
3,10
\n
balancegyroDegrees:-4.07 accelDegrees:-11.45 overallAngleofTilt:-10.43 accsum: 357.29
3,9
\n
balancegyroDegrees:2.38 accelDegrees:-11.70 overallAngleofTilt:-10.15 accsum: 357.57
3,10
\n
balancegyroDegrees:6.07 accelDegrees:-10.67 overallAngleofTilt:-8.86 accsum: 356.38
3,9
\n
balancegyroDegrees:8.22 accelDegrees:-7.88 overallAngleofTilt:-6.95 accsum: 353.14
3,10
\n
balancegyroDegrees:9.30 accelDegrees:-6.53 overallAngleofTilt:-4.70 accsum: 351.57
3,9
\n
balancegyroDegrees:8.53 accelDegrees:-3.74 overallAngleofTilt:-2.60 accsum: 348.33
3,10
\n
balancegyroDegrees:9.38 accelDegrees:-1.11 overallAngleofTilt:-0.46 accsum: 345.29
3,9
\n
balancegyroDegrees:5.61 accelDegrees:3.16 overallAngleofTilt:1.42 accsum: 340.33
Tim003 in reply to Pizzapie500Jan 31, 2013. 7:48 AM
Did you get the segway working in the end?
Pizzapie500 in reply to Tim003Jan 31, 2013. 12:10 PM
I haven't got the time with school and everything. Did you?
1-40 of 533Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!