OpenSource Remote for VESC ArduBoardControl

Lightweight / Folding / Portable EVs - seats optional

Re: OpenSource Remote for VESC ArduBoardControl

Postby Nordle » Thu Aug 04, 2016 8:40 am

This is what it shows me, i tried all baud rates, maybe a defect arduino board?
Attachments
TX.png
TX.png (34.92 KiB) Viewed 1333 times
RX.png
RX.png (28.6 KiB) Viewed 1333 times
Last edited by Nordle on Thu Aug 04, 2016 8:40 am, edited 1 time in total. View post history.
4:20 Noob Hubz! BLAZE it
..sry for dat poor english..
User avatar
Nordle
100 W
100 W
 
Posts: 190
Joined: Mon Jul 20, 2015 1:42 pm
Location: The Alps

Re: OpenSource Remote for VESC ArduBoardControl

Postby Pedrodemio » Thu Aug 04, 2016 12:47 pm

This seems to be the same type i got when reading the serial while it is sending data to VESC

And speaking on serial, finally everything works, rode my board a lot this last days, but today when i was implementing the battery capacity led's i realized i'm no getting any data back from VESC, anyone have a guess? shame i don't have a Mega, so no debugging to see where is the problem, i will dig a little further
Pedrodemio
10 W
10 W
 
Posts: 77
Joined: Tue Jun 30, 2015 8:38 pm
Location: Brazil

Re: OpenSource Remote for VESC ArduBoardControl

Postby RollingGecko » Thu Aug 04, 2016 6:15 pm

OK. Get it sorry.

To check the serial stream to the controller you can not use the terminal because you have to check an uint8 stream.
I use realterm instead http://realterm.sourceforge.net/
Select display as uint8. You need to switch the Arduino IDE Terminal of to use Realterm.
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/
RollingGecko
100 W
100 W
 
Posts: 109
Joined: Tue Jul 14, 2015 2:20 am

Re: OpenSource Remote for VESC ArduBoardControl

Postby RollingGecko » Thu Aug 04, 2016 6:17 pm

We have maybe a new possibility:

http://redbearlab.com/blenano/

Can handle central mode and has a arduino library...

Need now a bit more investigation.
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/
RollingGecko
100 W
100 W
 
Posts: 109
Joined: Tue Jul 14, 2015 2:20 am

Re: OpenSource Remote for VESC ArduBoardControl

Postby Pimousse » Fri Aug 05, 2016 11:48 am

Yeah ! That's sounds really great ! :D
I had a look on the website and the others products (and android app associated), they have some cool stuff !
But quite more expensive than Adafruit.
Let us know if it seems to be a great solution. In this case, I order one and try to give you my hand. :wink:
Pimousse
10 mW
10 mW
 
Posts: 23
Joined: Tue Jun 28, 2016 7:36 am

Re: OpenSource Remote for VESC ArduBoardControl

Postby s28400 » Sat Aug 06, 2016 4:46 pm

I looked at those and they don't currently have the firmware out for central mode. I have however found and ordered some of laird bluetooth modules and I will begin playing with them this week. They do support central mode and have a firmware updating utility for their breakout boards.

http://www.mouser.com/new/lairdtechnolo ... le-module/
My Project Site: https://www.radicalcreation.com
Science may set limits to knowledge, but should not set limits to imagination.
User avatar
s28400
100 W
100 W
 
Posts: 143
Joined: Tue Apr 05, 2016 11:02 pm
Location: Orlando Florida

Re: OpenSource Remote for VESC ArduBoardControl

Postby zmoney » Sat Aug 06, 2016 9:44 pm

I really late to the party, but i'm starting to build my first esk8 atm. I love this VESC controller and was wondering where I could find a link to the Remote Housing File. Cheers! :D
zmoney
1 µW
1 µW
 
Posts: 1
Joined: Wed Jun 01, 2016 10:18 am

Re: OpenSource Remote for VESC ArduBoardControl

Postby s28400 » Tue Aug 09, 2016 3:37 pm

I have been playing around with these bluetooth modules and I have done some more digging with regards to the feather. The feather uses the exact same chip as the ble nano and nordic gives out their firmware for it which supports central role. I have looked at schematics and pinouts and the programming pins for the ble on the feather are located on the bottom. I am going to order a debugging/programming adapter and try loading this firmware onto it. I will most likely have to write a program in the firmware to communicate with the arduino but we will see. I'll update as soon as I get more info.

