The present invention relates to the technical field of swing control of swing chairs, and in particular, to a swing control method for a swing dining chair, a swing chair or a swing bed, and to a swing control apparatus.
In recent years, swing dining chairs, swing chairs, and swing beds for children have developed rapidly.
However, the high-performance swing control technology patents in the United States and Europe have been controlled by the American company KIDS II, which has controlled the American baby swing market for a long time with its core patent U.S. Pat. No. 7,905,791 B2 due to high control accuracy and low production costs. On the basis of the structure shown in the invalid patent U.S. Pat. No. 6,339,304 B1 of Graco, an improvement can be made to a control algorithm to eliminate the defect of low accuracy of the original algorithm, thereby achieving a swing performance comparable to that in the patent of KIDS II to enter the American market.
An objective of the present invention is to overcome the shortcomings of the prior art, provide a swing control method, and solve the technical problem in the prior art of insufficient accuracy of swing control algorithms for children swings.
In order to solve the technical problem above, the present invention provides the following technical solutions.
In a first aspect, the present invention also provides a swing control method, including the following steps:
Optionally, the detecting the time when blocked or opening parts of gratings pass through photoelectric sensors includes: calculating, by a timer, the pulse time generated on the photoelectric sensors by the blocked or opening parts of the gratings when the gratings move.
Optionally, the detecting a current swing direction includes:
Optionally, the when the minimum time value is not equal to the preset time value, generating a control signal for adjusting an output power of a motor so that the swing amplitude reaches the preset swing amplitude so that the swing amplitude reaches includes:
In a second aspect, the present invention also provides a swing dining chair. The swing of the swing dining chair is controlled using the swing control method.
In a third aspect, the present invention also provides a swing chair. The swing of the swing chair is controlled using the swing control method.
In a fourth aspect, the present invention also provides a swing bed. The swing of the swing bed is controlled using the swing control method.
In a fifth aspect, the present invention provides a swing control apparatus, including a controller, a motor, swing time detectors, and swing direction detectors.
The swing time detectors are configured to detect the time when blocked or opening parts of gratings pass through photoelectric sensors.
The swing direction detectors are configured to detect a current swing direction.
The controller is configured to compare a minimum time value with a time value corresponding to a preset swing amplitude in each swing cycle, when the minimum time value is not equal to a preset time value, generate a control signal for adjusting an output power of a motor so that the swing amplitude reaches a preset swing amplitude, and determine whether a current swing direction changes, and if the current swing direction changes, generate a control signal for adjusting the output power of the motor for co-direction supplementary augmentation.
Optionally, the swing time detectors include photoelectric sensor and a timer, and the pulse time generated on the photoelectric sensors by the blocked or opening parts of the gratings when the gratings move is calculated by the timer.
Optionally, the swing direction detectors are dual photoelectric sensors; the dual photoelectric sensors are respectively disposed on two sides of a grating disc and respectively denoted as a photoelectric sensor A and a photoelectric sensor B, and the forward or reverse direction of swing is determined through a phase relationship of signals of the dual photoelectric sensors A and B.
Compared with the prior art, the present invention achieves the following beneficial effect: in the present invention, the movement speed of a spindle is calculated according to the pulse time generated on the dual photoelectric sensors when the spindle gratings move, and a drive power of a motor is adjusted by comparing with a preset value and changing a PWM value, and the linearity of the swing is controlled to be smoother, thereby effectively solving the problem of insufficient accuracy. In addition, performing forward and reverse co-direction supplementary augmentation according to the swing direction can correct the swing power in advance so that the swing reaches a preset requirement.
1. support frame; 2. swing control apparatus; 3. hanging bracket; 4. seat; 5. disc member; 6. grating disc; 7. photoelectric sensor; 8. controller; 9. motor; 10. timer
The present invention is further described below in conjunction with the accompanying drawings. The following embodiments are only for illustrating the technical solutions of the present invention more clearly, and cannot be construed to limit the scope of protection of the present invention.
In the prior art, the swing speed of a swing is generally controlled by calculating the number of gratings (or the number of teeth). Because a grating disc is not disposed on a motor shaft, but on an output shaft, and the rotation speed of the output shaft is very small, only one tooth or two teeth pass. The accuracy of such control is very poor, and it cannot meet the requirements of accurate control of the swing speed.
The structure of a children's swing dining chair is shown in
A swing control method of the present invention, as shown in
At step 1, a timing module is initialized, and the PWM is initialized; and a timer 10 in the timing module is used for timing, and PWM waves are used for adjusting a motor drive power.
At step 2, input values of photoelectric sensors are read, a set time value is read, and the set value is calculated according to a swing amplitude requirement on a swing in actual use.
Photoelectric sensors in the prior art are used for collecting the speed and movement direction of the swing. A light source is provided on one side of the grating disc 6, and two photoelectric sensors 7 are placed at opposite ends of the grating disc 6, and are respectively denoted as a photoelectric sensor A and a photoelectric sensor B.
When the motor 9 drives the swing movement, the grating disc 6 is driven to swing between the light source and the photoelectric sensors 7. The photoelectric sensors output feature signals that characterize whether the gratings are blocked. For example, when the gratings are not blocked (corresponding to ON), high-level pulses are generated on the photoelectric sensors, and the time intervals corresponding to the OFF, ON, and OFF of the grating disc output by the photoelectric sensors are recorded.
In the present invention, the movement speed of a motor spindle, i.e., the speed of the swing, is calculated by the pulse time generated on (any) photoelectric sensor when the spindle grating moves.
Signals of the photoelectric sensor A and the photoelectric sensor B disposed at two ends of the grating disc are collected. The movement direction of the swing is determined according to the phase signals of the dual photoelectric sensors A and B. If a sensor A first detects resistance grids of the grating disc, the phase relationship is AB-AB-AB, and it can be determined that the swing swings from A to B, a forward direction. If the sensor B first detects resistance grids of the grating disc, the phase relationship is BA-BA-BA, and it can be determined that the swing direction is from B to A, a reverse direction.
At step 3, whether input values of the photoelectric sensors change is determined, and if not, step 4 is proceeded, and if yes, step 5 is proceeded.
A change in the input value of the photoelectric sensor indicates that the motor drive power is greater than a friction force, and no change indicates that the motor drive power is less than the friction force.
At step 4, if the time counter is increased by 1, execution is restarted from step 2.
At step 5, the time counter is stored, and then the time counter is cleared.
At step 6, the minimum time value is selected to compare with a preset time value (corresponding a preset swing amplitude);
In the present invention, the minimum time value is selected as the basis for determining an instantaneous swing speed, that is, it is considered that when the lowest point is reached, the time interval for passing gratings is the shortest and the swing speed is the fastest. The motor drive power is adjusted timely so that the swing chair can reach a set swing amplitude.
At step 7, a new swing cycle is calculated, and a new PWM parameter is calculated; and step 8 is proceeded.
The swing cycle is calculated by an A/B reversing time difference detected by the dual photoelectric sensors.
A PWM control signal for adjusting the output power of the motor 9 is generated so that the swing amplitude reaches the preset swing amplitude.
When the minimum time value is less than the preset time value, a PWM signal for reducing the output power of the motor 9 is generated.
When the minimum time value is greater than the preset time value, a PWM signal for increasing the output power of the motor 9 is generated.
At step 8, whether the swing direction changes is determined, if not, execution is restarted from step 2, and if yes, step 9 is proceeded.
An MCU determines the forward or reverse direction of the swing by reading a signal phase difference between the dual photoelectric sensors A and B. When the swing chair reaches the highest point, the movement direction changes, and forward and reverse co-direction supplementary augmentation is performed according to the swing direction,
At step 9, a new swing cycle is calculated, and a new PWM parameter is calculated. A PWM control signal for adjusting the output power of the motor 9 is generated for co-direction supplementary augmentation.
Because the swing cycle may change at any time when the swing is subject to external force or wind resistance, etc. in operation, the cycle needs to be recalculated for each swing cycle. The swing frequency is controlled to be equal to the eigen frequency of the swing. A PWM control signal for adjusting the output power of the motor 9 is generated for co-direction supplementary augmentation.
In the present invention, the swing speed (i.e., the amplitude) of the swing is controlled by calculating a value of the time for passing by a grating, thereby improving the control accuracy, and effectively solving the problem of insufficient accuracy. In addition, performing forward and reverse co-direction supplementary augmentation according to the swing direction can correct the swing power in advance so that the swing reaches a preset requirement.
The swing control method is applicable to the children's swing dining chairs, swing beds, swing chairs, etc. in the prior art.
The swing time detectors are configured to monitor the pulse time generated on the dual photoelectric sensors when a single grating moves. The swing time detectors includes the dual photoelectric sensors and timer 10, the dual photoelectric sensors includes the photoelectric sensor A and the photoelectric sensor B (reference to
The swing direction detectors are configured to monitor a current swing direction. The swing direction detectors includes the dual photoelectric sensors, the dual photoelectric sensors includes the photoelectric sensor A and the photoelectric sensor B (reference to
The controller 8 is configured to compare a minimum swing time value with a time value corresponding to a preset swing amplitude in each swing cycle, and when the two values are not equal, generate a control signal for adjusting an output power of a motor 9, determine whether a current swing direction changes, and when the current swing direction changes, generate a control signal for adjusting the output power of the motor 9.
A timer 10 calculates the time from a rising edge to a falling edge of the pulse as the time for the swing passing a grating, and then the speed of the swing is calculated through the time value. In the present invention, the minimum time value is selected to calculate the movement speed of the swing at the highest point, and the motor drive power is adjusted timely to reach a set swing amplitude.
Upon swing to the highest point, the swing is reversed under the action of gravity. The controller 8 determines the forward or reverse direction of the swing by reading the phases of dual photoelectric sensor tubes A and B and performs forward and reverse co-direction supplementary augmentation according to the determined direction.
In the present invention, the swing speed of the swing is controlled by calculating a value of the time for passing a grating, and the time value can be calculated to 0.001 second, thereby improving the control accuracy and effectively solving the problem of insufficient accuracy.
Nowadays, common swing devices include swings and swing chairs. The swing drive control apparatus can be directly used in the swings and swing chairs.
A person skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application may be embodied in the form of complete hardware embodiments, complete software embodiments, or embodiments combining software and hardware. Moreover, the present application may use the form of a computer program product implemented on one or more computer available storage media (including but not limited to a disk memory, a CD-ROM, an optical memory, etc. including computer available program codes.
The present application is described with reference to flowcharts and/or block diagrams of the method, the device (system), and the computer program product according to the embodiments of the present application. It is understood that, each step and/or block in a flowchart and/or a block diagram and the combination of steps and/or blocks in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that an apparatus for implementing functions specified in one or more steps in the flowchart and/or one or more blocks in the block diagram can be generated through the instructions executed by the processor of the computer or other programmable data processing devices.
These computer program instructions can also be stored in a computer readable memory that can guide the computer or other programmable data processing devices to operate in a particular manner, so that the instructions stored in the computer readable memory generate a product including an instruction apparatus, and the instruction apparatus implements the functions specified in one or more steps in the flowchart and/or one or more blocks in the block diagram.
These computer program instructions can also be loaded on the computer or other programmable data processing device to enable the computer or other programmable devices to execute a series of operation steps to perform computer-implemented processing, so that the instructions executed on the computer or other programmable devices provide steps for implementing the functions specified in one or more steps in the flowchart and/or one or more blocks in the block diagram.
The above are only the preferred embodiments of the present invention. It is noted that, for those of ordinary skill in the art, several improvements and modifications can be made without departing from the technical principle of the present invention, and these improvements and modifications may also be regarded as falling within the scope of protection of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
202110662371.6 | Jun 2021 | CN | national |