Open Source Arduino transmitter/receiver for (V)ESC

Lightweight / Folding / Portable EVs - seats optional
elkick   100 W

100 W
Posts: 127
Joined: Nov 13 2014 3:45am
Location: Hamburg

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by elkick » Jun 10 2015 8:42am

erwincoumans wrote:The I/O shield is bigger than I hoped, I received it yesterday, so I look for a smaller solution.
Maybe we can design a simple small PCB and share the schematics. (those soldered wires become messy and take space)
Got one today as well, one would have to fold it to fit into the Kama. :)
Will think about other possibilities...
http://www.esk8.de/vesc VESC V4.12 - made in Germany
http://www.esk8.de/shop General eSkateboard parts

erwincoumans   100 W

100 W
Posts: 141
Joined: Apr 02 2015 11:25pm

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by erwincoumans » Jun 10 2015 10:06am

elkick wrote:
erwincoumans wrote:The I/O shield is bigger than I hoped, I received it yesterday, so I look for a smaller solution.
Maybe we can design a simple small PCB and share the schematics. (those soldered wires become messy and take space)
Got one today as well, one would have to fold it to fit into the Kama. :)
Will think about other possibilities...
Just curious, why don't you use thin wires and solder them? For example 30 Gauge wire like this: http://www.amazon.com/30AWG-Plated-Copp ... 6426179011

In my first prototype the wires were not thin and it still fits:
FullSizeRender_4.jpg
FullSizeRender_4.jpg (76.34 KiB) Viewed 2826 times
FullSizeRender_2.jpg
FullSizeRender_2.jpg (49.5 KiB) Viewed 2826 times
If you really want to fit the Arduino and nRF24L01+ inside the Kama Nunchuck, wires is likely the easiest. It would likely require some custom PCB with a bended shape to fit the internals. I was thinking of a small custom PCB for a custom enclosure.

elkick   100 W

100 W
Posts: 127
Joined: Nov 13 2014 3:45am
Location: Hamburg

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by elkick » Jun 10 2015 10:21am

I'll definitely solder it together, but have to wait for the Arduino without shield to fit into the Nunchuk (I like the controls of it). Also thinking of a way to implement a "officer's-speed-limit-switch", they are quite restrictive over here. But by limiting the speed by switching the board to a pedestrian compatible one will avoid this (6kph). ;)
http://www.esk8.de/vesc VESC V4.12 - made in Germany
http://www.esk8.de/shop General eSkateboard parts

erwincoumans   100 W

100 W
Posts: 141
Joined: Apr 02 2015 11:25pm

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by erwincoumans » Jun 10 2015 10:42am

elkick wrote:I'll definitely solder it together, but have to wait for the Arduino without shield to fit into the Nunchuk
Yes, I like it too, hence the effort of gutting it. It will likely look and feel better than a custom 3d printed enclosure. I use this Nano, it has no pins pre-soldered so it takes less space. And they do same-day delivery :-)
http://www.amazon.com/Lucksender-Atmega ... duino+nano
(I like the controls of it). Also thinking of a way to implement a "officer's-speed-limit-switch", they are quite restrictive over here. But by limiting the speed by switching the board to a pedestrian compatible one will avoid this (6kph). ;)
What ESC are you using? When using the VESC, we could directly attach a nRF24L01+ to the VESC and read out the electrical RPM and derive a very precise speed from it. I got instructions from Benjamin Vedder how to hook it up, and then we could write a VESC-App for it that communicates with the remote Arduino Nano-nRF24L01+. Does that make sense?

elkick   100 W

100 W
Posts: 127
Joined: Nov 13 2014 3:45am
Location: Hamburg

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by elkick » Jun 10 2015 11:04am

That would be great, I have some VESC's here. Would also save a little bit of space I guess. I'd be happy to contribute, even though my programming experience dates back to the last century. :)
http://www.esk8.de/vesc VESC V4.12 - made in Germany
http://www.esk8.de/shop General eSkateboard parts

torqueboards   100 MW

100 MW
Posts: 2940
Joined: May 27 2013 10:02pm
Location: San Francisco, CA
Contact:

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by torqueboards » Jun 10 2015 11:21am

Are we still making it compatible with all ESCs and a specific version for VESC or is now just for VESC?
DIYElectricSkateboard.com Electric Skateboard Kits

erwincoumans   100 W

100 W
Posts: 141
Joined: Apr 02 2015 11:25pm

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by erwincoumans » Jun 10 2015 11:35am

torqueboards wrote:Are we still making it compatible with all ESCs and a specific version for VESC or is now just for VESC?
First I work on making a generic ESC version, using two Arduino Nano', each with its own nRF24L01+.

In addition, we MIGHT get an OPTIONAL VESC receiver App. The transmitter would be the same for both cases.

vedder   100 W

100 W
Posts: 249
Joined: Nov 05 2011 9:37pm

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by vedder » Jun 10 2015 8:59pm

