Onewheel Build Guide

the code for self balansing is comming along and I’m testing each update and having a dialob with the developer… its getting better and better… also I am currently impementing some code for velostat footsensor(s) using the free adc on the vesc6+

1 Like

Im using the DieBieMS BMS witch includes a antispark switch and a oled battery display

the pull has not yet been accepted to the firmware…?

Your work to implement velostat foot sensors sounds great!

We have plenty of work ahead of us with the rest of the build, so waiting a release or two probably won’t hurt us. Do you have any idea what sort of timeframe it might be (not gonna hold anyone’s feet to the fire or anything, but would like to know if it’s likely closer to 6 days, 6 weeks, or 6 months). I’d be happy to try and help out, but would be starting from scratch to learn the codebase. It might be better (and get results faster) for me to simply offer to buy you pizza and beer (or your foodstuff and beverage of choice.)

1 Like

functions should be in place But I am getting eratic behaviour from the voltage read so code might be good but hw implemenetation wrong or vice verce …

anyhow… here is the newest compilation (footsensor code commented out)

1 Like

I think I was too enthusiastic, later I realized the last changes where made with the news of Benjamin, not from Michlol, I suppose the code of Michlol will be next release, but just guessing. Btw I can’t connect the mpu9250 with vesc, don’t know why, maybe wiring is not correct, but I asked in vesc project forum couple days ago, but no answer at all. If someone can confirm the wiring I will be sooo happy.

Here is how is connected now:

Vcc to vcc or 5v

Gnd=gnd

Scl=scl

Sda=sda

The only thing I can think now is if sda or scl are crossed like Tx Rx in UART

Edit: copy from vedder answer:

Many of the changes were inspired from your code :slight_smile: (Michlol code) Then I will call it a half merge :slight_smile:

3 Likes

@Dan333 mind you to give a basic instructions where are the comments for the food pad sensors? I can’t find them, the only thingie I know is using one of the ADC free from the vesc. Thanks mate

This was a month ago before my VESC decided to stop working with PWM/PPM. Been trying to get UART communication to work eversince…

2 Likes

There is a “bug”/“missing feature” in the vesc code. It uses a whitelist of I2C addresses for the MPU9250, and at least for the MUP9250 that i got off amazon, the I2C address is not on the list. That is why i made this change.

This is likely your issue. The options are to wait for my pr to merge, buy a different gyro (MPU6050 works if you have one, BMI is probably the best but i haven’t tested it yet.), or maybe there is a jumper or something you can use on the MPU9250 to change the address (not sure if thats real or not, i vaguely recall reading it somewhere)

3 Likes

For anyone trying to make velostat sensors, here is a video on what I’ve found is the best method. I spent almost a year trying different things, and riding on these, so it is pretty legit. (I don’t have any more kits for sale, but if there is a big demand, maybe i can make a 2nd batch)

7 Likes

Welcome @NuRxG this is getting exciting!!! Awesome what you are doing man, thanks to bring euc’s and ow to the DIY scene. Yep I installed your firmware and I’m getting data from the gyro, still I didn’t figure out how to get pid output working, but yeah I will keep trying :slight_smile:

NuRxG’s firmware and tool compiled:

6 Likes

I’ve been watching these videos…keep it up!

1 Like

I’d be interested for 2 units. Do you have a cost estimation ?

1 Like

I’d be interested as well

I was selling them for 15$ I think I would keep the price the same. Not super profitable and kind of annoying to prepare, but I’m only making a few as a service to the community rather than trying to pay my rent.

Last time i sold the kits, i never heard or saw any posts or anything from any of the buyers which was super bummer. I don’t know if anyone actually used them, or they’re all sitting in peoples “to do” piles. Maybe if i charge more people will actually use them LOL!

5 Likes

I might have some code samples of a nano controlling a vesc with self balancing over uart, but id have to dig them up, as i abandoned that route a long time ago.

Regardless i based my code on this.

I switched from UART to PPM and it seemed to be more stable, and i never went back, however i didn’t really do extensive A/B testing, so I’m not so confident in that answer. Regardless my current code is worlds better.

1 Like

Was Arduino uart slow/laggy?

@NuRxG I thought to use this one nrf 52 + bmi160 do you think it can work? I have a vesc 6 and using external gyro, then I can’t use Bluetooth module for fine tuning pid, no more UART ports available. (Bmi160 is not firmware ready yet, buy I think it will be soon) Also there is a forum member who produces a UART splitter module, that could be a solution, but I don’t know if that could create noise or any kind of interference on the readings from the gyro.

Thanks for your input mate

It was twitchy and hard to tune, but I can’t promise it was due to UART. Ive come a long way since i last tried that method, and rewritten my code 2 or 3 times on different architectures. Every system will have a weakest link, and across my various systems there were many different weakest links.

Some of them being:

flipsky vescs are shit for self balancing

PPM signals are a few MS each

arduino nano cant run at more than like 400hz (use a teensy, way better!)

complementry filters are lame

MPU6050 random drifting biases

VESC time to read and process an input depending on the source (ive never quantified this, and it may not exist)

The gyro library i initially picked had lots of small hard to find bugs that wasted weeks/months of my life

General signal interference/noise on the lines from gyro to arduino and arduino to vesc, I’ve never quantified this either but electronics people love to talk about it.

The shape and weight of your build.

A good example is that i switched from arduino to teensy to run at 1k, but running at 1k made almost no difference when i was controlling over PPM, that was a major defeat and super depressing. However now that I’m running onboard the vesc switching from from 500hz to 1khz made a HUGE difference in stability.

1 Like