OpenSource Remote for VESC ArduBoardControl

Lightweight / Folding / Portable EVs - seats optional
Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: OpenSource Remote for VESC ArduBoardControl

Post by Pedrodemio » Jan 17 2016 9:33pm

Good to hear

Is there any way you could upload the compiled version for hw 4.10? I have no idea how to do that and wouldn't like to brick my vesc trying

RollingGecko   100 W

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

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Jan 23 2016 11:26am

F..k

Wanted to configure today the motor correctly in bldc after firmware update. In bldc-tool in the Motor Configuration BLDC I wanted to make a Detect parameters. The motor snapped once really havily and no he is off. No function in bldc anymore. Tried to control it over bldc-tool but the motor remains quit. Reupdated the firmware once more because I thought it could be caused by some settings. Nothing! :evil: :evil: :evil:
Any ideas?


I bought also a OLED display to play around for the remote. It is f..ed up to. Not my day.
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/

piyiotisk   10 mW

10 mW
Posts: 29
Joined: Jan 15 2016 10:38am

Re: OpenSource Remote for VESC ArduBoardControl

Post by piyiotisk » Jan 23 2016 4:04pm

so if I am correct from the nunchuck you only have the joystick?

Controller(arduino nano + rf + led + vibrate motor)
VESC( arduino nano + rf)
?????

RollingGecko   100 W

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

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Jan 23 2016 7:31pm

Hi,

On controller site I use also the both buttons B and C for PID and reverse. And in future a OLED ist planed for Speed, Distance, remaining BAT etc.
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/

piyiotisk   10 mW

10 mW
Posts: 29
Joined: Jan 15 2016 10:38am

Re: OpenSource Remote for VESC ArduBoardControl

Post by piyiotisk » Jan 24 2016 4:14pm

can we prevent replay attacks with nrf24 and arduino?

RollingGecko   100 W

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

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Jan 24 2016 5:39pm

nRF24 has already a checksum. Furthermore we can add a device-ID (Binding) and we can work with a package counter.
Never the less I want to try around with multiple devices of nRF24 in near filed and parallel working of more than one remote.

Will put it on the to do.

At the moment we have only a timeout. As soon as the signal is lost longer then a defined timeout, VESC gets a neutral signal.

My first task is at the moment to get my VESC back to work. Have no idea how or where the problem is. :x
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/

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: OpenSource Remote for VESC ArduBoardControl

Post by Pedrodemio » Jan 28 2016 2:16pm

Any lucky with your VESC? the faults command is not giving you anything?

I'm finally getting data back from VESC and into the remote, thank you sir for this library :wink:

Just one thing that i think is missing is Wh in and out, from my point of view is mandatory for coulomb counting fuel gauge, is just a matter of adding to the datatypes.h or much more complex?

RollingGecko   100 W

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

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Jan 28 2016 2:40pm

I don*t know why I skipped them. They are exactly the 8 bits I skipped there. Maybe I wanted to save memory?
I don't really need them. I calculate a battery by the used Ah.
There 2 are ways to do it. One to add this 8 bits (I can do it when I can find the time for) or simply calculate Ah*V and you are at the same results. :)

Still no Idea with my VESC. Need here support because here I'm out of knowledge.
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/

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: OpenSource Remote for VESC ArduBoardControl

Post by Pedrodemio » Jan 28 2016 3:28pm

RollingGecko wrote:I don*t know why I skipped them. They are exactly the 8 bits I skipped there. Maybe I wanted to save memory?
I don't really need them. I calculate a battery by the used Ah.
There 2 are ways to do it. One to add this 8 bits (I can do it when I can find the time for) or simply calculate Ah*V and you are at the same results. :)

Still no Idea with my VESC. Need here support because here I'm out of knowledge.
Will try that, i think that this 8 bits missing is whats making some values not to show, for example tachoABS

Have you posted it in vedder's forum?

RollingGecko   100 W

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

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Jan 28 2016 4:31pm

TachometerAbs is there...

Code: Select all

case COMM_GET_VALUES:
		ind = 14; //Skipped the first 14 bit.
		values.avgMotorCurrent = buffer_get_float32(message, 100.0, &ind);
		values.avgInputCurrent = buffer_get_float32(message, 100.0, &ind);
		values.dutyCycleNow = buffer_get_float16(message, 1000.0, &ind);
		values.rpm = buffer_get_int32(message, &ind);
		values.inpVoltage = buffer_get_float16(message, 10.0, &ind);
		values.ampHours = buffer_get_float32(message, 10000.0, &ind);
		values.ampHoursCharged = buffer_get_float32(message, 10000.0, &ind);
		ind += 8; //Skip 9 bit
		values.tachometer = buffer_get_int32(message, &ind);
		values.tachometerAbs = buffer_get_int32(message, &ind);
		return true;
		break;
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/

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: OpenSource Remote for VESC ArduBoardControl

Post by Pedrodemio » Jan 28 2016 5:23pm

