You are here

Setting PID gains (and other config parameters) over CAN Bus

1 post / 0 new
TheCuriousRobot
Offline
Last seen: 6 months 1 week ago
Joined: 2021-06-08 22:55
Posts: 1
Setting PID gains (and other config parameters) over CAN Bus

Hi,

I'm using 3 VESCs for a 3-wheeled driving robot, and have all of them wired up over CAN Bus.
For configuring and setting parameters with VESC Tool I am able to use a USB connection into only 1 of the VESCs, which detects and writes all of the parameters over CAN to the others

For control, I have an STM32 board that sends speed and position commands to all 3 VESCs over CAN.

Everything works OK so far, but I would like to be able to set parameters (such as PID gains for speed and position control) over CAN bus via the STM32, instead of having to connect VESC Tool via USB each time. I feel like this should be possible, since they are already being set over CAN when using VESC Tool.

So far, I am able to use all of the commands types found in the source code here via the STM32, but many commands are missing from this list - notably the commands for setting PID values.

I have been going through the VESC and VESC Tool source codes to try and figure out what CAN packets I need to send in order to set these but am pretty lost.

If anyone has done this before or knows how this would be done, your help would be greatly appreciated!