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.

RM57L843: N2HET timer for motor speed measurement

Part Number: RM57L843

Tool/software:

Hi,

I am currently working on a safety critical project and one of the requirement is to measure motor speed and direction of rotation. We are using quadrature encoder signals as one of the way to measure speed using eQEP module and 3 hall effect sensors separated by 120 degrees around a BLDC motor as the other way to detect speed for redundancy. The 3 hall signals are connected to N2HET pins. I am able to read speed using eQEP module but I am kind of lost on how to get started on measuring speed and direction using N2HET. 

The 3 signals from the hall sensors would be phased shifted by 120 degrees. So, my approach is to measure the frequency of one of the signas. Using signal frequency, we can derive speed value and by looking at the phase sequence of the 3 signals, we should be able to get direction information. My question is, is there a way to do this using NHET? Can someone guide me with some information to help me get started?

Thanks,

Ravi

  • Hi Ravi,

    Apologies for the delay in response.

    I think you can do it using NHET, but i think we don't have any direct example for this.

    I will guide in high level,

    1. First enable the capturing functionality for your applied inputs.

    2. Now if you call the capGetSignal in your application code then you can get the period and duty cycle of your applied inputs.

    So, from the period you can calculate frequency or speed.

    3. And to calculate direction it is not a direct way like QEP, here you have to manually calculate the direction. For this purpose, one way is that you should need to enable the edge interrupts for your input signals

    4. For example, consider i am enabling raising edge interrupts for all 3 inputs, so from the order of sequence of my interrupts i can determine the direction right.

    Example i am assuming my inputs are A, B and C. If i get raising edge interrupts sequence is A, B and C then i will assume it is in forward direction. or else if my interrupt sequence is A, C and B then i will assume it is in reverse direction. You can do something like this for direction finding.

    --
    Thanks & Regards,
    Jagadish.