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.

MCF8316AEVM: Disabling MPET from GUI?

Part Number: MCF8316AEVM
Other Parts Discussed in Thread: MCF8316A

Hello,

I'm evaluating the MCF8316A for a project. I've got a custom board on order and I'm trying to use the eval kit and web-based GUI to work out the parameters and settings in the mean time.

I keep running into the MPET_BEMF_FAULT error. The fault handling guide suggests increasing the open loop current reference and/or decreasing the open loop slew rate. I've tried both and it doesn't seem to help. It looks like MPET successfully finds the resistance (2.4ohm) and inductance (0.062mH), but stalls out before finding the BEMF constant.

I would like to bypass MPET entirely and just use manually entered values. I followed the guide on using an oscilloscope to manually find the BEMF constant, which I determined to be 3 mV/Hz (this is a custom motor with no datasheet). I entered all three values by manually editing the MTR_PARAMS register and see that they have been correctly set by reading the motor status registers. I also manually set  MPET_CMD, MPET_R, MPET_L, and MPET_KE to False. I expected these settings to mean that MPET won't run at all, but when I set it to run, the algorithm state goes right to MPET_KE_MEASURE and results in the same MPET_BEMF_FAULT as before. Throughout, the motor status registers read the values that I set them to and never revert to "SELF MEASUREMENT" as they normally do when MPET runs.

Is there any way to totally disable MPET?

Thanks,

Mitcham

  • A quick add-on:

    If I do all the above and also set MPET_IPD_SELECT and MPET_KE_MEAS_PARAMETER_SELECT to False, the motor runs for a bit, then stops as though there were a fault. However, no fault is reported. R, L and Ke read "Self Measurement" and the algorithm state is MOTOR_IDLE. Interestingly, the VM Voltage box in the motor status register drops down to around 5V instead of the 15V it previously read (the correct value). Voltage Magnitude dropped to 0%. Nothing seems to work at this point - I have to reset the whole board to get anything to work again.

    I guess this is some kind of bug?

  • Hi Mitcham,

    MPET will run automatically if any of the following five parameters are zero:

    [MOTOR_RES], [MOTOR_IND], [MOTOR_BEMF_CONST], [SPD_LOOP_KP], [SPD_LOOP_KI]

    Please ensure to enter non-zero values for all five parameters. Good starting values for KP and KI to use are 10 and 1.

    After these five parameters have been set to non-zero values, you can go ahead and write these values to EEPROM using the "Write to EEPROM" button to ensure the settings persist through power cycle.

    Please let me know if this helps.

    Regards,
    Eric C.

  • Eric,

    Thank you for the response. I was able to set all 5 of those parameters to my desired values (using 10 and 1 as you suggested for the PI) and after a few tries I got the motor to spin. It ramped up quickly and drew a lot of current (750mA) for several seconds, then slowly ramped down and stabilized around 150mA at a slower speed. This current is about what I'm aiming for, but I didn't manage to measure the RPM. At this point the algorithm state was CLOSED_LOOP_ALIGNED, which I believe is the steady "everything looks good" state. However, after maybe 10 seconds of this the motor stopped spinning and current dropped to 40mA. No fault was thrown on the GUI and the algorithm state still says CLOSED_LOOP_ALIGNED. Any ideas?

    Another thing to note is that in the motor status boxes the resistance and inductance read the values that I set them to, but the BEMF constant still says "Self Measurement". I'm not sure I understand the difference between the [MOTOR_RES], [MOTOR_IND], and [MOTOR_BEMF_CONST] boxes that you screenshotted vs. the values in the [MOTOR_PARAMS] register, which seem to be the ones read out in the motor status boxes. 

    Thanks,

    Mitcham

    EDIT:

    I am now able to spin it in steady state. Current and RPM look as expected. I think maybe I had the speed set too low when I had the unexplained crash above. The motor parameters in the motor status boxes still read "Self Measurement", but that must be wrong because it's definitely spinning. Now I'm on the hunt for further optimization to power consumption.

  • Hi Mitcham,

    Good to year that you were able to get your motor spinning in closed loop!

    The [MOTOR_RES], [MOTOR_IND], [MOTOR_BEMF_CONST] bitfield settings in the device's CLOSED_LOOP# registers are the values that actually get utilized in the algorithm.

    The [MOTOR_R], [MOTOR_L], and [MOTOR_BEMF_CONST] bitfields inside the MTR_PARAMS register are 'temporary' read-only values that simply stores the measured result of MPET.

    By default, if any of the 5 parameters are 0 in the CLOSED_LOOP# registers, MPET runs automatically -> results get stored in the MTR_PARAMS register and copied over to the CLOSED_LOOP# registers if needed. (The [MPET_WRITE_SHADOW] bit allows user to trigger this copy mechanism manually.)

    If you manually entered all 5 parameters, MPET won't run, which means the MTR_PARAMS will remain 0. Hence you see the motor status boxes still read "Self Measurement"

    Hope that clarifies things a bit.

    Regards,
    Eric C.

  • Hi Mitcham,

    The closed loop may have been unstable due to the speed loop Kp and Ki values entered. If MPET is not able to determine the speed loop parameters automatically, we do have a guided tuning section to manually determine appropriate values for your motor. Might be worth a try to follow the step-by-step instructions:

    Thanks,
    Eric C.