cancel
Showing results for 
Search instead for 
Did you mean: 

Current Sensing: MCW 6.3.2 issue when setting Internal PGA Gain for STSPIN32G4

PCama.1
Associate III

Hello,

I have a custom motor control board and have so far been using MCW 5.Y.4

This is my Amplifying Network using internal Op-amp gain of 4x and I just have external resistors R1, and R2. The resistors R4 and R5 are internal as you well know:

image11.jpgimage12.jpg

Now I am migrating to MCWB 6.3.2 and am starting configuration from Inverter Board EVLSPIN32G4-ACT as I had done before.

However, in Current Sensing, I noticed that:

1.) Channel W is connected to OPAMP2, but I believe that doesn't change anything since my board has same resistor network for all three op amps and I understand that channel V will be inferred from the two other channels

2.) Internal PGA Gain of 4 (600mV) is not an option, even though this MCU has that as an option and previous firmware allowed that as you can see form the screenshot. Is this just a bug in the system, and can I simply change it manually in the code? I designed our board based on a gain of 4 so I really need that to be the case.

3.) There are no inputs for the external network for gain offset, as I had before as you can see in one of the images above. However, since that is an analog input does that mean that it won't make a difference for the firmware as long as it is between 0 and 3.3V?

I like this MCWB a lot better. However, your earlier version seemed more explicit and clear about the Current Sensing network with a nice calculator and diagram.

Could you please let me know what to do, especially regarding points 2 and 3 above?

Thank you in advance,

Paulo

 

1 ACCEPTED SOLUTION

Accepted Solutions
GMA
ST Employee

Hello @PCama.1 ,

2) "Internal PGA Gain of 4" is not available in the original EVLSPIN32G4-ACT board because it will not respect min/max VOUT or polarization offset limits for example.
Modifying EVLSPIN32G4-ACT.json file with your parameters, Internal PGA Gain of 4 is available on MC Workbench.

3) Do you mean "Offset Network Attenuation"? It is still present in EVLSPIN32G4-ACT.json file.

 

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA

View solution in original post

6 REPLIES 6
GMA
ST Employee

Hello @PCama.1 ,

2) "Internal PGA Gain of 4" is not available in the original EVLSPIN32G4-ACT board because it will not respect min/max VOUT or polarization offset limits for example.
Modifying EVLSPIN32G4-ACT.json file with your parameters, Internal PGA Gain of 4 is available on MC Workbench.

3) Do you mean "Offset Network Attenuation"? It is still present in EVLSPIN32G4-ACT.json file.

 

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA
PCama.1
Associate III

It makes sense. Thank you!

PCama.1
Associate III

By the way where would the board JSON would be?

Hello @PCama.1,

Custom Inverter board .json files could be located in "~/.st_workbench\hardware\board\inverter".

You can also use "STMC Board Designer" tool: clone the EVLSPIN32G4-ACT board, edit and modify parameters and save it.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA
PCama.1
Associate III

Hello GMA,

I am almost there but still need your help in this final stretch:

1. I created a custom board by cloning the STSPIN32G4 board. Sorry, this was the original board I used, not EVLSPIN34G...

After creating a custom board I was able to locate the 'hardware\board\inverter' folder with the json file in it.

2. I set up current sensing internal OpAmp gain and our board shunt resistor, offset network attenuation and polarization offset, same as we had before in my original post:

ST_011625_img2.png

3. Then I created the project with the updated board, but I am encountering issues as you can see in the pictures below. There is a warning for current sensing, a weird current readable range and another warning at main screen.

ST_011625_Img1.pngST_011625_img3.png

PCama.1
Associate III

Sorry for the multiple posts, but after I cloned the board and changed the .json file directly, as you suggested, everything seems to be working fine now.

Thank you!

Paulo