Motor control method and device, electronic equipment and storage medium
By adjusting the torque difference and binding the position of the dual-motor drive structure, the stability problem of the battery swapping unit moving on the track was solved, and the stability and balance of synchronous movement were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2026-03-13
AI Technical Summary
When the battery swapping unit moves on the track, there are stability issues, especially when the battery is heavy and the track is long, which may cause the speed to slow down and vibrate.
The dual-motor drive structure is adopted. Synchronous movement is achieved by obtaining a zero torque difference between the first motor and the second motor. By binding the position or speed of the first motor and the second motor, load balance is ensured and stability is improved.
This achieves stable synchronous movement of the battery swapping unit on the track, avoiding slowdown and shaking caused by insufficient driving force, and improving the stability of movement.
Smart Images

Figure CN121664026A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of battery swapping station technology, and more specifically, to a motor control method, device, electronic equipment, and storage medium. Background Technology
[0002] With the rapid development of the new energy vehicle industry, battery swapping stations have emerged. These stations use swapping equipment to first place the depleted battery from the vehicle into a buffer slot in the battery compartment, and then place a fully charged battery from the charging slot in the battery compartment onto the vehicle. The entire swapping process can be completed within minutes, greatly improving vehicle operating efficiency.
[0003] In related technologies, battery swapping equipment includes a swapping unit and a track. Typically, the swapping unit moves on the track using a single motor. However, when the battery is too heavy and the track is too long, it not only affects the speed of the swapping unit but also increases the likelihood of vibration. Summary of the Invention
[0004] The problem addressed by this invention is how to improve the stability of the battery swapping unit as it moves on the track.
[0005] To address the above problems, the present invention provides a motor control method, apparatus, electronic device, and storage medium.
[0006] In a first aspect, the present invention provides a motor control method applied to a battery swapping device in a battery swapping station. The battery swapping device includes a drive structure, a battery swapping body, and a track. The drive structure includes a first drive structure and a second drive structure. The first drive structure includes a first motor, and the second drive structure includes a second motor. The track includes a first guide rail and a second guide rail that are parallel to each other. The first motor is mounted on the first guide rail, and the second motor is mounted on the second guide rail. One end of the battery swapping body is connected to the first motor, and the other end of the battery swapping body is connected to the second motor. The first motor is used to move along the first guide rail, and the second motor is used to move along the second guide rail, thereby driving the battery swapping body to move on the track. The motor control method includes: Determine the first position of the first motor on the first guide rail; The first torque of the first motor and the second torque of the second motor are obtained respectively. Based on the first torque and the second torque, the second motor is controlled to move until the first difference between the first torque and the second torque is zero. When the first difference is zero, the second position of the second motor is determined on the second guide rail; Based on the first position and the second position, the first motor and the second motor are bound together to achieve synchronous movement of the first motor and the second motor on the track.
[0007] Optionally, the first drive structure further includes a first belt and a first structure, and the second drive structure further includes a second belt and a second structure. The first structure includes a first pulley and at least one first rotating structure. The first pulley is connected to the shaft of the first motor, and each of the first rotating structures is connected to the housing of the first motor. The second structure includes a second pulley and at least one second rotating structure. The second pulley is connected to the shaft of the second motor, and each of the second rotating structures is connected to the housing of the second motor. One end of the first belt is connected to one end of the first guide rail, and the other end of the first belt passes around the first pulley and each of the first rotating structures and connects to the other end of the first guide rail. The first rotating structure is used to adjust the tension of the first belt and the contact area between the first belt and the first pulley. One end of the second belt is connected to one end of the second guide rail, and the other end of the second belt passes around the second pulley and each of the second rotating structures and connects to the other end of the second guide rail. The second rotating structure is used to adjust the tension of the second belt and the contact area between the second belt and the second pulley. When the first motor rotates, driving the first structure to move along the first belt, and the second motor rotates, driving the second structure to move along the second belt, the battery swapping body moves on the track. And / or, before determining the first position of the first motor on the first guide rail, the method further includes: Obtain the first tension of the first belt and the second tension of the second belt; Adjust both the first tension and the second tension to the preset range.
[0008] Optionally, before determining the first position of the first motor on the first guide rail, the method further includes: The rotation directions of the first motor and the second motor are determined based on the direction in which the battery swapping body moves on the track.
[0009] Optionally, controlling the movement of the second motor based on the first torque and the second torque includes: When the first torque is not equal to the second torque, control the second motor to move in the direction of the first motor.
[0010] Optionally, controlling the second motor to move toward the first motor includes: When the first difference is greater than the first preset threshold, the second motor is controlled to rotate at the first preset speed; When the first difference is less than or equal to the first preset threshold, the second motor is controlled to rotate at a second preset speed, wherein the second preset speed is less than the first preset speed.
[0011] Optionally, after binding the first motor and the second motor according to the first position and the second position, the process includes: The third position of the first motor and the fourth position of the second motor are acquired in real time during the movement of the battery swapping unit. A first displacement is determined based on the first position and the third position, and a second displacement is determined based on the second position and the fourth position; Based on the first displacement and the second displacement, the third preset speed of the second motor is adjusted until the second difference between the first displacement and the second displacement is equal to zero.
[0012] Optionally, adjusting the third preset speed of the second motor based on the first displacement and the second displacement includes: When the second displacement is less than the first displacement, the third preset speed is controlled to increase according to the first preset acceleration; When the second displacement is greater than the first displacement, the third preset speed is controlled to decrease according to the second preset acceleration.
[0013] Secondly, the present invention provides a motor control device applied to a battery swapping device in a battery swapping station. The battery swapping device includes a drive structure, a battery swapping body, and a track. The drive structure includes a first drive structure and a second drive structure. The first drive structure includes a first motor, and the second drive structure includes a second motor. The track includes a first guide rail and a second guide rail that are parallel to each other. The first motor is mounted on the first guide rail, and the second motor is mounted on the second guide rail. One end of the battery swapping body is connected to the first motor, and the other end of the battery swapping body is connected to the second motor. The first motor is used to move along the first guide rail, and the second motor is used to move along the second guide rail, thereby driving the battery swapping body to move on the track. The motor control method includes: The first determining module is used to determine the first position of the first motor on the first guide rail; The adjustment module is used to obtain the first torque of the first motor and the second torque of the second motor respectively, and control the second motor to move according to the first torque and the second torque until the first difference between the first torque and the second torque is zero; The second determining module is used to determine the second position of the second motor on the second guide rail when the first difference is zero. A binding module is used to bind the first motor and the second motor according to the first position and the second position, so as to realize the synchronous movement of the first motor and the second motor on the track.
[0014] Thirdly, the present invention provides an electronic device, including a memory and a processor; The memory is used to store computer programs; The processor is configured to implement the motor control method as described in the first aspect when executing the computer program.
[0015] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the motor control method as described in the first aspect.
[0016] The beneficial effects of the motor control method, device, electronic device, and storage medium of the present invention are as follows: The battery swapping body moves on a track via a drive structure. The drive structure includes a first drive structure and a second drive structure; the first drive structure includes a first motor, and the second drive structure includes a second motor. To achieve synchronous movement of both ends of the battery swapping body on the track driven by the first and second motors, before the first and second motors rotate simultaneously, it is first determined that the starting points of the first motor and the second motor are aligned during synchronous movement. Then, the positions or speeds of the first and second motors are bound together. Since misalignment of the two motors will result in unequal loads, by obtaining the first torque of the first motor and the second torque of the second motor, the first difference between the first torque and the second torque is made zero to achieve equal loads, thereby achieving alignment of the starting points. Adjusting the positions of the first motor and / or the second motor can also make the first difference between the first torque and the second torque zero. For ease of operation, the starting point of the first motor during synchronous movement, i.e., the first position, is first determined. Using this first position as a reference, the position of the second motor is adjusted. The specific adjustment operation involves controlling the rotational speed and direction of movement of the second motor. When the first difference between the first torque and the second torque is zero, the second motor is located at the starting point, i.e., the second position, during the synchronous movement. Therefore, by achieving synchronous movement of the first motor and the second motor on the track, this invention not only avoids the battery swapping unit slowing down due to insufficient driving force, but also reduces the possibility of vibration caused by unbalanced driving force, thereby improving the stability of the battery swapping unit's movement on the track. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the motor control method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of the battery swapping equipment according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the first structure and the first belt according to an embodiment of the present invention; Figure 4 This is a system architecture diagram of the motor control device according to an embodiment of the present invention; Figure 5 This is a system architecture diagram of an electronic device according to an embodiment of the present invention; Explanation of reference numerals in the attached figures: 11. First drive structure; 111. First motor; 112. First belt; 113. First structure; 12. Second drive structure; 121. Second motor; 122. Second belt; 123. Second structure; 2. Battery swapping main body; 31. First guide rail; 32. Second guide rail; 4. Anti-collision post; 5. Tensioning mechanism. Detailed Implementation
[0018] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the accompanying drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0019] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0020] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to"; the term "based on" means "at least partially based on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; and the term "optionally" means "optional embodiments". Definitions of other terms will be given in the following description. It should be noted that the concepts of "first," "second," etc., mentioned in this invention are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0021] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0022] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0023] like Figure 1 As shown and as Figure 2 As shown in the figure, an embodiment of the present invention provides a motor control method applied to a battery swapping device in a battery swapping station. The battery swapping device includes a drive structure, a battery swapping body 2, and a track. The drive structure includes a first drive structure 11 and a second drive structure 12. The first drive structure 11 includes a first motor 111, and the second drive structure 12 includes a second motor 121. The track includes a first guide rail 31 and a second guide rail 32 that are parallel to each other. The first motor 111 is disposed on the first guide rail 31, and the second motor 121 is disposed on the second guide rail 32. One end of the battery swapping body 2 is connected to the first motor 111, and the other end of the battery swapping body 2 is connected to the second motor 121. The first motor 111 is used to move along the first guide rail 31, and the second motor 121 is used to move along the second guide rail 32, so as to drive the battery swapping body 2 to move on the track. The motor control method includes: S100: Determine the first position of the first motor 111 on the first guide rail 31.
[0024] Specifically, the battery swapping station is divided into a swapping channel and a battery compartment. The swapping channel is used for vehicles needing battery swapping to park, and the battery compartment is used to store depleted batteries, fully charged batteries, and charging equipment. The swapping equipment is installed above the swapping station to replace depleted batteries in vehicles with fully charged batteries. The swapping equipment includes a drive structure, a swapping body 2, and a track. The swapping body 2 moves on the track via the drive structure. A negative limit block is set on the first guide rail 31, and a negative limit sensor is set on the first drive structure 11. The first drive structure 11 is moved until the negative limit sensor is within a preset range of the negative limit block (e.g., 2cm to 10cm), and the initial position of the swapping body 2 is determined on the first guide rail 31. At the same time, the initial position (i.e., the first position) of the first motor 111 is determined on the first guide rail 31. The first guide rail 31 is used as the first coordinate axis, and the first position is used as the first origin. The initial position of the swapping body 2 and the initial position (i.e., the first position) of the first motor 111 are associated.
[0025] S200: Obtain the first torque of the first motor 111 and the second torque of the second motor 121 respectively, and control the second motor 121 to move according to the first torque and the second torque until the first difference between the first torque and the second torque is zero.
[0026] Specifically, when the first motor 111 is in the first position, a first driver connects to the first motor 111 to obtain its first torque, and a second driver connects to the second motor 121 to obtain its second torque. The driver uses a built-in current sensor to measure the three-phase current flowing into the motor in real time. A built-in microprocessor performs a Clarke transform followed by a Park transform on the three-phase current to determine the torque current component. Based on the torque current component and the torque constant, the torque is determined. The rotational speed and direction of movement of the second motor 121 are adjusted with the goal of equalizing the first torque with the second torque. During the adjustment process, the position of the second motor 121 changes, while the first motor 111 remains in the first position. After the adjustment is complete, a green light illuminates to alert the operator.
[0027] S300: When the first difference is zero, determine the second position of the second motor 121 on the second guide rail 32.
[0028] Specifically, when the first torque equals the second torque, that is, when the first difference between the first torque and the second torque is zero, the initial position (i.e. the second position) of the second motor 121 is determined on the second guide rail 32, the second guide rail 32 is used as the second coordinate axis, the second position is used as the second origin, and the second origin is aligned with the first origin.
[0029] S400: Based on the first position and the second position, bind the first motor 111 and the second motor 121 to achieve synchronous movement of the first motor 111 and the second motor 121 on the track.
[0030] Specifically, a first encoder is mounted on the shaft of the first motor 111, and a second encoder is mounted on the shaft of the second motor 121. The first motor 111 and the second motor 121 start rotating simultaneously. The first driver determines a first target position of the first motor 111 on the first guide rail 31 based on the number of pulses emitted by the first encoder; the second driver determines a second target position of the second motor 121 on the second guide rail 32 based on the number of pulses emitted by the second encoder. Synchronous movement of the first motor 111 and the second motor 121 on the track is achieved by ensuring that the coordinates of the second target position on the second coordinate axis are the same as the coordinates of the first target position on the first coordinate axis. Alternatively, the first motor 111 and the second motor 121 start rotating simultaneously. The first driver determines a first speed of rotation for the first motor 111 based on the number of pulses emitted by the first encoder within a preset time range, or by the time interval between two adjacent pulses emitted by the first encoder; the second driver determines a second speed of rotation for the second motor 121 based on the number of pulses emitted by the second encoder within a preset time range, or by the time interval between two adjacent pulses emitted by the second encoder. Synchronous movement of the first motor 111 and the second motor 121 on the track is achieved by ensuring that the second speed is equal to the first speed.
[0031] In this embodiment, the battery swapping unit 2 moves on a track via a drive structure. The drive structure includes a first drive structure 11 and a second drive structure 12. The first drive structure 11 includes a first motor 111, and the second drive structure 12 includes a second motor 121. To achieve synchronous movement of both ends of the battery swapping unit on the track driven by the first motor 111 and the second motor 121, before the first motor 111 and the second motor 121 rotate simultaneously, it is first determined that the starting points of the first motor 111 and the second motor 121 during synchronous movement are aligned. Then, the positions or speeds of the first motor 111 and the second motor 121 are bound together. Since misalignment of the two motors will result in unequal loads, by obtaining the first torque of the first motor 111 and the second torque of the second motor 121, the first difference between the first torque and the second torque is made zero to achieve equal loads, thereby achieving alignment of the starting points. Adjusting the positions of the first motor 111 and / or the second motor 121 can also ensure that the first difference between the first torque and the second torque is zero. For ease of operation, the starting point of the first motor 111 during synchronous movement, i.e., the first position, is first determined. Using this first position as a reference, the position of the second motor 121 is adjusted. The adjustment involves controlling the rotational speed and direction of movement of the second motor 121. When the first difference between the first torque and the second torque is zero, the second motor 121 is located at the starting point during synchronous movement, i.e., the second position. Therefore, by achieving synchronous movement of the first motor 111 and the second motor 121 on the track, this invention not only avoids the battery swapping unit 2 slowing down due to insufficient driving force but also reduces the possibility of vibration caused by unbalanced driving force, thereby improving the stability of the battery swapping unit 2's movement on the track.
[0032] Optionally, such as Figure 2As shown, the first drive structure 11 further includes a first belt 112 and a first structure 113, and the second drive structure 12 further includes a second belt 122 and a second structure 123. The first structure 113 includes a first pulley and at least one first rotating structure. The first pulley is connected to the shaft of the first motor 111, and each of the first rotating structures is connected to the housing of the first motor 111. The second structure 123 includes a second pulley and at least one second rotating structure. The second pulley is connected to the shaft of the second motor 121, and each of the second rotating structures is connected to the housing of the second motor 121. One end of the first belt 112 is connected to one end of the first guide rail 31, and the other end of the first belt 112 passes sequentially around the first pulley and each of the first rotating structures and connects to the first guide rail 31. The other end of the first guide rail 31 is connected to the first rotating structure, which is used to adjust the tension of the first belt 112 and the contact area between the first belt 112 and the first pulley. One end of the second belt 122 is connected to one end of the second guide rail 32, and the other end of the second belt 122 passes around the second pulley and each of the second rotating structures in sequence and is connected to the other end of the second guide rail 32. The second rotating structure is used to adjust the tension of the second belt 122 and the contact area between the second belt 122 and the second pulley. When the first motor 111 rotates and drives the first structure 113 to move along the first belt 112, and the second motor 121 rotates and drives the second structure 123 to move along the second belt 122, the battery swapping body 2 is moved on the track. And / or, before determining the first position of the first motor 111 on the first guide rail 31, the method further includes: Obtain the first tension of the first belt 112 and the second tension of the second belt 122; Adjust both the first tension and the second tension to the preset range.
[0033] Specifically, anti-collision posts 4 are provided at the left and right ends of the first guide rail 31 and the second guide rail 32. The anti-collision posts 4 secure the two ends of the first belt 112 to the first guide rail 31 and the two ends of the second belt 122 to the second guide rail 32. Furthermore, the first belt 112 needs to pass over the first pulley on the first structure 113 and at least one first rotating structure. For example, as... Figure 3As shown, the first structure 113 has one first pulley and five first rotating structures, which are, from left to right, first rotating structure a, first rotating structure b, first rotating structure c, first rotating structure d, first rotating structure e, and first pulley f. First rotating structure a is above first rotating structure b, first rotating structure b is above first rotating structure c, the height of first rotating structure d is equal to the height of first rotating structure c, the height of first rotating structure e is equal to the height of first rotating structure b, and the height of first pulley f is equal to the height of first rotating structure a. One end of the first belt 112 is fixed to the left end of the first guide rail 31. The other end of the first belt 112 first passes over the right side of first rotating structure a from above, then passes over the left side of first rotating structure b from above, then passes under first rotating structures c and d from the left, then passes over the right side of first rotating structure e from below, then passes over the left side of first pulley f from below, and finally is fixed to the right end of the first guide rail 31. The second belt 122 passes around the second pulley on the second structure 123 and at least one second rotating structure in the same way that the first belt 112 passes around the first pulley on the first structure 113 and at least one first rotating structure. The operator places a tension tester at the midpoint between the first belt 112 and the second belt 122 to test the tension. If the tension is less than a second preset threshold, the belt is too loose. The operator, whose end of the screw on the tensioning mechanism 5 installed on the bumper post 4 is visible, needs to adjust the screw clockwise to tighten the belt. If the tension is greater than a third preset threshold, the belt is too tight. The operator, whose end of the screw on the tensioning mechanism 5 installed on the bumper post 4 is visible, needs to adjust the screw counterclockwise to loosen the belt. During the adjustment process, the operator continuously uses the tension tester to test the belt tension until the belt tension is greater than or equal to the second preset threshold and less than or equal to the third preset threshold, i.e., the belt tension is within the preset range, and then tightens the screw on the tensioning mechanism 5. The preset range can preferably be from 5300N to 5700N. The setting of the second preset threshold ensures that the belt can drive the battery swapping body 2 to move continuously, and the setting of the third preset threshold avoids the belt from being damaged quickly.
[0034] In this optional embodiment, the current tension of the belts is quantified by acquiring the first tension of the first belt 112 and the second tension of the second belt 122. By adjusting both the first and second tensions to preset ranges, slippage is effectively prevented, ensuring that the rotational motion of the motor is accurately converted into the linear motion of the battery swapping body 2. This also avoids additional wear caused by excessive tension, extending the service life of the drive structure. Furthermore, when both the first and second tensions are within preset ranges, the first torque and the second torque can accurately reflect the relative positional relationship (such as leading, lagging, or aligned) between the first motor 111 and the second motor 121.
[0035] Optionally, before determining the first position of the first motor 111 on the first guide rail 31, the method further includes: The rotation directions of the first motor 111 and the second motor 121 are determined based on the direction in which the battery swapping body 2 moves on the track.
[0036] Specifically, both the first motor 111 and the second motor 121 are installed inside the battery swapping station to prevent external environmental factors (such as rainwater) from affecting their normal operation. During installation, the first motor 111 and the second motor 121 are mirror images of each other about the center of the battery swapping main body 2. Since the first motor 111 and the second motor 121 are the same model of motor, in response to a forward movement command for the battery swapping main body, both the first motor 111 and the second motor 121 move forward along the track, or in response to a reverse movement command for the battery swapping main body, both the first motor 111 and the second motor 121 move in the opposite direction along the track. The rotation direction of the second motor 121 is set to be opposite to the rotation direction of the first motor 111. Assuming the vehicle enters the battery swapping station in the forward direction, when the battery swapping host moves in the forward direction, the first motor 111 rotates counterclockwise and the second motor 121 rotates clockwise when viewed from the direction of the motor shaft, so as to drive the battery swapping body 2 to move in the forward direction on the track; when the battery swapping host receives a command to move in the reverse direction, if the first motor 111 rotates clockwise and the second motor 121 rotates counterclockwise, so as to drive the battery swapping body 2 to move in the reverse direction on the track.
[0037] In this optional embodiment, by determining the rotation directions of the first motor 111 and the second motor 121, the battery swapping unit 2 is prevented from getting stuck or even damaged due to inconsistent movement directions of the first motor 111 and the second motor 121, thus ensuring smooth movement of the battery swapping unit 2 on the track. Specifically, determining the rotation mode involves first determining the direction of movement of the battery swapping unit 2 on the track, then determining the rotation direction of the first motor 111 based on the direction of movement of the battery swapping unit 2 on the track, and finally determining the rotation direction of the second motor 121 based on the rotation direction of the first motor 111. When the first motor 111 and the second motor 121 are mirror images of each other about the center of the battery swapping unit 2, the rotation direction of the second motor 121 is opposite to the rotation direction of the first motor 111.
[0038] Optionally, controlling the movement of the second motor 121 based on the first torque and the second torque includes: When the first torque is not equal to the second torque, the second motor 121 is controlled to move in the direction of the first motor 111.
[0039] Specifically, if the first torque of the first motor 111 and the second torque of the second motor 121 are not equal, it means that the motor with the larger torque bears a greater load and expends more force, and its position is relatively ahead of the motor with the smaller torque. The motor with the larger torque can be controlled to move towards the motor with the smaller torque to reduce the force expended until the first difference in torque between the two motors is zero. At this point, the motor with the larger torque moves to a position opposite to the motor with the smaller torque. Alternatively, the motor with the smaller torque can be controlled to move towards the motor with the larger torque to increase the force expended until the first difference in torque between the two motors is zero. At this point, the motor with the smaller torque moves to a position opposite to the motor with the larger torque. Since the first position of the first motor 111 on the first guide rail 31 is determined, the second motor 121 is controlled to move towards the first motor 111 to adjust the second torque of the second motor 121.
[0040] In this optional embodiment, taking the position of the first motor 111 as a reference, if the first torque is greater than the second torque, it indicates that the force expended by the second motor 121 is less than that expended by the first motor 111, and the position of the second motor 121 lags behind that of the first motor 111. In this case, the second motor 121 is controlled to move towards the first motor 111 to eliminate the first difference. If the first torque is less than the second torque, it indicates that the force expended by the second motor 121 is greater than that expended by the first motor 111, and the position of the second motor 121 is ahead of that of the first motor 111. In this case, the second motor 121 is controlled to move towards the first motor 111 to eliminate the first difference. Aligning the first motor 111 and the second motor 121 by ensuring that their torques are equal lays the foundation for achieving synchronous movement of the first motor 111 and the second motor 121 on the track.
[0041] Optionally, controlling the second motor 121 to move toward the first motor 111 includes: When the first difference is greater than the first preset threshold, the second motor 121 is controlled to rotate at the first preset speed; When the first difference is less than or equal to the first preset threshold, the second motor 121 is controlled to rotate at a second preset speed, wherein the second preset speed is less than the first preset speed.
[0042] Specifically, firstly, a first preset threshold is reasonably set. If the first preset threshold is too large, too much time will be wasted adjusting the second torque of the second motor 121; if the first preset threshold is too small, the second motor 121 may overshoot the torque balance point due to inertia. The first preset threshold can preferably be 5 N·m. Then, the first difference between the first torque of the first motor 111 and the second torque of the second motor 121 is compared with the first preset threshold. If the first difference is greater than the first preset threshold, it is considered that the load imbalance between the two motors is high, and the position of the second motor 121 is significantly ahead or behind the position of the first motor 111. In this case, the second motor 121 is controlled to rotate at the first preset speed to quickly reduce the first difference until the first difference is less than or equal to the first preset threshold. If the first difference is less than or equal to the first preset threshold, it is considered that the load imbalance between the two motors is low, and the position of the second motor 121 is not significantly ahead or behind the position of the first motor 111. In this case, the second motor 121 is controlled to rotate at the second preset speed to slowly reduce the first difference until the first difference is equal to zero, and the second motor 121 is aligned with the first motor 111. In some embodiments, the second preset speed is set to half of the first preset speed, where the first preset speed is 500 RPM and the second preset speed is 250 RPM.
[0043] In this optional embodiment, by comparing the first difference with a first preset threshold, when the torque deviation between the two motors is large, the second motor 121 can be controlled to rotate rapidly at a first preset speed. This effectively avoids the problem of excessive time consumption caused by using low speed for adjustment when the initial deviation is large, thereby significantly shortening the time required for the entire synchronous calibration process and improving the efficiency of equipment debugging and preparation. Furthermore, when the torque deviation between the two motors is small, the second motor 121 can be controlled to rotate slowly at a second preset speed, which is lower than the first preset speed. This allows the second motor 121 to accurately reach the torque balance point, effectively preventing over-adjustment caused by excessive speed.
[0044] Optionally, after binding the first motor 111 and the second motor 121 according to the first position and the second position, the process includes: The third position of the first motor 111 and the fourth position of the second motor 121 are acquired in real time during the movement of the battery swapping body 2. A first displacement is determined based on the first position and the third position, and a second displacement is determined based on the second position and the fourth position; Based on the first displacement and the second displacement, the third preset speed of the second motor 121 is adjusted until the second difference between the first displacement and the second displacement is equal to zero.
[0045] Optionally, adjusting the third preset speed of the second motor 121 based on the first displacement and the second displacement includes: When the second displacement is less than the first displacement, the third preset speed is controlled to increase according to the first preset acceleration; When the second displacement is greater than the first displacement, the third preset speed is controlled to decrease according to the second preset acceleration.
[0046] Specifically, by changing M0 from OFF to ON, the A_GEARIN instruction is triggered, and the master spindle (first motor 111) and slave spindle (second motor 121) are synchronously bound according to the set parameters. The parameters to be set for the A_GEARIN instruction include S0 for specifying the starting address of the input parameters, S1 for specifying the starting address of the output status word, S2 for specifying the starting address of the output status bit, and S3 for specifying the port number of the axis. When S0+1 is 0, the slave spindle (second motor 121) synchronizes with the given target position of the master spindle (first motor 111); when S0+1 is 1, the slave spindle (second motor 121) synchronizes with the feedback encoder position of the master spindle (first motor 111). When S0+3 is 0, if the slave axis (second motor 121) executes a command during its movement, the slave axis (second motor 121) immediately stops its current movement and synchronizes with the master axis (first motor 111). When S0+3 is 1, if the slave axis (second motor 121) executes a command during its movement, it will wait until the current movement of the slave axis (second motor 121) ends before synchronizing with the master axis (first motor 111). S0+12 determines the acceleration of the binding process, and S0+16 determines the deceleration of the binding process. S0+4 determines the numerator of the synchronization ratio, and S0+8 determines the denominator of the synchronization ratio. S1 represents the error code when executing the A_GEARIN command, and S2 represents the execution status of the A_GEARIN command (e.g., S2: In Gear; S2+1: Busy; S2+2: Active; Abort; Error). When S2 displays "InGear", the two motors are successfully bound together. M1 is set to ON. By changing M10 from OFF to ON, the main shaft (first motor 111) moves relative to the main shaft, while the driven shaft (second motor 121) moves synchronously according to a 1:1 synchronization ratio.
[0047] In this optional embodiment, after successfully binding the first motor 111 and the second motor 121, ideally, both the first motor 111 and the second motor 121 rotate at a third preset speed, with their positions aligned in real time. Considering that external factors may affect the synchronous movement of the two motors, the third position of the first motor 111 and the fourth position of the second motor 121 are acquired in real time to determine the first displacement of the first motor 111 and the second displacement of the second motor 121. If the second difference between the first displacement and the second displacement is not equal to zero, it indicates that the movement of the two motors is not synchronized, and the third preset speed of the second motor 121 needs to be adjusted until the second difference between the first displacement and the second displacement is equal to zero, that is, to quickly restore the synchronous movement of the first motor 111 and the second motor 121 on the track, thereby improving the stability of the battery swapping body 2 moving on the track. The specific operation of adjusting the third preset speed is to compare the second displacement with the first displacement. If the second displacement is less than the first displacement, the third preset speed is increased according to the first preset acceleration so that the second motor 121 can catch up with the first motor 111. If the second displacement is greater than the first displacement, the third preset speed is decreased according to the second preset acceleration so that the first motor 111 can catch up with the second motor 121.
[0048] like Figure 4 As shown in the figure, an embodiment of the present invention provides a motor control device 400 applied to a battery swapping device in a battery swapping station. The battery swapping device includes a drive structure, a battery swapping body 2, and a track. The drive structure includes a first drive structure 11 and a second drive structure 12. The first drive structure 11 includes a first motor 111, and the second drive structure 12 includes a second motor 121. The track includes a first guide rail 31 and a second guide rail 32 that are parallel to each other. The first motor 111 is disposed on the first guide rail 31, and the second motor 121 is disposed on the second guide rail 32. One end of the battery swapping body 2 is connected to the first motor 111, and the other end of the battery swapping body 2 is connected to the second motor 121. The first motor 111 is used to move along the first guide rail 31, and the second motor 121 is used to move along the second guide rail 32 to drive the battery swapping body 2 to move on the track. The motor control device 400 includes: The first determining module 410 is used to determine the first position of the first motor 111 on the first guide rail 31; The adjustment module 420 is used to obtain the first torque of the first motor 111 and the second torque of the second motor 121 respectively, and control the second motor 121 to move according to the first torque and the second torque until the first difference between the first torque and the second torque is zero. The second determining module 430 is used to determine the second position of the second motor 121 on the second guide rail 32 when the first difference is zero. The binding module 440 is used to bind the first motor 111 and the second motor 121 according to the first position and the second position, so as to realize the synchronous movement of the first motor 111 and the second motor 121 on the track.
[0049] like Figure 5 As shown, an electronic device 500 provided in this embodiment of the invention includes a memory 510 and a processor 520; the memory 510 is used to store a computer program; the processor 520 is used to implement the motor control method described above when the computer program is executed.
[0050] Alternatively, an electronic device 500 includes a memory 510 and a processor 520 coupled to the memory 510; the memory 510 is configured to store a computer program; and the processor 520 is configured to perform the following operations when the computer program is executed: Determine the first position of the first motor 111 on the first guide rail 31; The first torque of the first motor 111 and the second torque of the second motor 121 are obtained respectively. Based on the first torque and the second torque, the second motor 121 is controlled to move until the first difference between the first torque and the second torque is zero. When the first difference is zero, the second position of the second motor 121 is determined on the second guide rail 32; Based on the first position and the second position, the first motor 111 and the second motor 121 are bound together to achieve synchronous movement of the first motor 111 and the second motor 121 on the track.
[0051] This invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the motor control method described above.
[0052] Alternatively, a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the following operations: Determine the first position of the first motor 111 on the first guide rail 31; The first torque of the first motor 111 and the second torque of the second motor 121 are obtained respectively. Based on the first torque and the second torque, the second motor 121 is controlled to move until the first difference between the first torque and the second torque is zero. When the first difference is zero, the second position of the second motor 121 is determined on the second guide rail 32; Based on the first position and the second position, the first motor 111 and the second motor 121 are bound together to achieve synchronous movement of the first motor 111 and the second motor 121 on the track.
[0053] Electronic device 500, which can serve as a server or client of the present invention, is described below as an example of a hardware device applicable to various aspects of the present invention. Electronic device 500 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device 500 can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0054] Electronic device 500 includes a computing unit that can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) or a computer program loaded from a storage unit into random access memory (RAM). The RAM may also store various programs and data required for device operation. The computing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0055] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. In this application, the units described 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 the embodiments of the present invention according to actual needs. Furthermore, the functional units in the various embodiments of the present invention 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 units can be implemented in hardware or as software functional units.
[0056] While the present invention has been disclosed above, its scope of protection is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, and all such changes and modifications will fall within the scope of protection of the present invention.
Claims
1. A motor control method, applied to the battery swapping equipment in a battery swapping station, characterized in that, The battery swapping device includes a drive structure, a battery swapping body, and a track. The drive structure includes a first drive structure and a second drive structure. The first drive structure includes a first motor, and the second drive structure includes a second motor. The track includes a first guide rail and a second guide rail that are parallel to each other. The first motor is mounted on the first guide rail, and the second motor is mounted on the second guide rail. One end of the battery swapping body is connected to the first motor, and the other end of the battery swapping body is connected to the second motor. The first motor is used to move along the first guide rail, and the second motor is used to move along the second guide rail, thereby driving the battery swapping body to move on the track. The motor control method includes: Determine the first position of the first motor on the first guide rail; The first torque of the first motor and the second torque of the second motor are obtained respectively. Based on the first torque and the second torque, the second motor is controlled to move until the first difference between the first torque and the second torque is zero. When the first difference is zero, the second position of the second motor is determined on the second guide rail; Based on the first position and the second position, the first motor and the second motor are bound together to achieve synchronous movement of the first motor and the second motor on the track.
2. The motor control method according to claim 1, characterized in that, The first drive structure further includes a first belt and a first structure, and the second drive structure further includes a second belt and a second structure. The first structure includes a first pulley and at least one first rotating structure. The first pulley is connected to the shaft of the first motor, and each of the first rotating structures is connected to the housing of the first motor. The second structure includes a second pulley and at least one second rotating structure. The second pulley is connected to the shaft of the second motor, and each of the second rotating structures is connected to the housing of the second motor. One end of the first belt is connected to one end of the first guide rail, and the other end of the first belt passes around the first pulley and each of the first rotating structures and connects to the other end of the first guide rail. The first rotating structure is used to adjust the tension of the first belt and the contact area between the first belt and the first pulley. One end of the second belt is connected to one end of the second guide rail, and the other end of the second belt passes around the second pulley and each of the second rotating structures and connects to the other end of the second guide rail. The second rotating structure is used to adjust the tension of the second belt and the contact area between the second belt and the second pulley. When the first motor rotates, driving the first structure to move along the first belt, and the second motor rotates, driving the second structure to move along the second belt, the battery swapping body moves on the track. And / or, before determining the first position of the first motor on the first guide rail, the method further includes: Obtain the first tension of the first belt and the second tension of the second belt; Adjust both the first tension and the second tension to the preset range.
3. The motor control method according to claim 1, characterized in that, Before determining the first position of the first motor on the first guide rail, the process further includes: The rotation directions of the first motor and the second motor are determined based on the direction in which the battery swapping unit moves on the track.
4. The motor control method according to claim 1, characterized in that, The step of controlling the movement of the second motor based on the first torque and the second torque includes: When the first torque is not equal to the second torque, control the second motor to move in the direction of the first motor.
5. The motor control method according to claim 4, characterized in that, The control of the second motor to move toward the direction of the first motor includes: When the first difference is greater than the first preset threshold, the second motor is controlled to rotate at the first preset speed; When the first difference is less than or equal to the first preset threshold, the second motor is controlled to rotate at a second preset speed, wherein the second preset speed is less than the first preset speed.
6. The motor control method according to claim 1, characterized in that, After binding the first motor and the second motor according to the first position and the second position, the process includes: The third position of the first motor and the fourth position of the second motor are acquired in real time during the movement of the battery swapping unit. A first displacement is determined based on the first position and the third position, and a second displacement is determined based on the second position and the fourth position; Based on the first displacement and the second displacement, the third preset speed of the second motor is adjusted until the second difference between the first displacement and the second displacement is equal to zero.
7. The motor control method according to claim 6, characterized in that, The step of adjusting the third preset speed of the second motor based on the first displacement and the second displacement includes: When the second displacement is less than the first displacement, the third preset speed is controlled to increase according to the first preset acceleration; When the second displacement is greater than the first displacement, the third preset speed is controlled to decrease according to the second preset acceleration.
8. A motor control device, applied to the battery swapping equipment in a battery swapping station, characterized in that, The battery swapping device includes a drive structure, a battery swapping body, and a track. The drive structure includes a first drive structure and a second drive structure. The first drive structure includes a first motor, and the second drive structure includes a second motor. The track includes a first guide rail and a second guide rail that are parallel to each other. The first motor is mounted on the first guide rail, and the second motor is mounted on the second guide rail. One end of the battery swapping body is connected to the first motor, and the other end of the battery swapping body is connected to the second motor. The first motor is used to move along the first guide rail, and the second motor is used to move along the second guide rail, thereby driving the battery swapping body to move on the track. The motor control method includes: The first determining module is used to determine the first position of the first motor on the first guide rail; The adjustment module is used to obtain the first torque of the first motor and the second torque of the second motor respectively, and control the second motor to move according to the first torque and the second torque until the first difference between the first torque and the second torque is zero; The second determining module is used to determine the second position of the second motor on the second guide rail when the first difference is zero. A binding module is used to bind the first motor and the second motor according to the first position and the second position, so as to realize the synchronous movement of the first motor and the second motor on the track.
9. An electronic device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to implement the motor control method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the motor control method as described in any one of claims 1 to 7.