Servo motor driving method and device, storage medium and processor
By dynamically adjusting the current value according to the ambient temperature and operating speed of the servo motor, and driving the servo motor in combination with the PID algorithm, the problem of unstable operation at the moment of starting the motor and under high and low temperature environments is solved, and faster response and more stable operation is achieved .
Patent Information
- Application Number
- CN202210963770.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-11
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-08-11
AI Technical Summary
The prior art is difficult to ensure the smooth operation of the servo motor during the moment of starting the motor and under high and low temperature environments, resulting in slow start-up speed, low response bandwidth, or jitter or overshoot.
By determining the target ambient temperature value based on the current ambient temperature of the servo motor, determining the preset current value in combination with the target running speed, the target current value is then determined, and the servo motor is driven based on the target current value and the PID algorithm.
It ensures the smooth operation of the servo motor at the moment of starting the motor and under high and low temperature environments, improves the start-up speed and response bandwidth, and avoids jitter and overshoot.
Smart Images

Figure CN115242130B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of controllers, and in particular, to a driving method and device for a servo motor, a storage medium, and a processor. Background Art
[0002] In the process of motor drive control, under different industrial control, the motor's running stability will be affected by different torques. Moreover, the output torque of the motor is greatly affected by temperature. Generally speaking, when the same drive current is loaded, the motor torque is small and the load resistance is large at low temperatures; the motor torque is large and the load resistance is small at high temperatures. At the same time, the load resistance is also affected by the rotation speed.
[0003] In the related technology, the conventional motor PID drive algorithm mainly performs closed-loop control through the three loops of the motor's current, speed, and position. First, the maximum current, voltage, and drive frequency required for the motor drive are calculated and set according to the factory parameters of the motor, and the position the motor wants to reach is set. The PID algorithm of the position loop is performed according to the set position to calculate the required running speed of the motor, and then the speed loop PID algorithm is performed according to the calculated speed to calculate the current value required to drive the motor. Finally, the duty cycle of the PWM is adjusted through the current loop PID to achieve the three-loop closed-loop control of the motor.
[0004] However, the related technology ignores the changes in motor parameters caused by temperature during the entire closed-loop process. Generally speaking, under low temperature conditions, the internal resistance of the motor increases, the resistance of the transmission mechanism increases, and the output torque of the motor decreases. Under high temperature conditions, the internal resistance of the motor decreases, the resistance of the transmission mechanism decreases, and the output torque of the motor increases. Moreover, during the movement of the motor, the load resistance will change under different speeds, which is particularly evident at the moment of motor startup. The transition of load resistance from static friction to dynamic friction will cause a step-by-step decrease in resistance. Therefore, using the existing technology to drive the motor will cause the motor to move unsteadily at the moment of startup and under high and low temperature conditions. The startup speed is slow, the response bandwidth is low, or there is jitter and overshoot.
[0005] With regard to the problem in the related art that it is difficult to ensure the smooth operation of the servo motor when the servo motor is started and driven in high and low temperature environments, no effective solution has been proposed so far. Summary of the invention
[0006] The main purpose of the present application is to provide a servo motor driving method and device, storage medium and processor to solve the problem in the related art that it is difficult to ensure the smooth operation of the servo motor when the servo motor is driven at the moment of motor startup and in high and low temperature environments.
[0007] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for driving a servo motor is provided. The method comprises: determining a target ambient temperature value according to the current ambient temperature value of the servo motor; determining a preset current value according to the target operating speed of the servo motor, wherein the target operating speed is the operating speed pre-configured for the servo motor; determining a target current value according to the target ambient temperature value and the preset current value; and driving the servo motor based on the target current value in combination with a PID algorithm.
[0008] Furthermore, determining the preset current value based on the target operating speed of the servo motor includes: obtaining target position data information, wherein the target position data information is used to represent the current position information of the servo motor; determining the target operating speed based on the target position data information in combination with the PID algorithm; determining the preset current value based on the target operating speed in combination with the PID algorithm.
[0009] Furthermore, based on the target operating speed and in combination with the PID algorithm, determining the preset current value includes: setting a corresponding relationship between the operating speed of the servo motor and the current value; determining a first current value based on the corresponding relationship and the target operating speed; based on the target operating speed, performing PID algorithm processing in the speed loop of the servo motor to obtain a second current value; and determining the preset current value based on the first current value and the second current value.
[0010] Furthermore, based on the target position data information and in combination with the PID algorithm, determining the target operating speed includes: performing differential processing on the target position data information to obtain a first operating speed; based on the target position data information, performing PID algorithm processing in the position loop of the servo motor to obtain a second operating speed; and determining the target operating speed based on the first operating speed and the second operating speed.
[0011] Furthermore, the method is applied in a motor drive system, wherein the motor drive system includes at least a motor drive module, and the motor drive module includes at least an encoder, and obtaining target position data information includes: collecting target position data information of the servo motor through the encoder.
[0012] Furthermore, the method is applied in a motor drive system, wherein the motor drive system includes at least a main control module, and the main control module includes at least a main control chip. Determining the target ambient temperature value based on the current ambient temperature value of the servo motor includes: collecting the current ambient temperature of the servo motor through the main control chip; and calculating the current ambient temperature in combination with a temperature compensation algorithm to obtain the target ambient temperature value.
[0013] Furthermore, based on the target current value and in combination with the PID algorithm, driving the servo motor includes: based on the target current value, performing PID algorithm processing in the current loop of the servo motor to adjust the duty cycle of the drive signal of the servo motor; and driving the servo motor according to the adjusted duty cycle of the drive signal of the servo motor.
[0014] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a servo motor driving device is provided. The device comprises: a first determining unit, used to determine a target ambient temperature value according to a current ambient temperature value of the servo motor; a second determining unit, used to determine a preset current value according to a target operating speed of the servo motor, wherein the target operating speed is a running speed pre-configured for the servo motor; a third determining unit, used to determine a target current value according to the target ambient temperature value and the preset current value; and a first driving unit, used to drive the servo motor based on the target current value in combination with a PID algorithm.
[0015] Furthermore, the second determination unit includes: a first acquisition module, used to acquire target position data information, wherein the target position data information is used to represent the current position information of the servo motor; a first determination module, used to determine the target operating speed based on the target position data information in combination with the PID algorithm; and a second determination module, used to determine the preset current value based on the target operating speed in combination with the PID algorithm.
[0016] Furthermore, the second determination module includes: a first setting submodule, used to set the correspondence between the operating speed and the current value of the servo motor; a first determination submodule, used to determine the first current value based on the correspondence and the target operating speed; a first processing submodule, used to perform PID algorithm processing in the speed loop of the servo motor based on the target operating speed to obtain the second current value; and a second determination submodule, used to determine the preset current value based on the first current value and the second current value.
[0017] Furthermore, the first determination module includes: a second processing submodule, used to perform differential processing on the target position data information to obtain a first operating speed; a third processing submodule, used to perform PID algorithm processing in the position loop of the servo motor based on the target position data information to obtain a second operating speed; and a third determination submodule, used to determine the target operating speed based on the first operating speed and the second operating speed.
[0018] Furthermore, the device is applied in a motor drive system, wherein the motor drive system includes at least a motor drive module, the motor drive module includes at least an encoder, and the first acquisition module includes: a first acquisition submodule, used to acquire target position data information of the servo motor through the encoder.
[0019] Furthermore, the device is applied in a motor drive system, wherein the motor drive system includes at least a main control module, and the main control module includes at least a main control chip, and the first determination unit includes: a first acquisition module, used to collect the current ambient temperature of the servo motor through the main control chip; a first calculation module, used to calculate the current ambient temperature in combination with a temperature compensation algorithm to obtain the target ambient temperature value.
[0020] Furthermore, the first driving unit includes: a first processing module, used to perform PID algorithm processing in the current loop of the servo motor based on the target current value, and adjust the duty cycle of the driving signal of the servo motor; a first driving module, used to drive the servo motor according to the adjusted duty cycle of the driving signal of the servo motor.
[0021] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer-readable storage medium is provided, wherein the storage medium stores a program, wherein the program executes any one of the above-mentioned methods for driving a servo motor.
[0022] In order to achieve the above objective, according to another aspect of the present application, a processor is provided, wherein the processor is used to run a program, wherein the program executes any one of the above-mentioned methods for driving a servo motor when running.
[0023] Through this application, the following steps are adopted: determine the target ambient temperature value according to the current ambient temperature value of the servo motor; determine the preset current value according to the target operating speed of the servo motor, wherein the target operating speed is the operating speed pre-configured for the servo motor; determine the target current value according to the target ambient temperature value and the preset current value; drive the servo motor based on the target current value in combination with the PID algorithm, thereby solving the problem in the related art that it is difficult to ensure the smooth operation of the servo motor when the servo motor is driven at the moment of motor startup and in high and low temperature environments. By determining the target ambient temperature value determined according to the current ambient temperature value of the servo motor and the preset current value determined according to the target operating speed of the servo motor, and driving the servo motor based on the target current value in combination with the PID algorithm, the effect of ensuring the smooth operation of the servo motor is achieved when the servo motor is driven at the moment of motor startup and in high and low temperature environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0025] Figure 1 is a flow chart of a servo motor driving method provided according to an embodiment of the present application;
[0026] Figure 2 is a framework diagram of a motor drive system provided according to an embodiment of the present application;
[0027] Figure 3 is a framework diagram of a power module in an embodiment of the present application;
[0028] Figure 4 is a flow chart of an optional servo motor driving method provided according to an embodiment of the present application;
[0029] Figure 5 Schematic diagram of a servo motor driving device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0031] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, other existing embodiments obtained by ordinary technicians in the field without creative work should all fall within the scope of protection of the present application.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] The present invention is described below in conjunction with preferred implementation steps. Figure 1is a flow chart of a servo motor driving method provided in accordance with an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0034] Step S101, determining a target ambient temperature value according to a current ambient temperature value of the servo motor.
[0035] For example, the current ambient temperature value of the servo motor to be driven is determined, and then an ambient temperature value (the above-mentioned target ambient temperature value) to be ultimately used in the motor driving process is calculated based on the current ambient temperature value.
[0036] Step S102 , determining a preset current value according to a target operating speed of the servo motor, wherein the target operating speed is an operating speed pre-configured for the servo motor.
[0037] For example, a required running speed of the servo motor (the above-mentioned target running speed) is set when the servo motor is driven, and then a current value (the above-mentioned preset current value) is determined based on the required running speed of the servo motor and the preset current algorithm when the servo motor is driven.
[0038] Step S103, determining a target current value according to the target ambient temperature value and the preset current value.
[0039] For example, the final current value (the above-mentioned target current value) is calculated based on the calculated ambient temperature value required to be used in the motor driving process and the determined current value.
[0040] Step S104: driving the servo motor based on the target current value in combination with the PID algorithm.
[0041] For example, the servo motor is closed-loop controlled based on the final current value calculated and the PID drive algorithm to drive the servo motor. Moreover, PID is the abbreviation of Proportional, Integral, and Differential. The PID control algorithm is a control algorithm that combines the three links of proportional, integral, and differential.
[0042] Through the above steps S101 to S104, the target current value is determined by determining the target ambient temperature value based on the current ambient temperature value of the servo motor and the preset current value based on the target operating speed of the servo motor, and the servo motor is driven based on the target current value in combination with the PID algorithm, thereby achieving the effect of ensuring the smooth operation of the servo motor at the moment of motor startup and when driving the servo motor in high and low temperature environments.
[0043] In order to accurately obtain the target position data information, in the servo motor driving method provided in the embodiment of the present application, the target position data information can also be obtained through the following steps: the servo motor driving method provided in the embodiment of the present application is applied in a motor driving system, wherein the motor driving system includes at least a motor driving module, and the motor driving module includes at least an encoder, and the target position data information of the servo motor is collected through the encoder.
[0044] For example, Figure 2 is a framework diagram of a motor drive system provided according to an embodiment of the present application, such as Figure 2 As shown, the servo controller (motor drive system) consists of a main control module, a power management module, an interface circuit module and a motor drive module, and the control circuit module includes a storage chip, a main control chip and its peripheral circuits. The power management module includes a power isolation module, a linear voltage regulator module, and a reverse overcurrent protection module. The interface circuit module includes communication interface circuits such as a drive interface, and the communication interface adopts an electrically isolated design. The motor drive module includes a drive control chip, a drive circuit, a voltage and current protection circuit, etc.
[0045] For example, the servo controller has high requirements for the power management module, which not only needs to convert the external power supply voltage into the special voltage used inside the control circuit, but also needs to monitor the real-time voltage and current of the drive part. Figure 3 is a framework diagram of the power module in the embodiment of the present application, such as Figure 3 As shown in the figure, the power management module also integrates the voltage reduction and stabilization function, reverse connection protection function, overvoltage and overcurrent alarm function. In addition, the servo controller isolates and filters the power supply of the board to ensure the electromagnetic compatibility of the board and prevent weak signals from being interfered by large current drive signals.
[0046] In order to ensure the use requirements of the system and the functional requirements that may be expanded in the future, the servo controller is designed with a rich set of external interfaces. In addition, considering the requirements of electromagnetic compatibility, the interface with a higher communication rate adopts the form of electrical isolation to avoid interference from other peripherals in the system or high driving current.
[0047] Moreover, when designing the circuit board layout, the design fully considers the electromagnetic compatibility, heat dissipation, and rationality of the installation and routing of the board to layout the PCB board. It mainly adopts the separation layout of power devices and digital signal devices, small signal routing ground protection treatment, multi-point large-area copper laying, power signal electrical isolation and other means for processing.
[0048] Moreover, the motor drive includes a drive circuit, a current sampling circuit, and an encoder sampling circuit. And the encoder sampling circuit can be used to collect the position information of the servo motor.
[0049] Through the above scheme, the position information of the servo motor can be obtained quickly and accurately using the encoder in the hardware system.
[0050] In order to accurately obtain the target ambient temperature value, in the driving method of the servo motor provided in the embodiment of the present application, the target ambient temperature value can also be obtained through the following steps: the driving method of the servo motor provided in the embodiment of the present application is applied in a motor driving system, wherein the motor driving system includes at least a main control module, and the main control module includes at least a main control chip, and the current ambient temperature of the servo motor is collected through the main control chip; combined with the temperature compensation algorithm, the current ambient temperature is calculated to obtain the target ambient temperature value.
[0051] For example, the servo controller can receive central control instructions and combine the data from encoders, gyroscopes and other sensors to complete the execution of the central control instructions, and control the platform to achieve usage requirements in different states such as guidance, positioning, tracking, and stabilization.
[0052] For example, the temperature sensor in the main control chip can be used to collect the current ambient temperature of the servo motor, and then the collected current temperature and the temperature compensation algorithm are used for calculation to obtain the target ambient temperature value.
[0053] Through the above solution, using the main control chip and temperature compensation algorithm in the hardware system, the ambient temperature value of the servo motor can be obtained quickly and accurately.
[0054] In order to accurately determine the preset current value, in the driving method of the servo motor provided in the embodiment of the present application, the preset current value can also be determined by the following steps: obtaining target position data information, wherein the target position data information is used to represent the current position information of the servo motor; based on the target position data information, combined with the PID algorithm, determining the target operating speed; based on the target operating speed, combined with the PID algorithm, determining the preset current value.
[0055] For example, an encoder is used to collect the position information of a servo motor, and then the required running speed of the motor when driving the motor is calculated based on the collected position information of the servo motor and the motor drive PID algorithm. Then, the preset current value is calculated based on the calculated running speed and the motor drive PID algorithm.
[0056] In summary, the preset current value can be conveniently calculated based on the position information of the servo motor, the motor drive PID algorithm and the required running speed of the motor when driving the motor.
[0057] In order to accurately determine the target running speed, in the driving method of the servo motor provided in the embodiment of the present application, the target running speed can also be determined by the following steps: differential processing is performed on the target position data information to obtain a first running speed; based on the target position data information, PID algorithm processing is performed in the position loop of the servo motor to obtain a second running speed; based on the first running speed and the second running speed, the target running speed is determined.
[0058] For example, the position information of the servo motor collected by the encoder is differentially calculated, and based on the position information of the servo motor collected by the encoder, PID algorithm processing is performed in the position loop of the servo motor to calculate the required running speed of the motor when driving the motor.
[0059] In summary, based on the position information of the servo motor and the motor drive PID algorithm, the required running speed of the motor when driving the motor can be easily calculated.
[0060] In order to accurately determine the preset current value, in the driving method of the servo motor provided in the embodiment of the present application, the preset current value can also be determined by the following steps: setting the corresponding relationship between the operating speed of the servo motor and the current value; determining the first current value based on the corresponding relationship and the target operating speed; based on the target operating speed, performing PID algorithm processing in the speed loop of the servo motor to obtain the second current value; determining the preset current value based on the first current value and the second current value.
[0061] For example, the corresponding relationship between the running speed and the current value of the servo motor is preset, and a current value is obtained according to the corresponding relationship, the preset current algorithm, and the running speed required by the motor when driving the motor. Based on the running speed required by the motor when driving the motor, the PID algorithm is processed in the speed loop of the servo motor to obtain a current value, and finally the preset current value is determined according to the two current values.
[0062] Through the above scheme, the preset current value can be conveniently determined according to the preset corresponding relationship between the running speed and the current value of the servo motor, the running speed required by the motor when driving the motor, and the motor drive PID algorithm.
[0063] In order to conveniently drive the servo motor, in the servo motor driving method provided in the embodiment of the present application, the servo motor can also be driven by the following steps: based on the target current value, PID algorithm processing is performed in the current loop of the servo motor to adjust the duty cycle of the drive signal of the servo motor; and the servo motor is driven according to the adjusted duty cycle of the drive signal of the servo motor.
[0064] For example, based on the final current value, PID algorithm processing is performed in the current loop of the servo motor, and the PWM duty cycle of the servo motor is adjusted, and then based on the adjusted PWM duty cycle, the three-loop closed-loop control of the motor is implemented to drive the servo motor.
[0065] Through the above scheme, the servo motor can be driven conveniently according to the final current value and PID algorithm.
[0066] For example, Figure 4 is a flow chart of an optional servo motor driving method provided according to an embodiment of the present application, such as Figure 4 As shown, a temperature sensor is used to collect the ambient temperature during driving, and the driving current is dynamically adjusted in combination with the motor parameters. At the same time, the motor's rotation speed is calculated by differentiating the collected motor encoder data. And a preset current is used in a known speed range to complete a smooth transition of the step resistance. This fully considers the changes in the motor and transmission mechanism caused by high and low temperatures, and at the same time pre-processes the known step resistance, thereby ensuring the smooth operation of the motor in the full temperature and full speed process. That is, temperature and speed feedback are adopted, and the motor drive is adjusted dynamically, so that the motor can achieve stable control in the full temperature range and full speed range, thereby improving the temperature adaptability and environmental adaptability of the turntable.
[0067] In summary, the driving method of the servo motor provided in the embodiment of the present application determines the target ambient temperature value according to the current ambient temperature value of the servo motor; determines the preset current value according to the target operating speed of the servo motor, wherein the target operating speed is the operating speed pre-configured for the servo motor; determines the target current value according to the target ambient temperature value and the preset current value; drives the servo motor based on the target current value in combination with the PID algorithm, thereby solving the problem in the related art that it is difficult to ensure the smooth operation of the servo motor when the servo motor is driven in a high and low temperature environment at the moment of motor startup and in high and low temperature environments. By determining the target ambient temperature value determined according to the current ambient temperature value of the servo motor and the preset current value determined according to the target operating speed of the servo motor, and driving the servo motor based on the target current value in combination with the PID algorithm, the effect of ensuring the smooth operation of the servo motor is achieved when the servo motor is driven in a high and low temperature environment at the moment of motor startup and in high and low temperature environments.
[0068] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0069] The embodiment of the present application also provides a servo motor driving device. It should be noted that the servo motor driving device of the embodiment of the present application can be used to execute the servo motor driving method provided in the embodiment of the present application. The servo motor driving device provided in the embodiment of the present application is introduced below.
[0070] Figure 5 Schematic diagram of a servo motor driving device according to an embodiment of the present application. Figure 5 As shown, the device includes: a first determining unit 501 , a second determining unit 502 , a third determining unit 503 and a first driving unit 504 .
[0071] Specifically, the first determining unit 501 is used to determine the target ambient temperature value according to the current ambient temperature value of the servo motor;
[0072] A second determining unit 502 is used to determine a preset current value according to a target operating speed of the servo motor, wherein the target operating speed is an operating speed pre-configured for the servo motor;
[0073] A third determining unit 503 is used to determine a target current value according to a target ambient temperature value and a preset current value;
[0074] The first driving unit 504 is used to drive the servo motor based on the target current value in combination with the PID algorithm.
[0075] In summary, the servo motor driving device provided in the embodiment of the present application determines the target ambient temperature value according to the current ambient temperature value of the servo motor through the first determining unit 501; the second determining unit 502 determines the preset current value according to the target operating speed of the servo motor, wherein the target operating speed is the operating speed pre-configured for the servo motor; the third determining unit 503 determines the target current value according to the target ambient temperature value and the preset current value; the first driving unit 504 drives the servo motor based on the target current value in combination with the PID algorithm, thereby solving the problem in the related art that it is difficult to ensure the smooth operation of the servo motor when the servo motor is driven at the moment of motor startup and in high and low temperature environments. The target current value is determined by the target ambient temperature value determined according to the current ambient temperature value of the servo motor and the preset current value determined according to the target operating speed of the servo motor, and the servo motor is driven based on the target current value in combination with the PID algorithm, thereby achieving the effect of ensuring the smooth operation of the servo motor when the servo motor is driven at the moment of motor startup and in high and low temperature environments.
[0076] Optionally, in the driving device of the servo motor provided in an embodiment of the present application, the second determination unit includes: a first acquisition module, used to acquire target position data information, wherein the target position data information is used to represent the current position information of the servo motor; a first determination module, used to determine the target operating speed based on the target position data information in combination with the PID algorithm; and a second determination module, used to determine a preset current value based on the target operating speed in combination with the PID algorithm.
[0077] Optionally, in the driving device of the servo motor provided in the embodiment of the present application, the second determination module includes: a first setting submodule, used to set the correspondence between the operating speed of the servo motor and the current value; a first determination submodule, used to determine the first current value based on the correspondence and the target operating speed; a first processing submodule, used to perform PID algorithm processing in the speed loop of the servo motor based on the target operating speed to obtain the second current value; and a second determination submodule, used to determine the preset current value based on the first current value and the second current value.
[0078] Optionally, in the driving device of the servo motor provided in the embodiment of the present application, the first determination module includes: a second processing sub-module, used to perform differential processing on the target position data information to obtain a first operating speed; a third processing sub-module, used to perform PID algorithm processing in the position loop of the servo motor based on the target position data information to obtain a second operating speed; and a third determination sub-module, used to determine the target operating speed based on the first operating speed and the second operating speed.
[0079] Optionally, in the driving device of the servo motor provided in an embodiment of the present application, the device is applied in a motor driving system, wherein the motor driving system includes at least a motor driving module, the motor driving module includes at least an encoder, and the first acquisition module includes: a first acquisition sub-module, for acquiring target position data information of the servo motor through the encoder.
[0080] Optionally, in the driving device of the servo motor provided in an embodiment of the present application, the device is used in a motor driving system, wherein the motor driving system includes at least a main control module, and the main control module includes at least a main control chip, and the first determination unit includes: a first acquisition module, used to collect the current ambient temperature of the servo motor through the main control chip; a first calculation module, used to calculate the current ambient temperature in combination with a temperature compensation algorithm to obtain a target ambient temperature value.
[0081] Optionally, in the driving device of the servo motor provided in an embodiment of the present application, the first driving unit includes: a first processing module, used to perform PID algorithm processing in the current loop of the servo motor based on the target current value, and adjust the duty cycle of the driving signal of the servo motor; a first driving module, used to drive the servo motor according to the adjusted duty cycle of the driving signal of the servo motor.
[0082] The driving device of the servo motor includes a processor and a memory. The first determination unit 501, the second determination unit 502, the third determination unit 503 and the first driving unit 504 are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
[0083] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters can be adjusted to ensure the smooth operation of the servo motor when the motor is started and when the servo motor is driven in high and low temperature environments.
[0084] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0085] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the driving method of the servo motor is implemented.
[0086] An embodiment of the present invention provides a processor, which is used to run a program, wherein the driving method of the servo motor is executed when the program is run.
[0087] An embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: determining a target ambient temperature value based on a current ambient temperature value of a servo motor; determining a preset current value based on a target operating speed of the servo motor, wherein the target operating speed is an operating speed pre-configured for the servo motor; determining a target current value based on the target ambient temperature value and the preset current value; and driving the servo motor based on the target current value in combination with a PID algorithm.
[0088] When the processor executes the program, the following steps are also implemented: determining the preset current value based on the target operating speed of the servo motor includes: obtaining target position data information, wherein the target position data information is used to represent the current position information of the servo motor; determining the target operating speed based on the target position data information in combination with the PID algorithm; determining the preset current value based on the target operating speed in combination with the PID algorithm.
[0089] When the processor executes the program, the following steps are also implemented: based on the target operating speed, combined with the PID algorithm, determining the preset current value includes: setting the corresponding relationship between the operating speed of the servo motor and the current value; determining the first current value based on the corresponding relationship and the target operating speed; based on the target operating speed, performing PID algorithm processing in the speed loop of the servo motor to obtain a second current value; determining the preset current value based on the first current value and the second current value.
[0090] When the processor executes the program, the following steps are also implemented: based on the target position data information, combined with the PID algorithm, the target operating speed is determined, including: differentiating the target position data information to obtain a first operating speed; based on the target position data information, performing PID algorithm processing in the position loop of the servo motor to obtain a second operating speed; and determining the target operating speed based on the first operating speed and the second operating speed.
[0091] When the processor executes the program, the following steps are also implemented: the method is applied in a motor drive system, wherein the motor drive system includes at least a motor drive module, the motor drive module includes at least an encoder, and obtaining the target position data information includes: collecting the target position data information of the servo motor through the encoder.
[0092] When the processor executes the program, the following steps are also implemented: the method is applied in a motor drive system, wherein the motor drive system includes at least a main control module, and the main control module includes at least a main control chip. Determining the target ambient temperature value based on the current ambient temperature value of the servo motor includes: collecting the current ambient temperature of the servo motor through the main control chip; and calculating the current ambient temperature in combination with a temperature compensation algorithm to obtain the target ambient temperature value.
[0093] When the processor executes the program, the following steps are also implemented: based on the target current value, combined with the PID algorithm, the servo motor is driven, including: based on the target current value, the PID algorithm is processed in the current loop of the servo motor to adjust the duty cycle of the drive signal of the servo motor; based on the adjusted duty cycle of the drive signal of the servo motor, the servo motor is driven.
[0094] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0095] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the following method steps: determining a target ambient temperature value based on a current ambient temperature value of the servo motor; determining a preset current value based on a target operating speed of the servo motor, wherein the target operating speed is an operating speed pre-configured for the servo motor; determining a target current value based on the target ambient temperature value and the preset current value; and driving the servo motor based on the target current value in combination with a PID algorithm.
[0096] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: determining a preset current value based on the target operating speed of the servo motor includes: obtaining target position data information, wherein the target position data information is used to represent the current position information of the servo motor; determining the target operating speed based on the target position data information in combination with the PID algorithm; determining the preset current value based on the target operating speed in combination with the PID algorithm.
[0097] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: based on the target operating speed, combined with the PID algorithm, determining the preset current value includes: setting the corresponding relationship between the operating speed and the current value of the servo motor; determining the first current value based on the corresponding relationship and the target operating speed; based on the target operating speed, performing PID algorithm processing in the speed loop of the servo motor to obtain a second current value; determining the preset current value based on the first current value and the second current value.
[0098] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: based on the target position data information, combined with the PID algorithm, determining the target operating speed includes: performing differential processing on the target position data information to obtain a first operating speed; based on the target position data information, performing PID algorithm processing in the position loop of the servo motor to obtain a second operating speed; determining the target operating speed based on the first operating speed and the second operating speed.
[0099] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: the method is applied in a motor drive system, wherein the motor drive system includes at least a motor drive module, the motor drive module includes at least an encoder, and obtaining target position data information includes: collecting the target position data information of the servo motor through the encoder.
[0100] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: the method is applied in a motor drive system, wherein the motor drive system includes at least a main control module, and the main control module includes at least a main control chip. Determining the target ambient temperature value based on the current ambient temperature value of the servo motor includes: collecting the current ambient temperature of the servo motor through the main control chip; and calculating the current ambient temperature in combination with a temperature compensation algorithm to obtain the target ambient temperature value.
[0101] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: based on the target current value, combined with the PID algorithm, driving the servo motor includes: based on the target current value, performing PID algorithm processing in the current loop of the servo motor to adjust the duty cycle of the drive signal of the servo motor; driving the servo motor according to the adjusted duty cycle of the drive signal of the servo motor.
[0102] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in conjunction with software and hardware. Moreover, the application can adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program codes.
[0103] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0104] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0105] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0106] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0107] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0108] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0109] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0110] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) in which a computer-usable program code is present.
[0111] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and variations may be present in the present application. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for driving a servo motor, characterized in that: include: Determine the target ambient temperature value according to the current ambient temperature value of the servo motor; Determining a preset current value according to a target operating speed of the servo motor, wherein the target operating speed is an operating speed pre-configured for the servo motor; Determining a target current value according to the target ambient temperature value and the preset current value; Based on the target current value and in combination with a PID algorithm, the servo motor is driven; Wherein, determining the preset current value according to the target operating speed of the servo motor includes: Acquiring target position data information, wherein the target position data information is used to indicate the current position information of the servo motor; Based on the target position data information and in combination with the PID algorithm, determine the target running speed; Based on the target operating speed and in combination with the PID algorithm, determining the preset current value; Based on the target operating speed, in combination with the PID algorithm, determining the preset current value includes: setting a corresponding relationship between the operating speed of the servo motor and the current value; determining a first current value according to the corresponding relationship and the target operating speed; based on the target operating speed, performing PID algorithm processing in the speed loop of the servo motor to obtain a second current value; determining the preset current value according to the first current value and the second current value; Based on the target position data information and in combination with the PID algorithm, determining the target operating speed includes: performing differential processing on the target position data information to obtain a first operating speed; based on the target position data information, performing PID algorithm processing in the position loop of the servo motor to obtain a second operating speed; and determining the target operating speed based on the first operating speed and the second operating speed.
2. The method according to claim 1, characterized in that The method is applied in a motor drive system, wherein the motor drive system includes at least a motor drive module, the motor drive module includes at least an encoder, and obtaining target position data information includes: The target position data information of the servo motor is collected by the encoder.
3. The method according to claim 1, characterized in that The method is applied in a motor drive system, wherein the motor drive system includes at least a main control module, and the main control module includes at least a main control chip. Determining a target ambient temperature value according to a current ambient temperature value of the servo motor includes: The current ambient temperature of the servo motor is collected by the main control chip; In combination with a temperature compensation algorithm, the current ambient temperature is calculated to obtain the target ambient temperature value.
4. The method according to claim 1, characterized in that: Based on the target current value and in combination with a PID algorithm, driving the servo motor includes: Based on the target current value, performing PID algorithm processing in the current loop of the servo motor to adjust the duty cycle of the drive signal of the servo motor; The servo motor is driven according to the adjusted duty cycle of the driving signal of the servo motor.
5. A servo motor driving device, characterized in that: include: A first determining unit, used to determine a target ambient temperature value according to a current ambient temperature value of the servo motor; a second determining unit, configured to determine a preset current value according to a target operating speed of the servo motor, wherein the target operating speed is an operating speed pre-configured for the servo motor; A third determining unit, configured to determine a target current value according to the target ambient temperature value and the preset current value; A first driving unit, configured to drive the servo motor based on the target current value in combination with a PID algorithm; The second determination unit includes: a first acquisition module for acquiring target position data information, wherein the target position data information is used to indicate the current position information of the servo motor; a first determination module for determining the target running speed based on the target position data information in combination with the PID algorithm; a second determination module for determining the preset current value based on the target running speed in combination with the PID algorithm; The second determination module includes: a first setting submodule, used to set the corresponding relationship between the running speed of the servo motor and the current value; determining the first current value according to the corresponding relationship and the target running speed; a first processing submodule, used to perform PID algorithm processing in the speed loop of the servo motor based on the target running speed to obtain a second current value; a second determination submodule, used to determine the preset current value according to the first current value and the second current value; The first determination module includes: a second processing submodule, used to perform differential processing on the target position data information to obtain a first operating speed; a third processing submodule, used to perform PID algorithm processing in the position loop of the servo motor based on the target position data information to obtain a second operating speed; and a third determination submodule, used to determine the target operating speed based on the first operating speed and the second operating speed.
6. A computer-readable storage medium, characterized in that: The storage medium stores a program, wherein the program executes the servo motor driving method according to any one of claims 1 to 4.
7. A processor, characterized in that: The processor is used to run a program, wherein the program executes the servo motor driving method according to any one of claims 1 to 4 when running.
Citation Information
Patent Citations
Motor drive control device and control method thereof
CN108155834A