CN113939855A - Method and device for realizing motor control based on FPGA - Google Patents
Method and device for realizing motor control based on FPGA Download PDFInfo
- Publication number
- CN113939855A CN113939855A CN202080000627.0A CN202080000627A CN113939855A CN 113939855 A CN113939855 A CN 113939855A CN 202080000627 A CN202080000627 A CN 202080000627A CN 113939855 A CN113939855 A CN 113939855A
- Authority
- CN
- China
- Prior art keywords
- signal
- edge
- time point
- preset
- detected
- 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
Images
Classifications
-
- G—PHYSICS
- G07—CHECKING-DEVICES
- G07D—HANDLING OF COINS OR VALUABLE PAPERS, e.g. TESTING, SORTING BY DENOMINATIONS, COUNTING, DISPENSING, CHANGING OR DEPOSITING
- G07D11/00—Devices accepting coins; Devices accepting, dispensing, sorting or counting valuable papers
-
- G—PHYSICS
- G07—CHECKING-DEVICES
- G07D—HANDLING OF COINS OR VALUABLE PAPERS, e.g. TESTING, SORTING BY DENOMINATIONS, COUNTING, DISPENSING, CHANGING OR DEPOSITING
- G07D11/00—Devices accepting coins; Devices accepting, dispensing, sorting or counting valuable papers
- G07D11/20—Controlling or monitoring the operation of devices; Data handling
- G07D11/22—Means for sensing or detection
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Control Of Electric Motors In General (AREA)
Abstract
A method and a device for realizing motor control based on FPGA (field programmable gate array), wherein the method comprises the following steps: when the preset medium bearing assembly moves towards the preset separation assembly, acquiring a pulse signal generated by the preset detection assembly; sampling the pulse signal according to a preset clock frequency to obtain a sampling signal; when an edge signal is detected from the sampling signal, determining a corresponding edge time point when the edge signal is detected; determining a target time point after a preset time from the edge time point; determining a first level type of the pulse signal detected at the target time point; and controlling the medium bearing component to move towards the separation component by adopting a preset motor according to the edge signal and the first level type. By the embodiment of the invention, the problem that the movement of the medium bearing component to the separation component is stopped in advance due to the pulse waveform jitter of the detection component in the preset time caused by the superposition of the medium hardness action is solved.
Description
The invention relates to the technical field of mobile control, in particular to a method for realizing motor control based on an FPGA and a device for realizing motor control based on the FPGA.
The container for storing the medium often involves the problem of how to separate the medium in the container, and the separation of the medium in the existing container often realizes the technical effect of separating the medium from the container through the friction between the separation component in the container and the medium.
As the medium separates, the original pressing force on the medium is gradually released, and the state of the medium and the separation element exists: tight-loose-no-contact, a state process; and the corresponding detection assembly has a change of shielding-non-shielding, and after the state change of the detection assembly is detected, the medium bearing assembly can bring the medium to move towards the separation assembly. However, under the action of the spring, the state of the detection assembly in the process of non-shielding is superposed due to the hardness of the medium, so that the medium shakes, and the pulse signal of the detection assembly may shake.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are provided to provide a method for implementing motor control based on an FPGA and a corresponding apparatus for implementing motor control based on an FPGA, which overcome or at least partially solve the above problems, and avoid the problem that the movement of a media bearing assembly to a separation assembly is stopped in advance due to the jitter of a pulse waveform of a detection assembly within a preset time caused by the superposition of the action of the hardness of the media through the operation and control technology of the FPGA.
The embodiment of the invention discloses a method for realizing motor control based on an FPGA (field programmable gate array), which comprises the following steps:
when the preset medium bearing assembly moves towards the preset separation assembly, acquiring a pulse signal generated by the preset detection assembly;
sampling the pulse signal according to a preset clock frequency to obtain a sampling signal;
when an edge signal is detected from the sampling signal, determining a corresponding edge time point when the edge signal is detected;
determining a target time point after a preset time from the edge time point;
determining a first level type of the pulse signal detected at the target time point;
and controlling the medium bearing component to move towards the separation component by adopting a preset motor according to the edge signal and the first level type.
Optionally, the sampling signal comprises a first sampling signal and a second sampling signal; the edge signals comprise rising edge signals; the edge time points comprise first edge time points; when an edge signal is detected from the sampling signal, the step of determining a corresponding edge time point when the edge signal is detected includes:
determining a second level type of the second sampled signal when the rising edge signal is detected from the first sampled signal;
when the second level type is a low level, determining a time point at which the rising edge signal is detected as the first edge time point.
Optionally, the sampling signal comprises a first sampling signal and a second sampling signal; the edge signal comprises a falling edge signal; the edge time points comprise second edge time points; when an edge signal is detected from the sampling signal, the step of determining a corresponding edge time point when the edge signal is detected includes:
determining a third level type of the second sampled signal when the falling edge signal is detected from the first sampled signal;
when the third level type is a high level, determining a time point at which the falling edge signal is detected as the second edge time point.
Optionally, the step of controlling, by using a preset motor, the media carrier to move towards the separation assembly according to the edge signal and the first level type includes:
and when the edge signal is the rising edge signal and the first level type is a high level, a preset motor is adopted to stop moving the medium bearing assembly to the separation assembly.
Optionally, the step of controlling, by using a preset motor, the media carrier to move towards the separation assembly according to the edge signal and the first level type includes:
and when the edge signal is the falling edge signal and the first level type is a low level, a preset motor is adopted to stop moving the medium bearing assembly to the separation assembly.
Optionally, the step of controlling the media bearing assembly to move towards the separation assembly by using a preset motor according to the edge signal and the level type further includes:
and when the edge signal is the rising edge signal and the level type is low level, adopting the motor to keep moving the medium bearing component towards the separation component.
Optionally, the step of controlling the media bearing assembly to move towards the separation assembly by using a preset motor according to the edge signal and the level type further includes:
and when the edge signal is the falling edge signal and the level type is high level, keeping moving the medium bearing component towards the separation component by adopting the motor.
The embodiment of the invention also discloses a device for realizing motor control based on the FPGA, which comprises:
the pulse signal acquisition module is used for acquiring a pulse signal generated by the preset detection assembly when the preset medium bearing assembly moves towards the preset separation assembly;
the sampling module is used for sampling the pulse signal according to a preset clock frequency to obtain a sampling signal;
the edge time point determining module is used for determining corresponding edge time points when the edge signals are detected from the sampling signals;
the target time point determining module is used for determining a target time point after preset time from the edge time point;
a first level type determining module, configured to determine a first level type of the pulse signal detected at the target time point;
and the medium bearing component movement control module is used for controlling the medium bearing component to move towards the separation component by adopting a preset motor according to the edge signal and the first level type.
Optionally, the sampling signal comprises a first sampling signal and a second sampling signal; the edge signals comprise rising edge signals; the edge time points comprise first edge time points; the edge time point determining module includes:
a second level type determining module, configured to determine a second level type of the second sampling signal when the rising edge signal is detected from the first sampling signal;
and a first edge time point determining module, configured to determine, when the second level type is a low level, that a time point at which the rising edge signal is detected is the first edge time point.
Optionally, the sampling signal comprises a first sampling signal and a second sampling signal; the edge signal comprises a falling edge signal; the edge time points comprise second edge time points; the edge time point determining module includes:
a third level type determining module, configured to determine a third level type of the second sampling signal when the falling edge signal is detected from the first sampling signal;
and a second edge time point determining module, configured to determine, when the third level type is a high level, that a time point at which the falling edge signal is detected is the second edge time point.
Optionally, the media bearing assembly movement control module comprises:
and the first movement stopping control module is used for stopping moving the medium bearing component to the separation component by adopting a preset motor when the edge signal is the rising edge signal and the first level type is a high level.
Optionally, the media bearing assembly movement control module comprises:
and the second movement stopping control module is used for stopping moving the medium bearing component to the separation component by adopting a preset motor when the edge signal is the falling edge signal and the first level type is a low level.
Optionally, the media carrier assembly movement control module further comprises:
and the first movement control module is used for keeping the medium bearing component to move towards the separation component by adopting the motor when the edge signal is the rising edge signal and the level type is low level.
Optionally, the media carrier assembly movement control module further comprises:
and the second movement control module is used for keeping the medium bearing component to move towards the separation component by adopting the motor when the edge signal is the falling edge signal and the level type is high level.
The embodiment of the invention also discloses electronic equipment which comprises a memory and a processor, wherein the memory stores a computer program, and the computer program is executed by the processor, so that the processor executes the steps of the method for realizing the motor control based on the FPGA.
The embodiment of the invention also discloses a computer program which comprises computer readable codes, and when the computer readable codes run on computing processing equipment, the computing processing equipment is caused to execute the method for realizing the motor control based on the FPGA.
The embodiment of the invention also discloses a computer readable storage medium, wherein the computer program is stored.
The embodiment of the invention has the following advantages: according to the embodiment of the invention, the edge time point of the edge signal in the sampling signal obtained by sampling the pulse signal is determined, so that the first level type of the pulse signal detected at the target time point after the preset time from the edge time point is determined, and whether the media bearing assembly is controlled to move towards the separation assembly is judged according to the edge signal and the first level type. Therefore, the problem that the medium bearing assembly moves towards the separation assembly and stops in advance due to pulse waveform jitter of the detection assembly within preset time caused by superposition of medium hardness is solved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 schematically illustrates a schematic diagram of a media separation configuration within a vessel in accordance with an embodiment of the present invention;
FIG. 2 is a schematic diagram of a signal feedback structure in a media separation process according to an embodiment of the present invention;
FIG. 3 schematically illustrates a waveform of a pulse signal generated by the detection assembly during movement of the media bearing assembly toward the separation assembly in accordance with an embodiment of the present invention;
FIG. 4 is a flow chart that schematically illustrates steps of an embodiment of a method for implementing motor control based on an FPGA, in accordance with an embodiment of the present invention;
FIG. 5 is a flow chart that schematically illustrates steps of an embodiment of a method for implementing motor control based on an FPGA, in accordance with an embodiment of the present invention;
FIG. 6 schematically illustrates a method of detecting a rising edge of a detection assembly in accordance with an embodiment of the present invention;
FIG. 7 is a schematic diagram illustrating a method for obtaining a target time point according to an embodiment of the present invention;
FIG. 8 is a flow chart that schematically illustrates steps of an embodiment of a method for implementing motor control based on an FPGA, in accordance with an embodiment of the present invention;
fig. 9 schematically shows a block diagram of an embodiment of an apparatus for implementing motor control based on an FPGA according to an embodiment of the present invention.
Fig. 10 schematically shows a block diagram of an electronic device for performing a method according to the invention;
fig. 11 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a schematic diagram of a structure for separating media inside a container according to an embodiment of the present invention is schematically shown, including a separation assembly 101, a detection assembly 102, a media carrying assembly 103, and a motor 104; wherein, a separating element 1011 is arranged on the separating component 101.
Wherein the detecting component 102 is used for determining the contact state of the medium and the separating element 101, in one example, the detecting component 102 may be an infrared sensor, and the infrared sensor determines the contact state of the medium and the separating element 101 according to the return of the infrared ray by emitting the infrared ray to the surface of the medium.
The separating element 101 serves to bring the medium out of the container by means of friction and pressing force with the medium.
The medium bearing component 103 can be used for placing the medium on the surface, and the control of the movement of the medium bearing component 103 towards the separation component 101 through the motor 104 can ensure that a certain pressing force is kept between the medium and the separation element 101, so that the separation element 101 can conveniently carry the medium out of the container through friction force.
The container according to the embodiment of the present invention is a container capable of storing media, and includes, but is not limited to, a banknote box for storing banknotes, a bill box for storing bills, and the like. The upper surface of the media bearing assembly 103 may be used for stacking media, and the media bearing assembly 103 may move vertically along the gravity direction or laterally along the horizontal direction in different application scenarios. The separating assembly 101 can rotate around a center point to drive the separating element to rotate, and the separating element can take the medium out of the container through contact friction with the medium.
Referring to fig. 2, a schematic diagram of a signal feedback structure in a media separation process according to an embodiment of the present invention is schematically shown, including a structural component, a spring, a detection component and a media carrying component.
The detection assembly can be arranged at the top of the container and consists of a light-emitting end and a receiving end; the optical path may be formed to obtain occlusion, non-occlusion information according to the optical path.
The structural component may be used for transmission media.
The spring can provide effective resistance to the structural component so that the structural component can transmit the medium.
In practical application, the media bearing assembly moves towards the separation assembly until contacting the structural assembly, and if the media bearing assembly continues to move towards the separation assembly, one side of the structural assembly is squeezed; the structural component moves according to the radian according to the extrusion force, and can extrude the spring, so that the extrusion force between the separating element and the medium is changed. When the spring deforms to a certain degree, the detection assembly can form a light path closed loop, and therefore shielding information is obtained.
The prior art has the disadvantages that, as the medium is separated, the original pressing force on the medium is gradually released, and the medium and the separation element have the following components: tight-loose-no-contact, such a change in state. Correspondingly, there will be a change of blocking-unblocking in the top detection module, and there will be a change of high level-low level in the pulse signal of the detection module (the level change mode of the pulse signal is determined according to the corresponding relationship between the set state and level of the top detection module, and it is assumed that the blocking corresponds to the high level here). After detecting the pulse signal change of the detection component, the medium carrying component can carry the medium to move towards the separation component. However, under the action of the spring, the state of the detection assembly is in the process of no shielding-shielding, the medium shakes due to the superposition of medium hardness, and the pulse signal of the detection assembly may shake, so that a pulse waveform 1 shown in fig. 3 (fig. 3 schematically shows a waveform diagram of the pulse signal generated by the detection assembly in the process of moving the medium bearing assembly to the separation assembly) is generated; this configuration will remain on the order of milliseconds (specific magnitude is associated with spring selection).
Comparing the waveform 1 and the waveform 2, the t0 to tn section of the waveform is a process for detecting the state of the component from non-occlusion to occlusion. The t 1-tn section of the waveform 1 is generated by the vibration of the medium due to the continuous superposition of the hardness of the medium caused by the resistance of the structural component to the medium when the detection component is in the non-shielding state; the moving media bearing assembly should not be stopped during this process, but at tn.
However, in practical applications, when the waveform 1 appears, the high level is sampled from t1 to tn, and the process of moving the media bearing assembly to the separating assembly is stopped in advance, so that the pressing force and the friction force between the separating element and the media are insufficient, and the phenomenon of void occurs.
Based on the above problem, one of the core concepts of the embodiments of the present invention is to provide a method for implementing motor control based on an FPGA, where when an edge signal generated by a detection component is detected during a process of moving a media bearing component to a separation component, timing is performed by a system clock, after a preset time elapses, a level type of pulse information generated by the detection component is detected, and the media bearing component is stopped from moving to the separation component when the edge signal and the level type satisfy a preset condition.
The following is illustrated by specific examples:
referring to fig. 4, a flowchart schematically illustrating steps of an embodiment of a method for implementing motor control based on an FPGA according to an embodiment of the present invention may include the following steps:
in the embodiment of the present invention, the detecting component may be an infrared sensor, and the infrared sensor includes a transmitting end and a receiving end. The sending end can send infrared rays to the medium on the medium bearing assembly, and the receiving end can generate corresponding pulse signals according to the receiving condition of the infrared rays returned by the medium.
In an actual working scenario, since the medium separation process is very fast, the magnitude of the pulse signal collected by the detection component in this process is in the order of milliseconds, and in order to accurately collect the pulse signal, in an example of the present invention, an FPGA (Field-Programmable Gate Array) may be used to collect the pulse signal. The reaction speed of the FPGA can easily reach nanosecond level, and the precision can reach picosecond level, so that pulse signals generated by the detection assembly can be accurately collected.
In the embodiment of the invention, the pulse signal generated by the detection component can be acquired in real time through the FPGA in the process that the medium bearing component moves to the separation component.
after the pulse signal of the detection assembly is acquired, the pulse signal can be sampled once or twice to obtain a sampling signal. Two samplings are typically performed to eliminate metastability during sampling.
Specifically, the pulse signal can be sampled by a system clock generated by an external crystal oscillator source through an on-chip clock management unit to obtain a sampling signal.
when an edge signal is detected from the sampling signal, a time point at which the edge signal is detected may be determined as an edge time point.
For example, when the rising edge at the time t1 in the waveform 1 of fig. 3 is detected, the time t1 is the time point when the edge signal is detected.
and after the edge time point is determined, timing is carried out through a system clock, and a target time point after the timing duration is obtained.
During the timing process, other edge signals generated in the pulse signal, such as the edge signals generated at the time t2 and t3 in fig. 3, can be ignored, so that the problem that the process of moving the medium bearing component to the separation component is stopped in advance due to the fact that the edge signals generated by the medium shaking are detected is avoided.
In embodiments of the invention, the timing duration is such that the target point in time falls after tn, since the target point in time falls before tn may cause the detection of an edge signal resulting from media jitter to prematurely stop the movement of the media carrying member towards the separating member.
The specific value of the timing duration is influenced by mechanical design, for example, the timing duration is influenced by the elasticity of a spring and the installation angle of a detection assembly. Therefore, in practical applications, actual measurements are required. In the embodiment of the present invention, the timing duration takes 1 millisecond.
after the target time point is determined, the first level type of the pulse signal at the target time point may be obtained. The shielding state of the detection assembly at the target time point can be judged according to the first level type, and then the contact state between the separation element and the medium is judged.
And 406, controlling the medium bearing component to move towards the separation component by using the motor according to the edge signal and the first level type.
After determining the contact state between the separating element and the media, a decision can be made whether to stop moving the media carrying assembly.
In an example of the present invention, when the waveform of the pulse signal of the detection assembly is waveform 2 of fig. 3, the time point at which the first edge signal occurs is tn, and as can be seen from the waveform, when the detection assembly enters the shielding state, the moving of the media bearing assembly should be stopped. However, in practice, the media carrier assembly will continue to move the timed length of distance at this point.
Moving the model v according to the media bearing assemblyn=s unit/(t unit±(32*n/1000))
Wherein s isunit: a unit displacement amount;
t unit: consuming unit displacement no-load time;
n: the number of standard media placed on the media bearing assembly is counted;
it is known that in the case of no load and full load, the displacement unit of 1 millisecond is less than 1 millimeter, and the separating element is not sufficient to cause an excessive pressing force on the medium. The normal separation of the medium is not affected. Therefore, even in the case where the waveform 2 appears, normal medium separation can be performed.
The embodiment of the invention determines the first level type of the pulse signal detected at a target time point after preset time from the edge time point by determining the edge time point of the edge signal in the sampling signal obtained by sampling the pulse signal, so as to judge whether to control the media bearing component to move according to the edge signal and the first level type. Therefore, the problem that the movement of the medium bearing component is stopped in advance due to the pulse waveform jitter of the detection component in the preset time caused by the superposition of the medium hardness action is solved.
Referring to fig. 5, a flowchart schematically illustrates steps of an embodiment of a method for implementing motor control based on an FPGA according to an embodiment of the present invention, where in the embodiment of the present invention, when a pulse signal is at a high level, it indicates that a detection component is in a shielding state. When the rising edge signal in the sampling signal is detected, the detection component enters an occlusion state. The method specifically comprises the following steps:
in the embodiment of the present invention, the detection component may be an infrared detection component, and the infrared detection component includes a sending end and a receiving end. The sending end can send infrared rays to the medium on the medium bearing assembly, and corresponding pulse signals are generated according to the receiving condition of the infrared rays returned by the medium by the receiving end.
In an actual working scene, the medium separation process is very fast, the magnitude of the pulse signal acquired by the detection assembly in the process is millisecond level, and in order to accurately acquire the pulse signal, in one example of the invention, the pulse signal can be acquired by adopting an FPGA. The reaction speed of the FPGA can easily reach nanosecond level, and the precision can reach picosecond level, so that pulse signals generated by the detection assembly can be accurately collected.
In the embodiment of the invention, the pulse signal generated by the detection component can be acquired in real time through the FPGA in the process that the medium bearing component moves to the separation component.
after the pulse signal of the detection assembly is acquired, the pulse signal can be sampled once or twice to obtain a sampling signal. Two samplings are typically performed to eliminate metastability during sampling.
Specifically, the pulse signal can be sampled by a system clock generated by an external crystal oscillator source through an on-chip clock management unit to obtain a sampling signal.
when a rising edge signal is detected from the first sampled signal, a second level type of the second sampled signal may be simultaneously obtained to eliminate meta-stability during sampling based on the second sampled signal.
when the second level type is a low level, a time point at which the rising edge signal is detected may be determined as a first edge time point.
Referring to fig. 6, a schematic diagram of a method for detecting a rising edge of a detection component according to an embodiment of the present invention is schematically shown.
As shown in fig. 6, the pulse signal of the detection component is sampled twice according to the system clock, and a first sampling signal and a second sampling signal are obtained respectively.
After the first sampling signal and the second sampling signal are obtained, the rising edge of the first sampling signal is determined, and the time point of the second sampling signal which is at low level is determined as the time point of the rising edge of the pulse signal of the detection assembly, so that the waveform diagram of the rising edge signal of the pulse signal of the detection assembly is generated.
and after the first edge time point is determined, timing by a system clock to obtain a target time point after the timing duration.
after the target time point is determined, the first level type of the pulse signal at the target time point may be obtained. The shielding state of the detection assembly at the target time point can be judged according to the first level type, and then the contact state between the separation element and the medium is judged.
As shown in fig. 7, a schematic diagram of a method for acquiring a target time point according to an embodiment of the present invention is schematically shown, and as shown in fig. 7, after a first rising edge signal is detected, timing is performed, the rising edge signal detected after the timing starts is ignored within a preset time, and when the timing ends, a pulse signal of a detection component is acquired again.
when the rising edge signal is detected in the sampling signal and the level type of the pulse signal at the target time point is high level, the state of the detection component is proved to be changed from the non-shielding state to the shielding state, and at the moment, the medium bearing component needs to be stopped moving to the separation component.
And step 508, when the edge signal is the rising edge signal and the level type is low level, keeping moving the medium bearing component to the separation component by using the motor.
When a rising edge signal is detected in the sampling signal and the level type of the pulse signal at the target time point is low level, it is proved that the detection component is still in the non-shielding state, and the medium bearing component needs to be moved to the separation component continuously.
The embodiment of the invention determines the first level type of the pulse signal detected by the target time point after the preset time from the edge time point by determining the edge time point of the edge signal in the sampling signal obtained by sampling the pulse signal, so as to judge whether to control the medium bearing component to move to the separation component according to the edge signal and the first level type. Therefore, the problem that the moving process of the medium bearing assembly to the detection assembly is stopped in advance due to pulse waveform jitter of the detection assembly within preset time caused by superposition of medium hardness is solved.
Referring to fig. 8, a flowchart schematically illustrates a step of an embodiment of a method for implementing motor control based on an FPGA according to an embodiment of the present invention, where in the embodiment of the present invention, when a pulse signal is at a low level, it indicates that a detection component is in a shielding state. When the falling edge signal in the sampling signal is detected, the detection component enters an occlusion state. The method specifically comprises the following steps:
in the embodiment of the invention, the pulse signal generated by the detection component can be acquired in real time through the FPGA in the process that the medium bearing component moves to the separation component.
after the pulse signal of the detection assembly is acquired, the pulse signal can be sampled once or twice to obtain a sampling signal. Two samplings are typically performed to eliminate metastability during sampling.
Specifically, the pulse signal can be sampled by a system clock generated by an external crystal oscillator source through an on-chip clock management unit to obtain a sampling signal.
when a falling edge signal is detected from the first sampled signal, a third level type of the second sampled signal may be simultaneously obtained to eliminate a metastable state during sampling according to the second sampled signal.
when the second level type is a low level, a point of time at which the falling edge signal is detected may be determined as a second edge point of time.
and after the second edge time point is determined, timing is carried out through a system clock, and a target time point after the timing duration is obtained.
after the target time point is determined, the first level type of the pulse signal at the target time point may be obtained. The shielding state of the detection assembly at the target time point can be judged according to the first level type, and then the contact state between the separation element and the medium is judged.
Step 807 of stopping moving the media bearing assembly within the receptacle toward the separating assembly when the edge signal is the falling edge signal and the first level type is low;
when the falling edge signal is detected in the sampling signal and the level type of the pulse signal at the target time point is low level, the state of the detection component is proved to be changed from the non-shielding state to the shielding state, and at this time, the medium bearing component needs to be stopped moving to the separation component.
When the falling edge signal is detected in the sampling signal and the level type of the pulse signal at the target time point is high level, the detection component is proved to be still in the non-shielding state, and the medium bearing component needs to be continuously moved to the separation component.
According to the embodiment of the invention, the edge time point of the edge signal in the sampling signal obtained by sampling the pulse signal is determined, so that the first level type of the pulse signal detected at the target time point after the preset time from the edge time point is determined, and whether the media bearing assembly is controlled to move towards the separation assembly is judged according to the edge signal and the first level type. Therefore, the problem that the movement of the medium bearing assembly to the detection assembly is stopped in advance due to the pulse waveform jitter of the detection assembly within the preset time caused by the superposition of the medium hardness action is solved.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 9, a block diagram schematically illustrates a structural diagram of an embodiment of an apparatus for implementing motor control based on an FPGA according to an embodiment of the present invention, which may specifically include the following modules:
a pulse signal acquiring module 901, configured to acquire a pulse signal generated by a preset detection component when the preset media bearing component moves towards the preset separation component;
the sampling module 902 is configured to sample the pulse signal according to a preset clock frequency to obtain a sampling signal;
an edge time point determining module 903, configured to determine, when an edge signal is detected from the sampling signal, an edge time point corresponding to the detected edge signal;
a target time point determining module 904, configured to determine a target time point after a preset time from the edge time point;
a first level type determining module 905, configured to determine a first level type of the pulse signal detected at the target time point;
a media support movement control module 906, configured to control, according to the edge signal and the first level type, a preset motor to move the media support toward the separation assembly.
In an embodiment of the present invention, the sampling signal includes a first sampling signal and a second sampling signal; the edge signals comprise rising edge signals; the edge time points comprise first edge time points; the edge time point determining module may include:
a second level type determining module, configured to determine a second level type of the second sampling signal when the rising edge signal is detected from the first sampling signal;
and a first edge time point determining module, configured to determine, when the second level type is a low level, that a time point at which the rising edge signal is detected is the first edge time point.
In an embodiment of the present invention, the sampling signal includes a first sampling signal and a second sampling signal; the edge signal comprises a falling edge signal; the edge time points comprise second edge time points; the edge time point determining module may include:
a third level type determining module, configured to determine a third level type of the second sampling signal when the falling edge signal is detected from the first sampling signal;
and a second edge time point determining module, configured to determine, when the second level type is a high level, that a time point at which the falling edge signal is detected is the second edge time point.
In an embodiment of the present invention, the media support assembly movement control module may include:
and the first movement stopping control module is used for stopping moving the medium bearing component to the separation component by adopting a preset motor when the edge signal is the rising edge signal and the first level type is a high level.
In an embodiment of the present invention, the media support assembly movement control module may include:
and the second movement stopping control module is used for stopping moving the medium bearing component to the separation component by adopting a preset motor when the edge signal is the falling edge signal and the first level type is a low level.
In an embodiment of the present invention, the moving the control module to the separation component may further include:
and the first movement control module is used for keeping the medium bearing component to move towards the separation component by adopting the motor when the edge signal is the rising edge signal and the level type is low level.
In an embodiment of the present invention, the media support assembly movement control module may further include:
and the second movement control module is used for keeping the medium bearing component to move towards the separation component by adopting the motor when the edge signal is the falling edge signal and the level type is high level.
The embodiment of the invention also discloses electronic equipment which comprises a memory and a processor, wherein the memory stores a computer program, and the computer program is executed by the processor, so that the processor executes the steps of the method for realizing the motor control based on the FPGA.
The embodiment of the invention also discloses a computer program which comprises computer readable codes, and when the computer readable codes are run on computing processing equipment, the computing processing equipment is caused to execute the method for realizing the motor control based on the FPGA according to any one of the embodiments of the invention.
The embodiment of the invention also discloses a computer readable storage medium, wherein the computer program is stored. The computer-readable recording medium includes any mechanism for storing or transmitting information in a form readable by a computer (e.g., a computer). For example, a machine-readable medium includes Read Only Memory (ROM), Random Access Memory (RAM), magnetic disk storage media, optical storage media, flash memory media, electrical, optical, acoustical or other form of propagated signals (e.g., carrier waves, infrared signals, digital signals, etc.), and others.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in a computing processing device according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
For example, FIG. 10 illustrates a computing processing device in which a method in accordance with the present invention may be implemented. The computing processing device conventionally includes a processor 1010 and a computer program product or computer-readable medium in the form of a memory 1020. The memory 1020 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. The memory 1020 has a storage space 1030 for program code 1031 for performing any of the method steps of the above-described method. For example, the storage space 1030 for program code may include respective program code 1031 for implementing various steps in the above method, respectively. The program code can be read from or written to one or more computer program products. These computer program products comprise a program code carrier such as a hard disk, a Compact Disc (CD), a memory card or a floppy disk. Such a computer program product is typically a portable or fixed storage unit as described with reference to fig. 11. The memory unit may have memory segments, memory spaces, etc. arranged similarly to the memory 1020 in the computing processing device of fig. 10. The program code may be compressed, for example, in a suitable form. Typically, the memory unit comprises computer readable code 1031', i.e. code that can be read by a processor, such as 1010, for example, which when executed by a computing processing device causes the computing processing device to perform the steps of the method described above.
Reference herein to "one embodiment," "an embodiment," or "one or more embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention. Moreover, it is noted that instances of the word "in one embodiment" are not necessarily all referring to the same embodiment.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (11)
- A method for realizing motor control based on FPGA is characterized by comprising the following steps:when the preset medium bearing assembly moves towards the preset separation assembly, acquiring a pulse signal generated by the preset detection assembly;sampling the pulse signal according to a preset clock frequency to obtain a sampling signal;when an edge signal is detected from the sampling signal, determining a corresponding edge time point when the edge signal is detected;determining a target time point after a preset time from the edge time point;determining a first level type of the pulse signal detected at the target time point;and controlling the medium bearing component to move towards the separation component by adopting a preset motor according to the edge signal and the first level type.
- The method of claim 1, wherein the sampled signal comprises a first sampled signal and a second sampled signal; the edge signals comprise rising edge signals; the edge time points comprise first edge time points; when an edge signal is detected from the sampling signal, the step of determining a corresponding edge time point when the edge signal is detected includes:determining a second level type of the second sampled signal when the rising edge signal is detected from the first sampled signal;when the second level type is a low level, determining a time point at which the rising edge signal is detected as the first edge time point.
- The method of claim 1, wherein the sampled signal comprises a first sampled signal and a second sampled signal; the edge signal comprises a falling edge signal; the edge time points comprise second edge time points; when an edge signal is detected from the sampling signal, the step of determining a corresponding edge time point when the edge signal is detected includes:determining a third level type of the second sampled signal when the falling edge signal is detected from the first sampled signal;when the third level type is a high level, determining a time point at which the falling edge signal is detected as the second edge time point.
- The method of claim 1 or 2, wherein the step of controlling the movement of the media carrier assembly toward the separation assembly with a preset motor based on the edge signal and the first level type comprises:and when the edge signal is the rising edge signal and the first level type is a high level, a preset motor is adopted to stop moving the medium bearing assembly to the separation assembly.
- The method of claim 1 or 3, wherein the step of controlling the movement of the media carrier assembly toward the separation assembly with a preset motor based on the edge signal and the first level type comprises:and when the edge signal is the falling edge signal and the first level type is a low level, a preset motor is adopted to stop moving the medium bearing assembly to the separation assembly.
- The method of claim 4, wherein the step of controlling the media carrier assembly to move toward the separation assembly using a preset motor based on the edge signal and the level type further comprises:and when the edge signal is the rising edge signal and the level type is low level, adopting the motor to keep moving the medium bearing component towards the separation component.
- The method of claim 5, wherein the step of controlling the media carrier assembly to move toward the separation assembly using a preset motor based on the edge signal and the level type further comprises:and when the edge signal is the falling edge signal and the level type is high level, keeping moving the medium bearing component towards the separation component by adopting the motor.
- The device for realizing motor control based on the FPGA is characterized by comprising the following components:the pulse signal acquisition module is used for acquiring a pulse signal generated by the preset detection assembly when the preset medium bearing assembly moves towards the preset separation assembly;the sampling module is used for sampling the pulse signal according to a preset clock frequency to obtain a sampling signal;the edge time point determining module is used for determining corresponding edge time points when the edge signals are detected from the sampling signals;the target time point determining module is used for determining a target time point after preset time from the edge time point;a first level type determining module, configured to determine a first level type of the pulse signal detected at the target time point;and the medium bearing component movement control module is used for controlling the medium bearing component to move towards the separation component by adopting a preset motor according to the edge signal and the first level type.
- An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of the FPGA-based motor control method of any one of claims 1-7.
- A computer program comprising computer readable code which, when run on a computing processing device, causes the computing processing device to perform an FPGA-based implementation motor control method according to any one of claims 1-7.
- A computer-readable medium, in which a computer program according to claim 10 is stored.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2020/087674 WO2021217471A1 (en) | 2020-04-29 | 2020-04-29 | Fpga-based method and apparatus for implementing motor control |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113939855A true CN113939855A (en) | 2022-01-14 |
Family
ID=78373270
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202080000627.0A Pending CN113939855A (en) | 2020-04-29 | 2020-04-29 | Method and device for realizing motor control based on FPGA |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113939855A (en) |
WO (1) | WO2021217471A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115389856B (en) * | 2022-10-27 | 2023-01-06 | 季华实验室 | Signal change edge detection method, device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102262378A (en) * | 2010-05-26 | 2011-11-30 | 富士施乐株式会社 | Image forming apparatus, control device, detecting method of reference index on transfer body |
CN105654612A (en) * | 2016-01-05 | 2016-06-08 | 新达通科技股份有限公司 | ATM banknote sorting device and ATM banknote sorting system capable of accurately controlling banknote sorting process |
CN206133778U (en) * | 2016-10-26 | 2017-04-26 | 深圳市信通检测技术有限公司 | Counting currency machine testing arrangement |
CN107689101A (en) * | 2017-07-26 | 2018-02-13 | 深圳怡化电脑股份有限公司 | A kind of cash box tongue piece localization method, device and terminal device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6174407B2 (en) * | 2013-07-24 | 2017-08-02 | 富士通コンポーネント株式会社 | Printing apparatus and mark detection method |
CN104658100B (en) * | 2015-02-03 | 2017-06-30 | 深圳怡化电脑股份有限公司 | Bank note rolling wheel formula temporary storage part bank note method for detecting residue, device and ATM |
-
2020
- 2020-04-29 CN CN202080000627.0A patent/CN113939855A/en active Pending
- 2020-04-29 WO PCT/CN2020/087674 patent/WO2021217471A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102262378A (en) * | 2010-05-26 | 2011-11-30 | 富士施乐株式会社 | Image forming apparatus, control device, detecting method of reference index on transfer body |
CN105654612A (en) * | 2016-01-05 | 2016-06-08 | 新达通科技股份有限公司 | ATM banknote sorting device and ATM banknote sorting system capable of accurately controlling banknote sorting process |
CN206133778U (en) * | 2016-10-26 | 2017-04-26 | 深圳市信通检测技术有限公司 | Counting currency machine testing arrangement |
CN107689101A (en) * | 2017-07-26 | 2018-02-13 | 深圳怡化电脑股份有限公司 | A kind of cash box tongue piece localization method, device and terminal device |
Also Published As
Publication number | Publication date |
---|---|
WO2021217471A1 (en) | 2021-11-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2407943A1 (en) | Method for event initiated video capturing and a video camera for capture event initiated video | |
RU2672769C2 (en) | Method and device for monitoring a circuit breaker | |
CN113939855A (en) | Method and device for realizing motor control based on FPGA | |
WO2022061472A1 (en) | Systems and methods for waste management | |
CN105472231B (en) | Control method, image collecting device and electronic equipment | |
US9984381B2 (en) | Managing customer interactions with a product being presented at a physical location | |
CN113189664B (en) | Object placing state detection method and device | |
CN108900834B (en) | A kind of high speed camera time for exposure and lose frame measuring device and method | |
GB2533366A (en) | Methods of controlling document display devices and document display devices | |
CN104215966A (en) | Terminal ranging method | |
CN112752100B (en) | Method and device for determining video integrity and readable storage medium | |
US20230266509A1 (en) | Removal of liquid drops from optical element | |
CN111887749B (en) | Material cup returning method, storage medium and kitchen equipment | |
CN113939854A (en) | Method and device for realizing motor control based on FPGA | |
EP2929328B1 (en) | Counting gemstones using image processing | |
CN113299003B (en) | Method and device for adjusting medium bearing assembly | |
CN113268016B (en) | Method and device for realizing motor control based on FPGA | |
CN113299002B (en) | Method and device for adjusting medium bearing assembly | |
CN113284289B (en) | Method and device for initializing position of medium bearing assembly | |
CN113496569A (en) | Vending machine, vending machine detection method and vending machine detection device | |
US9082447B1 (en) | Determining storage media substrate material type | |
CN113284290B (en) | Method and device for realizing motor control based on FPGA | |
CN115081562B (en) | Equipment state judging method and device, storage medium and electronic device | |
CN106027885B (en) | Electronic device method and device, first electronic device and second electronic device | |
CN113284288B (en) | Method and device for adjusting medium bearing assembly |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220114 |
|
RJ01 | Rejection of invention patent application after publication |