Yes, just one question, i just have to add the wh and wh count on VescUart.cpp and datatypes.h right? i did that but everything past where i edited stoped working :lol:

RollingGecko   100 W

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

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Jan 28 2016 5:35pm

Tachometer values are as int32. In the commands.c in bldc:

Code: Select all

	case COMM_GET_VALUES:
		ind = 0;
		send_buffer[ind++] = COMM_GET_VALUES;
		buffer_append_float16(send_buffer, NTC_TEMP(ADC_IND_TEMP_MOS1), 1e1, &ind);
		buffer_append_float16(send_buffer, NTC_TEMP(ADC_IND_TEMP_MOS2), 1e1, &ind);
		buffer_append_float16(send_buffer, NTC_TEMP(ADC_IND_TEMP_MOS3), 1e1, &ind);
		buffer_append_float16(send_buffer, NTC_TEMP(ADC_IND_TEMP_MOS4), 1e1, &ind);
		buffer_append_float16(send_buffer, NTC_TEMP(ADC_IND_TEMP_MOS5), 1e1, &ind);
		buffer_append_float16(send_buffer, NTC_TEMP(ADC_IND_TEMP_MOS6), 1e1, &ind);
		buffer_append_float16(send_buffer, NTC_TEMP(ADC_IND_TEMP_PCB), 1e1, &ind);
		buffer_append_float32(send_buffer, mc_interface_read_reset_avg_motor_current(), 1e2, &ind);
		buffer_append_float32(send_buffer, mc_interface_read_reset_avg_input_current(), 1e2, &ind);
		buffer_append_float16(send_buffer, mc_interface_get_duty_cycle_now(), 1e3, &ind);
		buffer_append_float32(send_buffer, mc_interface_get_rpm(), 1e0, &ind);
		buffer_append_float16(send_buffer, GET_INPUT_VOLTAGE(), 1e1, &ind);
		buffer_append_float32(send_buffer, mc_interface_get_amp_hours(false), 1e4, &ind);
		buffer_append_float32(send_buffer, mc_interface_get_amp_hours_charged(false), 1e4, &ind);
		buffer_append_float32(send_buffer, mc_interface_get_watt_hours(false), 1e4, &ind);
		buffer_append_float32(send_buffer, mc_interface_get_watt_hours_charged(false), 1e4, &ind);
		buffer_append_int32(send_buffer, mc_interface_get_tachometer_value(false), &ind);
		buffer_append_int32(send_buffer, mc_interface_get_tachometer_abs_value(false), &ind);
		send_buffer[ind++] = mc_interface_get_fault();
		// TODO: send FOC values id, iq, abs
		commands_send_packet(send_buffer, ind);
		break;
What are you doing with it?
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/

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: OpenSource Remote for VESC ArduBoardControl

Post by Pedrodemio » Jan 28 2016 5:43pm

They are in int32 here, here's what i changed

Code: Select all

	case COMM_GET_VALUES:
		ind = 14; //Skipped the first 14 bit.
		values.avgMotorCurrent = buffer_get_float32(message, 100.0, &ind);
		values.avgInputCurrent = buffer_get_float32(message, 100.0, &ind);
		values.dutyCycleNow = buffer_get_float16(message, 1000.0, &ind);
		values.rpm = buffer_get_int32(message, &ind);
		values.inpVoltage = buffer_get_float16(message, 10.0, &ind);
		values.ampHours = buffer_get_float32(message, 10000.0, &ind);
		values.ampHoursCharged = buffer_get_float32(message, 10000.0, &ind);
		values.Wh = buffer_get_float32(message, 10000.0, &ind);
		values.WhCharged = buffer_get_float32(message, 10000.0, &ind);
		values.tachometer = buffer_get_int32(message, &ind);
		values.tachometerAbs = buffer_get_int32(message, &ind);
		return true;
		break;

	default:
		return false;
		break;
	}

Code: Select all

struct bldcMeasure {
	//7 Values int16_t not read(14 byte)
	float avgMotorCurrent;
	float avgInputCurrent;
	float dutyCycleNow;
	long rpm;
	float inpVoltage;
	float ampHours;
	float ampHoursCharged;
	float Wh;
     float WhCharged;
	long tachometer;
	long tachometerAbs;
}	;

RollingGecko   100 W

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

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Jan 28 2016 6:27pm

No idea at the moment....
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/

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: OpenSource Remote for VESC ArduBoardControl

Post by Pedrodemio » Jan 28 2016 11:08pm

After a few hours solved

As soon i connect the Arduíno usb, VESC start dumping data on the rx port, the same port used for the upload of the new sketch :roll:

The problem was that the code with Wh counting never had been uploaded, now almost everything is working, i'm still getting zero on battery current, duty cycle and booth tachometers, but enough for today, the goal was to get Wh reading

EDIT:

Obviously i was getting zero on both current readings, the motor was not spinning :|

RollingGecko   100 W

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

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Jan 29 2016 12:57am

What is the project you are worķing on?
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/

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: OpenSource Remote for VESC ArduBoardControl

