As we have discussed on the discord,
"Setting parameters on the vesc that the lisp runs on is easy and transparent - pick a config entry from the provided list, set it - (conf-set 'max-speed 228).
Running the same command on a can-connected vesc is really tedious - (can-cmd X (str-merge "(conf-set 'max-speed " (str-from-n 228) ")"))."
At the same time, in escooter applications, you (almost) always want to change a parameter on both controllers.
A good example is max-speed, or max current,or current-max-scale.
So currently the way to do that, if you change a "profile" from the display, would be:
Which is hard to read, and easy to forget to adjust, if you want your profile to do something slightly different.
What would be cool, is for a function to exist, which would take over the heavy lifting for me.
Currently I have implemented the following code:
(defun set-param (param value can_slave_id_list)
(progn
(conf-set param value)
(loopforeach i can_slave_id_list
(can-cmd i (str-merge "(conf-set " "'" (sym2str param) " " (str-from-n value) ")"))
)
)
)
Which permits me to do what (conf-set) does, but instead on multiple vescs attached to the canbus (in my case it's only one, but I can imagine that for drone/multimotor setups it will apply to 4+ escs):
(set-param 'max-speed 228 (list 61))
I am not sure how this is relevant to electric skateboards, but all scripts that I know of for Kugoo/Ninebot/Xiaomi displays with multiple motors have the same need, and implement something close to that function either way.
This can be a shortform, since it does not need to execure fast in any form or way.
Appreciate your time and effort on everything.
Hello Sven,
As we have discussed on the discord, "Setting parameters on the vesc that the lisp runs on is easy and transparent - pick a config entry from the provided list, set it - (conf-set 'max-speed 228).
Running the same command on a can-connected vesc is really tedious - (can-cmd X (str-merge "(conf-set 'max-speed " (str-from-n 228) ")"))."
At the same time, in escooter applications, you (almost) always want to change a parameter on both controllers. A good example is max-speed, or max current,or current-max-scale.
So currently the way to do that, if you change a "profile" from the display, would be:
Which is hard to read, and easy to forget to adjust, if you want your profile to do something slightly different.
What would be cool, is for a function to exist, which would take over the heavy lifting for me. Currently I have implemented the following code:
Which permits me to do what
(conf-set)
does, but instead on multiple vescs attached to the canbus (in my case it's only one, but I can imagine that for drone/multimotor setups it will apply to 4+ escs):(set-param 'max-speed 228 (list 61))
I am not sure how this is relevant to electric skateboards, but all scripts that I know of for Kugoo/Ninebot/Xiaomi displays with multiple motors have the same need, and implement something close to that function either way.
This can be a shortform, since it does not need to execure fast in any form or way. Appreciate your time and effort on everything.