With Instructables you can share what you make with the world, and tap into an ever-growing community of creative experts.
Not sure. I didn't build it to ride for more than a few minutes. The calculation will be skewed based on how much current (power) is being used. THis will vary based on weight of rider, hills etc.Also, each motor is 280W and is drawing power. So your worst case math is 560W at 24V....
I dont know what autonomy is in this context.
Hi Jean Claude,Welcome back...You have 2 problems.The direction of rotation issue is due to electromagnetic noise being coupled into the serial communications. You need to have a common ground tie point. All the wires especially the I2C and Saber serial wires need to be twisted.The vibrating motors are caused by the saber telling you it is in over-current mode. They vibrate the motors for you when that happens. You will also see the lights flashing red on the saber when this happens. This can be due to undersized power wires or more likely a battery that cannot produce the current you need. You may need to charge or replace your 12 batteries. Each should measure at least 12V when you start.
Hi Ziga,Thanks for the videos. As mentioned multiple times in these comments, you cannot prototype this kind of a motor design without twisting the wires. Please twist ALL your wires preferably with a ground wire. Make sure that you have a common ground tie point in your design. See if that makes your design work better.
Just to correct one thing you wrote. The deadman switch is an input to the Arduino. It is high impedance and has no output current. If you ground that input, it enables the Arduino to drive the Saber.Yes, you should unzip the code you downloaded and program your Uno. I assume that you have proven that you can program the Uno with some blinky code to prove that programming it works?It's possible that you damaged the Uno outputs but I would rule out everything else before you assume that.Also, look in the debug section. You should be able to print out the gyro angle to confirm the Uno and setup are working.
Nice build! Thank you for sharing your presentation. I hope you get an A...
Hi,It looks like you have a good start. The LED will come on when you hit the deadman switch. it does not indicate calibration. It doesn't look like your LED is coming on so something is wrong there. You have to pick where to start your debug. The Saber controller won't get the command to power the wheels from the Arduino if the deadman switch circuit is not closed. I assume that you have tested your motors by applying 24V to them at sime point.Also, after you do this initial testing, make sure to shorten and twist all your wires or it will not be reliable.
And yes, the orientation of the gyroscope will matter in the final version to get the motors to spin the proper way. Make sure it matches the Instructable images on your board.The fact that your motors dont spin at all is not due to gyro orientation.
First check the schematic carefully to make sure it matches what you have. Check that the batteries are at least 12 volts each.
Hi Claudio,What a cool looking build. I haven't had the issue you are observing with the starting tilt angle changing over time. Could it be that there is some kind of intermittent short with the tilt wire? That might explain the built up tilt offset as you ride.Please post a youtube video of your machine running for us when you have a chance.
That's great news. Twisting the wires is important. Big motors give off a lot of electromagnetic energy which couples into the low voltage signal wires and corrupts the I2C communications. Twisting cancels out this noise.I don't believe that the "modified the settings from 0x01 to 0x02" mod does anything. it would be interesting to try backing that out again as an experiment to see if you notice a difference.To modify the gain, change this at the top of the code. I would start with ACCEL_GAIN://Variables for GYRO_GAIN and ACCEL_GAIN#define ACCEL_GAIN 18.0 //#define GYRO_GAIN 5.0 //Post a youtube video of the machine in motion if you can.
It looks great! How about sharing a working video for us?
It looks great! How about sharing a working Youtube video for us?
Very happy to hear that! I dont understand why those offsets fixed your slow moving motor issues. Do you?Post a video of someone riding it for the community please.
What solutions did you try? New batteries?You can try to adjust the gain settings. Play with these values in the code. Start with the ACCEL_GAIN://Variables for GYRO_GAIN and ACCEL_GAIN#define ACCEL_GAIN 18.0 //#define GYRO_GAIN 5.0 //
Trying new batteries is a great idea. 25AH or more is fine. The batteries amp rating is the max current it can supply. The power required by your wheels is fixed. 350W *2 = 700W V=24V P=IV I=P/V I=700/24 = 29ASo, in reality, the max current the motors could draw is 29A. You will not need this much current to balance the segway with a person on it.
Interesting. It looks like it is basically working without a load.One thing you definitely need to change is your I2C and S1 serial wiring. They must be twisted with a ground wire or you will get corruption as the motor load increases. This is due to EM radiation.The batteries need to be in excellent condition to drive the 350W motors. THey should be charged and preferably new. I remember that my segway behaved like yours when the batteries were bad.Does the red LED flash on the saber board when you cant ride it? If so, this means you are having overcurrent issues and the saber is shutting down.
How to Make a Fan POV Display
Nice instructable! Another method to do this is to build a jig that uses the factory edge of a sheet of plywood as a guide. You would lay foam (or a bunch of 2x4 segments) on the floor under the piece you want to cut. It can be used for 4' crosscuts or almost 8' rips. This is an example of how to make the jig I'm talking about. http://tombuildsstuff.blogspot.com/2012/10/how-to-...
The wires should be the size of an extension cord wire. If possible, get 2 car batteries and try that as an experiment. It's still possible that your batteries are weak or are not rated at 7A each.Once you get close, you may want to increase the gain settings at the top of the code. Your video shows that the Saber is cutting out due to an overcurrent error so that is not the issue yet.
The red flashing LED means over current error. Sometimes the Saber will vibrate the motors to let you know you have this condition.The power requirement of the motors are fixed. If you drop the voltage, you will increase the current needed to run them. That will cause the over current error.Either your battery is too low or your wires are too thin. Check both carefully under load this time. Or, your wires are too thin for the load. Make sure they are the size of electrical extension cords as used in the Instructable. If they are thin wires, there will be a voltage drop.Yes the gearing matters. 1:1 is not good but I dont think it would cause the severe problem you have. Not sure. You should try to match the gearing of the Razor scooter gears and chain used in this Instructable.
Hi Devesh,Nice build and video. You are very close. My first question is what is the voltage on your batteries? Both should be at least 12V when the switch is off. If not, they need to be recharged or replaced if they wont hold a charge anymore. THese lead acid 12v batteries can be permanently damaged if they are over discharged.Is the led flashing on the saber when you have the segway on the ground?
Sphere-o-bot: a Friendly Art Robot
It sounds like a battery issue if it won't work under load. The batteries need to both be over 12V when you start out. They should be 7A minimum each as shown in the Instructable. The batteries do fail if they are too depleted and not charged in time.
One other thing comes to mind since this is an intermittent problem. Make sure your batteries are fresh. Each battery should measure at least 12V when not under load. If not, replace your batteries.
The title should be changed to "Build Your Own Microcontroller Board"Building a microcontroller would be an interesting instructable but it would consist of many MSI parts or an FPGA. This is a good writeup on what a microcontrlolller is:https://learn.mikroe.com/ebooks/picmicrocontrollersprogramminginassembly/front-matter/introduction-to-the-world-of-microcontrollers/
Wow! That looks great. It's nice to not have a big black screen on your wall when it's not being used. I hope you enjoy it for many years.
Let me know how the saber "test program" test goes.The metallic cabinet does not have to be grounded. I can see one picture which looks larger when I click on it.Debugging is tough. I do it a lot. It will feel great when you solve the problem!
Yes, the Arduino code could be modified to ignore the Accel Gyro and just follow the steering switch. What are you using this for?
Sorry for the reply delay Jean -Claude. Just returned from vacation. The video looks good. at around 47seconds in, It looks like there are 2 wires connected to S1 at the Saber. Why is that? It should be only 1 wire.On the green wire from S1 to Arduino board, this should go to pin 13. It's hard to tell in the photo but it looks strange. All the wires from the steering and tilt switches should be twisted with grounds. If not, it can couple noise to the Arduino. You can see my son doing this with a drill in the Instructable video.I still think you have I2C noise getting into the system or a wiring issue. If you have ruled all these above problems out and really think the Saber is a problem, try: modifying the Arduino code to just drive the saber wheels with a delay. No I2C accel ...see more »Sorry for the reply delay Jean -Claude. Just returned from vacation. The video looks good. at around 47seconds in, It looks like there are 2 wires connected to S1 at the Saber. Why is that? It should be only 1 wire.On the green wire from S1 to Arduino board, this should go to pin 13. It's hard to tell in the photo but it looks strange. All the wires from the steering and tilt switches should be twisted with grounds. If not, it can couple noise to the Arduino. You can see my son doing this with a drill in the Instructable video.I still think you have I2C noise getting into the system or a wiring issue. If you have ruled all these above problems out and really think the Saber is a problem, try: modifying the Arduino code to just drive the saber wheels with a delay. No I2C accel readings at all. For example, Mot0 clockwise for 2 seconds at a slow speed then stop for 1 second then CCW for 2 seconds and repeat. Try the same for Mot1. This will prove out the Saber. Let me know how it goes.
Hi Niall,I assume that you have the segway up on a bucket when you push the deadman switch. Does the segway respond at all when you tip the board or just slam to 100% no matter what you do? Is the MPU 6050 oriented as shown in the picture and up on the top of the board in a box?Are you sure the I2C communication is good? Pullups, twisted wires? Noise can easily couple in and you will get bad Accell gyro readings. The debug section shows how to use the serial monitor to see the actual Accell gyro readings from the MPU6050. It's cool and you should try it.Re-read the instructable and check the schematics carefully for the I2C connections and the S1 connections.
Beautiful build and description.
Hi Jean Claude,None of your pictures came out. Please send a video of what happens when you try to ride the Segway. Show the twisted wires and pull up resistor. I am not sure from your description what you are saying. There is an I2C bus break?? Obviously this will cause many problems. There should be signals on pin 13. The code will send serial commands to the saber to stop. Verify all your wiring against the schematic again please. Check that the grounds tie to a common central point.
The dimensions for the segway were found experimentally. For example, I measured the size of my foot and the box needed to determine the size of the platform plywood. No advanced mathematical calculations or formulas were used for that. Does that answer your question?
Sorry. S2 is not used here. Leave it unconnected.
Hi Madbots,You are really sticking with this project! Check all your wiring per the schematic and make sure the wires are twisted. Especially check the I2C wires and motor wires. If they are not twisted, they are susceptible to EM interference from the motors. Make sure the correct value pullup resistors are on the I2C lines.Dont worry about #4. There is no evidence that it made any difference and I did not implement that.Send a detailed youtube video if it still doesn't work.
I would not advise using the mpu6050 for steering on the initial model. Start with the switch in the intractable. Switch to a potentiometer if you want mechanical steering.
Don't think there is an s2 on the saber in here. Maybe on the 60amp version. Check the spec.
This would be a great project for middle schoolers. My son is actually in middle school now. PID (Proportional, Integral, Derivative) is one type of control system which uses feedback. In real world application, all 3 of the terms are not usually used. The code here uses a front end filter to smooth out the input from the accel/gyro. It then uses a type of proportional control to stabilize the platform. I bet some of the kids can help you with the arduino if you have issues. ;-)Read through the instructable and some of the comments. Let me know if you have issues. Good luck.
Open the instructable and type cntrl-f. Type 19fifo in the search box. It is described in the instructable...
Hi Jacob,That's great that you built a Segway. That "known fault" fix did not affect my build or many others. Some people claim it helped them.I dont have that weird behavior issues on my build.Can you upload a Youtube video of the behavior? Zoom in on the circuit boards and the wiring. Did you use all the same components? Twist the wires? Verify pullup resistor connection? Batteries are over 12V each?
The switches are momentary SPDT. See the parts list.Yes, if you are using higher current motors than the Instructable uses, you should use that higher current driver. Good luck with your build!
Setup and Print
Using a Slicer
Easy 3D Printing
Did you read the Instructable?
Wow. Great instructable. Can you share a video of it in action?
Hi Fabio,I wasn't able to find any schematic tool that would look good and be easy for everyone to understand so...I made my own. I used visio and a combination of screen shots and the visio "connector tool". I saved it as a .jpg I would be happy to send you the original visio document if you have access to microsoft Visio. Let me know.ira-
Excellent Instructable! Very well done video and description. Thanks for sharing your work.
Acoustic Tractor Beam
Hi h-craft,You can use any wheels you want of course. I assume you have a way to mount a chain to them.You can use the larger motor. If you do, you should use the corresponding larger Saber motor controller because it will use more current.You do not have to change the Arduino code.
Hi Adri95,This instructable uses the Saber controller which is very well designed and has internal protection. I tried using PWM at one point in my design but the controllers I used were not able to survive. They both went up in smoke. They couldn't handle the load of the segway. I suggest that you start with the Saber and then if that works, try to replace it (and the code) with your own.
Raspberry Pi Class
Hi,Please read the instructable. This is in there:Motor Controller:The Dimension Engineering Saber motor controller was one of the most expensive parts of this project. I tried two cheaper ebay motor controllers using PWM driven by the Arduino. They both failed to work well and so we needed to use the Saber part. It would be great to find a lower cost alternative to the Saber which is very well designed.
@fungypro I dont think the Arduino is running out of RAM. It's more likely that the RFI and EMI from the motor is messing up the I2C communication between the Arduino and the MPU6050. If this happens, the Arduino cant read the accel/gyro numbers from the MPU6050. Make sure your connections are good. Soldering is preferred. Make sure your wires are tightly twisted. Make sure you have the proper pullup resistors on the I2C lines. You should also of course check the deadman switch connection to make sure that's not an issue.
Wow Rob! That is the best build yet! Better than the original here. I love the deadman switches you built into the platform. If you have a second, upload the videos to Youtube for sharing. Not everyone can download 200MB files. Congrats!
All purpose flour.
I totally understand! It's always a trade-off on a project as to how much effort to put into it knowing that there are a pile of other projects waiting in queue behind that one. Since you are married, that also comes into play if the spouse has something else in mind that is higher priority... Not that I would know about that.. ;-)
Great project! One quick thing you might do to clean up your storage box front is to add some iron on edge tape. After you cut and iron on 4 pieces, use a box cutter or sharp knife to trim out your 1/4" dado slots. If you were starting from scratch, you could put the edge tape on first and then cut the dados.edge tape (get white birch only):https://www.amazon.com/Cloverdale-78250-Edging-Banding-25-Feet/dp/B000BZ0ZN6
Make a Melting Spoon
Hi,I chose the lift because it was the only quality lift available with IR control at the time. Not sure if they have competitors now.Yes, you can use a cabinet. You'll need to make sure it's wide enough for the TV. You probably need to go custom and not tweak a standard base cab. The top needs to have a piano hinged lid as I did. You want to buy a universal remote that can learn the IR code for the lift so you can do the raising and lowering with one remote as I did.Post a pic if you build something. Good luck!
If you are planning to make a Segway Clone, I recommend that you follow this Instructable with the exact code here. Afterward, If you decide to change the code to use a PID controller, you can use the Arduino library for it or code it yourself using this great reference:http://www.wescottdesign.com/articles/pid/pidWithoutAPhd.pdf
Poul,Please start with some basic Arduino How-to code to learn how to code and use the Arduino GUI. Then come back to this Instructable.You didn't answer this question from 3 months ago:Make sure the pullups are installed and the correct values?
Superhero Costume Class
Designing a Supersuit
Thanks for sharing this method of ironing on a laser printed image to the bare PCB. FYI, I used to make my own PCBs but have recently switched to the newer low cost fast turn PCB houses for mine. I am able to wait a week or 2 for my boards as I write the code.For example, OSH Park (in the USA) will give you three 1" x 2" boards (with text and drilled holes) for $10 (including shipping) in 15 days. It feels like stealing when you get the boards back... ;-)This website is awesome and lets you put in your board characteristics to find the best price/timing for your PCB designs by showing information from 27 different vendors including OSH Park: http://pcbshopper.com/
4 independent switches will work as long as they have spring return. I see the right type of switch here on ebay but it is more expensive than it should be: http://www.ebay.com/itm/NEW-Momentary-on-Off-on-SP...By the way, a potentiometer will not work with this design.
The tilt and steer switches are both push spring type switches. When you push them, they make contact. When you stop pushing them, they break contact.To adjust tilt, just push a few times in the direction you want. Same idea with steering.If the wheels wont move, try the steps in the debug section. Send a detailed video of the problem if it still wont work after you try the debug.Good luck!
Confused. It looks like you are balancing in the mp4. If you want to make it less sensative you can tweak some of the variables at the top of the code.
XenonJohn,Thanks for commenting here and thank you for your work on self balancers! Your designs helped make this one possible. Check out XenonJohn's page for some great instructables.
Hi Max,It sounds like what you are describing might work. I bought the Firgelli lift to avoid that part of the design because I'm not good at it. The purchased lift has the top and bottom senors and IR control built in. The top sensor which is the TV height has a programmable stop which is important unless you make yours go to an exact height or can move the limit switch.Let us know how it works out or make an instructable to share if you have good luck with this!
Hi Poul,pull-ups are the 2 resistors in the design. They pull up the voltage on the I2C bus to reduce switching noise. The ones you are using sound good.Monitor the USB output from the Arduino, as described in the Debug:Step "35: Optional: Debug step."Edit the Arduino program to do this:To enable printing to the serial monitor, set this to a 1:#define DEBUG_ENABLE_PRINTING 0 //normalLoad it into the Arduino.Put the Segway up on a bucket or step. Hook up the USB cable between segway and computer. click on the "serial monitor" pull down in the Arduino menu on your computer. select the 115,200 baud rate in the Arduino menu.turn on the segway and you should see messages flowing out of the arduino to your computer screen.Read the debug section and try to follow it. ...see more »Hi Poul,pull-ups are the 2 resistors in the design. They pull up the voltage on the I2C bus to reduce switching noise. The ones you are using sound good.Monitor the USB output from the Arduino, as described in the Debug:Step "35: Optional: Debug step."Edit the Arduino program to do this:To enable printing to the serial monitor, set this to a 1:#define DEBUG_ENABLE_PRINTING 0 //normalLoad it into the Arduino.Put the Segway up on a bucket or step. Hook up the USB cable between segway and computer. click on the "serial monitor" pull down in the Arduino menu on your computer. select the 115,200 baud rate in the Arduino menu.turn on the segway and you should see messages flowing out of the arduino to your computer screen.Read the debug section and try to follow it. Let us know how it goes.
That looks like a beautiful build. You are having some issue between the Arduino and Acell/gyro board. Did you check the debug section of the Instructable? Make sure the pullups are installed and the correct values? twist wires tighter than you have shown in picture.Monitor USB output with motors not running and make sure that when you tilt the board, the Arduino thinks it's getting the right angles.
Congrats! It looks like a great build. Your .MOV file was upside down for me but you get the idea that it was exciting for the family there. Youtube can flip it if you choose to upload there.re: the deadman switch pressure, did you use the same switch as shown in the instructable? That takes very little pressure to push.
Thanks for sharing these! Looks like a great build with smooth motion.
Thanks for this Jon. I added a note to the Arduino code section of the Instructable with fgastald's code recommendation. Hopefully it will help others with motor issues.Post a video of your build!
Sculpted Reclaimed Wood Bench with Steel Base
3D Printed Stepper Motor
Build your own Variable Lab Bench Power Supply
Which MICROCONTROLLER for your ELECTRONIC FASHION?
Head Mouse - Game controller or disability aid
Arduino wireless laser turret
Removing Rust with Citric Acid
Five Dollar Blow Gun with Explosive Darts!
Secret Knock Detecting Door Lock
Self-balancing skateboard/segw*y project Arduino Shield
Guide to gyro and accelerometer with Arduino including Kalman filtering
How to make a small wind generator (In celebration of earth day!)
PVC -- It's Great for Inventions
LED Pocket Watch
Let your inbox help you discover our best projects, classes, and contests. Instructables will help you learn how to make anything!
© 2016 Autodesk, Inc.