This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MCF8316A: Motor not Spinning properly while PWM Generated from RPi

Part Number: MCF8316A

Hello TI team

I am working on MCF8316AEVM. The board and motor was configured and tested with the analog potentiometer. Then the input is configured to accept PWM (duty cycle) at 10 to 325Hz.

I gave PWM from RaspberyPi which is 3.3V at 50Hz. Whenever input pwm is provided at any particular dutycycle, the motor starts spinning with some jerks and then speed starts varying and later it stops.

After a moment it restarts the same behaviour. The EVM is not able to spin the motor at the requested speed.

Can you suggest why the motor behavior is like this?

Thanking you
K Bindu

  • Hi Bindu,

    Can you check if the registers are configured as shown below? Did you connect the jumper J1 to EXT and apply the PWM signals across EXT_SPEED and AGND test points on the EVM? What is the duty cycle applied at 50 Hz? Is the PWM signal stable? When you apply very low duty cycle, device might not be able to spin the motor at very low speed. Do you see the same behavior at higher PWM duty cycles as well?

    Regards,

    Vishnu

  • Hello sir,
    Our settings are as follows,
    Speed mode is dutycycle speed input pin freq is 10hz to 325hz.
    J1 is connected properly.
    PWM is also connected across EXT_SPEED and AGND
    PWM singal is stable
    Our motor is having same behaviour from low dutycycle to high dutycycle.
    It runs with some disruptions it stops for sometime and runs again the PWM flow(inputs side) is continuous.

    Thankyou,

    K.Bindhu

  • Bindu,

    Since you mentioned the motor is able to spin in analog mode, I think this is not a motor tuning issue. We haven't seen this issue on our side. Do you see this issue only when duty cycle is changed or even at constant duty cycle? Can you try applying higher duty cycle (>50%) and also at higher PWM frequencies (>1 kHz)? Would be great if you can share the screenshot of the oscilloscope capturing the PWM signal and the FGOUT signal.

    Regards,

    Vishnu

  • Hello Vishnu,

    1. we have this issue with constant duty cycle, we didn't still tested in varying duty cycle since we are facing the issue with constant duty cycle.

    2. I applied duty cycles form 10 to 100 at every instant i am getting the same motor behavior 

    3. I tested my motor till 1000hz same motor behavior 

    I am attaching images for 500hz at higher duty cycles. 

    Thankyou,

    Bindhu.

  • Hello Vishnu,

    I Wanted to know is there any register to observe the speed of the motor. 

    when i give particular duty cycle the input of the motor is generating at the same speed or not. i need to monitor that speed register.

    Thanking you,

    Bindhu.

  • Hello vishnu,

    I need to know is there any register to monitor the input command given to the motor.

    Thank you 

    Bindhu

  • Hi Bindu,

    I will get back to you shortly.

    Regards,

    Vishnu 

  • Bindu,

    Apologies for the delayed response.

    You can monitor the % voltage magnitude in the Motor status window as shown in below screenshot. This parameter is the modulation index (ratio of applied motor voltage to the DC bus voltage).

    Select the "speed feedback" in the "Algorithm variable status select".

    Note: Enabling "Auto-read" register while the motor is spinning might cause the device to get stuck. 

  • Hello Vishnu,

    How to make sure that the controller is reading the input PWM command properly? Is there any register to validate the same?

    Thankyou

    Bindhu.

  • Hi Bindu,

    The reference for speed loop (screenshot displayed below) should indicate the PWM duty cycle change. For example, if the MAX_SPEED is set to 100 Hz and PWM duty cycle is 50%, reference for speed loop should read back 50 Hz.

    Regards,

    Vishnu

  • Hello vishnu,

    I gave input PWM at 50% duty cycle and max speed is set as 267Hz. The Reference for Speed loop was varying and the values were 49.30Hz, 67.60Hz, 89.0Hz, where we expected was 133.5Hz.
    I tried with another duty cycle, the observation was similar.
    Can you suggest to me why the value is changing?

    Thanking you 

    Bindu.

  • Bindu,

    Can you make sure the frequency and the duty cycle of the speed PWM signal is constant? Also, can you double check if the speed input is configured to "Controlled by duty cycle"?  Also, make sure you write the settings to EEPROM. 

    Regards,

    Vishnu

  • Hello vishu, 

    Appologises for delay in reply.

    According to what your suggested example max speed is 100 hz and duty cycle is 50

    We have a max speed is 267hz our estimayed output should be 133.5hz where we are getting different values like 49.30Hz, 67.60Hz, 89.0Hz

    We double checked the speed input is  "controlled by dutycycle"

    We are sure that after changing in the gui registers we write to EPROM.

    Thankyou

    Bindu

  • Bindu,

    Can you read the ALGO_STATUS register (bit 15:4)? This is 12-bit value indicating decoded speed command in PWM/Analog mode. Here's the equation to convert the raw data to duty command. 

    DUTY_CMD (%) = ALGO_STATUS<15:4> /4096 * 100%. This should match with the input PWM speed command. 

    Regards,

    Vishnu

  • Hello vishnu,

    As you suggested i checked EVM, aurdino for PWM signal I captured the values of ALGO_Status register(15:4) and used the formula suggested by you

    Aurdino  ALGO_STATUS at 50 DutyCycle.

    Register value                             Register bits                            decimal conversion                 Duty_Cmd%

    0×2B98FC20

    111111000010

    4034

    0.9843

    0×2C21FC00

    111111000000

    4032

    0.98437

    0×3044FC10

    111111000001

    4033

    0.9846

    0×2EEDFBF0

    111110111111

    4031

    0.98413

    0×2F93FC10

    111111000001

    4033

    0.984619

    I gave 50% duty cycle but i got 0.98., can suggest me what's going wrong and how i generate the correct input.

  • Bindu,

    This is strange! We haven't seen this issue in the past. Is there an alternate source of PWM signal generator you can try? I want to narrow down this issue by checking if the issue exists on the PWM signal being generated or the IC itself. 

    Also, can you make sure the PWM signal is making proper contact to the EVM?

    Regards,

    Vishnu

  • Hi Bindu,

    I am working on MCF8316AEVM. The board and motor was configured and tested with the analog potentiometer. Then the input is configured to accept PWM (duty cycle) at 10 to 325Hz.

    I gave PWM from RaspberyPi which is 3.3V at 50Hz. Whenever input pwm is provided at any particular dutycycle, the motor starts spinning with some jerks and then speed starts varying and later it stops.

    It seems the set up causing the problem: 

    First, you said the board was configured for using the analog pot to control the motor speed, then the same speed input pin was configured for pwm duty cycle speed control. What value did you set to the SPD_CTRL_MODE register? Or maybe you meant to say that you changed the speed control method from using a POT then to PWM duty cycle at different time? It is not clear to me exactly what speed control you selected.

    Anyway, can you provide the set values for the following registers:

    MAX_SPEED

    MIN_DUTY

    ZERO_DUTY_THR

    SPD_PWM_RANGE_SELECT

    PWM_FREQ_OUT

    Speed mode is dutycycle speed input pin freq is 10hz to 325hz.

    This is the root cause of the problem: 10 to 325 is out of the spec, as the pwm frequency should be within this range [325-Hz to 95-kHz]

    Brian

  • 10 to 325 is out of the spec, as the pwm frequency should be within this range [325-Hz to 95-kHz]

    Brian,

    SPEED_RANGE_SEL is configured to 10 Hz to 325 Hz. Bindu is applying 50 Hz PWM signal so this shouldn't be an issue. 

    Regards,

    Vishnu

  • Hi Bindu,

    the motor starts spinning with some jerks and then speed starts varying and later it stops.

    The waveform below shows the PWM duty is not stable: it sometime jumped from ~ 50% to ~30%. Can you confirm this?

    Brian

  • Brian,

    SPEED_RANGE_SEL is configured to 10 Hz to 325 Hz. Bindu is applying 50 Hz PWM signal so this shouldn't be an issue. 

    Thank you, Vishnu! I somehow didn't see the low frequency range select option.

    Brian

  • Hello Brain,

    Initially we kept Speed Control mode for analog, but finally we are expecting SPEED_MODE is controlled by duty cycle for speed input pin

    our frequency SPEED_RANGE_SEL is 325hz to 95khz 

    MAX_SPEED is 267Hz

    PWM_FREQ_OUT=25kHz

    i will attach even the register file please check it for all register we used and suggest us for changes.

  • Bindu,

    Thanks for the details.

    Regards,

    Vishnu

  • Hi Bindu,

    Re to the bottom waveform: is it a bad scope trigger, or the PWM duty is unstable between 30 and 50% duty?