Confusion about Workbench external OPAMP gain - Bug in code generation?
In the workbench (5.Y.3 MCSDK-FUL) there are two locations to set/calculate the OP-gain. One is located under "Analog Input and Protection" and one under "Current Sensing". In my configuration I use external resistors so set the gain of the OPAMP. I found out that if you set the gain using the "calculate" button under "Analog Input and Protection" by entering all the right resistor values, and then go to the "Current Sensing" menu, the gain showing there is the same that you entered in the Analog input section. Now I save the project under a new name as Configuration 1 and generate the code. When I check the source code I can find the gain is set to as 7.333 (power_stage_parameters.h). Now back in the workbench I change the resistor values under "Current sensing" menu using the "calculate" button, I set the gain to 1 and click on "confirm". Now the gain value is changed only there under "current sensing", but if I go to "Analog Input and Protection", the previous set gain value is still shown 7.333). Now I save the project under a new name (Configuration 2) and generate the code, and I look in the source code for the gain value, it is still set to the old value 7.333, but now in the drive_parameters.h all the PI-regulator and CORDIC parameters are changed and also the rev-up current values in s16A unit are different. Now the question is should you enter the gain values twice in both menus (are the two meant to be the same?) or will the software apply the gain twice for the current measurement? Because those two gain values seem to be independent of each other, and the value shown under current sensing seems to be used for current calculation, even if the field itself is "greyed out" (and therefore assumed to be inactive)

