Hi,
thanks for the recent update, I’m working on my first simpleFOC implementation just now. I have just a small request: on this page Commander Interface | Arduino-FOC - the animation that shows what each element of the command interface string does (MVD0.765, OE) - argh! Why is it animated? It makes it really hard to read and get useful information from! It’s effectively a manual, why would you make the information appear and dissappear…please can you remove the animation?
Thank you!
It is animated to show that the execution is sequential, or chained (recursive) better said.
When the commander received the string:
It first checks the command id, identifies its M
and sends the remaining string to the motor handling callback:
Then the motor callback checks what is the coommand id, findsV
and sends the remaining string to the PID velocity callback:
Then the PID velocity callback scans the command id and finds it is the D
, so derivative gain and sets the value:
The other example is if the commander receives:
First id that it finds is O
, which is for example motor. It calls the callback that is assigned to this command (which is in this case motor callback) with the string remaining string:
Then the motor callback finds the command E
and knows its the status (enabled/disabled) either getting or getting. It checks the value and sees that the value is empty, which means the user has sent a get request:
I can remove the gif, I agree that it is not necessary, all of these info youll be able to find further in the text. It was really not imagined to be any kind of centerpiece of the commander docs page. And even less to annoy anyone
Thank you for your detailed response, this is useful information. I’m struggling a bit with getting this set up; I followed the Nucleo-64/L298N/stepper/encoder setup example with that hardware and got FOC to initialise, turn the motor a little, and declare itself ready for the first time this morning. Unfortunately in trying to work out what to type into the Arduino serial monitor to get the motor to turn, I somehow caused a power surge and smoked the L298N and now the Nucleo64 is telling me it can’t accept sketch uploads because it’s full!
So…searching for solutions on the upload problem and wired in a new L298N board; I have the Pololu 36v4 driver to try, which can be set to receive 4x PWM inputs for independent control of 4 mosfets and (if properly cooled) can drive steppers with up to 50V 6A per phase, which is perfect for me. I’d rather kill the L298Ns while I learn, though, that’s only about £3 per mistake rather than £15… thanks again for your helpfulness and all the work with the updated library.
So to move the motor you just type the motor id and target value.
If your motor id is ‘A’ for example.
Just type:
A0.5125
for 0.5135 rad in angle mode
or 0.5135 rad/s in velocity mode
or 0.5135 vots in torque mode