Page 1 of 4

Self balancing skateboard

Posted: Mon Oct 13, 2014 7:33 am
by satacoy
Hi All!

First time poster, longtime SparkFun customer.

I'm going to buck the trend in this forum, and just document a project I'm working on. I'm sure I'll pose questions along the way, but my main goal here is to give myself some incentive to keep moving forward on this project.

I'm starting to build the successor to a self balancing skateboard I made a few years back. An avid snowboarder, I wanted something to play with during the dry seasons here in Colorado. Plenty of people have made these before, but it seemed like a great project on many different levels. I documented it a bit here: http://teamcosmos.com/skateone/index.shtml. Video here: https://www.youtube.com/watch?v=rhfugvQB1jY. It used a Netduino and a 6 DOF IMU from Sparkfun, amongst other items.

Image

It was a fun project, but as is typical, halfway through the project I was already thinking of the next version of the skateboard. As noted on the above site, there were a few issues that haunted the project: Minimal feedback from the skateboard, a difficult to access micro-controller, and physical layout issues that caused problems turning or climbing hills.

So the upgrade plans involve a few toys from SparkFun: An RGB LED strip that wraps around the skateboard, some bright LEDs for headlights, a Bluetooth module, and an Infrared receiver. I'll use the LED Strip to indicate things like speed, direction, angle, etc. I'll dump a lot of data out via the Bluetooth module, and allow modification of key variables via Bluetooth as well. The infrared receiver will allow me to tweak settings when I don't have a laptop or phone handy.

Pete

Re: Self balancing skateboard

Posted: Mon Oct 13, 2014 5:33 pm
by satacoy
I've been working on version 2 of the skateboard for quite a few months. I'm past the design phase, and am wrapping up the chassis building phase. I'll do a few quick posts that cover the design considerations and the building, just to catch up to the current state.

In terms of design, as I mentioned before, there were a few items to address:
  • Clearance issues - I need more clearance, especially while turning.
  • Accessing the Microcontroller - I want to be able to upload new code easily, without tearing apart the machine.
  • Feedback - Having a Bluetooth interface would be great in terms of getting debug info out, and tweaking settings without recompiling.
  • Up the Nerd/Wow factor - While not as dorky as a Segway, I have to admit I'm not 100% comfortable riding this thing in public. I need to up its visual appeal somehow, or conversely make it so overtly nerdy that you have no choice but to truly embrace that inner nerd.
There are other smaller issues to address, such as weight, ease of carrying, etc., but the above issues are the big ones. From a chassis design perspective, really the first issue is the only one that could be addressed. I started playing around with a CAD program, and eventually came up with a layout that I liked. The placement of components is nicer, I lopped off the corners of the foot rests, raised the deck farther from the ground, and improved the bearing setup.

In the following picture, the new skateboard is on the left, the older is on the right.

Image

Machining

Posted: Mon Oct 13, 2014 5:50 pm
by satacoy
With the design more or less finalized, I started machining. I have a simple manual mill from Enco, so I can't do fancy curves or compound angles easily. I started with this pile of aluminum:

Image

A month or so later, and 6 pounds of aluminum chips on the garage floor, I ended up with this:

Image

You can see the channel running around the outside that will house the RGB LED strip from SparkFun. Now to face some of the electronic and software challenges. While I've been building combat robots for years, I'm still pretty weak when it comes to electronics. Part of the appeal to this project is to stretch my understanding a bit in this area.

Electronics

Posted: Tue Oct 14, 2014 9:12 pm
by satacoy
I've collected a fair share of the electronics that I'll need for this second iteration of the skateboard.

Image

These include: There are a few more odds and ends, but those are the big items.

The plan is to use the Arduino to control the LED strips, and the Netduino to control everything else. The LED strip require microsecond timing to control properly, and the Arduino has open source libraries that will do this for you. I've played around with custom firmware on the Netduino to try to control the LED strip, but haven't had any luck. The main issue there is my lack of a good scope, so I can't troubleshoot my timing issues.

I suspect that the Netduino will be busy running everything else, so offloading some of the work to the Arduino is a nice option from that perspective. I'll have the two micro-controllers talk to each via a serial interface.

That's at least the plan. I need to finish up my circuit design, and test a few last items out on a breadboard. If all looks good, the plan is to order a custom circuit board and get everything wired up.

Re: Self balancing skateboard

Posted: Wed Oct 15, 2014 7:56 am
by lyndon
4.5 peak HP? Your skateboard weighs, what, about 25lbs? That's a one-wheeled motorcycle!!

Re: Self balancing skateboard

Posted: Wed Oct 15, 2014 8:22 am
by Ross Robotics
I would love to build one of these but I have way too many projects on my bench.. But please continue with your documentation!

Re: Self balancing skateboard

Posted: Wed Oct 15, 2014 8:27 am
by satacoy
Lyndon: Yeah, the 4.5 HP is overkill, but I had a few of these motors laying around not being used. You're right on the money with the weight, I'm hoping for about 25 pounds. The motor is a large contributor to the overall weight.

Codlink: I know what you're talking about. I wanted to build one of these for about 5 years before I finally got around to it.

Re: Self balancing skateboard

Posted: Wed Oct 15, 2014 2:39 pm
by lyndon
Amy over at amybuildsstuff.com built a small gokart with similar motors a few years back. Might be some good ideas there.

Mounting & Wiring

Posted: Sat Oct 18, 2014 6:22 pm
by satacoy
I've been sneaking in a few hours here and there to get the electronics mounted.

