2024-05-03 04:37 AM
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:
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?
Solved! Go to Solution.
2024-05-23 07:19 AM
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.
Best regards
2024-05-22 09:52 AM
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
2024-05-23 02:22 AM
I suppose I need to put a negative value into "opAmpGain" for that?
2024-05-23 02:24 AM
Hello DMeie.2,
Yes, you can do this way.
Best regards,
2024-05-23 06:32 AM - edited 2024-05-23 07:06 AM
@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.
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
2024-05-23 07:19 AM
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.
Best regards
2024-05-23 07:58 AM
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: