I’m using two VESC to control a two wheel drive system made with sensored hoverboard wheels and a 36V Lipo battery.
I would like to get some advice about how to wire/connect my arduino to my two VESCs. I basically want to send velocity commands. Ideally i would use an arduino micro or uno (smaller size) or another equivalent. However, I may use a Mega and leverage its several serial ports.
- should I communicate with each VESC independantly? or should i have one “master” VESC connected to arduino and the other VESC connected to the “master” through CAN bus?
- should I use UART communication? (https://github.com/SolidGeek/VescUart would be nice to send exact velocity commands instead of sending a PWM and hope for the best)
- should I use PWM ? (like I have been using with my RC controller. what seems to be used there => https://github.com/shusain/eskatecontroller/blob/master/Arduino/rc_receiver/rc_receiver.ino)
I tried the later. but unfortunately both servo.writeMillisec() and analogWrite() do produce a PWM that I can see on my oscilloscope, but seem to have no effect on VESC whatsoever. In vesc_tool, in app > PPM settings > mapping, it looks like the VESC does not see any signal at all. However it works just fine with my hobby RC receiver and remote controller though. I just connected arduino GND to the black wire of the VESC PWM cable and used the signal white cable to inject my PWM. To no avail.
What should I do to see that PWM in vesc_tool? What connection/architecture would make more sense to control a dual VESC setup from arduino?