Will I be able to see the PWM waveforms on my BLDC driver output when no motor is connected

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Will I be able to see the PWM waveforms on my BLDC driver output when no motor is connected

852 Views
sidi
Contributor I

I have a FRDM-MC-LVBLDC driver and I'm using it with FRDM KV-11z. I wanted to observe my pwm waveforms on Phase A,B and C output ports before I provide it as the input to my motor. The reason behind it is because I tried measuring them with the motor being connected and my BLDC driver MOSFET was damaged due to some issue. I didn't wanted to take risk this time so I using an oscilloscope first to check what type of waveform I'm getting first.

When I observe the waveform on the oscilloscope, the PWM frequency is accurate but the duty cycle is showing as 95% ON time. I'm using the basic SDK example "mc_bldc" , which has a duty cycle of 50% and no matter now many changes I do by changing the value of "FTM0->CONTROLS[0].CnV"  , "FTM0->CONTROLS[1].CnV" and so on , it just doesn't change the duty cycle of the waveform.

So I wanted to know if it's possible to observe the waveforms or it's mandatory to connect it with a Motor to observe my waveforms.  Any kind of guidance will be helpful

Thank you

Labels (1)
0 Kudos
4 Replies

662 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Gateth Bale,

   1. Of course you can see the PWM waveform when no motor is connected.

     I think you check the FTM PWM from the MCU side at first, then check the driver output, if the PWM all works OK as your demand, then you can power off and add your motor.

2. SDK can't change the duty when you modify CnV.

   I think you modify the wrong place, maybe even you modify the CnV, but in the code, below your modified point, the SDK also use the old duty, that's why you can't modify it.

  Actually, you can change the duty cycle directly instead of modify the CnV register.

  pastedImage_1.png

pastedImage_2.png

Please try it again on your side.

You can change the updateDutycyle data directly to change your PWM duty.

Wish it helps you!

If you still have question about it, please kindly let me know.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

662 Views
sidi
Contributor I

Hi Keyy Zhou,

Thank you for the help, but I am using the "frdmkv11z_mc_bldc" example. I am able to see the PWM waveform when I'm using the "ftm_simple_pwm" example and the "ftm_pwm_twochannel", no issues in that. 

The problem comes when I use the "mc_bldc" example from the demo_apps folder.

In that example it is using 6 channels which are - C1,C2,C3,C4,D4 and D5.

Screenshot (115).png

And the dutycycle is set in the "InitFTM0()" funtion as shown below.

I am not making ANY CHANGES in the duty cycle. Im using this "mc_bldc" example just as it is , with out any changes made.

Screenshot (116).png

So the example code sets 50% as duty cycle. But when I connect the MC-LV-BLDC Driver shield with the FRDM Kv11z and Power Up driver using 12V power source. I'm not getting the waveform on my channels with 50% duty cycle.

The waveform which is get is shown below.waveform_c1.jpg

This is the waveform observed on Pin C1. Other channels show similar duty cycle (C2,C3,C4, D4 and D5) .The duty-cycle is around 95%.

I think I'm missing some minute detail here. Like on which pin to measure my PWM signal. I tried measuring the PWM waveform from the Output ports of BLDC driver as well, which is PHA , PHB and PHC ports which are Phase A , Phase B and Phase C output ports of my MC-LVBLDC driver. 

Thank you

0 Kudos

662 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Gareth Bale,

   Sorry for my later reply.

  Could you debug the code, and when you get the PWM is not the duty which you want, can you check the FTM channel register? What the value in the register?

  You can give me the channel register when you setting the 50%, you also can calculate it, whether it is really 50%?


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

662 Views
muduhuweh
Contributor I

Hey Kerry,

The value in FTM register is 262.

To be precise I am setting the FTM->CONTROLS[0].CnV register.

Yes it is 50% because the register is set as given below : 

/* initial value of the FTM counter */
FTM0->CNTIN = (uint32_t)(-(g_sClockSetup.ui16PwmModulo) / 2);

/* modulo value */
FTM0->MOD = (uint32_t)((g_sClockSetup.ui16PwmModulo / 2) - 1);

/* Initial setting of value registers to 50 % of duty cycle */
FTM0->CONTROLS[0].CnV = (uint32_t)(-g_sClockSetup.ui16PwmModulo / 4);
FTM0->CONTROLS[1].CnV = (uint32_t)(g_sClockSetup.ui16PwmModulo / 4);
FTM0->CONTROLS[2].CnV = (uint32_t)(-g_sClockSetup.ui16PwmModulo / 4);
FTM0->CONTROLS[3].CnV = (uint32_t)(g_sClockSetup.ui16PwmModulo / 4);
FTM0->CONTROLS[4].CnV = (uint32_t)(-g_sClockSetup.ui16PwmModulo / 4);
FTM0->CONTROLS[5].CnV = (uint32_t)(g_sClockSetup.ui16PwmModulo / 4);

Where : 

g_sClockSetup.ui16PwmModulo = 1048

I am just using the sdk demo example without any changes. So I'm getting all my values from the sdk.

0 Kudos