CN114977912A - Load-based motor driving method and device and digital pathological section scanning system - Google Patents
Load-based motor driving method and device and digital pathological section scanning system Download PDFInfo
- Publication number
- CN114977912A CN114977912A CN202210668157.6A CN202210668157A CN114977912A CN 114977912 A CN114977912 A CN 114977912A CN 202210668157 A CN202210668157 A CN 202210668157A CN 114977912 A CN114977912 A CN 114977912A
- Authority
- CN
- China
- Prior art keywords
- motor
- load
- speed
- running
- current
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 96
- 230000001575 pathological effect Effects 0.000 title claims abstract description 12
- 230000001133 acceleration Effects 0.000 claims abstract description 69
- 230000008569 process Effects 0.000 claims abstract description 69
- 230000008859 change Effects 0.000 claims abstract description 10
- 238000001514 detection method Methods 0.000 claims abstract description 7
- 238000005457 optimization Methods 0.000 claims description 28
- 238000010586 diagram Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000005299 abrasion Methods 0.000 description 1
- 230000004913 activation Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000717 retained 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/14—Arrangements for controlling speed or speed and torque
- H02P8/16—Reducing energy dissipated or supplied
-
- 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
-
- 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/36—Protection against faults, e.g. against overheating or step-out; Indicating faults
- H02P8/38—Protection against faults, e.g. against overheating or step-out; Indicating faults the fault being step-out
Landscapes
- Engineering & Computer Science (AREA)
- Power Engineering (AREA)
- Control Of Electric Motors In General (AREA)
Abstract
The application provides a motor driving method and device based on load and a digital pathological section scanning system, which relate to the technical field of section scanning, and the method comprises the following steps: starting the detection equipment; acquiring a motor operation instruction and initial operation parameters of each motor; aiming at each motor, solving the running speed of the motor at preset time intervals according to the initial load coefficient and a preset acceleration and deceleration operation model, collecting the load coefficient of the motor in the current running process, and storing the load coefficient in a load coefficient array until the motor is judged to be finished running; and updating the initial load coefficient according to the change condition of each load coefficient in the load coefficient array of each motor, and solving the running speed of each motor according to the updated initial load coefficient when detecting that the equipment is started next time to drive the motors to run. Therefore, the load requirements of the motor under different conditions can be met, the running speed of the stepping motor is continuously optimized, and the use loss of the stepping motor is reduced.
Description
Technical Field
The application belongs to the technical field of slice scanning, and particularly relates to a motor driving method and device based on load and a digital pathological slice scanning system.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
The digital pathological section scanning system converts pathological sections into panoramic digital sections through the cooperation of a mechanical structure, electrical equipment and computer software, and realizes the operations of saving and reading digital images and the like. The digital pathological section scanning system has the great characteristic of automation, namely automatic section scanning, automatic sheet feeding and discharging and the like, and in order to realize an automatic function, the effect is achieved by combining a mechanical structure and electrical equipment.
The types of electrical equipment are roughly classified into three types: the first is a mode of a direct current motor and an encoder, although the direct current motor can smoothly adjust the speed of the motor, the direct current motor can not obtain a feedback signal only, the precision can not meet the requirement, the direct current motor is also used in combination with the encoder, the volume after the encoder is added is increased, the utilization rate of the internal space of the machine is reduced, and in addition, the cost of the direct current motor is higher, so that the direct current motor is generally considered rarely; the second type is a magnetic axis type linear motor, although the precision is high and the durability is strong, the positioning is carried out by matching with a grating ruler; the third is a stepping motor, the precision of each step of the stepping motor is three to five percent, and the error of one step cannot be accumulated to the next step, so that the position precision and the motion repeatability are better, and compared with a direct current motor, the cost of the stepping motor is lower, so that the stepping motor is mostly selected as a driving device.
The inventor finds that the following problems still exist in the use process of the stepping motor: if the pulse changes too fast when starting, the situation of losing steps or locked rotor is easy to happen, and resonance is generated once improper control is performed, the scanning speed and quality of the digital slice are affected. In the actual use process, the load of the motor can be changed due to the problems of assembly, long-term running abrasion and the like, and if only a single acceleration and deceleration scheme can be fixedly set by using the acceleration and deceleration model and the setting operation is complex, the load requirements of the motors under different conditions are difficult to meet.
Disclosure of Invention
In order to solve the above problems, the present application provides a load-based motor driving method, a load-based motor driving device, and a digital pathological section scanner, which determine the operating speed of a motor according to an initial load coefficient and the current operating condition of the motor, acquire the load coefficient during the operation of the motor, and update the initial load coefficient of the device at the next start according to the change condition of the load coefficient, so as to meet the load requirements of the motor under different conditions, continuously optimize the operating speed of the stepping motor, and reduce the use loss of the stepping motor.
In order to achieve the above object, the present application mainly includes the following aspects:
in a first aspect, an embodiment of the present application provides a load-based motor driving method, including:
starting the detection equipment; acquiring a motor operation instruction and initial operation parameters of each motor, wherein the initial operation parameters comprise a load current balance value and an initial load coefficient;
for each motor, solving the running speed of the motor at preset time intervals according to the initial load coefficient and a preset acceleration and deceleration operation model, acquiring the load coefficient of the motor in the current running process, and storing the load coefficient in a load coefficient array until the motor is judged to run;
and updating the initial load coefficient according to the change condition of each load coefficient in the load coefficient array of each motor, and solving the running speed of each motor according to the updated initial load coefficient when detecting that the equipment is started next time, so as to drive the motors to run.
As an optional embodiment, before obtaining the motor operation command and the initial operation parameters of each motor, the method further comprises:
acquiring the running times, the optimization period and the optimization times of equipment;
judging whether the current equipment needs to optimize the motor speed or not, and clearing the running times of the equipment when judging that the current equipment needs to optimize the motor speed, so that the optimization times are increased.
As an alternative embodiment, the motor operation command includes a target speed and a total pulse number, and the initial operation parameter further includes an initial speed; solving the running speed of the motor by the following method:
acquiring the current movement time of a motor and a preset acceleration and deceleration operation model;
initializing parameters of the acceleration and deceleration operation model, wherein the parameters comprise: the pulse number of the accelerated motion, the running pulse number, the total motion time, the state switching time in the accelerated motion process, the time for switching the uniform speed state to the deceleration state and the state switching time in the deceleration motion process;
determining the difference between the total pulse number and the running pulse number, and judging the current motion stage of the motor according to the comparison result of the difference and the pulse number of the accelerated motion;
solving the running speed of the motor in the current motion stage according to the initial load coefficient and the deceleration operation model;
and updating parameters of the acceleration and deceleration operation model according to the initial speed, the target speed and the running speed of the motor in the current motion stage.
As an optional implementation manner, when the difference between the total pulse number and the running pulse number is greater than the pulse number of the acceleration motion, it is determined that the motor is currently in an acceleration or constant speed stage;
or when the difference between the total pulse number and the running pulse number is equal to the pulse number of the accelerated motion, judging that the motor is switched from the constant speed state to the deceleration state, and recording the current running time;
or when the difference between the total pulse number and the running pulse number is smaller than the pulse number of the acceleration motion, judging that the motor motion is in a deceleration stage;
alternatively, when the total pulse number is equal to the running pulse number, it is determined that the motor running is ended.
As an optional implementation manner, the motion phase includes an acceleration phase, an acceleration and deceleration phase, a uniform velocity phase, an acceleration and deceleration phase, and a deceleration and deceleration phase; the updating of the parameters of the acceleration and deceleration operation model according to the initial speed, the target speed and the running speed of the motor in the current motion stage comprises the following steps:
determining the intermediate speed of the motor in the motion process according to the target speed and the initial speed of the motor;
when the pulse number of the accelerated motion is equal to the running pulse number and the running speed of the motor in the current motion stage is equal to the intermediate speed, judging that the motion of the motor is switched from the acceleration stage to the acceleration stage, and recording the current running time as the state switching time in the accelerated motion process;
or when the motor motion is in a deceleration stage and the running speed of the motor in the current motion stage is equal to the intermediate speed, judging that the motor motion is switched from the deceleration stage to the deceleration stage, and recording the current running time as the state switching time in the deceleration motion process.
As an optional implementation manner, a load coefficient mean value is obtained according to an average value of each load coefficient in the load coefficient arrays of each motor, and the initial load coefficient is updated according to a comparison result between the load coefficient mean value and a load current balance value.
As an optional implementation manner, determining a value range of a load coefficient mean value according to a load current balance value and a preset proportional coefficient; if the average value of the load coefficients falls into the value range, the speed of the motor does not need to be optimized; otherwise, the initial load factor is updated.
As an alternative embodiment, the initial load factor is updated according to the following way:
wherein k is an initial load coefficient and is a load coefficient mean value, and b1 is a load current balance value.
In a second aspect, embodiments of the present application further provide a load-based motor driving apparatus, including:
the detection module is used for detecting the starting of equipment; acquiring a motor operation instruction and initial operation parameters of each motor, wherein the initial operation parameters comprise a load current balance value and an initial load coefficient;
the acquisition module is used for solving the running speed of each motor at intervals of preset time according to the initial load coefficient and a preset acceleration and deceleration operation model, acquiring the load coefficient of the motor in the current running process, and storing the load coefficient in a load coefficient array until the motor running is judged to be finished;
and the driving module is used for updating the initial load coefficient according to the change condition of each load coefficient in the load coefficient array of each motor, solving the running speed of each motor according to the updated initial load coefficient when the next starting of the equipment is detected, and driving the motor to run.
In a third aspect, embodiments of the present application further provide a digital pathological section scanning system, which includes a stepping motor and a load-based motor driving device as described in the second aspect.
The beneficial effect of this application is:
1. when the equipment is detected to be started, the running speed of the motor is determined according to the initial load coefficient and the current running condition of the motor, the load coefficient during the running of the motor is collected, the initial load coefficient during the next starting of the equipment is updated according to the change condition of the load coefficient, so that the load requirement of the motor under different conditions is met, the running speed of the stepping motor is continuously optimized, and the use loss of the stepping motor is reduced.
2. When the running speed of the motor is solved, the parameters of the acceleration and deceleration operation model are updated according to the current running state of the motor, so that the running speed of each motor can be adaptively adjusted under the condition of step loss or locked rotor, and the scanning speed and the quality of the digital slice can be improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application.
FIG. 1 is a schematic flow chart diagram of a load-based motor driving method provided by an embodiment of the present application;
FIG. 2 is a flow chart of a motor speed optimization cycle provided by an embodiment of the present application;
FIG. 3 is a diagram illustrating a variation trend of a motor movement speed provided by an embodiment of the present application;
fig. 4 is a schematic structural diagram of a load-based motor driving apparatus provided in an embodiment of the present application.
Detailed Description
The present application will be further described with reference to the following drawings and examples.
It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the disclosure. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments according to the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
Referring to fig. 1, fig. 1 is a schematic flowchart of a load-based motor driving method according to an embodiment of the present application, and as shown in fig. 1, the load-based motor driving method according to the embodiment of the present application includes the following steps:
s101: starting the detection equipment; and acquiring a motor operation instruction and initial operation parameters of each motor, wherein the initial operation parameters comprise a load current balance value and an initial load coefficient.
As an alternative embodiment, before obtaining the motor operation command and the initial operation parameters of each motor, the method further comprises the following steps: acquiring the running times, the optimization period and the optimization times of equipment; judging whether the current equipment needs to optimize the motor speed or not, and clearing the running times of the equipment when judging that the current equipment needs to optimize the motor speed, so that the optimization times are increased.
In a specific implementation, step S1: initial speed c of each motor operation 0 The load current balance value b l, the initial load coefficient k, the device operation times n, the optimization period m and the optimization times o are set into a register.
Step S2: when the equipment is started, reading the initial speed c of each motor in the register 0 The load current balance value b l, the initial load coefficient k, the equipment operation times n, the optimization period m and the optimization times o.
Step S3: the device runs, n + +, writing n into the register. Judging whether the current operation needs to optimize the motor speed according to the equipment operation times n, the optimization period m and the optimization times o, if so, judging whether the current operation needs to optimize the motor speedThat is, the motor speed needs to be optimized according to the current running state, and the step S4 is entered; otherwise, the process proceeds to step S5.
Step S4: and entering an optimization period. Resetting the running times of the equipment, namely n is 0; the optimization count increases, i.e., o + +, n and o are written into the register, the number of motor operations D is initialized to 0, and the load factor array D is initialized, and the process proceeds to step S5.
S102: and for each motor, solving the running speed of the motor at preset time intervals according to the initial load coefficient and a preset acceleration and deceleration operation model, collecting the load coefficient of the motor in the current running process, and storing the load coefficient in a load coefficient array until the motor is judged to be finished running.
As an alternative embodiment, the motor operation command includes a target speed and a total pulse number, and the initial operation parameter further includes an initial speed; solving the running speed of the motor by the following method:
acquiring the current movement time of a motor and a preset acceleration and deceleration operation model; initializing parameters of the acceleration and deceleration operation model, wherein the parameters comprise: the pulse number of the accelerated motion, the running pulse number, the total motion time, the state switching time in the accelerated motion process, the time for switching the uniform speed state to the deceleration state and the state switching time in the deceleration motion process; determining the difference between the total pulse number and the running pulse number, and judging the current motion stage of the motor according to the comparison result of the difference and the pulse number of the accelerated motion; solving the running speed of the motor in the current motion stage according to the initial load coefficient and the deceleration operation model; and updating parameters of the acceleration and deceleration operation model according to the initial speed, the target speed and the running speed of the motor in the current motion stage.
As an optional embodiment, when the difference between the total pulse number and the running pulse number is greater than the pulse number of the acceleration motion, it is determined that the motor is currently in an acceleration or uniform speed stage; or when the difference between the total pulse number and the running pulse number is equal to the pulse number of the accelerated motion, judging that the motor is switched from the constant speed state to the deceleration state, and recording the current running time; or when the difference between the total pulse number and the running pulse number is smaller than the pulse number of the acceleration motion, judging that the motor motion is in a deceleration stage; alternatively, when the total pulse number is equal to the running pulse number, it is determined that the motor running is finished.
As an optional embodiment, the motion phase includes an acceleration phase, an acceleration and deceleration phase, a uniform velocity phase, an acceleration and deceleration phase, and a deceleration and deceleration phase; the updating of the parameters of the acceleration and deceleration operation model according to the initial speed, the target speed and the running speed of the motor in the current motion stage comprises the following steps: determining the intermediate speed of the motor in the motion process according to the target speed and the initial speed of the motor; when the pulse number of the accelerated motion is equal to the running pulse number and the running speed of the motor in the current motion stage is equal to the intermediate speed, judging that the motion of the motor is switched from the acceleration stage to the acceleration stage, and recording the current running time as the state switching time in the accelerated motion process; or when the motor motion is in a deceleration stage and the running speed of the motor in the current motion stage is equal to the intermediate speed, judging that the motor motion is switched from a deceleration stage to a deceleration stage, and recording the current running time as the state switching time in the deceleration motion process.
In a specific implementation, step S5: if the motor running instruction is obtained, reading the target speed c in the motor running instruction 1 And a total number of pulses f. Initializing parameters: the pulse number g of the accelerated motion is 0, the running pulse number h is 0, the total motion time t is 0, and the state switching time t in the accelerated motion process 0 Time t for switching constant speed state to deceleration state 1 And the state switching time t in the process of deceleration movement 2 Calculating the intermediate speed v of the motor in the motion process according to the formula (1) m The process proceeds to step S6.
Step S6: and (4) starting a timer when the motor enters a motion stage, and calculating the speed once in 50 ms.
Step S6-1: the process advances to a timer, t +50, and then to step S6-2.
Step S6-2: and judging the current motion state.
The speed v of the stepping motor represents the output frequency of pulses within a certain time, the unit of the speed is set to step/millisecond, and the timer 50ms calculates the speed once, so that the number of pulses C at the current speed can be calculated according to the formula (2). Since this embodiment uses an S-shaped curve composed of two parabolas having the same shape and opposite openings, the number of pulses in the acceleration state is equal to that in the deceleration state.
C=v*50 (2)
When f-h is larger than g, the motor moves in an acceleration or uniform speed stage, and the step S6-3 is carried out;
when f-h is equal to g, the motor moves from a constant speed to a deceleration state, and the current time t is recorded 1 If n is equal to 0, that is, currently in the load factor optimization cycle, the process proceeds to step S6-9, otherwise, the process proceeds to step S6-8;
when f-h is less than g, the motor is in a deceleration stage, and the step S6-8 is carried out;
when f is equal to h, the motion process ends, and the process proceeds to step S6-12;
step S6-3: if g is equal to h, the motor motion is in an acceleration stage, the step S6-4 is entered, otherwise, the motor motion is in a constant speed stage, and the step S6-7 is entered.
Step S6-4: and (4) substituting the current time t into the formula (3) to calculate the current running speed v of the motor.
When v is<v m When the motor is in the acceleration stage, the step S6-5 is carried out;
when v ═ v m When the motor moves, the acceleration stage is switched to the acceleration stage, and the current time t is recorded 0 Advancing to step S6-5;
otherwise, the motor motion is in the acceleration and deceleration stage, and the step S6-6 is entered.
Step S6-5: the current velocity v is set into the drive, controlling the motor motion. And (4) calculating the pulse number at the current speed according to the formula (2), accumulating the pulse number to g and h, and entering the step S6-1.
Step S6-6: and substituting the current time t into the formula (4) to calculate the current speed v. If v is<c 1 Advancing to step S6-5; otherwise, the motor motion is in a constant speed stage, and the step S6-7 is entered.
Step S6-7: the motor carries out uniform motion at the set target speed, and c is 1 Is set to driveIn the device, the motor is controlled to move, the pulse number at the current speed is calculated according to the formula (2) and is accumulated to h, and the step S6-1 is carried out.
Step S6-8: and substituting the current time t into the formula (5) to calculate the current running speed v of the motor.
When v is>v m When the motor is in the deceleration and acceleration stage, the step S6-10 is carried out;
when v ═ v m When the motor moves, the motor is switched from the deceleration acceleration stage to the deceleration stage, and the current time t is recorded 2 Advancing to step S6-10;
otherwise, the motor movement is in the deceleration stage, and the step S6-11 is entered.
Step S6-9: the current load factor a is obtained and stored in the load factor array, that is, D [ D ] ═ a, D + +, and the process proceeds to step S6-8.
Step S6-10: setting the current speed v into a driver, controlling the motor to move, calculating the pulse number at the current speed according to the formula (2), adding the pulse number to h, and entering step S6-1.
Step S6-11: the current speed v is calculated by substituting the current time t into equation (6), and the process proceeds to step S6-10.
Step S6-12: the movement process is finished, and the current time t is recorded 3 The process proceeds to step S7.
Step S7: if the lower computer obtains that the equipment operation is finished, the step S8 is carried out; otherwise, waiting for the next motor running instruction, and proceeding to step S5.
S103: and updating the initial load coefficient according to the change condition of each load coefficient in the load coefficient array of each motor, and solving the running speed of each motor according to the updated initial load coefficient when the next starting of the equipment is detected to drive the motor to run.
As an optional embodiment, the load coefficient mean value is obtained according to the average value of each load coefficient in the load coefficient array of each motor, and the initial load coefficient is updated according to the comparison result between the load coefficient mean value and the load current balance value. Optionally, determining a value range of the load coefficient mean value according to the load current balance value and a preset proportional coefficient; if the average value of the load coefficients falls into the value range, the speed of the motor does not need to be optimized; otherwise, the initial load factor is updated.
In a specific implementation, step S8: if n is 0, optimizing the load factor, and proceeding to step S9; otherwise, the process proceeds to step S11.
Step S9: calculating the average value of the load coefficient array, judging whether the load coefficient array is in the load balancing range, and if the load coefficient array is in the load balancing range, judging whether the load coefficient array is in the load balancing rangeI.e., without optimizing the motor speed, the process proceeds to step S11, otherwise, the process proceeds to step S10.
Step S10: and setting an optimized load coefficient k. The optimized coefficient k (two digits after the decimal point is retained) is calculated according to the formula (7), and k is written into the register, and the process proceeds to step S11.
Wherein k is an initial load factor,the average value of the load factors is b1, and the balance value of the load current is b 1.
Step S11: and finishing the operation of the equipment.
The following describes the above process in detail by taking an a-axis motor operation process with an apparatus operation number of times of 49, an optimization cycle of 50, and an optimization number of times of 1 as an example, as shown in fig. 2 and 3, specifically including the following steps:
s1, initializing parameters. Initial speed c at which the motor is to be operated 0 Load electricity (5)The flow balance value bl is 0.2, the load factor k is 0.2, the device operation number n is 49, the optimization period m is 50, and the optimization number o is 1 are set in the register.
And S2, starting the equipment. Reading initial speed c of A-axis motor operation in register 0 The method comprises the following steps of a load current balancing value bl, a load coefficient k, equipment operation times n, an optimization period m and an optimization time o.
And S3, operating the equipment. n + +, i.e., n 50, writes n to the register. Because ofThat is, the motor speed needs to be optimized according to the current running state, and the step S4 is entered;
and S4, entering an optimization period. Resetting the running times of the equipment, namely n is 0; the optimization times are increased, o + +, i.e., o ═ 2, n and o are written into the register. The number of motor operations D is initialized to 0 and the load factor array D is entered into step S5.
And S5, the lower computer receives the motor operation instruction and initializes the parameters. Reading target speed c sent by upper computer 1 15, 40000 as total pulse number f, 0 as pulse number g for initializing the acceleration motion, 0 as running pulse number h, 0 as total motion time t, and switching time t of state in the acceleration motion process 0 0, time t for switching constant speed state to deceleration state 1 0, state switching time t in the process of deceleration movement 2 Calculating the intermediate speed v of the motor motion process according to the formula (1) when the intermediate speed v is 0 m When the result is 10, the process proceeds to step S6.
And S6, starting a timer when the motor enters a motion stage, and calculating the speed once in 50 ms.
And (3) an acceleration stage:
step S6-1 proceeds to a timer, t +50, i.e., t 50, and step S6-2.
And step S6-2, judging the current motion state. When f-h is larger than g, the motor is in an acceleration or uniform speed stage, and the step S6-3 is carried out;
step S6-3, when g is equal to h is equal to 0, the motor is in an acceleration stage, and the process goes to step S6-4;
and step S6-4, substituting the current time t into equation (3) to calculate the current speed v-5.05.
At this moment v<v m When the motor moves in the acceleration stage, the step S6-5 is carried out;
and step S6-5, setting the current speed v into the driver and controlling the motor to move. And (4) calculating the pulse number at the current speed to be 252 according to the formula (2), accumulating the pulse number to g and h, entering a step S6-1, and waiting for entering a next timer.
The above steps are repeated until t is 500 and g is 3260, and the process proceeds to step S6-4, where the current speed is calculated to be 10, where v is v m When the motor movement is in the stage of accelerating and decelerating, the current time t is recorded 0 When the result is 500, the process proceeds to step S6-5.
And step S6-5, setting the current speed v into the driver and controlling the motor to move. The number of pulses at the current speed is calculated as 500 according to equation (2) and is added to g and h, that is, g-h-3760, and the process proceeds to step S6-1, and waits for the next timer.
An acceleration and deceleration stage:
step S6-1, the timer is entered, t equals t +50, i.e., t equals 550.
And step S6-2, judging the current motion state. At this time, f-h is 40000-3760 is 36240, the motor is in an acceleration or uniform speed stage, and the process proceeds to step S6-3;
step S6-3, because g ═ h ═ 3760, the motor motion is in the acceleration stage, and step S6-4 is entered;
step S6-4, substituting the current time t into equation (3) calculates the current speed v to be 11.05, v>v m When the motor is in the acceleration/deceleration stage, the process proceeds to step S6-6.
And step S6-6, substituting the current time t into the formula (4) to calculate the current speed v to be 10.95. At this time v<c 1 Advancing to step S6-5;
and step S6-5, setting the current speed v into the driver and controlling the motor to move. The number of pulses at the current speed is calculated as 547 according to equation (2), and the current speed is incremented to g and h, that is, g ═ h ═ 4307, and the process proceeds to step S6-1, and the process waits for the next timer.
The above steps are repeated until t is 1000, g is 6520, and the process proceeds to step S6-6, where the current speed is calculated to be 15, where v is c 1 And when the motor is in the constant speed stage, the step S6-7 is carried out.
Step S6-7, the motor moves at a set target speed at a constant speed, and step C is carried out 1 The pulse number at the current speed is calculated according to the formula (2) and is accumulated to h as 7270, and the process proceeds to step S6-1.
A uniform speed stage:
motor at target speed c 1 When the constant motion is performed until t equals 2700 and h equals 33480, the process proceeds to step S6-1.
And (3) a deceleration and acceleration stage:
step S6-1 proceeds to a timer, t +50, i.e., t 2750, and proceeds to step S6-2.
And step S6-2, judging the current motion state. At the moment, f-h is equal to g, the motor moves from a constant speed to a deceleration state, and the current time t is recorded 1 Step S6-9 is entered because n is 0, that is, currently in the load factor optimization cycle;
step S6-9, the current load factor a is obtained and stored in the load factor array, i.e., D [ D ] ═ a, D + +, and the process proceeds to step S6-8.
Step S6-8, substituting the current time t into equation (5) calculates the current speed v as 15, where v is>v m When the motor moves in the deceleration and acceleration stage, the step S6-10 is carried out;
and step S6-10, setting the current speed v into the driver, controlling the motor to move, calculating the pulse number at the current speed according to the formula (2), accumulating the pulse number until h is 34230, and entering the step S6-1.
The above steps are repeated until t is 3250, and the process proceeds to step S6-8, where the current speed is calculated to be 10, where v is v m When the motor moves in the stage of reducing acceleration and switching to reducing deceleration, the current time t is recorded 2 3250, proceed to step S6-10;
and step S6-10, setting the current speed v into the driver, controlling the motor to move, calculating the pulse number at the current speed according to the formula (2), accumulating the pulse number until h is 36240, and entering the step S6-1.
And a deceleration stage:
step S6-1 proceeds to a timer, t +50, i.e., t 3300, and step S6-2.
And step S6-2, judging the current motion state. At the moment f-h < g, the motor motion is in a deceleration stage, and the step S6-8 is entered;
step S6-8, substituting the current time t into equation (5) to calculate the current speed v equal to 8.95, v<v m The motor movement is in the deceleration stage, and the process proceeds to step S6-11.
Step S6-11, the current time t is substituted into equation (6) to calculate the current speed v to be 9.05, and the process proceeds to step S6-10.
And step S6-10, setting the current speed v into the driver, controlling the motor to move, calculating the pulse number at the current speed according to the formula (2), accumulating the pulse number until h is 36692, and entering the step S6-1.
The above steps are repeated until f is 40000, and the process proceeds to step S6-12.
Step S6-12, the movement process is ended, and the current time t is recorded 3 3800, the flow proceeds to step S7.
S7, the current lower computer obtains the operation end of the equipment and then the step S8 is carried out;
step S8, if n is equal to 0, optimizing the load factor, and then proceeding to step S9;
s9, calculating the average value of the load coefficient arrayObtaining the mean valueIs out of positionIn the range, the process proceeds to step S10.
And S10, setting an optimized load coefficient k. The optimized coefficient k is calculated according to equation (7) to be 0.21, and k is written into the register, and the process proceeds to step S11.
And S11, finishing the operation of the equipment.
The embodiment of the application provides a motor driving method based on load, when the starting of equipment is detected, the running speed of a motor is determined through an initial load coefficient and the current running condition of the motor, the load coefficient during the running of the motor is collected, the initial load coefficient of the equipment during the next starting is updated according to the change condition of the load coefficient, the load requirement of the motor under different conditions is met, the running speed of a stepping motor is continuously optimized, and the use loss of the stepping motor is reduced. And when the running speed of the motor is solved, the parameters of the acceleration and deceleration operation model are updated according to the current running state of the motor, so that the running speed of each motor can be adaptively adjusted under the condition of step loss or locked rotor, and the scanning speed and the quality of the digital slice can be improved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a load-based motor driving apparatus according to an embodiment of the present application, and as shown in fig. 4, a load-based motor driving apparatus 400 according to an embodiment of the present application further includes:
a detection module 410 for detecting device activation; acquiring a motor operation instruction and initial operation parameters of each motor, wherein the initial operation parameters comprise a load current balance value and an initial load coefficient;
the acquisition module 420 is configured to, for each motor, solve the operation speed of the motor at preset time intervals according to the initial load coefficient and a preset acceleration/deceleration operation model, acquire a load coefficient of the motor during current operation, and store the load coefficient in a load coefficient array until it is determined that the operation of the motor is finished;
and the driving module 430 is configured to update the initial load coefficient according to a change condition of each load coefficient in the load coefficient array of each motor, and when detecting that the device is started next time, solve the operation speed of each motor according to the updated initial load coefficient to drive the motor to operate.
The embodiment of the present application further provides a digital pathological section scanning system (not shown in the figure), which includes a plurality of stepping motors and the above-mentioned motor driving device based on load, and the digital pathological section scanning system includes a plurality of stepping motors, and the motor driving device adaptively adjusts the operating speed of each motor according to the initial load factor and the current operating state of the motor, so as to meet the load requirements of the motor under different conditions.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims (10)
1. A method of load-based motor driving, comprising:
starting the detection equipment; acquiring a motor operation instruction and initial operation parameters of each motor, wherein the initial operation parameters comprise a load current balance value and an initial load coefficient;
aiming at each motor, solving the running speed of the motor at preset time intervals according to the initial load coefficient and a preset acceleration and deceleration operation model, collecting the load coefficient of the motor in the current running process, and storing the load coefficient in a load coefficient array until the motor is judged to be finished running;
and updating the initial load coefficient according to the change condition of each load coefficient in the load coefficient array of each motor, and solving the running speed of each motor according to the updated initial load coefficient when the next starting of the equipment is detected to drive the motor to run.
2. The load-based motor driving method of claim 1, further comprising, before acquiring the motor operation commands and the initial operation parameters of the respective motors:
acquiring the running times, the optimization period and the optimization times of equipment;
judging whether the current equipment needs to optimize the motor speed or not, and clearing the running times of the equipment when judging that the current equipment needs to optimize the motor speed, so that the optimization times are increased.
3. The load-based motor driving method of claim 1, wherein the motor operation command includes a target speed and a total pulse number, and the initial operation parameters further include an initial speed; solving the running speed of the motor by the following method:
acquiring the current movement time of a motor and a preset acceleration and deceleration operation model;
initializing parameters of the acceleration and deceleration operation model, wherein the parameters comprise: the pulse number of the accelerated motion, the running pulse number, the total motion time, the state switching time in the accelerated motion process, the time for switching the uniform speed state to the deceleration state and the state switching time in the deceleration motion process;
determining the difference between the total pulse number and the running pulse number, and judging the current motion stage of the motor according to the comparison result of the difference and the pulse number of the accelerated motion;
solving the running speed of the motor in the current motion stage according to the initial load coefficient and the deceleration operation model;
and updating parameters of the acceleration and deceleration operation model according to the initial speed, the target speed and the running speed of the motor in the current motion stage.
4. The load-based motor driving method of claim 3, wherein it is determined that the motor is currently in an acceleration or uniform speed stage when the difference between the total number of pulses and the number of operation pulses is greater than the number of pulses for acceleration movement;
or when the difference between the total pulse number and the running pulse number is equal to the pulse number of the accelerated motion, judging that the motor is switched from the constant speed state to the deceleration state, and recording the current running time;
or when the difference between the total pulse number and the running pulse number is smaller than the pulse number of the acceleration motion, judging that the motor motion is in a deceleration stage;
alternatively, when the total pulse number is equal to the running pulse number, it is determined that the motor running is ended.
5. The load-based motor driving method of claim 4, wherein the motion phases include an acceleration phase, an acceleration and deceleration phase, a uniform velocity phase, a deceleration and acceleration phase, and a deceleration and deceleration phase; the updating of the parameters of the acceleration and deceleration operation model according to the initial speed, the target speed and the running speed of the motor in the current motion stage comprises the following steps:
determining the intermediate speed of the motor in the motion process according to the target speed and the initial speed of the motor;
when the pulse number of the accelerated motion is equal to the running pulse number and the running speed of the motor in the current motion stage is equal to the intermediate speed, judging that the motion of the motor is switched from the acceleration stage to the acceleration stage, and recording the current running time as the state switching time in the accelerated motion process;
or when the motor motion is in a deceleration stage and the running speed of the motor in the current motion stage is equal to the intermediate speed, judging that the motor motion is switched from the deceleration stage to the deceleration stage, and recording the current running time as the state switching time in the deceleration motion process.
6. The load-based motor driving method as claimed in claim 1, wherein the initial load factor is updated according to a comparison result between the load factor mean value and the load current balance value, by obtaining a load factor mean value according to a mean value of each load factor in the load factor array of each motor.
7. The load-based motor driving method of claim 6, wherein a value range of the load coefficient mean is determined according to the load current balance value and a preset proportionality coefficient; if the average value of the load coefficients falls into the value range, the speed of the motor does not need to be optimized; otherwise, the initial load factor is updated.
9. A load-based motor drive, comprising:
the detection module is used for detecting the starting of equipment; acquiring a motor operation instruction and initial operation parameters of each motor, wherein the initial operation parameters comprise a load current balance value and an initial load coefficient;
the acquisition module is used for solving the running speed of each motor according to the initial load coefficient and a preset acceleration and deceleration operation model at intervals of preset time, acquiring the load coefficient of the motor in the current running process, and storing the load coefficient in a load coefficient array until the motor is judged to finish running;
and the driving module is used for updating the initial load coefficient according to the change condition of each load coefficient in the load coefficient array of each motor, solving the running speed of each motor according to the updated initial load coefficient when the next starting of the equipment is detected, and driving the motor to run.
10. A digital pathological section scanning system comprising a stepper motor and the load-based motor drive of claim 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210668157.6A CN114977912A (en) | 2022-06-14 | 2022-06-14 | Load-based motor driving method and device and digital pathological section scanning system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210668157.6A CN114977912A (en) | 2022-06-14 | 2022-06-14 | Load-based motor driving method and device and digital pathological section scanning system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114977912A true CN114977912A (en) | 2022-08-30 |
Family
ID=82961727
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210668157.6A Pending CN114977912A (en) | 2022-06-14 | 2022-06-14 | Load-based motor driving method and device and digital pathological section scanning system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114977912A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115581617A (en) * | 2022-10-21 | 2023-01-10 | 海南先端医疗科技有限公司 | Electric acupuncture therapeutic instrument system capable of intelligently simulating manual twisting, lifting and inserting |
-
2022
- 2022-06-14 CN CN202210668157.6A patent/CN114977912A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115581617A (en) * | 2022-10-21 | 2023-01-10 | 海南先端医疗科技有限公司 | Electric acupuncture therapeutic instrument system capable of intelligently simulating manual twisting, lifting and inserting |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114977912A (en) | Load-based motor driving method and device and digital pathological section scanning system | |
CN106060380B (en) | A kind of linkage camera control system and control method | |
CN108227756B (en) | High-precision valve control method | |
US5008607A (en) | Driving system for stepping motor | |
CN111795198A (en) | Method for realizing motion controllability of valve core of high-speed switch valve based on speed controller | |
CN110147039B (en) | Hydraulic servo system and control device thereof | |
CN112923115A (en) | Electric actuator and positioning control method thereof, valve control system and storage medium | |
CN111262483B (en) | Motor motion control method | |
CN108322112B (en) | Composite motion control method of stepping motor | |
CN109748143A (en) | A kind of reciprocating Multi-stage precise coiling controlling method of electronics | |
EP1267235A2 (en) | Control device for driving and controlling a servomotor | |
EP1809023A2 (en) | Image pickup apparatus and lens position adjustment method | |
CN112865750A (en) | Numerical control system multiplying power change smooth control method and device based on FIR filter | |
US9606517B2 (en) | Actuator control method and actuator control device | |
US6628098B2 (en) | Method for accelerating a control movement in a positioner system with step motors | |
CN110855191A (en) | Synchronous control method for needle cylinder motor and handpiece motor of intelligent glove knitting machine based on sliding mode control | |
CN116275591A (en) | Curved surface laser cutting control method and system based on five-axis cutting robot | |
CN112865627B (en) | Control method and device for stepping motor | |
CN112596529B (en) | Direction-based robot walking speed adjusting method, chip and vision robot | |
CN117724406B (en) | Four-wheel drive mobile platform transverse and longitudinal control calibration method | |
CN114172409B (en) | Double-motor anti-backlash control system | |
CN113458606B (en) | Speed following method of metal surface hardening system based on laser | |
CN115542732B (en) | Acceleration and deceleration track planning method and device for servo motion control system | |
JPH10126671A (en) | Lens controller | |
CN117176008A (en) | Feed-forward current adjusting method, feed-forward current adjusting device, drive control system and readable storage medium |
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 |