cancel
Showing results for 
Search instead for 
Did you mean: 

How to invert current reading?

DMeie.2
Senior

For our motor control project we're using a driver IC with integrated opamp stage intended for current measurement.
This opamp stage inverts the current reading compared to the Current sensing signals conditioning model, see here:

grafik.png

To correct the current reading, could I simply put a negative gain value?
According to an article about an older version of the MCSDK, that didn't work. Would that be possible with the MCSDK Version 6.2.1?

1 ACCEPTED SOLUTION

Accepted Solutions

Hello DMeie.2,

Yes you are right, sorry for the inconvenience.

As a workaround, I would suggest to create a project with a positive gain and save the following values:

- In Speed Sensing config panel->Observer and PLL: G2 gain (if you are in sensorless mode)

- In Drive setting: torque and flux current regulator PI gains

- In Drive setting: speed regulator PI gains

Then in your project with negative gain, port the values previously saved:

- In Speed Sensing config panel->Observer and PLL: uncheck Auto Calculate box and copy the G2 gain from the project with positive gain 

- In Drive setting: uncheck Auto Calculate Torque/Flux Kp & Ki box and copy torque and flux current regulator PI gains from the project with positive gain 

- In Drive setting: uncheck Auto Calculate Kp & Ki box and torque and copy speed regulator PI gains from the project with positive gain 

This should generate a project with correct gains and inverted current values.

DBE_1-1716473687445.pngDBE_2-1716473788298.png

Best regards

 

 

 

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

View solution in original post

6 REPLIES 6
DBE
ST Employee

Hello DMeie.2,

 

Yes negative gain is supported by MCSDK 6.2.1 version. You need then to update your power board description file. 

 

Best regards

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

I suppose I need to put a negative value into "opAmpGain" for that?

Hello DMeie.2,

 

Yes, you can do this way.

 

Best regards,

 

 

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

@DBE  I just opened a new project to give that a try, however the MC Workbench doesn't let me generate a project with opAmpGain set to a negative value.

Under drive settings, all the regulator values are now negative and thus aren't accepted by the tool.

DMeie2_0-1716470885647.png

Would it be safe to just go ahead an manually invert these values?

Either way, if inverted gain is a feature, it not being accepted in the MCWB certainly would be a bug.
Motor Control WorkBench Verison is 6.2.1 or 6.3.0, doesn't matter

Hello DMeie.2,

Yes you are right, sorry for the inconvenience.

As a workaround, I would suggest to create a project with a positive gain and save the following values:

- In Speed Sensing config panel->Observer and PLL: G2 gain (if you are in sensorless mode)

- In Drive setting: torque and flux current regulator PI gains

- In Drive setting: speed regulator PI gains

Then in your project with negative gain, port the values previously saved:

- In Speed Sensing config panel->Observer and PLL: uncheck Auto Calculate box and copy the G2 gain from the project with positive gain 

- In Drive setting: uncheck Auto Calculate Torque/Flux Kp & Ki box and copy torque and flux current regulator PI gains from the project with positive gain 

- In Drive setting: uncheck Auto Calculate Kp & Ki box and torque and copy speed regulator PI gains from the project with positive gain 

This should generate a project with correct gains and inverted current values.

DBE_1-1716473687445.pngDBE_2-1716473788298.png

Best regards

 

 

 

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

I'll give that a try, thanks!


I also noticed that with negative gain, the "Current Sensing" tab shows the "Readable current range" as 0:

DMeie2_0-1716475343539.png