2025-05-17 6:02 AM
Hi I am currently trying to convert a project for the STM32 Motor Workbench by creating a custom inverter board. However when trying to create the workbench project by connecting the motor to my custom board I either get a current sensing error or the board doesnt even appear because it is not correctly configured. The project was first realised in PLECS and because of the reduced number of ADC for the phases U and V the ADC4 Channel 1 and 2 are used but for the third phase the second channel of ADC2 is used. I dont know if this could be an issue. I added the error file, an image of the error and the custom board file to this post. The custom board file still has some values that are the correct values for later as I am just trying to get the custom board to work with the workbench software, but I correctly configured the pins. I would be really happy if someone could help me.
Kind Regards
Elias
2025-05-17 6:06 AM
2025-05-19 6:41 AM
Hello EBH,
The board description you sent is confusing. The "BEMFSensingADCFixedDivider" in "SpeedAndPositionSensing" is relevant only for 6-STEP algorithm, for which current sensing is not mandatory. On top of this, the "ThreeICSCurrents" in "CurrentSensing" is only available for HSO algorithm, which is a FOC algorithm.
Allow me to ask what kind of MC algorithm do you want to run ? This way I can provide better support on the description of your board. You can find more information on how to describe a board on our MC wiki or on the Board Designer User Manual.
2025-05-19 7:09 AM
Hi Gaël thank you for responding.
I want to use the sensorless FOC algorithm with the cordic coprocessor. As you suggest the voltage sensing probably is not necessary for this. In reality the board receives the currents through three ICs that measure that voltage across a resistor and amplify the signal. I had no idea on how to implement this correctly with the limited options. If possible I would like to use the HSO algorithm, but if I can sense the position in another way without using sensors I’m okay too. I hope this makes a little more sense. I just want to make the board work so that I am able to configure the PI controllers in the ST software.
kind regards
Elias
2025-05-19 8:26 AM
Hello EBH,
Thank you for the reply. We currently offer two FOC algorithms that can run sensorless : the HSO and the original FOC based on Luenberger Observer. Each of them have their requirements and features.
The Luenberger based FOC only supports TwoICSCurrents, because we only need to sample 2 phases and estimate the third one.
The HSO is more performant but requires additional Voltage sensing. Both ThreeICSCurrents and TwoICSCurrents are supported for current sensing. You can use the Board Designer tool to help yourself with the board description. Be aware though that the BD does not guarantee that the chosen pins will lead to a working configuration.
2025-05-19 8:53 AM
Thank you but why doesn’t it work in current configuration. What did I configure wrong because I can’t even load the custom board to configure the observer
2025-05-19 9:03 AM
Hello EBH,
It seems that I have not been clear enough. I am sorry for the confusion, let me try to rephrase.
You currently only have described Current Sensing with Three ICS. This is not enough if you want to run the HSO algorithm, and even proceed with the WB and observer configuration. You also need PhaseVoltageSensing.(and not BEMFSensing). This can be done with 2 or 3 ADCs, just like current sensing.
2025-05-20 2:29 AM
Thank you Gael,
this has already been really helpful. I know adjusted the json for the ThreePhaseVoltageDividersFiltered as you said. But when I try to open the project in the workbench to configure the observer the project still does not load and I am getting a CurrentSensing Error. I am using the three ICSCurrents for Current sensing. I am already using the board designer. Do I still have something configured incorrectly? Thank you in advance.
2025-05-22 5:36 AM
Hello EBH,
Please make sure that the ADC used for Current Sampling are the same that the one used for Voltage Sensing. For example, if you use ADC1, ADC2 and ADC3 for Current Sampling, then you should use ADC1, ADC2 and ADC3 for Voltage Sensing. Despite being theoretically possible, the configuration using different sets of ADC for Current Sampling and Voltage Sensing is currently not supported.
2025-05-24 9:10 AM
Ok thank you for your help. Sadly I think I cant use the stm workbench if this is the case because my board hardware is already configured in a certain way.