@zmoney I have yet to upload the latest hosing file due to complications with the electronics. I will upload them as soon as we have this sorted out and tested.

Cheers!
My Project Site: https://www.radicalcreation.com
Science may set limits to knowledge, but should not set limits to imagination.
User avatar
s28400
100 W
100 W
 
Posts: 143
Joined: Tue Apr 05, 2016 11:02 pm
Location: Orlando Florida

Re: OpenSource Remote for VESC ArduBoardControl

Postby RollingGecko » Tue Aug 09, 2016 5:13 pm

@28400:
We should not forget, that the most of users here will not be able to program the ble chip that way. So we should take a look at a easy to reproduce way.

When can you release the code for your sensor?

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/
RollingGecko
100 W
100 W
 
Posts: 109
Joined: Tue Jul 14, 2015 2:20 am

Re: OpenSource Remote for VESC ArduBoardControl

Postby Pimousse » Wed Aug 10, 2016 6:22 am

@dl28400 :
Rollinggecko is not wrong on it, but maybe can you send the link of the firmware to Adafruit ?
It's maybe a way to help them in the development for their own BLE chipset and thus we can obtain official update af the feather with central mode ! :D

@Rollinggecko :
I'm in lack of free memory space on my Nano.
Is there a way to light a bit the VescUart library if I only use telemetry ?
I'm doing some test commenting some part of datatypes.h but it doesn't make my code lighter... :(
In the datatype.h file, Vedder bring the possibility to reach each BLDC parameter but it's a bit overkill for my (our) use. :D

Thank a lot !
Pimousse
10 mW
10 mW
 
Posts: 23
Joined: Tue Jun 28, 2016 7:36 am

Re: OpenSource Remote for VESC ArduBoardControl

Postby fuelre » Wed Aug 10, 2016 8:00 am

I know its a huge step - but change the Arduino libs to native C Code for UART/Display/Serialcommands and you should get tons of free memory
fuelre
10 mW
10 mW
 
Posts: 31
Joined: Wed Mar 11, 2015 10:54 am

Re: OpenSource Remote for VESC ArduBoardControl

Postby Pimousse » Thu Aug 11, 2016 1:58 am

As you say, it's a huge step. :D
It's not like I know only make the built-in LED blink, but... almost ! :mrgreen:

First, I have to clean my code, optimize variables (using byte instead of int, reduce strings length and amount...).
Pimousse
10 mW
10 mW
 
Posts: 23
Joined: Tue Jun 28, 2016 7:36 am

Re: OpenSource Remote for VESC ArduBoardControl

Postby s28400 » Sat Aug 13, 2016 5:51 pm

@RollingGecko
If the chip isn't locked it should be easy to flash while on the feather via the two pads under the chip. Only a programmer is necessary. I will release more details about this once I have done it successfully.

The code I wrote for the hall effect sensor is pretty basic and is currently being used in my test program (seen in my videos). I made a quick calibration routine for a few seconds when the remote is first turned on or reset. It looks for the absolute minimum and maximum values of the sensor and records them. It would be good to have something like this in a menu with a step by step guide on screen to calibrate if necessary.

Also note the pins may be different as I threw it together quickly.
Here is the code:

Code: Select all
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// If using software SPI (the default case):
#define OLED_MOSI   6
#define OLED_CLK   10
#define OLED_DC    11
#define OLED_CS    12
#define OLED_RESET 13
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);




#define XRANGE  19

int x,gss,y;

const int sensorPin = A0;

int sensorValue = 0;         // the sensor value
int sensorMin = 700;        // minimum sensor value
int sensorMax = 200;           // maximum sensor value

void setup()   {               
  Serial.begin(9600);
 
  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC);
  // init done
 
  // Show image buffer on the display hardware.
  // Since the buffer is intialized with an Adafruit splashscreen
  // internally, this will display the splashscreen.
  display.display();
  delay(2000);

  // Clear the buffer.

display.clearDisplay();

  while (millis() < 10000) {
    sensorValue = analogRead(sensorPin);
 
    // record the maximum sensor value
    if (sensorValue > sensorMax) {
      sensorMax = sensorValue;
    }
 
    // record the minimum sensor value
    if (sensorValue < sensorMin) {
      sensorMin = sensorValue;
    }
  }
}