The VESC already has support for the nrf24l01+. Only the nunchuk interface is implemented, but it is easy to extend the code to get data back from the nrf. To connect the nrf to the VESC:

CE -> Tied to VCC
CSN -> The servo input (you have to remove the lowpass filter on the servo input)
SCK -> The ADC_EXT pin
MOSI -> The SDA pin
MISO -> The SCL pin
IRQ -> not connected
VCC -> VCC
GND -> GND

To remove the filter from the servo input, remove C3 and replace R5 with a 0R resistor.

you can also change the mapping easily in this file:
https://github.com/vedderb/bldc/blob/ma ... nf/hw_46.h
Since software spi is used, you can use any pins in any combination.

This is the code for my modified nunchuk PCB:
https://github.com/vedderb/nunchuk_mod
It is not compatible with arduino, but you can see which nrf channels etc have been used. Once I have made a second revision of the hardware, I will upload it to github as well.
Some of my projects: http://vedder.se
Support my open source ESC development with a small donation

User avatar
buzztiaan   1 W

1 W
Posts: 52
Joined: Mar 09 2015 4:57am
Location: Netherlands

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by buzztiaan » Jun 13 2015 11:28am

So ehm, to which version of RF24.h should i link?
It seems this one isnt compatible; https://github.com/maniacbug/RF24
HK150 - 5055 SK3 280kv - 6S 5000mAh - 90mm bigfoots
https://nurdspace.nl/RobertLongboard

User avatar
buzztiaan   1 W

1 W
Posts: 52
Joined: Mar 09 2015 4:57am
Location: Netherlands

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by buzztiaan » Jun 13 2015 12:02pm

Oh got it,

changed line 122 into;

bool sendOK = radio.write( send_payload, next_payload_size );

(without ,false)
HK150 - 5055 SK3 280kv - 6S 5000mAh - 90mm bigfoots
https://nurdspace.nl/RobertLongboard

User avatar
buzztiaan   1 W

1 W
Posts: 52
Joined: Mar 09 2015 4:57am
Location: Netherlands

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by buzztiaan » Jun 13 2015 3:50pm

Also, here is my entry for most-shitty-controller ;

http://imgur.com/a/TCktG

* zarya's 'nrfsensornode v1' board ( https://nurdspace.nl/NrfSensorNode ), which has;
** ams1117 regulator
** arduino pro mini
** nrf24l01

also;

* adafruit powerboost 500
* 500mah lipo (also from adafruit)

* powerswitch (soldered into the battery, ha)
* potmeter (some random one i found)
* housing (charger of some thing, no clue, it fit my hand :D )
HK150 - 5055 SK3 280kv - 6S 5000mAh - 90mm bigfoots
https://nurdspace.nl/RobertLongboard

elkick   100 W

100 W
Posts: 127
Joined: Nov 13 2014 3:45am
Location: Hamburg

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by elkick » Jun 16 2015 3:01am

@erwincoumans: Got all those parts now, will start soldering within the next days. Also, I'll try it with a Logic3-Nunchuk, since it contains the Lipo already. Need to setup the environment on my Mac first to test things.
http://www.esk8.de/vesc VESC V4.12 - made in Germany
http://www.esk8.de/shop General eSkateboard parts

elkick   100 W

100 W
Posts: 127
Joined: Nov 13 2014 3:45am
Location: Hamburg

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by elkick » Jun 18 2015 1:26pm

Ok, I'm a step further now, soldered everything. While understanding how to connect the receiver part to the ESC I'm struggling with the transmitter to potentiometer side: not able to find the right spot on the potentiometer.

Do you have a picture as an example or could you describe how to find the right spot to connect Analog 3 to? The Logic3 Nunchuk has a lot of things I snide an is looking quite confusing. ;) Else I will use a Kama...
http://www.esk8.de/vesc VESC V4.12 - made in Germany
http://www.esk8.de/shop General eSkateboard parts

User avatar
buzztiaan   1 W

1 W
Posts: 52
Joined: Mar 09 2015 4:57am
Location: Netherlands

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by buzztiaan » Jun 19 2015 5:48am

You could identify the proper pins to solder to with a Ohmmeter
HK150 - 5055 SK3 280kv - 6S 5000mAh - 90mm bigfoots
https://nurdspace.nl/RobertLongboard

dakster   1 mW

1 mW
Posts: 19
Joined: Aug 19 2014 8:20pm

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by dakster » Jun 27 2015 7:09pm

How are you guys powering the arduino boardside? Any safe way of using the 5v from the esc?

erwincoumans   100 W

100 W
Posts: 141
Joined: Apr 02 2015 11:25pm

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by erwincoumans » Jun 27 2015 9:46pm

dakster wrote:How are you guys powering the arduino boardside? Any safe way of using the 5v from the esc?
In many cases the 3-pin servo cable delivers 5V, ground and signal. You can just connect this to the 5V pin of most Arduino's.

Pedrodemio   10 W

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

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by Pedrodemio » Jun 30 2015 8:43pm

