CN111464088A - Control method and control device of shift motor and projection system - Google Patents
Control method and control device of shift motor and projection system Download PDFInfo
- Publication number
- CN111464088A CN111464088A CN202010268992.1A CN202010268992A CN111464088A CN 111464088 A CN111464088 A CN 111464088A CN 202010268992 A CN202010268992 A CN 202010268992A CN 111464088 A CN111464088 A CN 111464088A
- Authority
- CN
- China
- Prior art keywords
- shaft
- step number
- preset
- motor
- controlling
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 88
- 230000001133 acceleration Effects 0.000 claims description 37
- 238000012935 Averaging Methods 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 11
- 230000008569 process Effects 0.000 description 12
- 238000001514 detection method Methods 0.000 description 10
- 230000003287 optical effect Effects 0.000 description 8
- 238000012360 testing method Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 4
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000003321 amplification Effects 0.000 description 2
- 238000012937 correction Methods 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000003199 nucleic acid amplification method Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02P—CONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
- H02P8/00—Arrangements for controlling dynamo-electric motors rotating step by step
- H02P8/32—Reducing overshoot or oscillation, e.g. damping
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02P—CONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
- H02P8/00—Arrangements for controlling dynamo-electric motors rotating step by step
- H02P8/14—Arrangements for controlling speed or speed and torque
- H02P8/20—Arrangements for controlling speed or speed and torque characterised by bidirectional operation
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02P—CONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
- H02P8/00—Arrangements for controlling dynamo-electric motors rotating step by step
- H02P8/22—Control of step size; Intermediate stepping, e.g. microstepping
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/12—Picture reproducers
- H04N9/31—Projection devices for colour picture display, e.g. using electronic spatial light modulators [ESLM]
- H04N9/3141—Constructional details thereof
Landscapes
- Engineering & Computer Science (AREA)
- Power Engineering (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Control Of Position Or Direction (AREA)
Abstract
The embodiment of the invention relates to the technical field of motor control, and particularly discloses a control method and a control device of a shift motor and a projection system. According to the control method of the shaft shifting motor, the moving part is driven to move when the shaft shifting motor rotates, and a first positioning sensor is arranged at one end of a moving path of the moving part; receiving a motion instruction; controlling the shaft moving motor to rotate towards a first direction and controlling the step number of the shaft moving motor to cross the first positioning sensor not to exceed the preset step number of the shaft moving motor to cross the positioning sensor; the method for controlling the shaft-moving motor to rotate towards the second direction and controlling the current step number of the shaft-moving motor not to exceed the preset maximum step number achieves the purpose that only a single-side positioning sensor is adopted, the step number of the shaft-moving motor passing over the positioning sensor and the current step number are recorded through more accurate software, the arriving position of the shaft-moving motor is determined, and the error of the shaft-moving arriving position amplified by the multi-stage gears is reduced.
Description
Technical Field
The invention relates to the technical field of motor control, in particular to a control method and a control device of a shift motor and a projection system.
Background
Projection motor products on the market at present generally use two light senses or opto-couplers to detect when arriving at the head, and manually move to the position of two positioning sensors to be considered as arriving at the head. In addition, because the shift motor reaches the ray apparatus module, has passed through a plurality of gear reduction, and the error is just enlarged by one-level one grade, adding the projection distance of ray apparatus to the plane of projection, holistic error will be enlarged, can cause the actual shift not yet to arrive the position and just stop, the whole scope of shift is incorrect. In addition, the focusing motor or the axis shifting motor on the market runs by fixed Pulse Per Second (PPS), shaking (for example, the motor suddenly stops at a speed and suddenly speeds up) may exist when the motor is started and stopped, and when the axis shifting motor drives the moving part to move from top to bottom, the projection plane is farther away from the optical machine in the lower part and closer to the upper part, so that an image on the actual projection plane is caused, and the movement is faster in the lower part and slower in the upper part.
Disclosure of Invention
In view of the above, the present application provides a method for controlling a shift motor, a control device and a projection system, which can solve or at least partially solve the above existing problems.
In order to solve the technical problems, the technical scheme provided by the invention is a control method of a shift motor, the shift motor drives a moving member to move when rotating, and a first positioning sensor is arranged at one end of a moving path of the moving member, the control method comprises the following steps:
receiving a motion instruction;
controlling the shaft moving motor to rotate towards a first direction and controlling the step number of the shaft moving motor to cross the first positioning sensor not to exceed the preset step number of the shaft moving motor to cross the positioning sensor;
and controlling the shaft moving motor to rotate towards the second direction, and controlling the current step number of the shaft moving motor not to exceed the preset maximum step number.
Preferably, the method for controlling the rotation of the axle moving motor to the first direction and controlling the number of steps of the axle moving motor to pass through the first positioning sensor to be not more than the preset number of steps of the passing through positioning sensor comprises the following steps:
controlling the shaft moving motor to rotate towards a first direction, and continuously detecting whether a signal reaching a first positioning sensor is received or not during rotation;
when the signal of reaching the first positioning sensor is received, the step number of the shaft moving motor crossing the first positioning sensor is recorded;
and when the number of steps of the shaft moving motor for crossing the first positioning sensor is equal to the preset number of steps of the shaft moving motor for crossing the positioning sensor, controlling the shaft moving motor to stop rotating towards the first direction.
Preferably, the method for controlling the rotation of the shift motor in the first direction includes:
acquiring a preset acceleration tolerance, a preset rotation second pulse, a preset averaging step number and a preset deceleration proportion;
controlling the shaft shifting motor to uniformly accelerate and rotate towards a first direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor reaches a preset rotation second pulse;
and controlling the shaft shifting motor to continue rotating towards the first direction, and reducing the current rotation second pulse of the shaft shifting motor by a preset deceleration proportion when rotating towards the first direction every time by a preset division step number.
Preferably, the method of controlling the shift motor to stop rotating in the first direction includes:
acquiring a current rotation second pulse of the shaft shifting motor;
and controlling the shaft shifting motor to uniformly decelerate and rotate towards the first direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor is 0.
Preferably, the method for controlling the shift motor to rotate in the second direction and controlling the current number of steps of the shift motor not to exceed the preset maximum number of steps includes:
controlling the shaft moving motor to rotate towards a second direction, and continuously recording the current step number of the shaft moving motor during rotation;
and when the current step number of the shaft moving motor is equal to the preset maximum step number, controlling the shaft moving motor to stop rotating towards the second direction.
Preferably, the method for controlling the rotation of the shift motor in the second direction includes:
acquiring a preset acceleration tolerance, a preset rotation second pulse, a preset averaging step number and a preset deceleration proportion;
controlling the shaft shifting motor to uniformly accelerate and rotate towards the second direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor reaches a preset rotation second pulse;
and controlling the shaft shifting motor to continue rotating towards the second direction, and reducing the current rotation second pulse of the shaft shifting motor by a preset deceleration proportion every time the shaft shifting motor rotates towards the second direction by a preset average step number.
Preferably, the method for controlling the rotation of the shift motor to the second direction further includes:
continuously recording the number of steps of the residual shaft moving motor passing the first positioning sensor when the residual shaft moving motor does not reach the first positioning sensor;
when the first positioning sensor is reached, if the absolute value of the step number of the remaining step number crossing the first positioning sensor is smaller than the preset step number crossing error of the positioning sensor, the operation is not carried out; and if the absolute value of the step number of the residual first positioning sensor crossing is greater than or equal to the preset step number error of the first positioning sensor crossing, correcting the step number of the residual first positioning sensor crossing to be 0.
Preferably, the method of controlling the shift motor to stop rotating in the second direction includes:
acquiring a current rotation second pulse of the shaft shifting motor;
and controlling the shaft shifting motor to uniformly decelerate and rotate towards the second direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor is 0.
Preferably, the control method further includes: receiving a starting-up instruction, and entering a standby state after self-checking;
the method for entering the standby state after self-checking comprises the following steps:
acquiring the current step number of the shaft moving motor, and judging whether the current step number of the shaft moving motor is equal to a preset initial step number or not;
if the current step number of the shaft-moving motor is equal to the preset initial step number, acquiring a preset rotary second pulse, a preset maximum step number, a preset minimum step number, a preset step number of the over-positioning sensor and a preset equipartition fixed value, controlling the shaft-moving motor to rotate to the preset maximum step number in the first direction according to the preset rotary second pulse, continuously detecting whether a signal reaching the first positioning sensor is received or not during rotation, if so, continuously rotating to the first direction for the preset step number of the over-positioning sensor, stopping rotation to enter the next step, if not, stopping rotation and outputting error reporting information after rotating to the first direction for the preset maximum step number,
controlling the shaft-moving motor to rotate to a preset maximum step number in a second direction according to a preset second pulse of rotation and then stop, then controlling the shaft-moving motor to rotate to a preset maximum step number in a first direction according to a preset second pulse of rotation, continuously recording the total step number of the shaft-moving motor rotation during rotation and continuously detecting whether a signal reaching a first positioning sensor is received, if so, continuously rotating to the first direction for a preset step number of steps to pass over the positioning sensor and then stop rotating to enter the next step, and if not, rotating to the first direction for a preset maximum step number and then stopping and outputting error reporting information,
judging whether the recorded total steps of the rotation of the shaft-moving motor is smaller than a preset minimum step, if so, outputting error-reporting information, if not, recording the current steps of the shaft-moving motor as an initial step, recording the total steps of the rotation of the shaft-moving motor as a preset maximum step, dividing the total steps of the rotation of the shaft-moving motor by a preset division fixed value to obtain a preset division step, and entering a standby state;
and if the current step number of the shaft moving motor is not equal to the preset initial step number, entering a standby state.
The invention also provides a control device of the shaft-moving motor, the shaft-moving motor drives the moving member to move when rotating, a first positioning sensor is arranged at one end of the moving path of the moving member, the control device comprises:
the instruction receiving module is used for receiving a motion instruction;
the rotating starting module is used for controlling the shaft moving motor to rotate towards a first direction and controlling the step number of the shaft moving motor passing over the first positioning sensor not to exceed the preset step number of the shaft moving motor passing over the positioning sensor;
and the shaft moving motor is also used for controlling the shaft moving motor to rotate towards the second direction and controlling the current step number of the shaft moving motor not to exceed the preset maximum step number.
Preferably, the rotation starting module includes:
the arrival first positioning sensor signal detection unit is used for controlling the shaft moving motor to rotate towards a first direction and continuously detecting whether a signal arriving the first positioning sensor is received or not during rotation;
the step number recording unit of the first positioning sensor is used for recording the step number of the shaft moving motor crossing the first positioning sensor after receiving the signal reaching the first positioning sensor;
and the step number detection unit is used for controlling the shaft moving motor to stop rotating towards the first direction when the step number of the shaft moving motor passing the first positioning sensor is equal to the preset step number of the shaft moving motor passing the positioning sensor.
Preferably, the method for controlling the rotation of the shift motor in the first direction includes:
acquiring a preset acceleration tolerance, a preset rotation second pulse, a preset averaging step number and a preset deceleration proportion;
controlling the shaft shifting motor to uniformly accelerate and rotate towards a first direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor reaches a preset rotation second pulse;
and controlling the shaft shifting motor to continue rotating towards the first direction, and reducing the current rotation second pulse of the shaft shifting motor by a preset deceleration proportion when rotating towards the first direction every time by a preset division step number.
Preferably, the method of controlling the shift motor to stop rotating in the first direction includes:
acquiring a current rotation second pulse of the shaft shifting motor;
and controlling the shaft shifting motor to uniformly decelerate and rotate towards the first direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor is 0.
Preferably, the rotation starting module further comprises:
the current step number recording unit is used for controlling the shaft moving motor to rotate towards the second direction and continuously recording the current step number of the shaft moving motor during rotation;
and the current step number detection unit is used for controlling the shaft moving motor to stop rotating towards the second direction when the current step number of the shaft moving motor is equal to the preset maximum step number.
Preferably, the method for controlling the rotation of the shift motor in the second direction includes:
acquiring a preset acceleration tolerance, a preset rotation second pulse, a preset averaging step number and a preset deceleration proportion;
controlling the shaft shifting motor to uniformly accelerate and rotate towards the second direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor reaches a preset rotation second pulse;
and controlling the shaft shifting motor to continue rotating towards the second direction, and reducing the current rotation second pulse of the shaft shifting motor by a preset deceleration proportion every time the shaft shifting motor rotates towards the second direction by a preset average step number.
Preferably, the method for controlling the rotation of the shift motor to the second direction further includes:
the residual step number recording unit for crossing the first positioning sensor is used for continuously recording the step number of the residual shaft-moving motor for crossing the first positioning sensor when the residual shaft-moving motor does not reach the first positioning sensor;
the residual crossing first positioning sensor step number correction unit is used for not acting when the absolute value of the step number of the residual crossing first positioning sensor is smaller than the preset crossing positioning sensor step number error when the residual crossing first positioning sensor reaches the first positioning sensor; and if the absolute value of the step number of the residual first positioning sensor crossing is greater than or equal to the preset step number error of the first positioning sensor crossing, correcting the step number of the residual first positioning sensor crossing to be 0.
Preferably, the method of controlling the shift motor to stop rotating in the second direction includes:
acquiring a current rotation second pulse of the shaft shifting motor;
and controlling the shaft shifting motor to uniformly decelerate and rotate towards the second direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor is 0.
Preferably, the control device further comprises a power-on processing module, which is used for receiving a power-on instruction and entering a standby state after self-test;
the boot processing module comprises:
the self-checking judging unit is used for acquiring the current step number of the shaft moving motor and judging whether the current step number of the shaft moving motor is equal to the preset initial step number or not;
a self-checking execution unit, which is used for obtaining a preset rotation second pulse, a preset maximum step number, a preset minimum step number, a preset step number of crossing the positioning sensor and a preset equipartition fixed value if the current step number of the shaft-moving motor is equal to a preset initial step number, controlling the shaft-moving motor to rotate to the preset maximum step number in the first direction according to the preset rotation second pulse, continuously detecting whether a signal reaching the first positioning sensor is received or not during rotation, if so, continuously rotating to the first direction for the preset step number of crossing the positioning sensor and then stopping rotation to enter the next step, if not, stopping rotation and outputting error reporting information after rotating to the first direction for the preset maximum step number,
controlling the shaft-moving motor to rotate to a preset maximum step number in a second direction according to a preset second pulse of rotation and then stop, then controlling the shaft-moving motor to rotate to a preset maximum step number in a first direction according to a preset second pulse of rotation, continuously recording the total step number of the shaft-moving motor rotation during rotation and continuously detecting whether a signal reaching a first positioning sensor is received, if so, continuously rotating to the first direction for a preset step number of steps to pass over the positioning sensor and then stop rotating to enter the next step, and if not, rotating to the first direction for a preset maximum step number and then stopping and outputting error reporting information,
judging whether the recorded total steps of the rotation of the shaft-moving motor is smaller than a preset minimum step, if so, outputting error-reporting information, if not, recording the current steps of the shaft-moving motor as an initial step, recording the total steps of the rotation of the shaft-moving motor as a preset maximum step, dividing the total steps of the rotation of the shaft-moving motor by a preset division fixed value to obtain a preset division step, and entering a standby state;
and the self-checking stopping unit is used for entering a standby state if the current step number of the shaft moving motor is not equal to the preset initial step number.
The present invention also provides a projection system comprising:
the shaft moving motor is used for driving the moving piece to move when rotating;
a memory for storing a computer program for controlling the axis shifting motor;
a processor for executing the computer program for controlling the axis shifting motor to realize the steps of the control method of the axis shifting motor.
The invention also provides a readable storage medium, in which a computer program is stored, which computer program, when being executed by a processor, realizes the steps of the above-mentioned method for controlling a tilt motor.
Compared with the prior art, the beneficial effects of the method are detailed as follows: according to the control method of the shaft shifting motor, the moving part is driven to move when the shaft shifting motor rotates, and a first positioning sensor is arranged at one end of a moving path of the moving part; receiving a motion instruction; controlling the shaft moving motor to rotate towards a first direction and controlling the step number of the shaft moving motor to cross the first positioning sensor not to exceed the preset step number of the shaft moving motor to cross the positioning sensor; the method for controlling the shaft-moving motor to rotate towards the second direction and controlling the current step number of the shaft-moving motor not to exceed the preset maximum step number achieves the purpose that only a single-side positioning sensor is adopted, the step number of the shaft-moving motor passing over the positioning sensor and the current step number are recorded through more accurate software, the arriving position of the shaft-moving motor is determined, and the error of the shaft-moving arriving position amplified by the multi-stage gears is reduced.
Drawings
In order to illustrate the embodiments of the present invention more clearly, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a schematic flow chart of a method for controlling a shift motor according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for controlling a spindle motor to rotate in a first direction without exceeding a first direction to a head position according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for controlling the rotation of the spindle motor in the second direction without exceeding the second direction to the head position according to an embodiment of the present invention;
fig. 4 is a schematic flow chart of another method for controlling a shift motor according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating a method for entering a standby state according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a control device of a shift motor according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without any creative work belong to the protection scope of the present invention.
In order to make the technical solutions of the present invention better understood by those skilled in the art, the present invention will be further described in detail with reference to the accompanying drawings and specific embodiments.
As shown in fig. 1, an embodiment of the present invention provides a method for controlling a shift motor, where the shift motor drives a moving member to move when rotating, a first positioning sensor is disposed at one end of a moving path of the moving member, where the one end does not include an end position, but refers to a non-end position on a certain side, and since the shift motor needs to continue to move to the end by a preset number of steps beyond the positioning sensor after reaching the positioning sensor, a distance from the first positioning sensor to the corresponding end is at least greater than or equal to a preset distance beyond the positioning sensor by the preset number of steps.
When the shaft moving motor rotates towards a first direction, the moving part is driven to move towards the first positioning sensor, and when the moving part moves to the first positioning sensor, a signal reaching the first positioning sensor is sent out; when the shaft shifting motor rotates towards the second direction, the moving part is driven to move towards the end without the positioning sensor. The embodiment can be applied to a shift motor for driving a moving member to move up and down, and the control method comprises the following steps:
s11: receiving a motion instruction;
s12: controlling the shaft moving motor to rotate towards a first direction and controlling the step number of the shaft moving motor to cross the first positioning sensor not to exceed the preset step number of the shaft moving motor to cross the positioning sensor;
s13: and controlling the shaft moving motor to rotate towards the second direction, and controlling the current step number of the shaft moving motor not to exceed the preset maximum step number.
Specifically, the detection of the end of the tilt-shift motor can be detected by a positioning sensor, the positioning sensor can be a light sensor or an optical coupler, when the optical coupler or the light sensor is shielded, a signal changes, if adc detection is performed, the more shielding is performed, the lower the adc value is, if gpio detection is performed, and when the adc detection is performed to a certain degree, the gpio is pulled down; when the axle moving motor rotates, a separation blade on the optical machine module can rotate, and when the optical coupler is rotated, the optical coupler can be shielded. For software, if the arrival location sensor signal is given by adc, the range of adc is 0-255, the software will use the intermediate value 125 as the judgment condition, if the arrival location sensor signal is given by gpio, the gpio has only 0 or 1, and 0 will be used as the in-place flag. The software may be configured to accommodate both acquisition modes when the adc signal is less than 125 and not equal to 1 as the detected arrival at the position sensor signal.
Specifically, the movement command does not limit to one command, and the control of the shift motor to rotate in the first direction and the control of the number of steps of the shift motor over the first positioning sensor not exceeding the preset number of steps over the positioning sensor may correspond to one command, two commands, or more than two commands. The control of the shaft-moving motor to rotate towards the second direction and the control of the current step number of the shaft-moving motor not exceeding the preset maximum step number can correspond to one instruction, also can correspond to two instructions or correspond to more than two instructions.
It should be noted that, as shown in fig. 2, the method for controlling the rotation of the shift motor in the first direction and controlling the number of steps of the shift motor to pass through the first position sensor to not exceed the preset number of steps of passing through the position sensor in S12 includes:
s121: controlling the shaft moving motor to rotate towards a first direction, and continuously detecting whether a signal reaching a first positioning sensor is received or not during rotation;
s122: when the signal of reaching the first positioning sensor is received, the step number of the shaft moving motor crossing the first positioning sensor is recorded;
s123: and when the number of steps of the shaft moving motor for crossing the first positioning sensor is equal to the preset number of steps of the shaft moving motor for crossing the positioning sensor, controlling the shaft moving motor to stop rotating towards the first direction.
The specific process comprises the following steps: acquiring the number of steps of the shaft-moving motor crossing the first positioning sensor and the preset number of steps of the shaft-moving motor crossing the positioning sensor, and judging whether the shaft-moving motor crosses the first positioning sensor;
if the shaft moving motor does not cross the first positioning sensor, the shaft moving motor is controlled to rotate towards the first direction, whether a signal reaching the first positioning sensor is received or not is continuously detected during rotation, the number of steps of the shaft moving motor crossing the first positioning sensor is continuously recorded after the signal reaching the first positioning sensor is received, and when the number of steps of the shaft moving motor crossing the first positioning sensor is equal to the preset number of steps of the shaft moving motor crossing the positioning sensor, the shaft moving motor is controlled to stop rotating towards the first direction, and the direction is prompted to be adjusted to the head reaching position;
if the shaft moving motor passes over the first positioning sensor, judging whether the number of steps of passing over the first positioning sensor is equal to the preset number of steps of passing over the positioning sensor;
if the number of steps of crossing the first positioning sensor is not equal to the preset number of steps of crossing the positioning sensor, controlling the shaft-moving motor to rotate towards the first direction, continuously recording the number of steps of crossing the first positioning sensor during rotation and continuously detecting whether the number of steps of crossing the first positioning sensor is equal to the preset number of steps of crossing the positioning sensor, and controlling the shaft-moving motor to stop rotating towards the first direction and prompting that the direction is adjusted to the head position when the number of steps of crossing the first positioning sensor is equal to the preset number of steps of crossing the positioning sensor;
if the number of steps over the first alignment sensor is equal to the preset number of steps over the alignment sensor, the direction is prompted to be adjusted to the head position.
Specifically, the shift motor enters a state of waiting for control, remains in a stopped state and cyclically waits for triggering of forward rotation or reverse rotation, for example, if forward rotation is performed, i.e., clockwise rotation, corresponding to the rotation in the first direction, it is first detected whether the shift motor has passed the first positioning sensor, since the step number of crossing the first positioning sensor is continuously recorded after the shaft moving motor crosses the first positioning sensor, by detecting the recorded step number of crossing the first positioning sensor and the preset step number of crossing the positioning sensor, it may be determined whether the shift motor has crossed the first positioning sensor, for example if the number of recorded steps crossing the first positioning sensor is 0, the shaft moving motor can be considered to not cross the first positioning sensor, the shaft moving motor can rotate towards the first direction, the signal reaching the first positioning sensor is continuously detected during rotation, and the situation that the step number of the shaft moving motor crosses the first positioning sensor is continuously detected after the shaft moving motor crosses the first positioning sensor; if the number of steps of crossing the first positioning sensor is more than 0 and less than the preset number of steps of crossing the positioning sensor, the shaft-moving motor can be considered to cross the first positioning sensor, but the preset number of steps of crossing the positioning sensor is not reached, namely the first direction to head position is not reached, the shaft-moving motor can rotate towards the first direction, and the situation of crossing the first positioning sensor is continuously detected during the rotation; if the number of steps of crossing the first positioning sensor is equal to the preset number of steps of crossing the first positioning sensor, the situation shows that the shaft-moving motor rotates to the head position in the first direction and cannot rotate any more, the interface prompts that the head is adjusted, the direction cannot rotate, and the shaft-moving motor does not rotate towards the first direction so as to ensure that the head cannot be adjusted by the shaft-moving motor.
The method of controlling the rotation of the shift motor in the first direction includes:
acquiring a preset acceleration tolerance, a preset rotation second pulse, a preset averaging step number and a preset deceleration proportion;
controlling the shaft shifting motor to uniformly accelerate and rotate towards a first direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor reaches a preset rotation second pulse;
and controlling the shaft shifting motor to continue rotating towards the first direction, and reducing the current rotation second pulse of the shaft shifting motor by a preset deceleration proportion when rotating towards the first direction every time by a preset division step number.
Specifically, the shaft-moving motor is controlled to rotate towards a first direction, a uniform acceleration starting mode is firstly entered, a rotation second pulse of current software is obtained, the shaft-moving motor is controlled to rotate by one step with 1-set preset acceleration tolerance, and one step with 2-set preset acceleration tolerance. Here, whether the shift motor is accelerated to rotate in the first direction or accelerated to rotate in the second direction, the same uniform acceleration mode is adopted to avoid the shake of the shift motor caused by the rapid acceleration of the shift motor.
After the rotation speed is accelerated to the preset rotation second pulse, the rotation speed is started to rotate towards the first direction at the preset rotation second pulse speed, every time the rotation speed is rotated by a preset average step number, the rotation second pulse is controlled to reduce a preset deceleration proportion P% (the preset deceleration proportion is the deceleration proportion determined by the structure and the performance of the shaft-moving motor, the rotation range and the like and is obtained by combining theory and actual measurement), for example, the average step number is 1000, the preset rotation second pulse of software is 500, and P is 2, so after the rotation speed is 1000 steps, the rotation second pulse is reduced to 490, and the deceleration is continued in this way. The mode that the rotating second pulse of the shaft shifting motor is decelerated according to the preset equal division step number is adopted, because when the shaft shifting motor rotates to drive the moving piece to move downwards, the distance between the projection surface and the optical machine is farther in the lower part and closer in the upper part, an image on the actual projection surface can be caused, and the movement is faster in the lower part and slower in the upper part. Therefore, when the shift motor rotates to drive the moving part to move so that the projection picture moves towards the direction far away from the position of the optical machine, the rotation second pulse of the shift motor is decelerated according to the preset averaging step number, namely, the moving speed of the projection picture is decelerated, and the projection picture can keep moving at a uniform speed on the projection plane. Meanwhile, in the rotating process of the shaft moving motor, the step number of the shaft moving motor passing the first positioning sensor is required to be continuously detected and cannot exceed the preset step number of the shaft moving motor passing the positioning sensor, so that the shaft moving motor is ensured to rotate towards the first direction and cannot exceed the head reaching position. The current rotation second pulse value is stored in real time in the rotation process, and whether a rotation stopping signal is received or not is detected in real time; when the head arriving position is reached, namely the head arriving position is triggered, the rotation is stopped, and the user is prompted that the direction is adjusted to the head arriving position.
The method of controlling the shift motor to stop rotating in the first direction includes:
acquiring a current rotation second pulse of the shaft shifting motor;
and controlling the shaft shifting motor to uniformly decelerate and rotate towards the first direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor is 0.
Specifically, for example, when the shift motor receives a stop first motion signal or the first direction rotates to the head, the first direction deceleration stop logic is entered, the current software rotation second pulse is obtained, the shift motor is controlled to rotate by one step (the current rotation second pulse-1 × the preset acceleration tolerance), and then rotate by one step (the current rotation second pulse-2 × the preset acceleration tolerance), i.e., the preset acceleration tolerance is decelerated every step until the current rotation second pulse is 0, for example, the current shift motor rotation second pulse is 480, the preset acceleration tolerance is 20, and then the rotation second pulse is 24 steps in a 480, 460, i.e., 0 manner. Here, the same uniform deceleration method is used to avoid the shaking of the shift motor due to the rapid deceleration of the shift motor, regardless of whether the shift motor receives the rotation stop signal when rotating in the first direction, or the rotation stop signal when rotating in the second direction, or the rotation stop signal when rotating in the first direction until the head stops rotating, or the rotation stop signal when rotating in the second direction until the head stops rotating. Although the deceleration process is started after the shaft-moving motor rotates to the head position, the actual number of steps of the shaft-moving motor passing the positioning sensor exceeds the preset number of steps of the shaft-moving motor passing the positioning sensor, the number of steps of the shaft-moving motor decelerating is very short, and abnormal conditions such as jamming and blocking of the shaft-moving motor cannot occur.
As shown in fig. 3, the method for controlling the shift motor to rotate in the second direction and controlling the current step number of the shift motor to not exceed the preset maximum step number in S13 includes:
s131: controlling the shaft moving motor to rotate towards a second direction, and continuously recording the current step number of the shaft moving motor during rotation;
s132: and when the current step number of the shaft moving motor is equal to the preset maximum step number, controlling the shaft moving motor to stop rotating towards the second direction.
The specific process comprises the following steps: acquiring the current step number and the preset maximum step number of the shaft moving motor, and judging whether the current step number of the shaft moving motor is smaller than the preset maximum step number or not;
if the current step number of the shaft moving motor is smaller than the preset maximum step number, controlling the shaft moving motor to rotate towards a second direction, continuously recording the current step number of the shaft moving motor during rotation, continuously detecting whether the current step number of the shaft moving motor is equal to the preset maximum step number, and controlling the shaft moving motor to stop rotating towards the second direction when the current step number of the shaft moving motor is equal to the preset maximum step number and prompting that the direction is adjusted to the limit position;
and if the current step number of the shaft moving motor is equal to the preset maximum step number, prompting that the direction is adjusted to the limit position.
Specifically, the spindle motor enters a state of waiting control, keeps a stopped state of the spindle motor and circularly waits for triggering forward rotation or reverse rotation, for example, if the spindle motor rotates in a reverse direction, i.e. counterclockwise direction, and rotates in a second direction, whether the current step number of the spindle motor is equal to a preset maximum step number is detected first, since the spindle motor continuously records (accumulates) the current step number from the initial step number to the second direction, whether the spindle motor has reached a second direction limit position can be judged by detecting the relationship between the recorded current step number and the preset maximum step number, if the current step number is less than the preset maximum step number, the spindle motor can continue to rotate in the second direction, if the current step number is equal to the preset maximum step number, the spindle motor rotates to a head position in the second direction and cannot continue to rotate, an interface prompts to adjust to the head, the direction can not rotate and does not rotate to the second direction so as to ensure that the shaft moving motor can not adjust the head.
The method of controlling the rotation of the shift motor in the second direction includes:
acquiring a preset acceleration tolerance, a preset rotation second pulse, a preset averaging step number and a preset deceleration proportion;
controlling the shaft shifting motor to uniformly accelerate and rotate towards the second direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor reaches a preset rotation second pulse;
and controlling the shaft shifting motor to continue rotating towards the second direction, and reducing the current rotation second pulse of the shaft shifting motor by a preset deceleration proportion every time the shaft shifting motor rotates towards the second direction by a preset average step number.
Specifically, the method for controlling the shift motor to rotate in the second direction is the same as the method for controlling the shift motor to rotate in the first direction, and reference may be made to the foregoing detailed description, which is not repeated herein.
The method for controlling the rotation of the shift motor in the second direction further includes:
continuously recording the number of steps of the residual shaft moving motor passing the first positioning sensor when the residual shaft moving motor does not reach the first positioning sensor;
when the first positioning sensor is reached, if the absolute value of the step number of the remaining step number crossing the first positioning sensor is smaller than the preset step number crossing error of the positioning sensor, the operation is not carried out; and if the absolute value of the step number of the residual first positioning sensor crossing is greater than or equal to the preset step number error of the first positioning sensor crossing, correcting the step number of the residual first positioning sensor crossing to be 0.
Specifically, when the axis-shifting motor starts to rotate from the first direction limit position to the second direction, the step number of the residual step passing through the first positioning sensor is continuously recorded, namely: when the shaft moving motor reaches a first direction limit position, the recorded step number of crossing the first positioning sensor is Y, when the shaft moving motor starts to rotate towards a second direction from the first direction limit position, Y is reduced by 1 every step, the step number of the remaining crossing the first positioning sensor is calculated according to the method, when the shaft moving motor reaches the first positioning sensor, the step number of the remaining crossing the first positioning sensor may not be equal to 0 due to the error of the shaft moving motor, the preset step number error of the crossing positioning sensor can be set to be Y/20, if the step number of the remaining crossing first positioning sensor is within Y/20 in absolute value, the step number does not act, if the step number of the remaining crossing first positioning sensor is not within Y/20, the step number of the remaining crossing first positioning sensor is corrected to be 0, and the recorded error of the step number of the crossing first positioning sensor is prevented from increasing, and the judgment of the limit position in the first direction.
The method of controlling the shift motor to stop rotating in the second direction includes:
acquiring a current rotation second pulse of the shaft shifting motor;
and controlling the shaft shifting motor to uniformly decelerate and rotate towards the second direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor is 0.
Specifically, the method for controlling the shift motor to stop rotating in the second direction is the same as the method for controlling the shift motor to stop rotating in the first direction, and reference may be made to the foregoing detailed description, which is not repeated herein.
It should be noted that, as shown in fig. 4, another method for controlling a shift motor according to an embodiment of the present invention includes:
s10: receiving a starting-up instruction, and entering a standby state after self-checking;
s11: receiving a motion instruction;
s12: controlling the shaft moving motor to rotate towards a first direction and controlling the step number of the shaft moving motor to cross the first positioning sensor not to exceed the preset step number of the shaft moving motor to cross the positioning sensor;
s13: and controlling the shaft moving motor to rotate towards the second direction, and controlling the current step number of the shaft moving motor not to exceed the preset maximum step number.
As shown in fig. 5, the method of entering the standby state after the self-test in S10 includes:
s101: acquiring the current step number of the shaft moving motor, and judging whether the current step number of the shaft moving motor is equal to a preset initial step number or not;
s1021: if the current step number of the shaft-moving motor is equal to the preset initial step number, acquiring a preset rotary second pulse, a preset maximum step number, a preset minimum step number, a preset step number of the over-positioning sensor and a preset equipartition fixed value, controlling the shaft-moving motor to rotate to the preset maximum step number in the first direction according to the preset rotary second pulse, continuously detecting whether a signal reaching the first positioning sensor is received or not during rotation, if so, continuously rotating to the first direction for the preset step number of the over-positioning sensor, stopping rotation to enter the next step, if not, stopping rotation and outputting error reporting information after rotating to the first direction for the preset maximum step number,
s1022: controlling the shaft-moving motor to rotate to a preset maximum step number in a second direction according to a preset second pulse of rotation and then stop, then controlling the shaft-moving motor to rotate to a preset maximum step number in a first direction according to a preset second pulse of rotation, continuously recording the total step number of the shaft-moving motor rotation during rotation and continuously detecting whether a signal reaching a first positioning sensor is received, if so, continuously rotating to the first direction for a preset step number of steps to pass over the positioning sensor and then stop rotating to enter the next step, and if not, rotating to the first direction for a preset maximum step number and then stopping and outputting error reporting information,
s1023: judging whether the recorded total steps of the rotation of the shaft-moving motor is smaller than a preset minimum step, if so, outputting error-reporting information, if not, recording the current steps of the shaft-moving motor as an initial step, recording the total steps of the rotation of the shaft-moving motor as a preset maximum step, dividing the total steps of the rotation of the shaft-moving motor by a preset division fixed value to obtain a preset division step, and entering a standby state;
s103: and if the current step number of the shaft moving motor is not equal to the preset initial step number, entering a standby state.
Specifically, the positioning sensor is arranged to determine the position of the shaft moving motor, the upper head and the lower head are not fixed points due to structural tolerance, if the position of the shaft moving motor is determined without the positioning sensor, the shaft moving motor is blocked and jammed, and the lower adjusting distance is too small due to too much movement of the shaft moving motor. When a power key interruption triggering starting signal is received, whether the shaft moving motor is started for the first time is judged, if the current step number of the shaft moving motor is equal to the preset starting step number, the shaft moving motor is considered to be started for the first time, and a shaft moving motor self-checking process is started, for example, when the read current step number of the shaft moving motor is-1 (a default value), the shaft moving motor self-checking process is started.
After entering a self-checking process, firstly, controlling a shaft-moving motor to move in a first direction (a direction provided with a positioning sensor) by X steps (X is the maximum step number preset by software, the maximum step number is the number of steps to the head determined by a structure and is obtained by combining theory and actual measurement) according to preset rotation second pulses, continuously detecting whether a signal reaching the first positioning sensor is received during rotation, stopping rotating Y steps (Y is the number of steps crossing the positioning sensor preset by the software) after receiving the signal, namely reaching the position from the first direction to the head, and stopping rotation and prompting the shaft-moving motor to be bad by an interface if the signal reaching the first positioning sensor is not detected after the X steps are completed.
And then controlling the shaft moving motor to rotate in a second direction (the direction without the positioning sensor) by X steps according to a preset second pulse of rotation, then controlling the shaft moving motor to rotate in a first direction by a preset maximum step number according to the preset second pulse of rotation, continuously recording the total step number of the shaft moving motor rotation and continuously detecting whether a signal reaching the first positioning sensor is received or not during rotation, stopping after the signal is received, continuously rotating Y steps, namely reaching the head position of the first direction, and stopping rotation and prompting the bad shaft moving motor by an interface if the signal reaching the first positioning sensor is not detected after the X steps are completed.
Judging whether the recorded total step number of the rotation of the shaft moving motor is smaller than a minimum step number preset by software (the minimum step number is a minimum limit value given by a structure, if the minimum step number is smaller than the minimum limit value, the actually adjusted shaft moving motor cannot reach an ideal range, and user experience is poor), if the minimum step number is smaller than the minimum limit value, prompting that the shaft moving motor is poor through an interface, otherwise, setting the current position as a starting point step number, wherein the step number is 0, recording the current rotation second pulse and the total step number, and dividing the total step number by an averaging fixed value preset by the software to obtain an averaging step number, wherein the averaging step number is 10000, 10 is the averaging fixed value, 1000 is the averaging step number, and is recorded as the preset averaging step number. Self-test failed in three cases: 1. the step number of walking to the first direction is greater than the maximum limit step number of the structure, and jamming may be caused at this time, 2, if the signal reaching the first positioning sensor is not detected, the hardware is considered to be abnormal, and 3, if the positioning sensor is detected too early or too late, the shaft moving range may be insufficient, or the jamming is too large, and the problem is considered to be installed. Through the self-checking process, the total steps from the first direction to the head of the shaft-moving motor to the second direction can be determined, and the preset average step number of the shaft-moving motor is calculated. In the self-checking process, the shaft-moving motor firstly rotates towards the direction provided with the positioning sensor, then rotates towards the direction not provided with the positioning sensor, and then rotates towards the direction provided with the positioning sensor to determine the total steps of the shaft-moving motor; when the first direction is counterclockwise, the second direction is clockwise, and in some special cases, the first direction and the second direction may be other directions, and the first direction and the second direction are only limited to two opposite directions in which the shift motor can rotate. The position set as the starting step number is the first direction to head position, where the starting step number position is set to determine only the positive and negative directions in which the software records steps past the position sensor.
Specifically, if the current step number of the shift motor is not equal to the preset starting step number, the shift motor is not considered to be started for the first time, that is, the self-checking process of the shift motor is already passed, the self-checking process of the shift motor is not entered, and the standby state is directly entered.
Presetting a step number value of crossing the positioning sensor, such as 1572 steps; presetting the maximum step number as 12000 steps; the number of steps using self-test may be selected to be between 10800 and 12000. It should be noted that the above steps are not limited to specific values and ranges, and the corresponding steps are specifically set according to the actually selected motor and hardware structure.
The technical scheme of the application has the advantages that: 1. the prior art is when walking to the position sensor position, thinks to move the axle to the head, and the technical scheme of this application is that one end is walked out behind the position sensor position, crosses the position sensor step number through the software record and judges the head, and the other end judges the head through predetermineeing the biggest step number, because software note step is more accurate, has reduced because the error of the axle that moves that leads to through multistage gear amplification to the head position. 2. In the prior art, when a shaft moving motor is started and stopped, the equal difference acceleration and deceleration is not carried out, and after multi-stage amplification, the phenomenon of shaking can be caused. 3. In the prior art, fixed Pulse Per Second (PPS) operation is adopted, and the technical scheme of the application is that PPS dynamic adjustment is adopted, so that uniform movement of a projection picture on a projection surface is realized.
As shown in fig. 6, an embodiment of the present invention further provides a control device for a shift motor, the shift motor drives a moving member to move when rotating, a first positioning sensor is disposed at one end of a moving path of the moving member, the control device includes:
an instruction receiving module 21, configured to receive a motion instruction;
the rotation start module 22: the step number of steps of the shaft moving motor for crossing the first positioning sensor is controlled not to exceed the preset step number of steps of the shaft moving motor for crossing the positioning sensor;
and the shaft moving motor is also used for controlling the shaft moving motor to rotate towards the second direction and controlling the current step number of the shaft moving motor not to exceed the preset maximum step number.
It should be noted that the rotation starting module 22 includes:
the arrival first positioning sensor signal detection unit is used for controlling the shaft moving motor to rotate towards a first direction and continuously detecting whether a signal arriving the first positioning sensor is received or not during rotation;
the step number recording unit of the first positioning sensor is used for recording the step number of the shaft moving motor crossing the first positioning sensor after receiving the signal reaching the first positioning sensor;
and the step number detection unit is used for controlling the shaft moving motor to stop rotating towards the first direction when the step number of the shaft moving motor passing the first positioning sensor is equal to the preset step number of the shaft moving motor passing the positioning sensor.
The method of controlling the rotation of the shift motor in the first direction includes:
acquiring a preset acceleration tolerance, a preset rotation second pulse, a preset averaging step number and a preset deceleration proportion;
controlling the shaft shifting motor to uniformly accelerate and rotate towards a first direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor reaches a preset rotation second pulse;
and controlling the shaft shifting motor to continue rotating towards the first direction, and reducing the current rotation second pulse of the shaft shifting motor by a preset deceleration proportion when rotating towards the first direction every time by a preset division step number.
The method of controlling the shift motor to stop rotating in the first direction includes:
acquiring a current rotation second pulse of the shaft shifting motor;
and controlling the shaft shifting motor to uniformly decelerate and rotate towards the first direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor is 0.
It should be noted that the rotation starting module 22 further includes:
the current step number recording unit is used for controlling the shaft moving motor to rotate towards the second direction and continuously recording the current step number of the shaft moving motor during rotation;
and the current step number detection unit is used for controlling the shaft moving motor to stop rotating towards the second direction when the current step number of the shaft moving motor is equal to the preset maximum step number.
The method of controlling the rotation of the shift motor in the second direction includes:
acquiring a preset acceleration tolerance, a preset rotation second pulse, a preset averaging step number and a preset deceleration proportion;
controlling the shaft shifting motor to uniformly accelerate and rotate towards the second direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor reaches a preset rotation second pulse;
and controlling the shaft shifting motor to continue rotating towards the second direction, and reducing the current rotation second pulse of the shaft shifting motor by a preset deceleration proportion every time the shaft shifting motor rotates towards the second direction by a preset average step number.
The method for controlling the rotation of the shift motor in the second direction further includes:
the residual step number recording unit for crossing the first positioning sensor is used for continuously recording the step number of the residual shaft-moving motor for crossing the first positioning sensor when the residual shaft-moving motor does not reach the first positioning sensor;
the residual crossing first positioning sensor step number correction unit is used for not acting when the absolute value of the step number of the residual crossing first positioning sensor is smaller than the preset crossing positioning sensor step number error when the residual crossing first positioning sensor reaches the first positioning sensor; and if the absolute value of the step number of the residual first positioning sensor crossing is greater than or equal to the preset step number error of the first positioning sensor crossing, correcting the step number of the residual first positioning sensor crossing to be 0.
The method of controlling the shift motor to stop rotating in the second direction includes:
acquiring a current rotation second pulse of the shaft shifting motor;
and controlling the shaft shifting motor to uniformly decelerate and rotate towards the second direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor is 0.
Preferably, the control device further comprises a power-on processing module, which is used for receiving a power-on instruction and entering a standby state after self-test;
the boot processing module comprises:
the self-checking judging unit is used for acquiring the current step number of the shaft moving motor and judging whether the current step number of the shaft moving motor is equal to the preset initial step number or not;
a self-checking execution unit, which is used for obtaining a preset rotation second pulse, a preset maximum step number, a preset minimum step number, a preset step number of crossing the positioning sensor and a preset equipartition fixed value if the current step number of the shaft-moving motor is equal to a preset initial step number, controlling the shaft-moving motor to rotate to the preset maximum step number in the first direction according to the preset rotation second pulse, continuously detecting whether a signal reaching the first positioning sensor is received or not during rotation, if so, continuously rotating to the first direction for the preset step number of crossing the positioning sensor and then stopping rotation to enter the next step, if not, stopping rotation and outputting error reporting information after rotating to the first direction for the preset maximum step number,
controlling the shaft-moving motor to rotate to a preset maximum step number in a second direction according to a preset second pulse of rotation and then stop, then controlling the shaft-moving motor to rotate to a preset maximum step number in a first direction according to a preset second pulse of rotation, continuously recording the total step number of the shaft-moving motor rotation during rotation and continuously detecting whether a signal reaching a first positioning sensor is received, if so, continuously rotating to the first direction for a preset step number of steps to pass over the positioning sensor and then stop rotating to enter the next step, and if not, rotating to the first direction for a preset maximum step number and then stopping and outputting error reporting information,
judging whether the recorded total steps of the rotation of the shaft-moving motor is smaller than a preset minimum step, if so, outputting error-reporting information, if not, recording the current steps of the shaft-moving motor as an initial step, recording the total steps of the rotation of the shaft-moving motor as a preset maximum step, dividing the total steps of the rotation of the shaft-moving motor by a preset division fixed value to obtain a preset division step, and entering a standby state;
and the self-checking stopping unit is used for entering a standby state if the current step number of the shaft moving motor is not equal to the preset initial step number.
An embodiment of the present invention further provides a projection system, including: the shaft moving motor is used for driving the moving piece to move when rotating; a memory for storing a computer program for controlling the axis shifting motor; and the processor is used for executing a computer program for controlling the shift motor so as to realize the steps of the control method of the shift motor.
The embodiment of the invention also provides a readable storage medium, wherein the readable storage medium stores a computer program, and the computer program is executed by a processor to realize the steps of the control method of the shift motor.
For the description of the features in the embodiment corresponding to fig. 6, reference may be made to the related description of the embodiments corresponding to fig. 1 to fig. 5, which is not repeated here.
The above detailed description describes a control method, a control device and a projection system for a shift motor according to an embodiment of the present invention. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Claims (10)
1. A control method of a shaft shifting motor is characterized in that the shaft shifting motor drives a moving member to move when rotating, and a first positioning sensor is arranged at one end of a moving path of the moving member, and the control method comprises the following steps:
receiving a motion instruction;
controlling the shaft moving motor to rotate towards a first direction and controlling the step number of the shaft moving motor to cross the first positioning sensor not to exceed the preset step number of the shaft moving motor to cross the positioning sensor;
and controlling the shaft moving motor to rotate towards the second direction, and controlling the current step number of the shaft moving motor not to exceed the preset maximum step number.
2. The method of controlling a shift motor according to claim 1, wherein the method of controlling the shift motor to rotate in a first direction and controlling the shift motor to not exceed a preset number of steps past a first registration sensor comprises:
controlling the shaft moving motor to rotate towards a first direction, and continuously detecting whether a signal reaching a first positioning sensor is received or not during rotation;
when the signal of reaching the first positioning sensor is received, the step number of the shaft moving motor crossing the first positioning sensor is recorded;
and when the number of steps of the shaft moving motor for crossing the first positioning sensor is equal to the preset number of steps of the shaft moving motor for crossing the positioning sensor, controlling the shaft moving motor to stop rotating towards the first direction.
3. The method for controlling a shift motor according to claim 1, wherein the method for controlling the shift motor to rotate in the second direction and controlling the current number of steps of the shift motor not to exceed the preset maximum number of steps comprises:
controlling the shaft moving motor to rotate towards a second direction, and continuously recording the current step number of the shaft moving motor during rotation;
and when the current step number of the shaft moving motor is equal to the preset maximum step number, controlling the shaft moving motor to stop rotating towards the second direction.
4. The method of controlling a shift motor according to claim 1 or 3, wherein the method of controlling the shift motor to rotate in the second direction includes:
acquiring a preset acceleration tolerance, a preset rotation second pulse, a preset averaging step number and a preset deceleration proportion;
controlling the shaft shifting motor to uniformly accelerate and rotate towards the second direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor reaches a preset rotation second pulse;
and controlling the shaft shifting motor to continue rotating towards the second direction, and reducing the current rotation second pulse of the shaft shifting motor by a preset deceleration proportion every time the shaft shifting motor rotates towards the second direction by a preset average step number.
5. The method of controlling a shift motor according to claim 4, further comprising:
continuously recording the number of steps of the residual shaft moving motor passing the first positioning sensor when the residual shaft moving motor does not reach the first positioning sensor;
when the first positioning sensor is reached, if the absolute value of the step number of the remaining step number crossing the first positioning sensor is smaller than the preset step number crossing error of the positioning sensor, the operation is not carried out; and if the absolute value of the step number of the residual first positioning sensor crossing is greater than or equal to the preset step number error of the first positioning sensor crossing, correcting the step number of the residual first positioning sensor crossing to be 0.
6. The method of controlling a shift motor according to claim 3, wherein the method of controlling the shift motor to stop rotating in the second direction includes:
acquiring a current rotation second pulse of the shaft shifting motor;
and controlling the shaft shifting motor to uniformly decelerate and rotate towards the second direction according to a preset acceleration tolerance until the current rotation second pulse of the shaft shifting motor is 0.
7. The method of controlling a shift motor according to claim 1, further comprising: receiving a starting-up instruction, and entering a standby state after self-checking;
the method for entering the standby state after self-checking comprises the following steps:
acquiring the current step number of the shaft moving motor, and judging whether the current step number of the shaft moving motor is equal to a preset initial step number or not;
if the current step number of the shaft-moving motor is equal to the preset initial step number, acquiring a preset rotary second pulse, a preset maximum step number, a preset minimum step number, a preset step number of the over-positioning sensor and a preset equipartition fixed value, controlling the shaft-moving motor to rotate to the preset maximum step number in the first direction according to the preset rotary second pulse, continuously detecting whether a signal reaching the first positioning sensor is received or not during rotation, if so, continuously rotating to the first direction for the preset step number of the over-positioning sensor, stopping rotation to enter the next step, if not, stopping rotation and outputting error reporting information after rotating to the first direction for the preset maximum step number,
controlling the shaft-moving motor to rotate to a preset maximum step number in a second direction according to a preset second pulse of rotation and then stop, then controlling the shaft-moving motor to rotate to a preset maximum step number in a first direction according to a preset second pulse of rotation, continuously recording the total step number of the shaft-moving motor rotation during rotation and continuously detecting whether a signal reaching a first positioning sensor is received, if so, continuously rotating to the first direction for a preset step number of steps to pass over the positioning sensor and then stop rotating to enter the next step, and if not, rotating to the first direction for a preset maximum step number and then stopping and outputting error reporting information,
judging whether the recorded total steps of the rotation of the shaft-moving motor is smaller than a preset minimum step, if so, outputting error-reporting information, if not, recording the current steps of the shaft-moving motor as an initial step, recording the total steps of the rotation of the shaft-moving motor as a preset maximum step, dividing the total steps of the rotation of the shaft-moving motor by a preset division fixed value to obtain a preset division step, and entering a standby state;
and if the current step number of the shaft moving motor is not equal to the preset initial step number, entering a standby state.
8. A control device of a shaft-moving motor is characterized in that the shaft-moving motor drives a moving member to move when rotating, a first positioning sensor is arranged at one end of a moving path of the moving member, and the control device comprises:
the instruction receiving module is used for receiving a motion instruction;
the rotating starting module is used for controlling the shaft moving motor to rotate towards a first direction and controlling the step number of the shaft moving motor passing over the first positioning sensor not to exceed the preset step number of the shaft moving motor passing over the positioning sensor;
and the shaft moving motor is also used for controlling the shaft moving motor to rotate towards the second direction and controlling the current step number of the shaft moving motor not to exceed the preset maximum step number.
9. A projection system, comprising:
the shaft moving motor is used for driving the moving piece to move when rotating;
a memory for storing a computer program for controlling the axis shifting motor;
a processor for executing the computer program for controlling a shift motor to carry out the steps of the method of controlling a shift motor according to any one of claims 1 to 7.
10. A readable storage medium, characterized in that the readable storage medium stores a computer program which, when being executed by a processor, carries out the steps of the method of controlling a tilt motor according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010268992.1A CN111464088B (en) | 2020-04-08 | 2020-04-08 | Control method and control device of shift motor and projection system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010268992.1A CN111464088B (en) | 2020-04-08 | 2020-04-08 | Control method and control device of shift motor and projection system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111464088A true CN111464088A (en) | 2020-07-28 |
CN111464088B CN111464088B (en) | 2022-04-01 |
Family
ID=71681210
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010268992.1A Active CN111464088B (en) | 2020-04-08 | 2020-04-08 | Control method and control device of shift motor and projection system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111464088B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113784023A (en) * | 2021-08-09 | 2021-12-10 | 深圳市天视通视觉有限公司 | Position determining method and device, camera equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012003213A (en) * | 2010-06-21 | 2012-01-05 | Sanyo Electric Co Ltd | Projection type display |
CN102493798A (en) * | 2011-12-15 | 2012-06-13 | 北京市三一重机有限公司 | Control method for halting drill pipe of piling machine on fixed point and drill pipe |
CN107681933A (en) * | 2017-08-29 | 2018-02-09 | 深圳怡化电脑股份有限公司 | Stepper motor driven control method and system |
CN109714579A (en) * | 2017-10-25 | 2019-05-03 | 成都市极米科技有限公司 | A kind of self-checking unit and method of stroke of focusing |
KR20190114573A (en) * | 2018-03-30 | 2019-10-10 | 한국과학기술연구원 | Method for controlling interface of cylindrical screen device |
CN110646914A (en) * | 2019-09-29 | 2020-01-03 | 成都极米科技股份有限公司 | Drive device idle-loop-back driving method, device, equipment and storage medium |
-
2020
- 2020-04-08 CN CN202010268992.1A patent/CN111464088B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012003213A (en) * | 2010-06-21 | 2012-01-05 | Sanyo Electric Co Ltd | Projection type display |
CN102493798A (en) * | 2011-12-15 | 2012-06-13 | 北京市三一重机有限公司 | Control method for halting drill pipe of piling machine on fixed point and drill pipe |
CN107681933A (en) * | 2017-08-29 | 2018-02-09 | 深圳怡化电脑股份有限公司 | Stepper motor driven control method and system |
CN109714579A (en) * | 2017-10-25 | 2019-05-03 | 成都市极米科技有限公司 | A kind of self-checking unit and method of stroke of focusing |
KR20190114573A (en) * | 2018-03-30 | 2019-10-10 | 한국과학기술연구원 | Method for controlling interface of cylindrical screen device |
CN110646914A (en) * | 2019-09-29 | 2020-01-03 | 成都极米科技股份有限公司 | Drive device idle-loop-back driving method, device, equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
马高印等: "80C196MC单片机及富士IPM-7MBP50RA060在自动门变频调速***中的应用", 《河南理工大学学报(自然科学版)》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113784023A (en) * | 2021-08-09 | 2021-12-10 | 深圳市天视通视觉有限公司 | Position determining method and device, camera equipment and storage medium |
CN113784023B (en) * | 2021-08-09 | 2023-06-30 | 深圳市天视通视觉有限公司 | Position determining method, device, image pickup equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111464088B (en) | 2022-04-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111464089B (en) | Control method and control device of shift motor and projection system | |
US7095200B2 (en) | Power window apparatus with pinch detecting function | |
CN111464088B (en) | Control method and control device of shift motor and projection system | |
US10715064B2 (en) | Control device, optical device, control method, and storage medium | |
CN111464090B (en) | Control method and control device of shift motor and projection system | |
US7222044B2 (en) | Rotating speed detecting apparatus | |
CN111464091B (en) | Control method and control device of shift motor and projection system | |
CN107482968B (en) | control method for improving motion precision of direct current motor | |
US7966167B2 (en) | Support method, design support apparatus, and storage medium | |
US20080129549A1 (en) | System and method for encoder failure detection | |
US5463293A (en) | Motor control device | |
JP5350029B2 (en) | Optical equipment | |
JP5822542B2 (en) | Optical equipment | |
US6870559B2 (en) | Image forming apparatus | |
US5442267A (en) | Device for controlling the reverse rotation of a motor and method of judging time point where the motor is actually rotated in a reverse direction | |
JPH04136704A (en) | Position detection device | |
KR100726829B1 (en) | Position control method of pen motor using coordinates data of different kind | |
JP2016080547A (en) | Position controller | |
EP0574931A1 (en) | Device for controlling reverse rotation of motor and method of judging time point where motor is actually rotated in reverse direction | |
KR101243017B1 (en) | Method for controlling pulse input device | |
KR19990026311A (en) | How to correct VSTAL's capstan slip error | |
JP6962044B2 (en) | Motor control device, image forming device and electronic equipment | |
JP6137973B2 (en) | Stepping motor control device, optical apparatus, stepping motor control method, and program | |
JP2009093037A (en) | Positioning unit and microscope incorporating the same | |
JPH08185226A (en) | Disturbance follow-up type positioning control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |