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.

Motor encoder angle computed during RsRecalc not consistent



Dear all,

I'm using an absolute encoder to measure the electric angle of my rotor with InstaSPIN motion. From my understanding, during RsRecalc estimation the rotor should be locked in the zero position of the electric angle, so that the measured encoder angle should always be consistent (assuming that I'm measuring the electric angle, and not the physical rotor position). However, I'm not seeing a consistent angle every time that I run RsRecalc. Actually I'm getting quite different results, varying from 140 degrees to 280 degrees. I measured the current during the RsRecalc across my three phases, and I'm seeing current in all of my coils.

Shouldn't I only be observing current from one (reference) phase to the other during RsRecalc? Do you have any suggestions as to why I'm seeing so much variability when locking the rotor position with RsRecalc?

Thank you in advance for your support.

Best regards,

Chris

  • "From my understanding, during RsRecalc estimation the rotor should be locked in the zero position of the electric angle, so that the measured encoder angle should always be consistent (assuming that I'm measuring the electric angle, and not the physical rotor position). "

    No. During RsRecalc a DC current is injected into Id. Depending on the magnitude of the current and the load and inertia of the machine, the rotor may rotate mechanically some amount of degrees. The rotor is not locked, but it may be possible to move the rotor into an oriented angle with regards to the stator. Basically preparing it for full torque production FOC.

    "However, I'm not seeing a consistent angle every time that I run RsRecalc. Actually I'm getting quite different results, varying from 140 degrees to 280 degrees."
    The electrical angle won't be consistent. You're just putting the stator into a starting position - and the rotor may self align during this process - which you then call your 0 mechanical degrees.
  • Hi Chris,
    Thank you again for your always quick feedback. I'm confused by your response. I thought the purpose of using RsRecalc in lab12a and lab12b is to move the rotor to a known position, and then compute the encoder offset. In other words, if the electric angle (i.e. that estimated from the sensorless approach) measures 0 degrees, but the encoder measures 30 degrees at this position (and during RsRecalc), then I should compute the encoder offset as 30 degrees, so that I can unbias the future encoder data to obtain the true electric angle for commutation. Am I making a mistake?

    I'm also confused when you mentioned " You're just putting the stator into a starting position - and the rotor may self align during this process". In our BLDC motor, the stator comprises stationary electromagnets, while the rotor is a permanent magnet and may rotate.

    Thanks,
    Chris
  • " is to move the rotor to a known position"
    It's not a known mechanical position. It is one of several (depending on # of poles) electrical positions where the rotor flux is aligned orthogonal to the just generated stator flux. You can then call this starting position a zero mechanical that you reference all mechanical off of.

    It has nothing to do with the estimated electrical angle from the sensorless algorithm. The sensorless algorithm isn't even giving an accurate estimation at this point.
  • Hi Chris,
    I understand that it's an electric angle. From your description, I believe it should align to a fixed electric angle, but I am seeing much variability in the electric angle. Would this be considered the zero angle from the sensorless algorithm? (I understand that the algorithm isn't accurate at this point). Does the electric angle where the rotor flux is aligned orthogonal to the generated stator flux happen at a fixed and constant electric angle, and if so, is this angle zero degrees?

    Thanks,
    chris
  • because you don't have rotor angle feedback you aren't placing your stator flux in a known place, you are just creating a specific stator flux and hopefully the rotor will be able to move to this position. You then call this specific position 0. This is just used to create a reference for your mechanical angle. It's a star in the sky to position relatively off of, that's all.

    "Does the electric angle where the rotor flux is aligned orthogonal to the generated stator flux happen at a fixed and constant electric angle, and if so, is this angle zero degrees?"
    The electrical angle difference between the rotor and the stator is described in the co-ordinates of the rotor axis, meaning if the stator is at 0 degrees it is aligned exactly with the rotor's north axis. Orthogonal alignment (where torque is maximized by the sin of the angle) is when the stator is +/- 90 degrees (+ 90 or +270) with respect to the rotor, depending on direction of rotation desired.
  • Hi Chris,
    I understand there isn't any rotor angle feedback, so there could be an error in rotor position. But if I understand correctly, current is applied to drive the rotor to an orthogonal alignment with the stator (?), so in the absence of any disturbances or reaction forces, it should reach orthogonal alignment, at least this is the intent.

    Is the electric angle calculated by your sensorless spinTac state estimation equivalent to the angle of the stator with respect to the rotor axis, such that if the electric angle is 0 degrees, the stator is at 0 degrees and aligned exactly with the rotor's north axis. Therefore, the theoretical electric angle from spinTac during this alignment stage is +/- 90 degrees?

    Lastly, is there any way to control or tell whether it is aligned to +90 degrees or -90 degrees during this alignment state?

    Thanks for helping me through this problem.
    Chris
  • Chris,

    Your understanding is correct.  You should see the motor aligned to a zero degree electrical angle when in RsRecalc, but the output from the sensorless algorithm will non non-zero this is because the sensorless algorithm can't estimate angles while it is holding a fixed position.  

    There should be a number of mechanical positions that your motor could align to that correspond to the number of poles in your motor.  Aligning to any one of these should be fine since we are just trying to get an offset for all future encoder data.  

    One thing I've found is that if your motor is coupled to something it may not be using enough current in order to perform the alignment.  You can adjust the amount of current that it uses for the alignment by adjusting the value of USER_MOTOR_RES_EST_CURRENT in the user.h file.  This can be as large as the value you placed in USER_MOTOR_MAX_CURRENT.

  • "so there could be an error in rotor position"
    I don't understand this comment. In proj_lab12 you are using an encoder for the rotor feedback. The sensorless observer (FAST) has nothing to do with proj_lab12 (although it is still running every control cycle for simplicity and ability to compare electrical angle and speed).

    "current is applied to drive the rotor to an orthogonal alignment with the stator (?), so in the absence of any disturbances or reaction forces, it should reach orthogonal alignment, at least this is the intent."
    No, this is incorrect (and I think I my first reply is at fault). We are driving the current "open loop", so we have no reference for how to apply the stator field. We are just driving a current made up of Id, and the rotor should be attracted to it (assuming enough torque is produced due to enough current) so that it aligns in the same direction (not orthogonal). We just use this as a reference. "Ok, now we are at what we are calling a zero electrical/mechanical position". If we want to produce torque we will make our next stator field orthogonal to this alignment.

    "Is the electric angle calculated by your sensorless spinTac state estimation equivalent to the angle of the stator with respect to the rotor axis, such that if the electric angle is 0 degrees, the stator is at 0 degrees and aligned exactly with the rotor's north axis. Therefore, the theoretical electric angle from spinTac during this alignment stage is +/- 90 degrees?"
    SpinTAC estimation is not sensorless. The portion you are talking about is simply converting encoder mechanical counts - with this offset we just generated - into an electrical angle to use for the current and modulation control.

    "Lastly, is there any way to control or tell whether it is aligned to +90 degrees or -90 degrees during this alignment state?"
    It's not aligned at 90 degrees. You will align your stator field to +/- 90 degrees when you start requesting Iq torque and Id = 0. The +/- depending on the direction of the speed reference.