Thursday, November 22, 2012

Electric Skateboard

In this previous post, I mentioned brainstorming an electric skateboard, and after doing research and finding various parts, I'm at the beginning of putting together some type of prototype electric skateboard. I'm basing my electric board off of the boosted boards models and am using my sector 9 reflections board. I like the flex and turning radius on the sector 9 better than a loaded vanguard, so I'm sticking with this board unless I find something equivalent.

There is quite a bit of work to be done to make this board a reality, but I'm willing to go through it all in order to learn more and to have a finished board that takes me around. This is the list of what's needed so far:

Motors
Motor controller
Mounting the motors and controller to the board
Making a drive train
Writing the motor controller software
Miscellaneous details such as protecting the battery and motors, speed levels, kill switches, etc

That may not be everything, but those seem to be the most important parts. I had originally though that writing the software would be one of the biggest challenges, but it turns out mounting the motors and creating a drive train are harder. These possibly involve CNC work or at least a shop where I need to work with metals, which will take some time on the schedule that I have. This project is in between school and my job, and it keeps me busy when I'm not at either of those. I picked up an Arduino Uno to play around with the software and have hacked a Memorex wireless Wii Nunchuck to control the motors. If anyone would like to see the code and/or help me refine it, send me an email because I'm new to Arduino, and am fairly new to coding. I first started taking nunchuck inputs and printing them to the screen, then used the inputs from the nunchuck to control LEDs. After those tests were successful, I hooked up the Arduino to a brushless motor ESC and used the inputs to control motor speeds. So far, I've gone through many versions of the software and have been refining them so that there is an intuitive control scheme:

Press and hold the C button for throttle
Press and hold the Z button for brake
If the C button is held and the Z button is pressed, override the throttle and engage the brake
Flick the nunchuck joystick up and down to move between speed levels for throttle
The position of the joystick is proportional to the braking intensity when in braking mode - instead of flicking up and down for braking
When no buttons are pressed, the motors are in neutral - there is no current to the motors

In all, to get where I'm at in terms of coding and software took me about a month. First, I had to learn how to use an Arduino, which is simple and uses a version of the C++ coding language. Then, I had to find out how to code what I wanted into the arduino. Thankfully, there are people who are smart enough to have created the coding to read data in from the nunchuck, so all I had to do was use their code and develop the output according to the input. I've got the motors moving but have not connected them to the wheels yet, so the coding will probably change when the motors have a bigger load on them.

There's more, but I'll talk about it later when I have time. I'm pretty tired now and am still working on the board. Hopefully the next post will have info about the finished board.

No comments:

Post a Comment