Position control method and device of electric shower room, electric shower room and medium
By installing magnetic components and electromagnetic sensors in the electric shower enclosure, the sequence of magnetic field changes is collected and processed for position adjustment, solving the problem of poor position control accuracy of the electric shower enclosure door in the prior art. This achieves high-precision control throughout the entire stroke, improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG LEHUA HOME FURNISHING CO LTD
- Filing Date
- 2023-10-20
- Publication Date
- 2026-07-14
AI Technical Summary
Existing methods for controlling the door position of electric shower enclosures mainly rely on infrared sensors or motor stall current detection, which cannot achieve precise control throughout the entire stroke, resulting in a poor user experience.
By setting up magnetic components on the door and installing electromagnetic sensors inside the door frame, the magnetic field change sequence is collected, normalized and differentially calculated, and the position is adjusted in combination with the magnetic pole width to achieve high-precision control throughout the entire stroke.
It achieves high-precision and high-stability position control of the electric shower room door throughout its entire travel, enhancing the user experience.
Smart Images

Figure CN118208134B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of shower equipment technology, and in particular to a position control method, device, electric shower room, and medium for an electric shower room. Background Technology
[0002] As people's demands for shower comfort increase, an electric shower enclosure has been designed, which automatically controls the position of the shower door to achieve automatic opening and closing. Traditionally, there are two main methods for controlling the position of the shower door: one relies on infrared transmitters / receivers or laser sensors to determine if the door is in position; the other uses a stall mechanism where the motor locks when the door is in position, generating a maximum stall current, and the duration of this maximum stall current is used to determine if the door is in position. Both methods only detect whether the door is in position, which is essentially point-to-point detection and control, and does not provide end-to-end position control of the electric shower door. Therefore, this point-to-point control of the door position negatively impacts the user experience when using the electric shower enclosure. Summary of the Invention
[0003] The main objective of this application is to provide a position control method, device, electric shower room, and medium for electric shower rooms, aiming to improve the user experience of using electric shower rooms.
[0004] To achieve the above objectives, a first aspect of this application provides a position control method for an electric shower enclosure, the electric shower enclosure including a door and a door frame, the door and the door frame being connected by a guide rail and pulleys, the door being provided with a magnetic component, and an electromagnetic sensor being installed inside the door frame; the position control method includes:
[0005] During the movement of the door, the target magnetic field change sequence collected by the electromagnetic sensor is acquired; wherein, the target magnetic field change sequence includes at least two magnetic field sampling values;
[0006] The magnetic field sample values are normalized to obtain the magnetic field change values; wherein, the magnetic field change values are linear values.
[0007] The magnetic field change value is calculated differentially to obtain the difference value, and the fluctuation position information of the difference value is obtained.
[0008] The number of magnetic field changes is calculated based on the fluctuation position information to obtain the quantity value of each fluctuation position information.
[0009] The position of the door is adjusted according to the quantity value of each fluctuation position information and the preset magnetic pole width; wherein, the magnetic pole width is the width of the magnetic pole inside the electromagnetic sensor.
[0010] In some embodiments, the magnetic field change value includes: a preset peak value, a preset trough value, and a zero value; the normalization process based on the magnetic field sample value to obtain the magnetic field change value includes:
[0011] The magnetic field sample value is compared with a preset zero value;
[0012] If the magnetic field sample value is greater than the zero value, the magnetic field sample value is replaced with the preset peak value; wherein, the preset peak value is a positive number;
[0013] If the magnetic field sample value is equal to the zero value, replace the magnetic field sample value with the zero value;
[0014] If the magnetic field sample value is less than the zero value, the magnetic field sample value is replaced with the preset valley value.
[0015] In some embodiments, the magnetic field change value includes: a preset peak value and a preset trough value; the normalization process based on the magnetic field sample value to obtain the magnetic field change value includes:
[0016] Select a chosen sample value and a previous sample value from the magnetic field sample values; wherein, the previous sample value is the magnetic field sample value preceding the chosen sample value;
[0017] The selected sample value, the previous sample value, and the preset zero value are compared.
[0018] If the selected sample value is equal to the zero value and the previous sample value is less than the zero value, the selected sample value is replaced with the preset trough value;
[0019] If the selected sample value is equal to the zero value and the previous sample value is greater than the zero value, the selected sample value is replaced with the preset peak value.
[0020] In some embodiments, the fluctuation position information includes peak position information and trough position information, wherein the peak position information is the position information of the preset peak value and the trough position information is the position information of the preset trough value; the magnetic field change value is calculated based on the fluctuation position information to obtain the quantity value of each fluctuation position information;
[0021] The number of preset peak values is calculated based on the peak position information to obtain the number of peaks.
[0022] The number of troughs is obtained by calculating the number of preset trough values based on the trough location information.
[0023] In some embodiments, adjusting the position of the door body based on the quantity value of each fluctuation position information and a preset magnetic pole width includes:
[0024] The number of wave peaks, the number of wave troughs, and the width of the magnetic poles are predicted by a preset position prediction model to obtain the movement distance of the door; wherein, the position prediction model is D=(S1+S2)*L; where S1 is the number of wave peaks, S2 is the number of wave troughs, and L is the width of the magnetic poles;
[0025] The speed and direction of the door are adjusted according to the distance the door moves.
[0026] In some embodiments, before normalizing the magnetic field sample values to obtain the magnetic field change values, the method further includes:
[0027] Setting the preset peak value and the preset trough value specifically includes:
[0028] The maximum and minimum magnetic field values sensed by the electromagnetic sensor during multiple positional movements of the door are collected.
[0029] The preset peak value is constructed based on the maximum magnetic field value, the minimum magnetic field value, and the preset calibration coefficient;
[0030] The preset peak value is converted into a negative value to obtain the preset trough value.
[0031] In some embodiments, acquiring the target magnetic field change sequence collected by the electromagnetic sensor during the door movement includes:
[0032] During the movement of the door, the original magnetic field change sequence collected by the electromagnetic sensor is obtained;
[0033] The original magnetic field change sequence is filtered to obtain candidate magnetic field change sequences;
[0034] The candidate magnetic field change sequence is denoised to obtain the target magnetic field change sequence.
[0035] To achieve the above objectives, a second aspect of this application provides a position control device for an electric shower room.
[0036] The electric shower enclosure includes a door and a door frame, with a guide rail and pulleys between the door and the door frame. A magnetic component is mounted on the door, and an electromagnetic sensor is installed inside the door frame. The position control device includes:
[0037] The sequence acquisition module is used to acquire the target magnetic field change sequence collected by the electromagnetic sensor during the movement of the door; wherein, the target magnetic field change sequence includes at least two magnetic field sampling values;
[0038] The normalization processing module is used to perform normalization processing on the magnetic field sampling value to obtain the magnetic field change value; wherein the magnetic field change value is a linear value;
[0039] The differential calculation module is used to perform differential calculation on the magnetic field change value to obtain the differential value and acquire the fluctuation position information of the differential value;
[0040] The quantity calculation module is used to perform quantity calculation on the magnetic field change value based on the fluctuation position information to obtain the quantity value of each fluctuation position information.
[0041] The position adjustment module is used to adjust the position of the door body according to the quantity value of each fluctuation position information and the preset magnetic pole width; wherein, the magnetic pole width is the width of the magnetic pole inside the electromagnetic sensor.
[0042] To achieve the above objectives, a third aspect of this application provides an electric shower enclosure, the electric shower enclosure comprising:
[0043] Door body;
[0044] A door frame, with a guide rail and pulleys connecting the door frame and the door body; a magnetic component is installed on the door body; an electromagnetic sensor, a control system, and a motor are installed inside the door frame; the control system includes:
[0045] The power management module is used to provide power to the control system;
[0046] A main controller is configured to execute the position control method for the electric shower room as described in the first aspect, in order to control the output of control commands;
[0047] The storage management module is used to store and manage the data generated by the electromagnetic sensor and the main controller;
[0048] A wireless transmission module is used to receive external control commands and send the external control commands to the main controller;
[0049] The motor drive module is used to adjust the speed and direction of the motor according to the control commands output by the main controller, so as to adjust the position of the door.
[0050] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the position control method for the electric shower room described in the first aspect.
[0051] The position control method, device, electric shower enclosure, and medium proposed in this application utilize a magnetic component mounted on the door and an electromagnetic sensor on the door frame. When the door moves, the electromagnetic sensor collects changes in magnetic field strength, forming a target magnetic field change sequence. This sequence includes at least two magnetic field sampling values. The magnetic field change values are normalized to obtain the magnetic field change value, and then the difference between these values is calculated. Based on the fluctuation position information of the difference value, the quantity of each fluctuation position information is calculated. The door position is then adjusted based on the quantity of the fluctuation position information and the magnetic pole width. Therefore, by using an electromagnetic sensor to collect the magnetic pole signals of the electric shower enclosure door, high-precision and high-stability position control of the entire travel range of the electric shower enclosure is achieved, solving the problems of poor position control accuracy and low reliability in the shower environment, thereby improving the user experience of the electric shower enclosure. Attached Figure Description
[0052] Figure 1 This is a structural schematic diagram of the electric shower room provided in the embodiments of this application;
[0053] Figure 2 This is a system architecture diagram of the electric shower room provided in the embodiments of this application;
[0054] Figure 3 This is a flowchart of the position control method for an electric shower room provided in an embodiment of this application;
[0055] Figure 4 yes Figure 3 The flowchart of step S301 in the process;
[0056] Figure 5 yes Figure 3 The flowchart of step S302 in the text;
[0057] Figure 6 yes Figure 3 Another flowchart of step S302 in the process;
[0058] Figure 7 This is a flowchart of a position control method for an electric shower room provided in another embodiment of this application;
[0059] Figure 8 yes Figure 3 The flowchart of step S304 in the process;
[0060] Figure 9 yes Figure 3 The flowchart for step S305 in the process. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0062] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0063] Unless otherwise defined, 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. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0064] First, let's analyze some of the terms used in this application:
[0065] Time series: This refers to a sequence of values for a statistical indicator of a phenomenon at different times, arranged in chronological order. Time series analysis is a quantitative forecasting method, also known as a simple extrapolation method, and is widely used in statistics as a common forecasting tool.
[0066] A wave crest is the maximum amplitude of a wave within a certain wavelength range, while the corresponding minimum amplitude is called a wave trough. For example, in a transverse wave, the highest point is the crest, and the lowest point is the trough.
[0067] A trough is a minimum value of a transverse wave that is orthogonal to the direction of propagation. The opposite maximum value is called a crest. Because minimum and maximum values depend only on the coordinate direction orthogonal to the direction of propagation, they are collectively referred to as extreme values. They also represent the low points of periodic phenomena.
[0068] With the development of smart homes, electric shower enclosures have emerged to enhance the user's showering experience. The position control technology for electric shower enclosure doors mainly falls into two categories: one relies on infrared photocells or laser sensors for feedback to determine if the door is in position. The other relies on the motor stalling when the door is in position, generating a maximum stall current, and using the maximum stall current and its duration to determine door positioning.
[0069] Both of the above methods of determining door positioning pose risks of false triggers and detection failures during showering due to the large amount of moisture in the electric shower enclosure. The current detection method, while effective, suffers from complex current sampling and reconstruction algorithms due to the numerous high-order harmonics generated by the electric shower enclosure motor, and can only perform position control when the door stalls. Therefore, both methods essentially perform point-to-point detection and cannot provide accurate position control throughout the entire door's travel. In today's increasingly demanding smart and customized home environment, this results in a poor user experience.
[0070] Based on this, embodiments of this application provide a position control method, device, electric shower enclosure, and medium for an electric shower enclosure. The aim is to collect a target magnetic field change sequence composed of changes in magnetic field strength as the door moves, thereby understanding the magnetic field strength changes of the door throughout its movement. Then, the magnetic field sampling values within the target magnetic field change sequence are normalized to obtain the magnetic field change value. Next, the quantity of fluctuation position information is calculated based on the fluctuation position information of the magnetic field change value. Finally, the door position is adjusted based on the quantity of fluctuation position information and the magnetic pole width. Therefore, using the magnetic field change throughout the door's movement as reference data for door position adjustment, and because electromagnetic induction is not affected by water vapor during showering, high-precision and high-stability position control of the electric shower enclosure throughout its entire movement is achieved, solving the problems of poor position control accuracy and reliability in electric shower enclosure environments.
[0071] The position control method, device, electric shower room, and medium provided in this application are specifically described through the following embodiments. First, the position control method of the electric shower room in this application embodiment is described.
[0072] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0073] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0074] The position control method for an electric shower enclosure provided in this application relates to the field of artificial intelligence technology. This method can be applied to a terminal, a server, or software running on either the terminal or the server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the position control method for the electric shower enclosure, but is not limited to the above forms.
[0075] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0076] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.
[0077] Please refer to Figure 1 and Figure 2 , Figure 1 This is a structural diagram of an electric shower enclosure. Figure 2This is a system framework diagram of an electric shower enclosure. The electric shower enclosure includes a door 101 and a door frame 102. A guide rail (not shown) and pulleys (not shown) connect the door 101 and door frame 102, allowing the door 101 to slide on the door frame 102 via the guide rail and pulleys. A magnetic component 103 is provided on the door 101, and the magnetic component 103 includes N-pole magnets and S-pole magnets, which are arranged alternately. A glass door is hung below the door 101. An electromagnetic sensor 104, a control system 105, and a motor (not shown) are installed inside the door frame 102. It should be noted that the electromagnetic sensor 104 is a Hall sensor, which measures the magnetic field strength of the door 101 during its movement on the door frame 102 and converts the magnetic field strength into a digital signal that the control system can understand. This allows the control system to determine the current position information of the door 101 based on changes in the magnetic field strength, thereby achieving full-range position control of the door 101.
[0078] The control system 105 includes: a power management module 106, a main controller 107, a storage management module 108, a wireless transmission module 109, and a motor drive module 110. The power management module 106 provides power to the control system 105, acting as the power supply for the entire system and ensuring a stable power supply to guarantee normal operation of the control system 105 under various conditions. The main controller 107 executes the position control method for the electric shower enclosure. It also processes various external control commands and issues control commands to the motor drive module 110 to drive the motor. Furthermore, the main controller 107 adjusts the control system 105 based on its operating status or other feedback information to ensure its stability and reliability. The storage management module 108 stores and manages the data generated by the electromagnetic sensor 104 and the main controller 107. Specifically, the storage management module 108 protects the data in the event of a power outage or other system failure. The wireless transmission module is used to receive external control commands from external devices and send them to the main controller 107. Simultaneously, it sends the operating status feedback from the main controller 107 to the external devices. The motor drive module 110 receives control commands from the main controller 107 and manipulates the motor to move the position of the door 101 according to these commands.
[0079] It should be noted that the control system 105 also includes a temperature acquisition module: the temperature acquisition module measures the temperature of the control system 105 to obtain temperature information, and the main controller 107 makes appropriate adjustments to the control system 105 based on this temperature information to ensure the normal operation of the control system 105.
[0080] Specifically, the wireless transmission module 109 receives external control commands from external devices and sends them to the main controller 107. The main controller 107 generates control commands based on the external control commands and sends them to the motor drive module 110. The motor drive module 110 drives the motor to move the door 101. During the movement of the door 101, the electromagnetic Hall sensor 104 collects the changes in magnetic field strength generated by the N-pole magnet and the S-pole magnet, forming a target magnetic field change sequence, and sends this sequence to the main controller 107. Based on the target magnetic field change sequence, the main controller 107 knows the position of the door 101 throughout its movement and can more accurately control its position.
[0081] Figure 3 This is an optional flowchart of the position control method for an electric shower room provided in the embodiments of this application. Figure 3 The method may include, but is not limited to, steps S301 to S305.
[0082] Step S301: During the movement of the door, acquire the target magnetic field change sequence collected by the electromagnetic sensor; wherein, the target magnetic field change sequence includes: at least two magnetic field sampling values;
[0083] Step S302: Normalize the magnetic field sampling values to obtain the magnetic field change values; wherein, the magnetic field change values are linear values.
[0084] Step S303: Perform differential calculation on the magnetic field change value to obtain the differential value, and obtain the fluctuation position information of the differential value;
[0085] Step S304: Calculate the quantity of magnetic field changes based on the fluctuation position information to obtain the quantity value of each fluctuation position information.
[0086] Step S305: Adjust the position of the door body according to the quantity value of each fluctuation position information and the preset magnetic pole width; wherein, the magnetic pole width is the width of the magnetic pole inside the electromagnetic sensor.
[0087] Steps S301 to S305 of this embodiment involve collecting magnetic field sampling values generated by the magnetic components during the movement of the door using an electromagnetic sensor, and combining these magnetic field sampling values into a target magnetic field change sequence according to a time sequence. Therefore, the target magnetic field change sequence represents the magnetic field sampling values ordered chronologically. Because the magnetic field sampling value is not a fixed value, to better determine the edge state of each sampling point, the magnetic field sampling value is normalized to obtain the magnetic field change value. Then, the magnetic field change value is differentially calculated to obtain a difference value, which represents the edge state of the sampling point. Next, the fluctuation position information of each difference value is obtained to determine the quantity of the difference value corresponding to each fluctuation position information. The position of the door is adjusted based on the quantity of each fluctuation position information and the magnetic pole width. Therefore, by setting up magnetic components and sensors, a magnetic field change is generated during the door's movement. The position of the door is controlled according to the magnetic field change. Moreover, the magnetic sensor and magnetic components are not easily affected by the ambient humidity, thus achieving high-precision and high-stability position control of the electric shower room door throughout its entire stroke. This solves the problems of poor position control accuracy and low reliability in the shower environment of electric shower rooms, thereby improving the user experience of using electric shower rooms.
[0088] Please see Figure 4 In some embodiments, step S301 may include, but is not limited to, steps S401 to S403:
[0089] Step S401: During the movement of the door, acquire the original magnetic field change sequence collected by the electromagnetic sensor;
[0090] Step S402: Filter the original magnetic field change sequence to obtain candidate magnetic field change sequences;
[0091] Step S403: Denoise the candidate magnetic field change sequence to obtain the target magnetic field change sequence.
[0092] In step S401 of some embodiments, when the door moves, the electromagnetic sensor collects the changing magnetic field strength, then determines the corresponding magnetic field sampling value according to the preset sampling time point, and assembles the magnetic field sampling values into an original magnetic field change sequence according to the time sequence. It should be noted that the main controller starts a timer to use the electromagnetic sensor to sample the magnetic field strength generated by the door movement according to the preset sampling time point, and then obtains a set of original magnetic field change sequences {arr[0]~arr[len]} according to the time sequence, where len is the length of the sampling data frame and arr[n] is the magnetic field sampling value.
[0093] In step S402 of some embodiments, the acquired original magnetic field change sequence is filtered to obtain a candidate magnetic field change sequence. It should be noted that abnormal magnetic field sampling values in the original magnetic field change sequence are filtered out, leaving normal magnetic field sampling values to form the candidate magnetic field change sequence.
[0094] In step S403 of some embodiments, in order to further improve the accuracy of the sampled magnetic field change sequence and thus improve the accuracy of door position detection, the candidate magnetic field change sequence is denoised to remove noisy magnetic field sample values within the candidate magnetic field change sequence, so as to obtain accurate and stable magnetic field sample values as the target magnetic field change sequence.
[0095] In steps S401 to S403 of this embodiment, the acquired original magnetic field change sequence is filtered and denoised to obtain a more accurate target magnetic field change sequence. Therefore, using the target magnetic field change sequence for gate position control is more precise and stable.
[0096] Please see Figure 5 In some embodiments, the magnetic field change value includes: a preset peak value, a preset trough value, and a zero value; step S302 may include, but is not limited to, steps S501 to S504:
[0097] Step S501: Compare the magnetic field sample value with the preset zero value;
[0098] Step S502: If the magnetic field sample value is greater than zero, replace the magnetic field sample value with a preset peak value; wherein, the preset peak value is a positive number.
[0099] Step S503: If the magnetic field sampling value is equal to zero, replace the magnetic field sampling value with zero.
[0100] Step S504: If the magnetic field sampling value is less than zero, replace the magnetic field sampling value with a preset valley value.
[0101] In steps S501 to S502 of some embodiments, since the N-pole magnet and the S-pole magnet are installed in the guide rail of the door frame, the range of door movement is fixed, and the magnetic field sampling value output by the electromagnetic sensor is also limited to a certain range. Therefore, the magnetic field sampling value is normalized here so as to determine the door's movement position based on the normalized magnetic field change value. Specifically, the magnetic field sampling value is compared with zero, that is, arr[n] is compared with 0, to determine whether arr[n] is greater than 0. If the magnetic field sampling value is greater than zero, that is, arr[n] is greater than 0, then the magnetic field sampling value is replaced with a preset peak value, that is, the preset peak value is used as the magnetic field change value. It should be noted that the preset peak value is a, calibra_arr[n] = a, and a is a positive number.
[0102] In step S503 of some embodiments, if the magnetic field sampling value is equal to zero, that is, arr[n] = 0, then the magnetic field sampling value is replaced with zero, and zero is used as the magnetic field change value, that is, calibra_arr[n] = 0.
[0103] In step S504 of some embodiments, if the magnetic field sampling value is less than zero, that is, arr[n] < 0, then the magnetic field sampling value is replaced by a preset valley value, and the preset valley value is negative, and the absolute value of the preset valley value is equal to the absolute value of the preset peak value. Therefore, the preset valley value is used as the magnetic field change value, that is, calibra_arr[n] = -a.
[0104] In steps S501 to S504 of this embodiment, the magnetic field sample value is compared with the zero value, and the magnetic field change value is set according to the comparison result between the magnetic field sample value and the zero value to realize the normalization operation of the magnetic field sample value and the calibration of the magnetic field sample value, so as to facilitate the calculation of the movement of the gate.
[0105] Please see Figure 6 In some embodiments, step S302 may also include, but is not limited to, steps S601 to S604:
[0106] Step S601: Select the selected sample value and the previous sample value from the magnetic field sample values; wherein, the previous sample value is the magnetic field sample value preceding the selected sample value;
[0107] Step S602: Compare the selected sample value, the previous sample value, and the preset zero value;
[0108] Step S603: If the selected sample value is equal to zero and the previous sample value is less than zero, replace the selected sample value with a preset trough value.
[0109] Step S604: If the selected sample value is equal to zero and the previous sample value is greater than zero, replace the selected sample value with the preset peak value.
[0110] In step S601 of some embodiments, a selected sample value is randomly selected from the magnetic field sample values, and then the previous magnetic field sample value of the selected sample value is extracted from the magnetic field sample values as the previous sample value. It should be noted that the selected sample value is defined as arr[n], and the previous sample value is defined as arr[n-1].
[0111] In some embodiments, steps S602 to S603, the selected sample value, the previous sample value, and the zero value are compared. If the selected sample value is equal to 0 and the previous sample value is less than 0, that is, arr[n] = 0 and arr[n-1] < 0, then the magnetic field sample value is replaced with a preset valley value, that is, calibra_arr[n] = -a is limited.
[0112] In step S604 of some embodiments, if the selected sample value is equal to zero and the previous sample value is greater than zero, that is, arr[n] = 0 and arr[n-1] is greater than 0, then the magnetic field sample value is replaced with a preset peak value, that is, the magnetic field change value is set to a preset peak value, so calibra_arr[n] = a.
[0113] In steps S601 to S604 of this embodiment, a selected sample value and a previous sample value are obtained. If the selected sample value is zero and the previous sample value is less than zero, the magnetic field change value is set to a preset trough value. If the selected sample value is zero and the previous sample value is greater than zero, the magnetic field change value is set to a preset peak value. Therefore, each magnetic field sample value is transformed into a single value of peak and trough to facilitate the calculation of subsequent fluctuation position points, thereby quickly calculating the door movement distance.
[0114] Please see Figure 7 In some embodiments, before step S302, the position control orientation of the electric shower room also includes setting a preset peak value and a preset trough value. Since the setting of the peak value and the trough value affects the normalization operation of the magnetic field sampling value, the design of the preset peak value and the preset trough value must be related to the peak value during the door movement process, and irrelevant values cannot be selected.
[0115] Setting preset peak values and preset trough values may include, but is not limited to, steps S701 to S703:
[0116] Step S701: Collect the maximum and minimum magnetic field values of the electromagnetic sensor during the multiple position movements of the door.
[0117] Step S702: Construct a preset peak value based on the maximum magnetic field value, the minimum magnetic field value, and the preset calibration coefficient;
[0118] Step S703: Convert the preset peak value to a negative value to obtain the preset trough value.
[0119] In step S701 of some embodiments, after the electric shower enclosure is powered on for the first time, data calibration within the electric shower enclosure is required. It should be noted that the electric shower enclosure door moves continuously multiple times, and the electromagnetic sensor detects multiple sets of magnetic field sample values. The maximum and minimum magnetic field sample values of each set are extracted, and then the average of the multiple maximum magnetic field sample values is calculated to obtain the maximum magnetic field value. Similarly, the average of the multiple minimum magnetic field sample values is calculated to obtain the minimum magnetic field value. Specifically, the maximum magnetic field value is denoted as Hall_mxx, and the minimum magnetic field value is denoted as Hall_min. Then, the maximum and minimum magnetic field values are stored in a storage unit.
[0120] In step S702 of some embodiments, in order to calculate the preset peak value, the maximum magnetic field value, the minimum magnetic field value, and the preset calibration coefficient are input into a preset peak value calculation function. It should be noted that the peak value calculation function is a = (Hall_mxx - Hall_min) / 2 * Q, where Q is the preset calibration coefficient. Therefore, the preset peak value can be quickly calculated using the peak value calculation function. In this embodiment, the preset peak value is 0.32, and it can be seen that the points with a difference value of zero are the same points.
[0121] In step S703 of some embodiments, the preset peak value can be obtained by converting the preset peak value to a negative number, that is, the valley value is -a.
[0122] In steps S701 to S703 of this embodiment, the preset peak value can be obtained by substituting the maximum magnetic field value, the minimum magnetic field value and the preset calibration coefficient into the peak value calculation function. Then, the preset peak value can be obtained by converting the preset peak value into a negative number. This makes the calculation of the preset peak value and the preset valley value simple and consistent with the magnetic field changes of the electric shower room.
[0123] In step S303 of some embodiments, based on the calculated magnetic field change value, a second difference calculation is performed on the magnetic field change value to obtain a difference value, and the difference value is recorded as calibra_arr2[n]. By obtaining the specific value of each difference value, the fluctuation position information of the difference value can be determined. It should be noted that the fluctuation position information includes peak position information and trough position information. When calibra_arr2[n] equals -2a, then the sampling point position corresponding to the difference value is the peak position information. When calibra_arr2[n] equals 2a, then the sampling point position of the difference value is the trough position information.
[0124] Please see Figure 8 In some embodiments, step S304 includes, but is not limited to, steps S801 to S802:
[0125] Step S801: Calculate the number of preset peak values based on the peak position information to obtain the number of peaks;
[0126] Step S802: Calculate the number of preset valley values based on valley location information to obtain the number of valleys.
[0127] In step S801 of some embodiments, after determining the peak position information, the number of preset peak values belonging to the peak position information is calculated to obtain the peak number, and the peak number is recorded as S1.
[0128] In step S802 of some embodiments, after determining the valley location information, the number of preset valley values belonging to the valley location information is calculated to obtain the valley number, and the valley number is recorded as S2.
[0129] In steps S801 to S802 of this embodiment, the number of preset peak values belonging to the peak position information is counted as the peak number, and the number of preset valley values corresponding to the valley position information is counted as the valley number, which makes the calculation of the peak number and valley number simple.
[0130] Please see Figure 9 In some embodiments, step S305 may include, but is not limited to, steps S901 to S902:
[0131] Step S901: The number of wave crests, the number of wave troughs, and the width of magnetic poles are predicted by a preset position prediction model to obtain the movement distance of the door; wherein, the position prediction model is D=(S1+S2)*L; where S1 is the number of wave crests, S2 is the number of wave troughs, and L is the width of magnetic poles.
[0132] Step S902: Adjust the speed and direction of the door according to the distance the door has moved.
[0133] In step S901 of some embodiments, the number of wave crests, the number of wave troughs, and the magnetic pole width are input into the position prediction model for calculation to obtain the door movement distance. It should be noted that the door movement distance is D = (S1 + S2) * L, so the door movement distance can be calculated based on the magnetic field generated during the door movement process, and the magnetic field strength detection is not affected by the ambient humidity, so the calculated door movement distance is accurate.
[0134] In step S902 of some embodiments, the real-time door movement distance is fed back to the main controller, so that the main controller can generate control commands for the motor drive module based on the door movement distance and external control commands, so that the motor drive module can adjust the direction and speed of the motor, thereby adjusting the position and speed of the door, so as to achieve precise adjustment of the door throughout the entire process, thereby improving the accuracy of door position control and improving the user's experience of using the electric shower room.
[0135] In steps S901 to S902 of this embodiment, the number of peaks, the number of troughs, and the magnetic pole width are substituted into the position prediction model to quickly calculate the door's movement distance, thus achieving real-time calculation of the door's movement distance. The door's position is then adjusted more accurately based on the movement distance, thereby improving the user experience of the electric shower enclosure.
[0136] Please see Figure 8 This application also provides a position control device for an electric shower room, which can implement the above-described position control method for an electric shower room.
[0137] The electric shower enclosure includes a door and a door frame, with a guide rail and pulleys between the door and the door frame. A magnetic component is installed on the door, and an electromagnetic sensor is installed inside the door frame. The position control device includes:
[0138] The sequence acquisition module is used to acquire the target magnetic field change sequence collected by the electromagnetic sensor during the movement of the door; wherein, the target magnetic field change sequence includes at least two magnetic field sample values;
[0139] The normalization module is used to normalize the root magnetic field sampling values to obtain the magnetic field change values; where the magnetic field change values are linear values.
[0140] The differential calculation module is used to perform differential calculations on the magnetic field change value, obtain the differential value, and acquire the fluctuation position information of the differential value.
[0141] The quantity calculation module is used to calculate the quantity of magnetic field changes based on the fluctuation position information, and obtain the quantity value of each fluctuation position information.
[0142] The position adjustment module is used to adjust the position of the door body according to the quantity value of each fluctuation position information and the preset magnetic pole width; wherein, the magnetic pole width is the width of the magnetic pole inside the electromagnetic sensor.
[0143] The specific implementation of the position control device for the electric shower room is basically the same as the specific implementation of the position control method for the electric shower room described above, and will not be repeated here.
[0144] This application embodiment also provides an electric shower room, which includes:
[0145] Door 101;
[0146] Door frame 102, with guide rails and pulleys connecting door body 101, magnetic component 103 on door body 101, and electromagnetic sensor 104, control system 105, and motor installed inside door frame 102; control system 105 includes:
[0147] Power management module 106 is used to provide power to the control system;
[0148] The main controller 107 is used to execute the position control method of the electric shower room as described above, so as to control the output control command;
[0149] Storage management module 108 is used to store and manage the data generated by electromagnetic sensor 104 and main controller 107;
[0150] The wireless transmission module 109 is used to receive external control commands and send them to the main controller 107.
[0151] The motor drive module 110 is used to adjust the speed and direction of the motor according to the control commands output by the main controller 107, so as to adjust the position of the door.
[0152] It should be noted that the electromagnetic sensor 104 is a Hall sensor, and multiple Hall sensors can be set to improve the static stiffness of the door movement position detection. Furthermore, the accuracy of four sets of Hall sensors can reach one-eighth of the magnetic pole width, and so on. Considering cost and space, two sets of Hall sensors are preferred in this embodiment.
[0153] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described position control method for an electric shower room.
[0154] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0155] The electric shower enclosure position control method, device, electric shower enclosure, and medium provided in this application embodiment utilize a magnetic component located on the door body and an electromagnetic sensor installed on the door frame. When the door moves, the electromagnetic sensor collects changes in magnetic field strength, forming a target magnetic field change sequence. This target magnetic field change sequence includes at least two magnetic field sampling values. The magnetic field sampling values are normalized to obtain the magnetic field change value, and then the difference between these values is calculated to obtain a difference value. Based on the fluctuation position information of the difference value, the quantity of each fluctuation position information is calculated, and the door body position is adjusted according to the quantity of fluctuation position information and the magnetic pole width. Therefore, by using an electromagnetic sensor to collect the magnetic pole signal of the electric shower enclosure door, high-precision and high-stability position control of the electric shower enclosure throughout its entire travel range is achieved, solving the problems of poor position control accuracy and low reliability in the shower environment.
[0156] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0157] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0158] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0159] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0160] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0161] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0162] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0163] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0164] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0165] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for controlling the position of an electric shower enclosure, characterized in that, The electric shower enclosure includes a door and a door frame, with a guide rail and pulleys between the door and the door frame. A magnetic component is mounted on the door, and an electromagnetic sensor is installed inside the door frame. The position control method includes: During the movement of the door, the target magnetic field change sequence collected by the electromagnetic sensor is acquired; wherein, the target magnetic field change sequence includes at least two magnetic field sampling values; The magnetic field sample values are normalized to obtain the magnetic field change values; wherein, the magnetic field change values are linear values. The magnetic field change value is calculated differentially to obtain the difference value, and the fluctuation position information of the difference value is obtained. The number of magnetic field changes is calculated based on the fluctuation position information to obtain the quantity value of each fluctuation position information. The position of the door is adjusted according to the quantity value of each fluctuation position information and the preset magnetic pole width; wherein, the magnetic pole width is the width of the magnetic pole inside the electromagnetic sensor; The fluctuation position information includes peak position information and trough position information, wherein the peak position information is the position information of a preset peak value, and the trough position information is the position information of a preset trough value; the step of calculating the quantity of the magnetic field change value based on the fluctuation position information to obtain the quantity value of each fluctuation position information includes: The number of preset peak values is calculated based on the peak position information to obtain the number of peaks. The number of troughs is obtained by calculating the number of preset trough values based on the trough location information.
2. The position control method according to claim 1, characterized in that, The magnetic field change values include: a preset peak value, a preset trough value, and a zero value; the normalization process based on the magnetic field sample values to obtain the magnetic field change values includes: The magnetic field sample value is compared with a preset zero value; If the magnetic field sample value is greater than the zero value, the magnetic field sample value is replaced with the preset peak value; wherein, the preset peak value is a positive number; If the magnetic field sample value is equal to the zero value, replace the magnetic field sample value with the zero value; If the magnetic field sample value is less than the zero value, the magnetic field sample value is replaced with the preset valley value.
3. The position control method according to claim 1, characterized in that, The magnetic field change value includes: a preset peak value and a preset trough value; the normalization process based on the magnetic field sample value to obtain the magnetic field change value includes: Select a chosen sample value and a previous sample value from the magnetic field sample values; wherein, the previous sample value is the magnetic field sample value preceding the chosen sample value; The selected sample value, the previous sample value, and the preset zero value are compared. If the selected sample value is equal to the zero value and the previous sample value is less than the zero value, the selected sample value is replaced with the preset trough value; If the selected sample value is equal to the zero value and the previous sample value is greater than the zero value, the selected sample value is replaced with the preset peak value.
4. The position control method according to claim 2 or 3, characterized in that, The step of adjusting the position of the door body according to the quantity value of each fluctuation position information and the preset magnetic pole width includes: The number of wave peaks, the number of wave troughs, and the width of the magnetic poles are predicted by a preset position prediction model to obtain the movement distance of the door; wherein, the position prediction model is D=(S1+S2)*L; where S1 is the number of wave peaks, S2 is the number of wave troughs, and L is the width of the magnetic poles. The speed and direction of the door are adjusted according to the distance the door moves.
5. The position control method according to claim 2 or 3, characterized in that, Before normalizing the magnetic field sample values to obtain the magnetic field change values, the method further includes: Setting the preset peak value and the preset trough value specifically includes: The maximum and minimum magnetic field values sensed by the electromagnetic sensor during multiple positional movements of the door are collected. The preset peak value is constructed based on the maximum magnetic field value, the minimum magnetic field value, and the preset calibration coefficient; The preset peak value is converted into a negative value to obtain the preset trough value.
6. The position control method according to claim 1, characterized in that, The process of acquiring the target magnetic field change sequence collected by the electromagnetic sensor during the movement of the door includes: During the movement of the door, the original magnetic field change sequence collected by the electromagnetic sensor is obtained; The original magnetic field change sequence is filtered to obtain candidate magnetic field change sequences; The candidate magnetic field change sequence is denoised to obtain the target magnetic field change sequence.
7. A position control device for an electric shower room, characterized in that, The electric shower enclosure includes a door and a door frame, with a guide rail and pulleys between the door and the door frame. A magnetic component is mounted on the door, and an electromagnetic sensor is installed inside the door frame. The position control device includes: The sequence acquisition module is used to acquire the target magnetic field change sequence collected by the electromagnetic sensor during the movement of the door; wherein, the target magnetic field change sequence includes at least two magnetic field sampling values; The normalization processing module is used to perform normalization processing on the magnetic field sampling value to obtain the magnetic field change value; wherein the magnetic field change value is a linear value. The differential calculation module is used to perform differential calculation on the magnetic field change value to obtain the differential value and acquire the fluctuation position information of the differential value; The quantity calculation module is used to perform quantity calculation on the magnetic field change value based on the fluctuation position information to obtain the quantity value of each fluctuation position information. The position adjustment module is used to adjust the position of the door body according to the quantity value of each fluctuation position information and the preset magnetic pole width; wherein, the magnetic pole width is the width of the magnetic pole inside the electromagnetic sensor; The fluctuation position information includes peak position information and trough position information. The peak position information is the position information of a preset peak value, and the trough position information is the position information of a preset trough value. The magnetic field change value is quantitatively calculated based on the fluctuation position information to obtain a quantitative value for each fluctuation position information, including: The number of preset peak values is calculated based on the peak position information to obtain the number of peaks. The number of troughs is obtained by calculating the number of preset trough values based on the trough location information.
8. An electric shower room, characterized in that, The electric shower room includes: Door body; A door frame, with a guide rail and pulleys connecting the door frame and the door body; a magnetic component is installed on the door body; an electromagnetic sensor, a control system, and a motor are installed inside the door frame; the control system includes: The power management module is used to provide power to the control system; A main controller, wherein the main controller is configured to execute the position control method for the electric shower room as described in any one of claims 1 to 6, to control the output of control commands; The storage management module is used to store and manage the data generated by the electromagnetic sensor and the main controller; A wireless transmission module is used to receive external control commands and send the external control commands to the main controller; The motor drive module is used to adjust the speed and direction of the motor according to the control commands output by the main controller, so as to adjust the position of the door.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the position control method for the electric shower room as described in any one of claims 1 to 6.