According to the principle, there’s no need to use the arduino board to control the VESC, ( because filter processing is required to make the ADC value stable, it’s a cost up solution ). The reading range of the voltage is 0V-3.3V. The principle of ADC control is to output the corresponding throttle value by reading the voltage difference. It is not common to see the ADC port controlling VESC. Last step: do parameters setting in VESC tool, choose “UART” mode, the baudrate must be 115200 in UART mode. In this program I just did a simple throttle control, you may add other functions by reading SolidGeek's library: motor reversal, cruising and reading VESC’s data.
Thanks to them for their contributions to the esk8 community! This is the link to the library I am using: , you may download it from the link above and add it to the arduino library.Ĭonnecting the analog port A0 to the signal cable of the potentiometer for detecting the change of the potentiometer determining what value to input to the UART according to the detected change of the potentiometer. The library I used in this blog was written by RollingGecko and modified and updated by SolidGeek. For details, please refer to the UART description written by Benjamin: Some parameters from the VESC can also be read, such as battery voltage, eprm value, motor temperature and so on. So UART-VESC communication can not only control the throttle, but also make reverse, cruise and other functions possible.
Input code to achieve UART control modeĬontrolling VESC with UART is also a common way: writing data to VESC through UART so that the VESC can make corresponding actions according to the given instructions.General introduction of UART control mode.Lastly, you need to finish parameter setting in VESC tool, the operation is similar like with a remote control. Set the value of the PPM output by the digital port 5 according to the detected change of the potentiometerĮsc.writeMicroseconds(map(analogRead(PotentiometerPin), 0, 1023, 1000, 2000)) The potentiometer indicated in this blog can also be a joystick. But, the VESC tool PPM mapping default set is standard PPM signal format.įollowing picture is an arduino board with wiring instruction: It’s actually not necessary to completely follow the PPM signal format since the VESC's throttle signal is adjustable. Reminds: Controlling VESC with PPM signals is the most popular and most conventional one.
Want to know more detail information about PPM, here it is by someone else: Https:///pwm-ppm-difference-conversion/ I would like to briefly describe it here: a signal with pulse width of 1ms to 2ms in a cycle of 20ms, the standard level of it is 5V. Make sure you have skills of soldering or wiring and are able to wire according to the wiring diagram I drew.įirst ,we need to know, what is the PPM signal?.