2026-03-26 1:19 AM - edited 2026-03-26 1:20 AM
I am using the EVLSPIN32G0B1 demo board and the MC Workbench v6.4.1 software, and I would like to use the FOC control algorithm.
More specifically, I would like to use the Hall sensors when the motor starts and operates at low speeds, and then switch to sensorless control at higher speeds.
I have read that the library does not support automatic switching, so I will need to implement it manually in the code.
How should I proceed?
Thank you for your support.
2026-03-26 2:30 AM
Hello @Diego3,
User-accessible APIs are defined in the mc_api.c file:
2026-03-26 3:51 AM
Thank you for your reply.
How should I use the MC_SensorSwitchMotor1 function?
If I later want to switch back to the Hall sensors, how should I do it? Can I use the MCI_SensorSet function? However, I wouldn’t know how to use it…
Also, how can I check that the PLL is locked before performing the switch?
Thank you for your support.
2026-03-26 6:54 AM
Hello @Diego3,
An example that uses MC_SensorSetMotor1() is provided in the "Auxiliary speed sensor usage" chapter of the "User Manual" available through "Workbench tool">About>Documentations>Documentation.
Starting with PLL you can use MC_GetSTMStateMotor1() API to wait for the RUN state.