OpenSource Remote for VESC ArduBoardControl

Lightweight / Folding / Portable EVs - seats optional
RollingGecko
100 W
100 W
Posts: 110
Joined: Tue Jul 14, 2015 2:20 am

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Sat Apr 08, 2017 5:38 pm

Hi,

I used a simple voltage divisor with 2 resistors. I soldered it in a flying connection without PCB.

Depending on your quotient for voltage devisor your can set in the config.h:

//TX Voltage measurement
#define VOLTAGE_DIVISOR_TX 102.5

Regards

Andy
Github: https://github.com/RollingGecko
ArduBoardControl: The Nunchuk Arduino implementation for the VESC: https://github.com/RollingGecko/ArduBoardControler
Berlin Custom Boards: All around DIY longboards: https://www.facebook.com/berlincustomboards/

maxxxx
1 µW
1 µW
Posts: 2
Joined: Fri Apr 07, 2017 3:02 am

Re: OpenSource Remote for VESC ArduBoardControl

Post by maxxxx » Sat Apr 15, 2017 11:53 am

RollingGecko wrote:Hi,

I used a simple voltage divisor with 2 resistors. I soldered it in a flying connection without PCB.

Depending on your quotient for voltage devisor your can set in the config.h:

//TX Voltage measurement
#define VOLTAGE_DIVISOR_TX 102.5

Regards

Andy
What resistor values did you use?

Jfriesen
1 µW
1 µW
Posts: 2
Joined: Sun May 28, 2017 4:20 pm

Re: OpenSource Remote for VESC ArduBoardControl

Post by Jfriesen » Sun May 28, 2017 4:25 pm

Anyone looked at the new NRF52 based feather designs? They have some support for central mode no re-flashing required. A UART example is provided. I'm going to order a couple and see how the reliability of the connection is.

https://www.adafruit.com/product/3406

RollingGecko
100 W
100 W
Posts: 110
Joined: Tue Jul 14, 2015 2:20 am

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Sun May 28, 2017 5:55 pm

Go for it and keep us updated!
Github: https://github.com/RollingGecko
ArduBoardControl: The Nunchuk Arduino implementation for the VESC: https://github.com/RollingGecko/ArduBoardControler
Berlin Custom Boards: All around DIY longboards: https://www.facebook.com/berlincustomboards/

Jfriesen
1 µW
1 µW
Posts: 2
Joined: Sun May 28, 2017 4:20 pm

Re: OpenSource Remote for VESC ArduBoardControl

Post by Jfriesen » Thu Jun 01, 2017 10:48 pm

Bought two feather NRF52s from amazon, they came in today and are working beautifully in my initial testing. I am getting round trip latency (sending a message and echoing it back to the central node) of something around 13-15 milliseconds with minor tweaks to the example code provided by adafruit. 5ms or lower one way latency should feel plenty responsive I'd imagine. They pair quickly (within half a second of turning on) and reliably in my testing so far though I need to work out some code for a more permanent pairing setup so you don't accidentally pair to your friends board etc. Haven't hit any roadblocks yet.

Conducted some initial range testing, at first I was very skeptical because more than 20ft apart I was getting very dodgy connections until I realized the default transmit power on the modules is 0 dB and it can go up to 4 dB. After using:
Bluefruit.setTxPower(4);
I saw a dramatic improvement in range and transmission through obstacles (such as enclosing my hand completely around the device). It seems pretty reliable after this change, only drops if I completely enclose the device in things that aren't rf transparent (metal box etc.) or mov them two rooms apart in my apartment.

I also hooked up a sharp memory display (128x128) and am able to refresh that guy with about 14 ms of CPU time (again completely non-optimized just printing some random stuff each time). Considering you only need to update the screen around 20 Hz it should only take 20-30% CPU to run the display worst case (I think I could at least halve this with simple tweaks/optimization).

Need to head into my lab to test power consumption numbers etc. So far my experience with the RTOS running underneath the arduino layer is pretty awesome. Having the ability to start extra event driven threads etc. will make writing code with lots of safety checks in place more straightforward. When I make more progress I'll post again.

FYI I am still waiting on my board to ship so it will be awhile until I can start testing with these things plugged into some VESCs. Regular arduino code runs fine on these feathers it seems so hopefully I can leverage a lot of the previous stuff you guys have done to accelerate there.

Jeefberky
1 mW
1 mW
Posts: 14
Joined: Sat Apr 09, 2016 4:53 am

Re: OpenSource Remote for VESC ArduBoardControl

Post by Jeefberky » Mon Jun 19, 2017 2:37 pm

Hey @RollingGecko,

It has been a while I have visited this topic. My remote still works great with my VESC (using an Ardnuino Nano).
I want to add a WS2812 LED to see the battery level of my longboard. I assume your code automatically enables the TX battery LED and the LED for the longboard battery level (since you have connected two ws2812 leds connected to each other)?

The problem I have is, I power the TX Arduino Nano with a battery booster (sparkfun power cell) because I'm powering the TX with a 1s Lipo.
So, is it still possible to measure the voltage of the 1S Lipo if the voltage of the Lipo gets boosted to 5v? Of course I want the Lipo voltage to be measured. Not the boosted voltage (because this will be always 5V till the battery voltage gets to low :lol: ).

Or, is it possible to disable the TX battery LED and only use one LED to diplay the longboard battery voltage with a simpel code edit?

Kind regards!

RollingGecko
100 W
100 W
Posts: 110
Joined: Tue Jul 14, 2015 2:20 am

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Mon Jun 19, 2017 3:24 pm

Great to hear, that the remote works!
To your questions:
To use it with one Cell just leave away the voltage divider at

