Hi everyone, got a SimpleFOC setup and configuration help request.
I am currently developing a CANBus-able board with a protocol which would ideally talk to the board using CAN.
The problem I am facing is that certain parameters or modes for SimpleFOC which are specific to a motor must be pre-compiled in the code, which makes the configuration rather difficult as each time I need to attach a different motor I need to rebuild the code. For example, number of pole pairs.
Is it possible that we set these parameters “on-the-fly” instead of in the code during build time?
My goal is to build the base code, attach a motor to each node and perform the entire setup via CANBus, such as setting the pole pairs, mode of operation, etc, somewhat similar to SimpleFOC GUI Configuration/ Tunning tool where a centralized MCU will communicate the node/motor setup before the action begins, and then fine-tune the motors individual parameters as they perform. I remember there was a similar thread on this board however it didn’t go anywhere.
I got my code to a point where the nodes talk to each other and I am now compiling a list of commands that the nodes can exchange, and some of them are the initialization commands.
It is also possible I am not quite familiar with some of the setup and what I want is already there and I only need to use it?
In other words, what init setup params currently CANNOT be set during code run-time on the fly?
Thanks,
Valentine
Edit:
To give you an idea what commands could look like
{ “TEST_COMMAND”,
“INFO_GENERAL”,
“WARNING_GENERAL”,
“ERROR_GENERAL”,
“STOP_MOTOR”,
“INIT_MOTOR”,
“ANGLE_TARGET”,
“VELOCITY_TARGET”,
“ACCELERATION_TARGET”,
“VOLTAGE_INIT”,
“VOLTAGE_MAX”,
“VOLTAGE_MIN”,
“CURRENT_MAX”,
“CURRENT_MIN”,
“TEMPERATURE_MOTOR”,
“TEMPERATURE_BOARD”,
“TEMPERATURE_AMBIENT”,
“MODE_FOCSINE”,
“MODE_FOCSPACEVECTOR”,
“MODE_FOCTRAP120”,
“MODE_FOCTRAP150”,
“MODE_OPENLOOP”,
“MODE_VELOCITY”,
“MODE_TORQUE”,
“MODE_CURRENT”,
“MODE_POLEPAIRS”,
“GET_ANGLE”,
“GET_VELOCITY”,
“GET_ACCELERATION”,
“GET_TOTALCURRENT”,
“GET_TEMPERATURE_MOTOR”,
“GET_TEMPERATURE_BOARD”,
“GET_TEMPERATURE_AMBIENT”}
The implementation is interrupt/mask driven so it won’t affect the loop performance as long as there is no message for that node.