You are here

Arduino UART max Current and max RPM setting

6 posts / 0 new
Last post
h2omatt
Offline
Last seen: 1 year 7 months ago
Joined: 2020-09-24 23:46
Posts: 3
Arduino UART max Current and max RPM setting

I am working on a project where I would like to set the max rpm and max current. I was testing using the SolidGeek VescUART library. I was commanding setCurrent and then SetRPM in the main loop. it seems that when using setRPM the motor vesc defaults to its motor current max and overrides the setCurrent command. 

Do you guys have any thoughts on how to make this happen? 

https://github.com/SolidGeek/VescUart

v8-rt
Offline
Last seen: 2 years 2 months ago
Joined: 2020-03-13 21:14
Posts: 4

I'm interested too! More for setting ramp up and down for ppm input, but will result in alike commands.

Did you find anything yet?

At the moment you send setCurrent, i asume VESC will try to make the motor accelerate until the Current (Amps) match to the value, that you sended to it. It will stop after the set timeout or when receiving another command. So setCurrent does not mean setMaxCurrent.

vadicus
Offline
Last seen: 12 hours 12 min ago
VESC Free
Joined: 2018-08-17 07:26
Posts: 348

Are you talking about modifying the Max Current in the configuration? If so, you would need to read the mc_conf completely, change the max current setting and write it back to VESC.

 

 

NextGen FOC High voltage 144v/32s, 30kw (https://vesc-project.com/node/1477)

h2omatt
Offline
Last seen: 1 year 7 months ago
Joined: 2020-09-24 23:46
Posts: 3

I don't want to change the configuration. I would just like to be able to have the max torques(current) set and then set the speed at which I want the motor to go to. if the load is too high the motor may not hit it RPM set point due to the user max torque(current).

Currently you can do current control or speed control but not a hybrid both. 

-Matt

h2omatt
Offline
Last seen: 1 year 7 months ago
Joined: 2020-09-24 23:46
Posts: 3

Still haven't figured out how to make this work the way I want. 

 I would like to be able to use setRPM to control the motor speed but also be able to limit the motor current. its basically a power limiter. 

I have tried to do speed control by using a PID loop using setCurrent and then UART.data.rpm and my PID input parameter.

Is there a way I could send a setRPM and setMaxCurrent command? I am open to suggestions too.

-Matt

dsuresh
Offline
Last seen: 1 year 3 months ago
VESC Free
Joined: 2021-02-10 18:57
Posts: 42

You can find the source code for the VESC on github and make changes to the RPM from there. Build the code and flash your vesc. Hopefully that works for you. I have tried editing the battery level and made that work

Dave