Onewheel Build Guide

You are all welcome, I just finished a V1 Code with PID for Arduino to control a one wheel. Feel free to use my code, and ask questions. I will answer if I can. LINK:

8 Likes

Hi MaxGoldenson,

Have you tried this code using arduino on a actual board? I wonder if an arduino is fast enough ?

1 Like

It is, early drones was made arround arduino 32u4 mcu

1 Like

It is fast enough on an Arduino Uno, but the code is old and I’ve recently updated it to work with foot sensors and fine-tune along with being able to tell your weight to adjust the k i, k p & k d values

I’m still working on it though

Also Arduino is way easier to work with having to reprogram your vesc and all that crazy stuff

Damn its super cool to see someone working on this. Do you have any sort of build process or parts list so people could start building their own?

Do you have that code available with the footpad sensors? I would like to try it and see if i can get it to work.

Have the footpad sensors been specified? A BOM would be great!

Hello all who have commented,

The code with the foot sensors is still a work in progress (the code works, but adding the foot sensors has broke other parts in the code) I have also added a Kalman filter to the gyro (so that there is minimal drift). The new code should be up soon. If you want to contact me about this project, or have any questions contact me at [email protected], leave a comment on this form, or you can google hangout me ([email protected]) at 3-4pm (PST may 9th) To discuss.(this will be the best way, because I can share the most updated code along with answer most questions (as best I can). Good luck! And feel free to contact, -Max

ALSO, If any of you are experienced in C++ then feel free to contact me (best via hangouts or email) To help me finish the code faster.

1 Like

If you want to discuss about this contact me on google hangouts from 3-4pm (PST may 9) today, and I can give you the work-in-progress code, and explain it.

UPDATED CODE:

This code has compatibility with PID and Kalman filter built in along with foot sensors to turn it on. The hook-up guide is a follows

Arduino-MPU6050

A4-SCL A5-SDA 5V-VCC GND-GND

Arduino-footsencors
GND-ONESIDE A0-OTHERSIDE

GND_ONESIDE A1-OTHERSIDE you will also need a 10k ohm pull up resistor from 3.3 to A0 and A1.

Arduino-VESC

PIN3-DATA GND-GND 5V-5V

If you have any questions please comment on this form or contact me at [email protected].

Links;

VESC

https:///products/torque-esc-bldc-electronic-speed-controller

Foot Sensor (FSR)

https://www.amazon.com/Adafruit-Round-Force-Sensitive-Resistor-FSR/dp/B00XW2MIRQ/ref=asc_df_B00XW2MIRQ/?tag=hyprod-20&linkCode=df0&hvadid=312727440900&hvpos=1o3&hvnetw=g&hvrand=10104964395484814044&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=1013581&hvtargid=pla-571396511975&psc=1

Arduino

. https://www.amazon.com/Teensy-3-2-with-pins/dp/B015QUPO5Y/ref=sr_1_3?gclid=CjwKCAjwiN_mBRBBEiwA9N-e_lwzqPukBJAB7jffS6Xo3iaYqIrGLus2Pp_4HR84tU6UIPkwBmX-MxoCzqYQAvD_BwE&hvadid=176320835894&hvdev=c&hvlocphy=1013581&hvnetw=g&hvpos=1t1&hvqmt=b&hvrand=13756269608124661101&hvtargid=kwd-35744547392&hydadcr=3016_9782497&keywords=teensy+arduino&qid=1557721656&s=gateway&sr=8-3

CODE

4 Likes

Thanks man! Anything else? Is there a motor in US?

I’m not super experienced with c++ but I’m still an engineer :slight_smile: so I’ll try to help out

I’m interesting in building one of these too. I can program in C and ASM if you still need help.

What do you plan to use for motor mounts? I imagine the wood is much weaker compared to the aluminum rails the OneWheel uses. Do you think it would be possible to use OneWheel rails (OEM or aftermarket)? Speaking of compatibility. What about tire options. Would this motor be compatible with Hoosier tires?

Also, what do you think about adding “LIDAR” (most likely ultrasonic or IR) sensors to the bottom front of the board? Like this board: https://www.hoverboard.com/ Might help prevent nose dives due to terrain. Maybe an Ultrasonic sensor like: https://www.amazon.com/WYPH-Ultrasonic-HC-SR04-Distance-Measuring/dp/B00P5W1JLM/ref=sr_1_6?keywords=Hc-sr04+Ultrasonic&qid=1558330264&s=electronics&sr=1-6

Anyways, just wanted to say again how great a project this is. Hope it inspires many more builds to disrupt the OneWheel monopoly.

the ultrasonic thing is interesting.

@Remieknaapen did you try @MaxGoldenson code? Im gonna try it this week.

I think it would be interesting to use 3 of them in the front (that way you have redundancy in case one fails). It would also be interesting to use 3 IMUs as well (as we are kind of developing a safety critical system) lol

Regarding my question about using OEM or aftermarket OneWheel aluminum rails I found a couple of listings on ebay.

Stock XR rails for $175: https://www.ebay.com/itm/Onewheel-XR-NEW-Stock-Rails-PREORDER/173899174029?hash=item287d32d08d:g:~tIAAOSwxL1cZLeR

Aftermarket extended XR rails for $200:

For a battery pack, has anyone considered using 21700 for extended range? https://www.imrbatteries.com/samsung-40t-21700-4000mah-30a-battery/

2 Likes

No, because not only will be an accurate but when you till the ultrasonic sensor will be at a different angle and therefore providing you a different link that it senses. The problem is is that the sensor can’t tell you how far from the ground you are but simply how far the sensor is from it’s reference.

1 Like

@Sindre Regenerative breaking wont be a issue when motor is 48V and battery pack is 12s…? Also what Vesc setting are you using?

Reg braking works fine and no issues with the 12s. I am running 30A on it, and its running fine!