Hello erwin

Great project

I need some help, the rx code works fine, but i'm getting errors with the tx one, could you please have a look? i didn't yet understand all of the code, but on a superficial look seems something wrong whit the RF24 library

Thanks

Code: Select all

Arduino: 1.6.3 (Windows 7), Placa:"Arduino Nano, ATmega328"

nrf24l01_transmitter.ino: In function 'void loop()':

nrf24l01_transmitter.ino:111:71: error: no matching function for call to 'RF24::write(unsigned char [4], int&, bool)'

nrf24l01_transmitter.ino:111:71: note: candidate is:

In file included from nrf24l01_transmitter.ino:2:0:

C:\Users\Pedro\Documents\Arduino\libraries\RF24/RF24.h:281:8: note: bool RF24::write(const void*, uint8_t)

   bool write( const void* buf, uint8_t len );

        ^

C:\Users\Pedro\Documents\Arduino\libraries\RF24/RF24.h:281:8: note:   candidate expects 2 arguments, 3 provided

Erro compilando.

  Este relatório deveria ter mais informações
  "Mostrar saída verbosa durante a compilação"
  habilitado em Arquivo > Preferências.

erwincoumans   100 W

100 W
Posts: 141
Joined: Apr 02 2015 11:25pm

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by erwincoumans » Jul 01 2015 1:02am

@Pedeodemio, see above:
http://endless-sphere.com/forums/viewto ... 0#p1059380

Please file an issue in github if you can. The version of RF24 is likely different and the 'false' is not needed in your version.

Pedrodemio   10 W

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

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by Pedrodemio » Jul 01 2015 11:25am

I missed that, now it works, thanks a lot

i will file the issue on github

jacobbloy   100 W

100 W
Posts: 237
Joined: Feb 12 2013 4:45pm

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by jacobbloy » Jul 04 2015 3:19am

Hi guys, as Vedder has said he has started work on a PCB to replace the PCB inside a wii nunchuck, his firmware is on his GitHub but I have helped him times wise by redesigning it, it is 26x46mm so it can be used not just in a nunchuck, it has a charging and step down for a lipo battery! The PCB alone will only be about $20 to make at 100pcs
For the VESC only the NRF24 chip will connect directly to the best and nothing els is needed but I want your help with designing the PCB for a receiver that can be used with non VESC esc's but keep function like lights and cruise control.

Iv attached photos of the remote PCB and the schematic for the receiver.

Thanks for the help in advance.
Attachments
image.jpg
image.jpg (87.17 KiB) Viewed 2404 times
image.jpg
image.jpg (102.85 KiB) Viewed 2404 times
image.jpg
Nunchuck non VESC receiver.
image.jpg (96.81 KiB) Viewed 707 times

erwincoumans   100 W

100 W
Posts: 141
Joined: Apr 02 2015 11:25pm

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by erwincoumans » Jul 04 2015 9:11am

I like your STM32F4 based solution Jacob.

We use the nRF24L01+ transceiver radios too.

This thread is about using Arduinos that can be programmed using the popular Arduino IDE.

jacobbloy   100 W

100 W
Posts: 237
Joined: Feb 12 2013 4:45pm

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by jacobbloy » Jul 04 2015 9:38am

I know I posted to ask if any one if knowledge could confirm my schematic I attached, I'm not trying to bomb!

erwincoumans   100 W

100 W
Posts: 141
Joined: Apr 02 2015 11:25pm

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by erwincoumans » Jul 04 2015 10:01am

jacobbloy wrote:I know I posted to ask if any one if knowledge could confirm my schematic I attached, I'm not trying to bomb!
Sure, and I just ordered one PCB+nunchuck from you.

Most people have no idea how to design a PCB, that's one reason we go for Arduino. I have no idea about PCB design either (yet). I do like the simplicity and fast way or programming the Arduino's. Hopefully we can program the STM32F4 remote controller with USB firmware upload in the future, similar to the VESC.

jacobbloy   100 W

100 W
Posts: 237
Joined: Feb 12 2013 4:45pm

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by jacobbloy » Jul 05 2015 7:19pm

This is the design for my receiver, hiply I can start modifying some code, the good thing is I think I can basically take the nrf receiver code and the nrf application code from the VESC and use that and just modify it to produce a pwm output instead!
Attachments
image.jpg
image.jpg (110.27 KiB) Viewed 2321 times
image.jpg
image.jpg (54.14 KiB) Viewed 2321 times

torqueboards   100 MW

100 MW
Posts: 2940
Joined: May 27 2013 10:02pm
Location: San Francisco, CA
Contact:

Re: Open Source Arduino transmitter/receiver for (V)ESC

Post by torqueboards » Jul 05 2015 7:28pm

Nice Jacob.

Are you selling it with the PWM output & receiver?

I'll buy a set with PWM output & receiver?

You have a link for the sale?
DIYElectricSkateboard.com Electric Skateboard Kits

Post Reply