Here you can see the batteries, contactor, two power switches, the 5 volt DC/DC converter, and the Netduino 2 (unmounted). One switch is a momentary switch to turn everything on and off. I'll use the Netduino and a transistor to keep the contactor on after the momentary switch is pressed. That way I'll be able to turn the skateboard off via software. For example if someone stopped riding it without hitting the switch again, I'll be able to determine inactivity and power everything down.

The second switch is an inline SPST that will disable the contactor physically. You never know when something will catch on fire, or you have a bug in the software that won't allow you turn the electronics off in a timely manner (usually discovered when the skateboard is on fire).

Image

Here's the motor and OSMC installed and wired up. I still haven't run a cable from the OSMC back to the micro-controller. I'll do that once I have the micro-controller mounted and the custom shield installed.

Image

Next is a picture of the contactor, batteries, switches, and DC converter wired up. It's turning into a bit of a rat's nest, I'm sure I'll have to move wires around to get everything happy in there. In the background is the Netduino with a custom shield for the original skateboard. It was test run to see if I could get a much simpler board printed without missing anything. It's the first one that I've done, I wanted a little practice before the much more complex shield that I'll be using on the new skateboard.

Image

I imagine progress will slow down a bit at this point. The next big thing to do is finish the design of the Netduino shield. I have a first pass done, but need to go back and make a few changes, double check what I did a few months ago, etc. As I go through that process, I very well may post some questions. I'm a almost a complete newb when it comes to that kind of stuff.

Re: Self balancing skateboard

Posted: Sat Oct 18, 2014 8:31 pm
by Ross Robotics
I have got to find time to build a CNC machine.. Your aluminum work is awesome.

Re: Self balancing skateboard

Posted: Sat Oct 18, 2014 8:42 pm
by satacoy
Thanks! I hope to someday add CNC capabilities to my mill, it'd open up a lot of design possibilities. As it is now, I spend a lot of time planning everything out, doing setup, using a belt sander for outside curves, etc.

Circuit Board for original skateboard

Posted: Fri Oct 24, 2014 8:59 pm
by satacoy
Since my "practice" board showed up in the mail that I had made for the original skateboard, I took a slight detour and have been getting it into the old chassis.

Image

The original board is to the right, the new board is on the left. A much cleaner look.

I'm still working out the kinks, the IMU is oriented 180 degrees differently. It's also given me the opportunity to mount the board better in the frame, so I can actually plug a USB cable in while the microcontroller is in the skateboard. This allows me to get some output via the debugger while the skateboard is on. So now I'm playing with the original code, tweaking things here and there.

Unfortunately I introduced some kind of power issue, the code exceptions here and there, unable to read the IMU. Not sure if I have a cold solder joint somewhere, or if I damaged the IMU or microcontroller board in the conversion process.

I'll keep playing with this until the original skateboard is up and running. Then I'll switch back to the new project. At the very least I proved I can layout a very simple board, I'll have a bit of experience to apply to the newer, more complicated board.

Netduino to Arduino Communication

Posted: Mon Nov 03, 2014 10:01 pm
by satacoy
I've been futzing around with controlling the LED strips via an Arduino. My original attempts at controlling the LEDs with the Netduino involved a few custom firmware experiments that never panned out. After a few hours of playing with the Arduino, I got the basics working in a few hours.

I plan on offloading all lighting duties to the Arduino, but keep the Netduino as the master controller. I just prefer working in C#, and the Netduino IDE is much nicer.

After a few frustrating days of trying to get the two microcontrollers to talk over serial, I realized that my original Netduino board was causing various issues. Swapping it out to a newer board cleared up all the inconsistent behavior I had been seeing. Very frustrating, but I should have known better, as the first board had given me trouble in the past.

Here's a short video of the LEDs working. I'll have to be careful, it'd be easy to spend weeks coming up with interesting animations. Click on the photo to watch the video.

Image

Re: Self balancing skateboard

Posted: Tue Nov 04, 2014 12:29 pm
by Ross Robotics
Nice!

Grounding Question

Posted: Sun Nov 09, 2014 7:52 pm
by satacoy
I've run into my first head-scratcher, and could use some help. As a reminder, I'm fairly a noob when it comes to electronics, some of the basics are very confusing to me.

I've run into an intermittent problem with the IMU (https://www.sparkfun.com/products/10121)

This only happens when I add a voltage divider into the circuit, and I'm powering the circuit from both the USB cable and a battery. Once I add the voltage divider in, I have a problem reading data from the IMU.

My question relates to how I have everything grounded. I have a 24 volt power bus, a 5 volt bus, a 3.3 volt bus, and often have a USB cable plugged in as well. The 24 volts come from the battery, the 5 volts come from the DC/DC converter, and the Netduino steps the 5 volts down to 3.3v, which is used by a few other devices (IMU included). The USB cable is also supplying power to the circuit.

Should I have all these buses sharing a common ground? I always understood that to be the case, but could be wrong.

The voltage divider is stepping the 24 volts down to a 3.3v signal for a Netduino analog input. Even if I remove the jumper to the Netduino, simply plugging the 24volts into the divider will cause the IMU to fail.

I seriously doubt that the voltage divider causes any kinds of voltage sag, but somethings definitely going on. Some times after plugging it in things will fail right away, other times it takes a minute before things go wrong.

I don't have a scope, so I can't get a good idea of what's happening voltage-wise.

Any ideas?