Skip to main content
SCrum.1
Associate II
February 16, 2022
Question

Can someone tell me what T-noise and T-rise are in the Current Sensing block of the Motor Control Workbench?

  • February 16, 2022
  • 14 replies
  • 5563 views

I am using the IHM17M1 power board which is not supported out of the box. I have it working quite well by configuring it as a custom board.

However I don't know how to set the t-rise and t-noise values. I can't find any reference to them in the documentation.

I also note the current sensing seems a little noisier that I think it should be, so wondered if these settings could have an effect.

Thanks.

This topic has been closed for replies.

14 replies

GMA
Technical Moderator
February 21, 2022

For short description: on ST Motor Control Workbench, click on "Documentation", select Firmware documentation and go to "Definition of noise parameters".

Rise time for IHM17M1:

Low voltage three phase and three sense motor driver (st.com)

On firmware side, sampling value will use max(trise, tnoise)

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
SCrum.1
SCrum.1Author
Associate II
February 21, 2022

Thanks. I can see it now. Seems there is a trade off between reducing noise but also maximizing the time that all 3 currents can be measured. i.e. allowing more settling time will reduce noise in the current measurement, but increase the chance that Dmin is greater than the time between the switching points in the different phases.

GMA
Technical Moderator
February 21, 2022

You are right.

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

Checking a Workbench generated use case with a IHM07, values are T-rise = =T-noise=700ns.

According to IHM07/L6230 document, 700ns correspond to ~tD(ON)EN+tRISE.

In your case: ~ 125ns+10ns

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
SCrum.1
SCrum.1Author
Associate II
February 22, 2022

Thanks. These values are quite different than the ones I was using (1000ns). However they don't make any difference to the current noise.

I suspect the noise is just because the current sense resistor value of 0.1 ohm. Plus the amplifier gain of just 1.53, is giving a full range current measurement capability of >10A. The power board and STSPIN233 device is only capable of 1.3A, and with the motor I am using, the max current is about 0.5A, though typically running at 0.1A. So we're only using a small range of the ADC. So I suspect the noise is just ADC noise and a small signal to noise ratio.

Do my values of 1.53 amplifier gain and 10A measurement range seem correct for that board?

I think upping the amplifier gain would be best solution here.

GMA
Technical Moderator
February 22, 2022

If you open a ST Motor Control workbench and go to "current sensing" box, set "Shunt resistor value" and click on "Calculate". Modifying current or Rshunt value, it computes directly the output dynamic (Min Vout / Max Vout). If you can change physically the Rshunt, you can verify the resulting dynamic.

0693W00000Ka5nFQAR.png

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
SCrum.1
SCrum.1Author
Associate II
February 22, 2022

Thanks again.

Doing some more digging I think something else is going on with the current. I currently have the motor fixed so it does not rotate. If I run it in torque control mode and slowly ramp up the torque demand you can see the measure current increasing as you expect. It has some noise on it but not too bad (1st image). However, once you reach a certain point it get huge amounts of noise on it, as in the second image.0693W00000Ka8vRQAR.png0693W00000Ka8vbQAB.pngthe I_A current is just about straight off the ADC I think. However this looks like a measurement error rather than what is really going on in the hardware. Any ideas what this could be?

SCrum.1
SCrum.1Author
Associate II
February 22, 2022

Just a further note, I am running this in 3 shunt mode. This issue seems to relate to current sampling when as the PWM pulse on time becomes very long as measured on the IN1,2 3 inputs on the power board. I'm guessing the current is measured in the off time and something is going wrong as this period becomes very narrow. Again I'm not sure what influence tRise is having here as all the references to it in the documentation are related to the single shunt operation.

GMA
Technical Moderator
February 23, 2022

You can check "Current sampling in three-shunt topology using two A/D converters" chapter on "STM32 motor control SDK5.x Firmware" document.

Timing parameters parameters as Trise ensure that you are sampling during stabilized current position. Did you verify the Min Dead Time value?

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
SCrum.1
SCrum.1Author
Associate II
February 23, 2022

Thanks. I have studied that section very closely yesterday. I have tried various settings for T-rise, T-noise, Min Dead time, HW Inserted Deadtime, and sampling time.

My current settings are:

Trise = Tnoise = 150nS.

Min dead time = 200nS

HW inserted deadtime = 300nS

Sampling time 3.0, giving a sampling time of 250ns.

But I have tried many other combinations.

What I have also seen through debugging, is that the function R3_1_SetADCSampPointSectX, choses one of 3 sampling strategies based on the values above and the current PWM edge times. Most of the time it is sampling in the middle of the PWM, and this is the one that works (the first strategy).

When the low duty cycle pwm becomes too narrow for this it switches to the second option, and sets the sample point to to be lowDuty - hTbefore, where hTbefore is 2 * sampling time + conversion time. This is the one that causes the big jump in current measurement. The noise is caused by rapidly switching between strategies 1 & 2.

I'm not sure where the conversion time is set, or quite where in the PWM cycle this second strategy is trying to set the sample point. Seems to be in the bit between the low & mid duty cycle pwm.

11235813
Associate II
March 2, 2022
SCrum.1
SCrum.1Author
Associate II
March 11, 2022

I have done a lot of investigation in to this now and still don't have a solution. I note that the documentation for the MC SDK v4.3 gives a lot of info on the 3 shunt current sampling (in UM1052), but the same info is not available in the documentation 5.Y.4.

I noted also that the function R3_1_SetADCSampPointSectX determines the current sampling point within the PWM waveform. It then passes this sample point to the function R3_1_WriteTIMRegisters. This function however, does nothing with this sample point, so it has no effect. As such the code samples in the middle of the PWM under all circumstances.

Is this a bug in the code? Or is this the intended functionality that in 3 shunt topology, only sampling in the center point is supported? I find I have to throttle the modulation index quite heavily to allow sufficient space for the current sampling to fit in this mid point under all circumstances.

GMA
Technical Moderator
March 16, 2022

I don't catch your point about "It then passes this sample point to the function R3_1_WriteTIMRegisters. This function however, does nothing with this sample point".

Parameters are written on TIM HW registers and will be taken into account on next PWM cycle. Here for sampling point:

R3_1_WriteTIMRegisters( &pHandle->_Super, hCntSmp );

And

__weak uint16_t R3_1_WriteTIMRegisters(PWMC_Handle_t *pHdl, uint16_t hCCR4Reg)

...

 LL_TIM_OC_SetCompareCH4 ( TIMx, (uint32_t)hCCR4Reg );

May be that timing parameters do not fit on what you have on your boards, as I tried several ST boards configuration and I was not able to have such bad current values on non middle sampling point positions...

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
SCrum.1
SCrum.1Author
Associate II
March 16, 2022

In my generated code the line 'LL_TIM_OC_SetCompareCH4 ( TIMx, (uint32_t)hCCR4Reg );' was missing from __weak uint16_t R3_1_WriteTIMRegisters(PWMC_Handle_t *pHdl, uint16_t hCCR4Reg).

I suspect this might be because I started the configuration in MC Workbench using a 'custom board' for the power board.

I can re-create this issue by starting a new project in MC Workbench. Select the NUCLEO-F401RE control board, custom power board and the generic low voltage motor. If you generate the code without making any config changes (STm32CubeMX 6.4.0, ST32CubeIDE & STM32 FW V1.26.2) I think you get the function above with the line missing. Of course in my case I have carefully set up all the parameters and am using a motor profile from the Motor Profiler. However this problem is the same.

I also see the same problem with NUCLEO-F401RE & IHM16M1 - 3 shunt.

This is all with MC SDK 5.Y.4.

Thanks.