Code: Select all

VOLTAGE_PIN
To define which LED is for what define it here:

Code: Select all

//WS2812 settings

#define NUM2812		4
#define BRIGHTNESS	20
#define LED_TX		0	//TX-Voltage
#define LED_TRANS	1	//Transmission
#define LED_VOLTAGE	2
#define LED_FOUR	3
And you have enable

Code: Select all

#define STATUS_LED_USED		//define out if not used
Number of cells is detected automatically.
Github: https://github.com/RollingGecko
ArduBoardControl: The Nunchuk Arduino implementation for the VESC: https://github.com/RollingGecko/ArduBoardControler
Berlin Custom Boards: All around DIY longboards: https://www.facebook.com/berlincustomboards/

Jeefberky
1 mW
1 mW
Posts: 14
Joined: Sat Apr 09, 2016 4:53 am

Re: OpenSource Remote for VESC ArduBoardControl

Post by Jeefberky » Mon Jun 19, 2017 3:55 pm

RollingGecko wrote:Great to hear, that the remote works!
To your questions:
To use it with one Cell just leave away the voltage divider at

Code: Select all

VOLTAGE_PIN
To define which LED is for what define it here:

Code: Select all

//WS2812 settings

#define NUM2812		4
#define BRIGHTNESS	20
#define LED_TX		0	//TX-Voltage
#define LED_TRANS	1	//Transmission
#define LED_VOLTAGE	2
#define LED_FOUR	3
And you have enable

Code: Select all

#define STATUS_LED_USED		//define out if not used
Number of cells is detected automatically.
Thanks for the fast reply!

A few questions.
What value do I have to give VOLTAGE_DIVISOR_TX if I do not use a voltage divider? (I guess it will be 1 but don't realy know what is going on in the code :oops: )
Because I use a switching powersupply (sparkfun power cell). Is it safe to keep the positive lead of the battery connected to pin A2 all the time? (even when the TX is turned off?)

RollingGecko
100 W
100 W
Posts: 110
Joined: Tue Jul 14, 2015 2:20 am

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Mon Jun 19, 2017 4:02 pm

Set the Devisor to one.
Put the connection to a2 after the Power switch.
Github: https://github.com/RollingGecko
ArduBoardControl: The Nunchuk Arduino implementation for the VESC: https://github.com/RollingGecko/ArduBoardControler
Berlin Custom Boards: All around DIY longboards: https://www.facebook.com/berlincustomboards/

Jeefberky
1 mW
1 mW
Posts: 14
Joined: Sat Apr 09, 2016 4:53 am

Re: OpenSource Remote for VESC ArduBoardControl

Post by Jeefberky » Mon Jun 19, 2017 4:49 pm

Thanks!

Connecting the positive wire to a2 after switching on the TX will be some what of a challenge for me. But thanks for the fast reply!

RollingGecko
100 W
100 W
Posts: 110
Joined: Tue Jul 14, 2015 2:20 am

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Mon Jun 19, 2017 6:00 pm

I dont mean after switching. Ich mean the physical switch.
Github: https://github.com/RollingGecko
ArduBoardControl: The Nunchuk Arduino implementation for the VESC: https://github.com/RollingGecko/ArduBoardControler
Berlin Custom Boards: All around DIY longboards: https://www.facebook.com/berlincustomboards/

AreaKruzer
1 mW
1 mW
Posts: 12
Joined: Mon Apr 18, 2016 1:35 am

Re: OpenSource Remote for VESC ArduBoardControl

Post by AreaKruzer » Tue Nov 21, 2017 12:00 am

Hi all,

I've been using my electric longboard for quite awhile now and want to fiddle with it.

I'm controlling my longboard on a PPM tx/rx. I am looking into having some form of telemetry from the VESC.

my VESC is 4.10 and running the latest 3.33 firmware. I've tried wiring the VESC Tx to arduino nano v3 and mega Rx and VESC Rx to Tx. I used RollingGecko's arduino library and files (including the vesc6 branch on his github), ran the setup on debug and the serial monitor was printing garbage. and don't seem to be able to be getting any values.

VESC is configured to be running PPM + UART. Can anyone advise what is the problem? Is there any way i could find out if the UART connection on my VESC is faulty ?

RollingGecko
100 W
100 W
Posts: 110
Joined: Tue Jul 14, 2015 2:20 am

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Tue Nov 21, 2017 7:51 pm

What have you connected to Vesc? A mega or a nano?
Currently the v6 branch is still in test because I have currently no hardware to test
Github: https://github.com/RollingGecko
ArduBoardControl: The Nunchuk Arduino implementation for the VESC: https://github.com/RollingGecko/ArduBoardControler
Berlin Custom Boards: All around DIY longboards: https://www.facebook.com/berlincustomboards/

AreaKruzer
1 mW
1 mW
Posts: 12
Joined: Mon Apr 18, 2016 1:35 am

Re: OpenSource Remote for VESC ArduBoardControl

Post by AreaKruzer » Wed Nov 22, 2017 10:21 pm

Hi RollingGecko,

I've tried connected to both the Nano V3 and Mega (not at the same time).

I re-downloaded all the files from your github with the rf library. Get it to run DEBUG mode again by uncommenting the //define DEBUG in the Config.h

This is the following print out in the Serial Monitor. Everytime before printing "Failed to get data from UART" there will be some gibberish

Code: Select all

Nrf24L01 Receiver Starting
@⸮Failed to get data from UART!
Received TX successfully!
Received package / Package in main loop: 
valXJoy = 128 valYJoy = 128
LowerButton = 0 UpperButton = 0
Calcx: 0.00

Post Reply