void loop() {

#define VBATPIN A7
   
float measuredvbat = analogRead(VBATPIN);
measuredvbat *= 2;    // we divided by 2, so multiply back
measuredvbat *= 3.3;  // Multiply by 3.3V, our reference voltage
measuredvbat /= 1024; // convert to voltage

int percent;
const float lipoDc[2][11] = { { 3.2, 3.680,3.740,3.780,3.810,3.850,3.870,3.960,4.02,4.100,4.200 } ,{ 0.000, 0.100,0.200,0.300,0.400,0.500,0.600,0.700,0.800,0.900,1.000 } };
int ind;
  if(measuredvbat>=4.2)
    percent=100;
  else
  {
    while (!(measuredvbat<=lipoDc[0][ind+1] && measuredvbat > lipoDc[0][ind])&& ind<=10)
    {
      ind++;
    }
 

    if (measuredvbat <= lipoDc[0][ind + 1] && measuredvbat > lipoDc[0][ind])
    {
      float CapacPers = (((lipoDc[1][ind + 1] - lipoDc[1][ind])/ (lipoDc[0][ind + 1] - lipoDc[0][ind]))*(measuredvbat - lipoDc[0][ind])) + lipoDc[1][ind];
    //  int intCapacPers = (int)(CapacPers * 100);
      percent = (int)(CapacPers*100.0);
    }
  }

  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(48,0);
  display.clearDisplay();
  display.print(percent);
  //display.print(measuredvbat);
  display.println("%");

  display.setCursor(0,30);
  display.setTextSize(1);
 
   
  int aValue =analogRead(0);
 
  y = map(aValue, sensorMax, sensorMin, 0, 1024);

  if (y < 552 && y > 472)
    y = 512;
  if (y < 0 || y < 10)
    y = 0;
  if (y > 1024 || y > 1014)
    y = 1024;

  x = map(y, 0, 1024, 0, 18);


 
  display.print("|");
  for (int i=0;i<x;i++){
    if(i==XRANGE/2)display.print("|");
    else display.print("-");
  }
  display.print("O");
  for (int i=x+1;i<XRANGE;i++){
    if(i==XRANGE/2)display.print("|");
    else display.print("-");
  }
  display.print("|");

  display.setCursor(53,50);
  display.print(y);

 display.display();
 
}


Cheers!
Last edited by s28400 on Sat Aug 13, 2016 5:51 pm, edited 1 time in total. View post history.
My Project Site: https://www.radicalcreation.com
Science may set limits to knowledge, but should not set limits to imagination.
User avatar
s28400
100 W
100 W
 
Posts: 143
Joined: Tue Apr 05, 2016 11:02 pm
Location: Orlando Florida

Re: OpenSource Remote for VESC ArduBoardControl

Postby s28400 » Tue Aug 30, 2016 6:45 pm

Alright guys, excellent news!
I have been working with someone in my lab on the feather BLE module and we have successfully flashed and tested firmware with central mode functionality!!! :D :D :D We used an existing stack (heartbeat) used for fitness devices and was able to communicate with a usb bluetooth module which was configured as a peripheral device. This proves the feather can work for what we need.

The next step will be to load a UART stack and play with that. I will have more details as progress is made. Also I will be writing a log on my site as well.

Cheers!
My Project Site: https://www.radicalcreation.com
Science may set limits to knowledge, but should not set limits to imagination.
User avatar
s28400
100 W
100 W
 
Posts: 143
Joined: Tue Apr 05, 2016 11:02 pm
Location: Orlando Florida

Re: OpenSource Remote for VESC ArduBoardControl

Postby RollingGecko » Tue Aug 30, 2016 6:54 pm

Hi,

Great job!

Please send some details on how to flash the blessing module.

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/
RollingGecko
100 W
100 W
 
Posts: 109
Joined: Tue Jul 14, 2015 2:20 am

Re: OpenSource Remote for VESC ArduBoardControl

Postby mrpj » Thu Sep 08, 2016 5:09 am

Hey guys,

