cancel
Showing results for 
Search instead for 
Did you mean: 

How to invert shunt signals in software?

RDodr.1
Associate

We are using the latest MCSDK on some custom hardware and our hardware design has inverted shunt signals from the design examples. An inverted shunt signal obviously won't work properly with the motor controller code.

I have been looking in the software where to make a change that would invert the signal but I am not having much luck. Does anyone know where I need to make the changes in the motor controller code to invert the signal and allow everything to work?

5 REPLIES 5
Laurent Ca...
Lead II

Dear @RDodr.1​ 

Do you still search where this signal has to be inverted in the SW?

Best Regards

==

Laurent Ca...

RDodr.1
Associate

We had to make other hardware changes so we just inverted the signals in hardware. I did try to invert in software but it did not work for some reason.

Gudgel.boB
Senior

Hardware is a more efficient way of doing that but I had to invert voltage recently.

For the future, what you can do is to take the original value and subtract it from the maximum value (power of 2).

At least for unsigned values.

Laurent Ca...
Lead II

The question has been set only to the "STM32 Motor Control" topic (the question is only about the STM32 SDK). 

Best regards

Laurent Ca...

Asantos
Senior

Hi, I also have the same problem. In my custom board the shunt voltage is amplified inverted from as expected from MCSDK. Where exactly in the MCSDK software the ADC is read to get the phase currents?

Another problem is the offset voltage. It is 1.71V for the X-NUCLEO-IHM08M1 and 1.56V for the X-NUCLEO-IHM16M1. Where to specify the offset voltage of the shunt amplifier? Where it is processed in the firmware?

Why didn't ST use 1.65V (VCC/2) for the offset voltage? As usual.