Showing results for 
Search instead for 
Did you mean: 

MCSDK 6 board config


Using the SDK I am basing a new system on the EVSPIN32G4. After selecting the inverter, and motor, I am then taken into the parameter configuration of the motor driver.

According to the boards manager the EVSPIN32G4 has multiple configurations available for single ended and differential current shunt configurations, plus using 3 op-amps, one for each current shunt etc, for the most system flexibility. Yet in the parameter configuration section of the SDK, when selecting this board, you have no control over the configuration of the current shunts and are locked into a single ended, triple shunt, system using only two op-amps. You can select to use either internal (PGA), or external resistor configurations but that's it. Moreover a triple shunt, triple op-amp, with external resistors, is the default hardware configuration for this board, so selecting something other than this (such as using the PGAs) should require hardware modifications but the SDK doesn't think this is necessary.

This doesn't seem to make any sense.

Additionally, with sensor-less control, the MCU should require voltage feedback from the three driven phases. These are already a part of the base hardware configuration for the EVSPIN32G4 board but there's no mention of this requirement, or input pin configuration, within the SDK.

Is there something I am doing wrong here to enable the configuration of additional parameters?

Many thanks,


Gael A
ST Employee

Hello MotorMatt,

Concerning the possibility to do single-shunt current sensing, it is a feature that should be available starting next release which should come up soon.

However, there is another explanation why only 2-OPAMPs single-ended is available.
Firstly, differential sensing can't be done for 2-OPAMPs configurations, as the sensed shunt is changing so it is impossible to choose a shunt to connect the ground to. For example with EVSPIN32G4, U-Shunt Negative would be connected to A3, WN to C5 and we wouldn't know where to put VN.

Secondly, as you mentioned, the Workbench does not allow 3-OPAMPs configuration either. This issue comes from ADC phases. Looking at the available ADC channels of each OPAMP via CubeMX, we can see that : OPAMP1 can only be connected to ADC1 channel 3 (PA2), OPAMP2 only to ADC2 channel 3 (PA6), and OPAMP3 only to ADC1 channel 12 (PB1). Neither of the 3 OPAMPs have the ability to be connected to 2 different ADCs, which is needed for phase sharing. We can't use only one ADC either as OPAMP2 can only be connected to ADC2 and not ADC1.

Next, using the PGA does not require any hardware modification, taking the U-phase as an example, PA3 isn't used anymore, and PA2 is the output of the OPAMP. Be it Internal or External, hardware needs no modifications.

Finally, concerning Voltage Feedback, it is only useful for 6-Step algorithm, not FOC.

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.

Hope this will help,
Gaël A.

Then why not sample with 3 OpAmp, external network or PGA, with 3 ADC? This should be doable hardware -wise. It allows differential measurement as well. At least it's doable with G474 and such. Are you planning to add MCSDK support for this kind of topology?

Gael A
ST Employee

Hello KKolj.1,

It should be possible to use such a configuration indeed. However, as I stated in my previous post, in the case of the EVSPIN32G4, each OPAMP have only one ADC they can access to : OPAMP1 -> ADC1 ; OPAMP2 -> ADC2 ; OPAMP3 -> ADC1.
So we can't do 3-ADCs configuration, OPAMP3 needs to access another ADC than ADC1.

Nevertheless, 3-ADCs configurations are not supported by our Firmware and it is currently not on our roadmap. It will not be added anytime, sorry.

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.

Hope this will help,
Gaël A.
Associate III

Thank you for your reply. That's very unfortunate. I checked as well - and yes it seems that the EVSPIN32G4 lacks the added ADC, but more capable G4 variants would benefit from 3-ADC measurement. Isn't it the only way to do external gain network, simultaneous, differential current measurement with G4 processor family? I see it as a "best" way to perform current measurement with low side shunts. Please educate me if I am wrong. Always happy to learn.

Gael A
ST Employee

Hello JKolj.1,

Indeed, 3-ADC measurement is the only way for such a configuration.
I take this opportunity to correct my last post : 3-ADC configurations may be included in an upcoming release 😉

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.

Hope this will help,
Gaël A.

What's confusing about this is the way the EVSPIN32G4 hardware is configured.


Above is a circuit diagram for one of the three phases. To my eyes it looks like it is using the three internal opamps, wired differentially to three current shunts, using external resistors. Then presumably with the current shunts Kelvin connected to the opamp circuits. 

This is not at all what's being talked about here nor is it anything like the configurations you can choose with the motor SDK. I also don't see how it's compatible, without any modifications, with the single ended PGA configuration you can choose in the SDK either.

Regarding the ADCs. From your description it implies that a single ADC could be used to perform all current shunt measurements but this would require the ADC in question to have separate input pins for each opamp. Something this chip doesn't have. Alternatively you could use two separate ADCs to perform the measurements but for this to work you need to be able to connect one of the three opamps to both ADCs at the same time. Presumably for some sort of calibration between the separate ADCs.

The configuration in the SDK, for the EVSPIN32G4, uses the two ADCs connected to two of the internal opamps. It then uses three current shunts. Shunt U and W have their own opamps but shunt V can be connected to either opamp when it needs to be measured.