Post by Pedrodemio » Jan 29 2016 6:13pm

Just get Wh on the remote do have an accurate battery indicator

Just saw that vedder merged your pull request on FW2.10, but unfortunately everything stopped working on this update, i'm not getting data back nor can i control the nunchuck app

For it to work, i have to set the control method to Nunchuck or UART?

EDIT:

No go, i'm back on 2.8 and still not working, everything is back exactly as it was yesterday

EDIT2:

I remembered that i was in firmware 2.7 last night, not 2.8, so back to it and getting data back starts working again (minus the tachometer_ABS)

So something changed in firmwares beyond 2.7 that made the library incompatible, will look into it tomorrow

I saw on the last page that you had the same problem, but getting the datatypes.h from the latest firmware did not help

Pedrodemio   10 W

10 W
Posts: 82
Joined: Jun 30 2015 8:38pm
Location: Brazil

Re: OpenSource Remote for VESC ArduBoardControl

Post by Pedrodemio » Jan 30 2016 12:21pm

Finally (almost) everything working

Getting data back and nunchuck app, shame that my motor support is bent and i can't teste the board for the next weeks

RollingGecko   100 W

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

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Feb 11 2016 6:01pm

Statusupdate:

Vedder merged already my changes in the FW. So please use directly his repo.

My VESC is now finally dead. Reason: I updated the FW without setting the Hardware to my Version in the file conf_general.h. After using the Autodetect it seams that the MOSFET driver get killed. As I tried to change this part, I damaged the PCB....F...k

So take care to set your Hardware Version correctly!!!

Now I'm without VESC and the development stagnates till I get a replacement.

Regards

Andreas
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/

saul   1 W

1 W
Posts: 64
Joined: Apr 02 2015 12:46am
Location: Los Angeles, CA

Re: OpenSource Remote for VESC ArduBoardControl

Post by saul » Feb 20 2016 3:30am

RollingGecko wrote:Statusupdate:

So take care to set your Hardware Version correctly!!!

Andreas
is it fried for good? What should I look out for?

I've been quietly following this, but no time to try it out yet.

So for I have a nano and nrf with sma ant (no amplifier).
a 2 axis joystick (with pushbutton)
2 micro lever swtich for nunchuck style options
2-3 pot (trim, speed, punch) analog setting
2s li ion/lipo
I was thinking of doing something similar and adding an i2c oled to display stats, change settings, etc...

just an example, not connected, plan on a 3d printed case smaller than the controller shown.
Image
Builds:
97mm Fly wheels + tiny 85kv + 12s Vesc
https://endless-sphere.com/forums/viewt ... 35&t=76450

more to come...

RollingGecko   100 W

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

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Feb 20 2016 4:38pm

Hi,

That sounds good. The OLED is also the next step I want to go. Already bought 2 china OLEDs from Ebay. I was not able to bring them to work. I'm searching for a reliable supplier for a .96 OLED 128x64 which I can operate with U8glib. And I want go with the featherwing to have more memory and SD for telemetry: https://www.adafruit.com/products/2922

@Saul: We should through our design for the OLED and all the abilities of configuration over that module together to run in the same direction and to share some workload if you want to. Maybe we can discus this first separately before presenting here our idea. Otherwise we get to much discussion. I want to start this discussion when the first sketch of a design is available. Maybe we can skype once? At the moment I'm on holiday but I'm back on the 5th of March.
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/

piyiotisk   10 mW

10 mW
Posts: 29
Joined: Jan 15 2016 10:38am

Re: OpenSource Remote for VESC ArduBoardControl

Post by piyiotisk » Feb 20 2016 4:51pm

You have to get the exact HEX Address for your specific oled in order to work. Hope it helps

RollingGecko   100 W

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

Re: OpenSource Remote for VESC ArduBoardControl

Post by RollingGecko » Feb 20 2016 5:14pm

No. Get and i2c OLEd and made a port scan and used this address. Without success. The other one should have bin an SPI but a pin is missing to be and SPI. Get already the money back for on ebay
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/

Trbt555   10 W

10 W
Posts: 77
Joined: Oct 26 2015 12:47am

Re: OpenSource Remote for VESC ArduBoardControl

Post by Trbt555 » Feb 29 2016 8:57am

For what it's worth, I'm doing something similar, i used an OLED display from this Italian Ebay seller. I'm using U8glib
It's SPI by default but can be used as I2C by rearranging a couple jumpers. but I haven't tried I2C yet.
Here's a pic:
Image
Shred.

stealth71   10 W

10 W
Posts: 75
Joined: Oct 23 2015 3:11pm

Re: OpenSource Remote for VESC ArduBoardControl

Post by stealth71 » Mar 02 2016 10:33am

What hardware is required to do this?

Arduino Nano and nRF24 on both RX and TX sides? Does one plug into the VESC and the other go into the nunchuck, then they speak between themselves across the nRF24?

I want to order some parts to start working on this, while I wait for VESC to come. New to the VESC, but not writing software.

Post Reply