I know I am a bit late to the whole topic - planing my own esk8 build to have a project for winter time I had to realized that the remote control options for DIY are really bad (and/or expensive).
I had the idea to use the upcoming esp32 ( https://espressif.com/en/products/hardw ... 2/overview ) - which has different communication stacks on board (Wifi, BLE) and massive amount of IOs.

I am not sure if it is too late to throw in the esp32 as an viable option, but my thoughts where:
- it would allow to create more complex applications on the remote (thinking about a wifi communication interface, allowing remote fw updates, configuration from almost any wifi device etc)
- has 2 cores/threads - so should easily handle all io tasks and keep communication flowing
- has a cryptographic stack on board (securing the connection between board and remote)

Also the esp32 is expected to be around 4-5 Euros/piece

Also there is strong support from the arduino community for this chip - it is possible to reuse most common arduino libraries. Although to fully utulize it`s potential, going with the espressif sdk will provice more control over firmware and afaik the arduino version does not yet utilize RTOS (threads)


I`ve been using the predecessor (esp8266) for a lot of projects (can`t beat the price and ease of use)
mrpj
1 µW
1 µW
 
Posts: 3
Joined: Thu Sep 08, 2016 4:56 am

Re: OpenSource Remote for VESC ArduBoardControl

Postby WTech » Sat Sep 10, 2016 12:51 pm

s28400 wrote:Alright guys, excellent news!
I have been working with someone in my lab on the feather BLE module and we have successfully flashed and tested firmware with central mode functionality!!!


You know you can just use a central enabled bluethooth module on the vesc, and then use the feather as it is as a peripheral. No need for all that hassle :)
EDIT: It seems that the bluefruit BLE does not support SPP and cannot communicate with standard Bluetooth modules, it has a proprietary firmware and can only pair with IOS and Android. It would be interesting to see how it turned out after re-flashing it.
Last edited by WTech on Sat Sep 10, 2016 6:47 pm, edited 1 time in total. View post history.
WTech
100 µW
100 µW
 
Posts: 9
Joined: Mon Jun 13, 2016 11:11 pm

Re: OpenSource Remote for VESC ArduBoardControl

Postby s28400 » Mon Sep 12, 2016 8:00 pm

WTech wrote:You know you can just use a central enabled Bluetooth module on the vesc, and then use the feather as it is as a peripheral. No need for all that hassle
EDIT: It seems that the bluefruit BLE does not support SPP and cannot communicate with standard Bluetooth modules, it has a proprietary firmware and can only pair with IOS and Android. It would be interesting to see how it turned out after re-flashing it.


We discussed moving the central role to the board side but it would not allow for a phone app to connect to it in the future. The bluefruit ble module uses a common ble chip and has many stacks available for it. I recently got the adafruit ble friend uart module with the same chip and will try and get it flashed with the uart program as the peripheral device. This module can then be interfaced with the vesc directly with no arduino in between just like we wanted. I'll post an update as soon as I get it to that point

Cheers!
My Project Site: https://www.radicalcreation.com
Science may set limits to knowledge, but should not set limits to imagination.
User avatar
s28400
100 W
100 W
 
Posts: 143
Joined: Tue Apr 05, 2016 11:02 pm
Location: Orlando Florida

Re: OpenSource Remote for VESC ArduBoardControl

Postby Pimousse » Tue Sep 13, 2016 8:31 am

Even if I don't paraticipate a lot, I follow your work both, and it's a great pleasure to see how it is going on !
I just played a bit with a HC05 and discover how powerful could bluetooth be with a VESC !
I still have a Feather BLE in a box, let me know if you need a beta tester for testing the upgrade procedure. :wink:

Oh and I remember you find BLE boards which were working in central mode (Laird). Any news about those ?
Pimousse
10 mW
10 mW
 
Posts: 23
Joined: Tue Jun 28, 2016 7:36 am

Re: OpenSource Remote for VESC ArduBoardControl

Postby RollingGecko » Mon Oct 03, 2016 6:42 pm

Hi guys,

At the moment I'm a bit more a passive participant as I started already with some new projects. I don't find the time to participate in the bluetooth implementation. But it is great to see your progress. Please don't forget to share your process here with us. I will review all pull-requests and at them to new releases. I will react to buck reports and will try to fix them. There is also already a bugfix as a pullrequest I will merge this week.
If you go on with the interface please contact me in advance. There is already an Interface Object class prepared on https://github.com/RollingGecko/VescUartControl/tree/DEVas a new branch on VEscUArtControl. Just contact me. Than we can skype to the details.
Even if you are not a programmer, everybody can support the project. Everyone who builds this remote can share his experiences and we can put it in the wiki to support all the others.
I updated the wiki a bit with some details for nRF24L01 (Capacitor!) and OLED. https://github.com/RollingGecko/ArduBoardControler/wiki



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/
RollingGecko
100 W
100 W
 
Posts: 109
Joined: Tue Jul 14, 2015 2:20 am

Re: OpenSource Remote for VESC ArduBoardControl

Postby Dude » Sun Nov 27, 2016 7:53 am

Josh (s28400),
did you make any progress in configuring the Feather as a central BLE device? If so, I would be very interested in some advice to go for that approach too.

Dude
Last edited by Dude on Sun Nov 27, 2016 7:53 am, edited 1 time in total. View post history.
User avatar
Dude
100 µW
100 µW
 
Posts: 7
Joined: Thu Jun 19, 2014 1:21 pm

Re: OpenSource Remote for VESC ArduBoardControl

Postby s28400 » Sun Nov 27, 2016 2:52 pm

Sorry for the long silence. I have not made much progress recently as other things have come up. I left off with the Bluetooth and programming a menu system. I hope to finish both up in the coming weeks when I have some free time. I will keep you guys updated as I make progress.
Cheers!
My Project Site: https://www.radicalcreation.com
Science may set limits to knowledge, but should not set limits to imagination.
User avatar
s28400
100 W
100 W
 
Posts: 143
Joined: Tue Apr 05, 2016 11:02 pm
Location: Orlando Florida

Re: OpenSource Remote for VESC ArduBoardControl

Postby jeffNYC » Wed Feb 15, 2017 4:31 am

Has anyone tried getting the VescUartControl library to work on a Simblee (https://www.simblee.com/)? Given Simblee's built-in BLE and simple mobile-app programming environment (one app coded in Arduino works on both Android and iOs), it might be the easiest way to just get VESC data displayed on everyone's phones (while using an independent throttle).

I'm pretty new to library dev, but Simblee runs on an ARM Cortex M0 so I believe a modified library would be required? (I tried using VescUartControl as-is on a Simblee connected to a VESC, but got a bunch of compile errors and even after commenting out the offending code so it would compile, was not able to get any data from the VESC).

My ultimate goal is to both read VESC data and control the VESC (setcurrent and setRPM) from a Simblee connected via UART, so it would be fantastic if someone could help me make this work!
Thanks!
jeffNYC
1 µW
1 µW
 
Posts: 1
Joined: Wed Feb 15, 2017 3:41 am

Re: OpenSource Remote for VESC ArduBoardControl

Postby ElongBoard » Wed Mar 22, 2017 6:06 am

Hi,
my name is Max.
I am currently building my first electric board controlled by a custom Controller using an OLED Display, NRF24L01 and Atmega 328P. I am using the VescUart library by RollingGecko. Current Control works already but I am not receiving any data from the VESC. The strange thing is that I got it working once, then changed a few code lines and got it working never again. I know this is an issue that keeps popping up with beginners and is annoying to most experienced users. I really hope someone can head me in the right direction.
Things that I checked already:
-Baudrate
-Connection RX to TX and TX to RX
-Redownloaded the library
-Firmware of VESC (2.18)

This does not write any values to my bldcmeasure structure:
Code: Select all
VescUartGetValue(VescMeasuredValues);


I would really appreciate some help on this matter.

Thanks.
ElongBoard
1 µW
1 µW
 
Posts: 1
Joined: Wed Mar 22, 2017 5:41 am

Re: OpenSource Remote for VESC ArduBoardControl

Postby maxxxx » Fri Apr 07, 2017 3:04 am

Hey

first of all thanks for this awesome project.
How did you connect the 2s lipo to the volltage measurement pin?
Last edited by maxxxx on Sat Apr 08, 2017 6:15 am, edited 1 time in total. View post history.
maxxxx
1 µW
1 µW
 
Posts: 2
Joined: Fri Apr 07, 2017 3:02 am

PreviousNext

Return to Stand-up E-scooters and E-skateboards

Who is online

Users browsing this forum: raystl and 7 guests