Hello, i have tried to write a custom app to set the max batt current (or better wattage) in runtime. My custom app started and can debug writes in the VESC Terminal.
Which function should i used to do that? mc_interface_set_current_rel(10); does not work.
Edit: I used hw 4.12, und start the ADC app for speed control + My custom app
Hello, now i set the variable in my code and this works.
mcconf = *mc_interface_get_configuration();
mcconf.l_in_current_max = 2;
mcconf.lo_in_current_max = 2;
mc_interface_set_configuration(&mcconf);
Is this OK for the VESC to change the variable under full load?
That will re-init a lot of stuff, so it is probably not a good idea. I will implement support for updating limits in run time, but for now I think you can do something like this:
mc_configuration *conf = (mc_configuration*)mc_interface_get_configuration();
conf->l_in_current_max = 2.0;
conf->lo_in_current_max = 2.0;