Writing to VESC

General topics and discussions about the VESC and its development.
twan
Posts: 5
Joined: 03 Apr 2018, 05:14

Writing to VESC

Postby twan » 05 Apr 2018, 22:09

Hey guys,

If we are creating a custom application to write to the VESC such as changing the motor current, wattage, erpm. Do we need to read every single value of MC config and then only change the values we are modifying and write it back to the vesc? Seems tedious, any other way to do it?

rew
Posts: 940
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: Writing to VESC

Postby rew » 07 Apr 2018, 09:10

When you are just changing the operational parameters like "current", you should use the "set current" command. When you are in ERPM feedback mode, similarly you can set the target ERPM dynamically with a dynamic command. If you want to measure voltage and current, calculate wattage and set the current according to the result to limit the motor to a certain wattage: that's also fine with the "set current" command.

But if you want to change the configuration to limit current or ERPM, then yes, you have to read-modify-write the whole configuration.

twan
Posts: 5
Joined: 03 Apr 2018, 05:14

Re: Writing to VESC

Postby twan » 10 Apr 2018, 20:15

Thank you so much for clarifying. Im having problems setting the vesc mc_configs do you know what are possible causes that can do this. I using the comm_set_mconfig and I'm sending the correct packet back to the vesc and it should change the vesc motor config but its not changing :( . The packet is correct, i checked the CRC checksum, length, byte length everything but it doesn't seem to do anything.

pf26
Posts: 296
Joined: 28 Mar 2016, 14:37
Location: FR Valence

Re: Writing to VESC

Postby pf26 » 11 Apr 2018, 09:33

You can use Portmon or other COM port monitors (assuming you are using windows) to spy the serial ports when using BLDCTools (or VESC tool) and then with your packet geenrator, to see where the difference lies.


Return to “General”

Who is online

Users browsing this forum: No registered users and 2 guests