Sensorless homing system for stepper motor system
An automated luminaire and method are provided. The automated luminaire includes a stepper motor, a mechanism moved by the stepper motor, and a control system coupled to the stepper motor. The control system rotates the stepper motor, senses a current passing through a motor winding of the stepper motor, determines from a calculated characteristic of the sensed current that the mechanism has contacted an end stop, and in response, stores data relating to a current position of the stepper motor in a memory of the control system.
1. An automated luminaire, comprising:
a stepper motor;
a mechanism configured to be moved by the stepper motor; and
a control system coupled to the stepper motor and configured to:
rotate the stepper motor;
sense a value of a current passing through a motor winding of the stepper motor;
determine whether a portion of the sensed value of the current varies from an expected value of the current;
in response to determining that the portion of the sensed value of the current varies from the expected value of the current, calculate a characteristic of the portion of the sensed value of the current;
determine whether the calculated characteristic meets a predefined criterion, the predefined criterion representative of a collision of a mechanism moved by the stepper motor with an end stop of the mechanism; and
in response to determining that the calculated characteristic meets the predefined criterion, store data relating to a current position of the stepper motor in a memory of the control system.
2. The automated luminaire of claim 1 , wherein the automated luminaire comprises a resistor electrically coupled in series with the motor winding of the stepper motor, and the control system senses the value of the current by measuring a voltage drop across the resistor.
3. The automated luminaire of claim 2 , wherein the control system comprises an analogue-to-digital (A-D) converter electrically coupled to the resistor, the control system configured to intermittently sample a digital output of the A-D converter to obtain a signal relating to the sensed value of the current.
4. The automated luminaire of claim 3 , wherein the control system samples the digital output of the A-D converter at intervals of 50 microseconds.
5. The automated luminaire of claim 3 , wherein the control system is configured to:
store a plurality of successive samples of the digital output of the A-D converter;
determine that the plurality of samples varies from a corresponding plurality of expected values of the current; and
in response to such determination, determine that the mechanism has contacted the end stop by determining that a calculated characteristic of the plurality of samples meets a predefined criterion.
6. The automated luminaire of claim 5 , wherein the control system is configured to calculate the calculated characteristic of the plurality of samples by detecting peak values in the plurality of samples, the predefined criterion being that the plurality of samples includes at least two peak values.
7. The automated luminaire of claim 5 , wherein the control system is configured to calculate the calculated characteristic of the plurality of samples by calculating a frequency of the plurality of samples; the predefined criterion being that the calculated frequency is within a threshold range of a predefined fundamental frequency.
8. A method of determining a home position for a mechanism moved by a stepper motor, the method comprising:
rotating a stepper motor;
while rotating the stepper motor, sensing a value of a current passing through a motor winding of the stepper motor;
determining whether a portion of the sensed value of the current varies from an expected value of the current;
in response to determining that the portion of the sensed value of the current varies from the expected value of the current, calculating a characteristic of the portion of the sensed value of the current;
determining whether the calculated characteristic meets a predefined criterion, the predefined criterion representative of a collision of a mechanism moved by the stepper motor with an end stop of the mechanism; and
in response to determining that the calculated characteristic meets the predetermined criterion, storing data relating to a current position of the stepper motor in a memory of a control system coupled to the motor.
9. The method of claim 8 , wherein:
calculating a characteristic of the sensed value of the current comprises detecting peak values in the portion of the sensed value of the current; and
determining whether the calculated characteristic meets the predefined criterion comprises determining whether the portion of the sensed value of the current includes at least two peak values.
10. The method of claim 8 , wherein:
calculating a characteristic of the sensed value of the current comprises calculating a frequency of the portion of the sensed value of the current; and
determining whether the calculated characteristic meets the predefined criterion comprises determining whether the calculated frequency is within a threshold range of a predefined fundamental frequency.
11. The method of claim 10 , wherein the motor is rotated at a speed selected to maximize an amplitude of the calculated frequency of the portion of the sensed value of the current.
12. The method of claim 8 , wherein sensing a value of a current passing through a motor winding of the stepper motor comprises generating digital data relating to a voltage across a current sense resistor in series with the stepper motor winding.
13. The method of claim 12 , wherein the current passing through a motor winding of the stepper motor is sensed at an interval of 50 microseconds.
14. The method of claim 8 , wherein the motor is rotated at a speed selected to reduce an amount by which the mechanism bounces off the end stop upon contact.
15. A method of determining a home position for a mechanism moved by a stepper motor, the method comprising:
rotating a stepper motor at a first speed in a first direction;
while rotating the stepper motor, sensing a first value of a current passing through a motor winding of the stepper motor;
determining whether a first portion of the sensed first value of the current varies from a first expected value of the current;
in response to determining that the first portion of the sensed first value of the current varies from the first expected value of the current, calculating a first characteristic of the first portion of the sensed first value of the current;
determining whether the calculated first characteristic meets a first predefined criterion, the first predefined criterion representative of a collision of a mechanism moved by the stepper motor with an end stop of the mechanism;
in response to determining that the calculated first characteristic meets the first predetermined criterion, rotating the stepper motor in a second direction opposite from the first direction for a predetermined period;
after rotating the stepper motor in the second direction for the predetermined period:
rotating the motor in the first direction at a second speed, the second speed being slower than the first speed;
while rotating the stepper motor at the second speed, sensing a second value of the current passing through the motor winding of the stepper motor;
determining whether a second portion of the sensed second value of the current varies from a second expected value of the current;
in response to determining that the second portion of the sensed second value of the current varies from the second expected value of the current, calculating a second characteristic of the second portion of the sensed second value of the current;
determining whether the calculated second characteristic meets a second predefined criterion, the second predefined criterion representative of a second collision of the mechanism with the end stop of the mechanism; and
in response to determining that the calculated second characteristic meets the second predetermined criterion, storing data relating to a current position of the stepper motor in the memory of the control system coupled to the motor.
16. The method of claim 15 , wherein the calculated second characteristic is different than the calculated first characteristic.
17. The method of claim 16 , wherein the second predefined criterion is different than the first predefined criterion.
18. The method of claim 15 , wherein:
calculating a second characteristic of the sensed second value of the current comprises detecting second peak values in the second portion of the sensed second value of the current; and
determining whether the calculated second characteristic meets the second predefined criterion comprises determining whether the second portion of the sensed second value of the current includes at least two second peak values.
19. The method of claim 15 , wherein:
calculating a second characteristic of the sensed second value of the current comprises calculating a second frequency of the second portion of the sensed second value of the current; and
determining whether the calculated second characteristic meets the second predefined criterion comprises determining whether the calculated second frequency is within a threshold range of a predefined fundamental frequency.
20. The method of claim 19 , wherein the second speed is selected to maximize an amplitude of the calculated second frequency of the second portion of the sensed second value of the current.