You are here

Cruise control by setting RPM over UART

4 posts / 0 new
Last post
solidgeek
solidgeek's picture
Offline
Last seen: 1 year 23 hours ago
VESC Original
Joined: 2017-05-24 12:30
Posts: 7
Cruise control by setting RPM over UART

Hi guys

I have been developing a remote based on RollingGeckos library (https://github.com/SolidGeek/nRF24-Esk8-Remote) and I have been trying to implement some form of cruise control. My remote uses PPM to set the speed and UART to receive data from the VESC (PPM and UART). I am getting telemetry just fine, and I was thinking that I could use the ERPM value to set the RPM over UART, like so:

VescUartSetRPM( cruiseRPM );

However this command doesn't seem to do anything, and I was wondering if this is because the PPM signal is overriding any UART commands regarding speed/rpm?  If this is the case, is there any way I can activate and disable the cruise control function within the VESC over UART, while still having the VESC configured as "PPM and UART"? 

Any help is much appreciated! Thanks

yosoufe
Offline
Last seen: 6 months 1 week ago
Joined: 2018-01-31 16:52
Posts: 10

You can send a UART command with this tag

COMM_SET_APPCONF

 to set the app configuration. Your command should have the following values and data.

https://github.com/vedderb/bldc/blob/master/commands.c#L518

you should use this datatype to read and write the app configurations.

But you should read the app settings first and send it back by changing only `appconf.app_to_use` using the following data type

https://github.com/vedderb/bldc/blob/master/datatypes.h#L247

benjamin
Offline
Last seen: 1 month 5 days ago
VESC FreeVESC OriginalVESC Platinum
Joined: 2016-12-26 15:20
Posts: 490

The PPM input will override the speed control command. Why don't you use UART only? One option with that would be to send the COMM_SET_CHUCK_DATA packet and use the nunchuk app, which has cruise control functionality among other things.

Lzx19961014
Offline
Last seen: 5 years 8 months ago
Joined: 2018-04-28 04:02
Posts: 7

I have new problems.  I want to control the VESC through the serial port to turn the motor forward and reverse, but I don't know how to realize it. Can you give me a way of doing it? For example, give me a piece of code? I am referring to this link to do https://github.com/R0b0shack/VESC-UART-Arduino.