Multifunctional programmable motor control method and device and computer equipment
By receiving and parsing parameter messages from the host computer, storing them in different flash memory areas, and using mode-specific PID parameter design, the problem of a single motor control mode is solved, enabling precise and stable control of the motor in multiple modes and adapting to diverse scenario requirements.
Patent Information
- Application Number
- CN202511183443.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-12-02
AI Technical Summary
Existing motor control systems cannot achieve motor programmability, resulting in a single control mode, chaotic parameter management, insufficient flexibility in mode switching, low efficiency in message interaction, and a tendency to cause control anomalies.
By receiving parameter messages sent by the host computer, parsing the operating mode parameters and motor application parameters, and storing them in different flash memory areas, the system adopts a mode-specific PID parameter and control loop design to achieve parameter classification management and precise recall, dynamically verify the correctness of messages, and support free switching and flexible control of the motor in different modes.
It enables the diversification of motor control modes, improves storage efficiency and data security, avoids abnormal operation, enhances the flexibility and efficiency of programming interaction, and adapts to diverse scenario requirements.
Smart Images

Figure CN121055853A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of motor control technology, specifically to a multifunctional programmable motor control method, device, and computer equipment. Background Technology
[0002] Major international air conditioning manufacturers (such as Mars, JCI, and Carrier) have developed a wide variety of load applications over the years. Each application has different requirements for motor settings. For example, there are constant speed operation mode, constant torque operation mode, and constant air volume operation mode. The speed range, torque range, and air volume range are all different. This makes it very inconvenient to develop motors from second-hand suppliers or aftermarket motors.
[0003] In the field of motor control, multi-mode operation (such as speed control, torque control, and airflow control) has become a core requirement for meeting diverse application scenarios. Traditional motor control systems typically employ fixed parameter storage and a single control logic, which has the following technical limitations:
[0004] Parameter management is chaotic: Motor application parameters (such as PWM (Pulse Width Modulation) limits, speed limits, etc.) and mode-specific parameters (such as constant air volume coefficient) are often stored together, resulting in low efficiency of parameter retrieval and difficulty in maintenance and updates.
[0005] Insufficient flexibility in mode switching: Most systems require hardware jumpers or firmware recompilation to achieve mode switching, and cannot be dynamically configured by the host computer, making it difficult to adapt to real-time operating condition adjustment needs.
[0006] Low message exchange efficiency: The parameter configuration messages between the host computer and the motor lack conditional verification and dynamic triggering mechanisms. All parameters must be written regardless of the control mode, resulting in communication redundancy and easy control abnormalities caused by parameter mismatch.
[0007] In summary, the inability to programmable motors in existing technologies leads to a single motor control mode. Summary of the Invention
[0008] In view of this, the present invention provides a multifunctional programmable motor control method, device and computer equipment to solve the problem of the single motor control mode caused by the inability to program the motor.
[0009] In a first aspect, the present invention provides a multifunctional programmable motor control method, the method comprising:
[0010] Receive parameter messages sent by the host computer and parse the operating mode parameters and programmable motor application parameters in the parameter messages;
[0011] The corresponding motor operating mode is called based on the operating mode parameters, and the target value is calculated based on the corresponding programmable motor application parameters under the operating mode.
[0012] The operating mode of the motor is controlled based on the target value.
[0013] This invention provides a multifunctional programmable motor control method. By receiving parameter messages sent from a host computer, it first extracts the operating mode parameters to determine which working mode to call. At the same time, it extracts the motor application parameters to calculate the target value. The target value and the corresponding motor application parameters are input to each loop module to control the motor in different operating modes. This method enables free switching between constant air volume control mode and other control modes, and calls the control application parameters of different modes to support motor operation. It also enables the programmability of the set parameters, solving the problem of the single motor control mode caused by the inability to program the motor.
[0014] In an optional implementation, before receiving the parameter message sent by the host computer, the method further includes:
[0015] The host computer writes the motor application parameters that need to be programmed and the range of values for each parameter to the first flash memory area.
[0016] Set the constant air volume coefficient required for the motor's constant air volume operation mode and store it in the second flash memory area.
[0017] This invention provides a multifunctional programmable motor control method in which motor application parameters and constant air volume control parameters are stored in different flash memory areas, enabling parameter classification management and precise retrieval, improving storage efficiency and data security, and facilitating retrieval for different operating modes.
[0018] In one optional implementation, a parameter message sent by a host computer is received, and the operating mode parameters and motor application parameters in the parameter message are parsed, including:
[0019] After the motor is connected to the host computer, it receives the parameter messages sent by the host computer and verifies the correctness of the parameter messages.
[0020] Once the verification is successful, the operating mode parameters and motor application parameters in the parameter message are parsed. If the value of the operating mode parameter is equal to the third preset value, the constant air volume coefficient will continue to be received and written.
[0021] This invention provides a multifunctional programmable motor control method that effectively filters erroneous data generated during transmission due to interference or misoperation by verifying the correctness of parameter messages sent by the host computer (such as CRC check, checksum comparison, etc.). This prevents abnormal operation (such as excessive speed, torque loss, etc.) caused by erroneous parameters being written into the motor control system, thus ensuring the safety of motor operation from the source. The method dynamically determines whether to write a constant air volume coefficient message based on the motor's operating mode, avoiding invalid data transmission and improving the flexibility and efficiency of programming interaction.
[0022] In one optional implementation, the programmable motor application parameters include programmable PWM upper and lower limits, programmable speed upper and lower limits, programmable torque upper and lower limits, and programmable airflow upper and lower limits;
[0023] The corresponding motor operating mode is invoked based on the programmable motor application parameters, and the target value is calculated based on the corresponding programmable motor application parameters within the operating mode, including:
[0024] When the control mode parameter value is equal to the first preset value, the constant speed operation mode of the motor is called, and the target speed value is calculated based on the programmable PWM upper and lower limits and the programmable speed upper and lower limits.
[0025] When the control mode parameter value is equal to the second preset value, the constant torque operation mode of the motor is invoked, and the torque target value is calculated based on the programmable PWM upper and lower limits and the programmable torque upper and lower limits;
[0026] When the control mode parameter value is equal to the third preset value, the constant air volume operation mode of the motor is invoked, and the target air volume value is calculated based on the programmable PWM upper and lower limits and the programmable air volume upper and lower limits.
[0027] This invention provides a multifunctional programmable motor control method. By designing the upper and lower limits of PWM, speed, torque, and airflow as programmable parameters, users can flexibly adjust the parameter range according to specific application scenarios (such as different loads, environmental conditions, and equipment specifications) without modifying the underlying motor control code or hardware circuitry. It features high programmability and adaptability to diverse scenario requirements. The method allows for free switching between constant airflow control mode and other control modes, and the use of control parameters from different modes to support motor operation.
[0028] In one optional implementation, the formula for calculating the target speed value based on the programmable PWM upper and lower limits and the programmable speed upper and lower limits is as follows:
[0029] rpm_setting=min_speed_prog+(pwm_setting-min_pwm_prog)*(max_speed_prog-min_speed_prog) / (max_pwm_prog-min_pwm_prog);
[0030] Where rpm_setting is the target speed value, min_speed_prog is the programmable lower speed limit value, pwm_setting is the PWM setting value, min_pwm_prog is the programmable lower PWM limit value, max_speed_prog is the programmable upper speed limit value, and max_pwm_prog is the programmable upper PWM limit value.
[0031] In one alternative implementation, the formula for calculating the target torque value based on the programmable PWM upper and lower limits and the programmable torque upper and lower limits is as follows:
[0032] torque_setting=min_torque_prog+(pwm_setting-min_pwm_prog)*(max_torque_prog-min_torque_prog) / (max_pwm_prog-min_pwm_prog);
[0033] Where torque_setting is the target torque value, min_torque_prog is the programmable lower limit torque value, and max_torque_prog is the programmable upper limit torque value.
[0034] In one optional implementation, the formula for calculating the target airflow value based on the programmable PWM upper and lower limits and the programmable airflow upper and lower limits is as follows:
[0035] cfm_setting=min_cfm_prog+(pwm_setting-min_pwm_prog)*(max_cfm_prog-min_cfm_prog) / (max_pwm_prog-min_pwm_prog);
[0036] Where cfm_setting is the target air volume value, min_cfm_prog is the programmable lower limit air volume value, and max_pwm_prog is the programmable upper limit air volume value.
[0037] In one optional implementation, controlling the motor's operating mode based on a target value includes:
[0038] Speed loop PID control is performed on the motor in constant speed operation mode based on the target speed value;
[0039] Torque loop PID control is performed on the motor in constant torque operation mode based on the torque target value;
[0040] A constant air volume control function is generated based on the target air volume value and the constant air volume coefficient, and the constant air volume operation mode of the motor is subjected to PID control of the air volume loop based on the constant air volume control function.
[0041] This invention provides a multi-functional programmable motor control method. It adopts mode-specific PID parameters and control loop design to adapt to different physical characteristics (different dynamic response laws of speed, torque, and airflow) for different operating modes. The control logic of the three modes (speed loop PID, torque loop PID, and airflow loop PID) adopts a modular design, with each module operating independently and having clear interfaces. This achieves accurate, stable, and reliable motor control in multiple modes, while also considering scenario adaptability and system maintainability.
[0042] In a second aspect, the present invention provides a multifunctional programmable motor control device, the device comprising:
[0043] The parameter message receiving and parsing module is used to receive parameter messages sent by the host computer and parse the programmable motor application parameters in the parameter messages;
[0044] The motor operation mode invocation and target value calculation module is used to invoke the corresponding motor operation mode based on the programmable motor application parameters, and calculate the target value based on the corresponding programmable motor application parameters under the operation mode.
[0045] The motor operation mode control module is used to control the motor's corresponding operation mode based on target values.
[0046] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the multifunctional programmable motor control method of the first aspect or any corresponding embodiment described above.
[0047] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the multifunctional programmable motor control method of the first aspect or any corresponding embodiment described above.
[0048] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the multifunctional programmable motor control method of the first aspect or any corresponding embodiment described above. Attached Figure Description
[0049] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0050] Figure 1 This is a flowchart illustrating a multi-functional programmable motor control method according to an embodiment of the present invention;
[0051] Figure 2 This is a flowchart illustrating another multifunctional programmable motor control method according to an embodiment of the present invention;
[0052] Figure 3 This is a flowchart illustrating another multifunctional programmable motor control method according to an embodiment of the present invention;
[0053] Figure 4 This is a flowchart illustrating another multi-functional programmable motor control method according to an embodiment of the present invention;
[0054] Figure 5 This is a structural block diagram of a multi-functional programmable motor control device according to an embodiment of the present invention;
[0055] Figure 6 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] The motor application parameters of existing HVAC (Heating, Ventilation and Air Conditioning) equipment, including control mode, direction of rotation, speed range, torque range, air volume range, PWM range, etc., are irregular. It is inconvenient to develop new auxiliary motors and after-sales motors, and the inability to program the motors easily leads to the problem of a single motor control mode.
[0058] This invention provides a multifunctional programmable motor control method. It receives and decodes messages sent from a host computer, first extracts operating mode parameters to determine which operating mode to use, and then extracts application parameters to calculate target values. These target values and corresponding control module parameters are input to each loop module to control the motor in different operating modes. This method enables free switching between constant airflow control mode and other control modes, and calls control application parameters for different modes to support motor operation. Furthermore, it allows for programmable setting parameters, solving the problem of a single motor control mode due to the inability to programmable the motor.
[0059] According to an embodiment of the present invention, a multifunctional programmable motor control method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0060] This embodiment provides a multifunctional programmable motor control method, which can be used in motors, HVAC equipment, etc. Figure 1 This is a flowchart of a multi-functional programmable motor control method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0061] Step S101: Receive the parameter message sent by the host computer and parse the operating mode parameters and programmable motor application parameters in the parameter message.
[0062] like Figure 4 As shown, after the motor is connected to the dedicated host computer, it receives and decodes the parameter messages sent by the host computer, and parses the operating mode parameter control_mode and programmable motor application parameters in the decoded parameter messages, such as the upper and lower limits of PWM, speed, torque, and airflow.
[0063] Step S102: Call the corresponding motor operation mode based on the operation mode parameters, and calculate the target value based on the corresponding programmable motor application parameters under the operation mode.
[0064] Specifically, based on the operating mode parameters, the corresponding constant speed, constant torque, or constant air volume operating mode of the motor is invoked, and the target speed, target torque, or target air volume value is calculated by using a preset formula in combination with the corresponding mode's exclusive programmable parameters.
[0065] Step S103: Control the operating mode of the motor based on the target value.
[0066] Specifically, based on the calculated target value, speed loop PID (Proportional-Integral-Derivative) control logic, torque loop PID control logic, or air volume loop PID control logic combined with constant air volume coefficient are used to achieve accurate and stable operation of the motor in the corresponding mode.
[0067] The multifunctional programmable motor control method provided in this embodiment receives parameter messages sent by the host computer, first extracts the operating mode parameters to determine which working mode to call, and then extracts the motor application parameters to calculate the target value. The target value and the corresponding motor application parameters are input to each loop module to control the motor in different operating modes. This enables free switching between constant air volume control mode and other control modes, and calls the control application parameters of different modes to support motor operation. It also enables the programmability of the set parameters, solving the problem of the single motor control mode caused by the inability to program the motor.
[0068] This embodiment provides a multifunctional programmable motor control method, which can be used in motors, HVAC equipment, etc. Figure 2 This is a flowchart of a multi-functional programmable motor control method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0069] Step S201: Write the motor application parameters and the range of values of each parameter that need to be programmed into the motor through the host computer and store them in the first flash memory area; set the constant air volume coefficient required for the constant air volume operation mode of the motor and store it in the second flash memory area.
[0070] Specifically, the first flash memory area is the first section of the flash memory, referred to as Flash Area 1; the second flash memory area is the second section of the flash memory, referred to as Flash Area 2.
[0071] First, define the motor application parameters that need to be programmed and their corresponding value ranges, and allocate the first Flash memory space for storage. The specific parameters are shown in Table 1 below.
[0072] Secondly, define the constant air volume coefficient variables (10 and 20 bytes) required for constant air volume mode operation, and allocate the second Flash memory space for storage.
[0073] Table 1 Motor Application Parameters
[0074]
[0075] In Table 1, rpm represents revolutions per minute, ozft is the torque unit, representing ounce force, Direction represents the steering number, HP represents the power segment number, and CFM stands for Cubic Feet per Minute.
[0076] Step S202: Receive the parameter message sent by the host computer and parse the operating mode parameters and programmable motor application parameters in the parameter message.
[0077] Specifically, after the motor is connected to the dedicated host computer software, the user programs the motor, first writing the motor application parameter communication message (and verifying its correctness), and then deciding whether to continue writing the constant air volume coefficient communication message based on the written application parameter value contro_mode. The above step S202 includes:
[0078] Step S2021: After the motor is connected to the host computer, the parameter message sent by the host computer is received and the correctness of the parameter message is verified.
[0079] Specifically, such as Figure 4 As shown, after the motor is connected to the host computer, the host computer confirms that the link is normal and actively sends a motor application parameter message as the starting command for parameter configuration.
[0080] After receiving the complete message, the motor controller first extracts the frame header and frame tail to confirm that the message format is valid (not garbled or truncated data).
[0081] CRC checksum calculation: Recalculate the checksum value for the parameter data segment (using the same algorithm as the host computer, such as CRC16), and compare it with the checksum field in the message.
[0082] Verification result processing: If the verification passes: the controller returns a verification success response (e.g., 0x00) and enters the parameter parsing stage; if the verification fails: the controller returns a verification error response (e.g., 0x01) with an error code (e.g., 0x02 indicates CRC mismatch, 0x03 indicates frame format error). The host computer receives the code and resends the message (maximum of 3 retries; if it still fails, the user is prompted to check the communication link).
[0083] Step S2022: After the verification is passed, the operating mode parameters and motor application parameters in the parameter message are parsed. If the value of the operating mode parameter is equal to the third preset value, the constant air volume coefficient is continued to be received and written.
[0084] Specifically, after the verification is successful, the motor controller parses the data according to a fixed order of parameter data segments:
[0085] Extract the operating mode parameters from the first byte (such as contro_mode in Table 1, 1 byte, with values 01 / 02 / 03, corresponding to constant speed / constant torque / constant air volume modes respectively);
[0086] Extract motor application parameters such as programmable PWM upper and lower limits (e.g., max_pwm_prog, min_pwm_prog in Table 1) and programmable speed upper and lower limits (max_speed_prog, min_speed_prog) in sequence, and convert them into numerical values (e.g., convert 2-byte data 0x00C8 to decimal 200).
[0087] If control_mode ≠ 03 (non-constant airflow mode): there is no need to receive the constant airflow coefficient. The application parameters are directly written into the first interval of Flash (stored according to the preset address mapping). After completion, a parameter configuration completion signal (such as 0x05) is returned.
[0088] If contro_mode = 03 (constant airflow mode): the controller returns a request for a constant airflow coefficient signal (e.g., 0x06), triggering the host computer to send subsequent messages.
[0089] Step S203: Based on the operating mode parameters, the corresponding motor operating mode is invoked, and the target value is calculated based on the corresponding programmable motor application parameters within the operating mode. For details, please refer to [link to relevant documentation]. Figure 1 Step S102 of the illustrated embodiment will not be described again here.
[0090] Step S204: Control the motor's operating mode based on the target value. For details, please refer to [link / reference]. Figure 1 Step S103 of the illustrated embodiment will not be described again here.
[0091] The multifunctional programmable motor control method provided in this embodiment stores motor application parameters and constant airflow control parameters in different flash memory areas, enabling parameter classification management and precise retrieval, improving storage efficiency and data security, and facilitating control retrieval for different operating modes. By performing correctness verification on parameter messages sent by the host computer (such as CRC check, checksum comparison, etc.), erroneous data generated during transmission due to interference, misoperation, etc., can be effectively filtered out, avoiding abnormal operation (such as speed exceeding limits, torque loss, etc.) caused by writing erroneous parameters into the motor control system, thus ensuring the safety of motor operation from the source. Whether to write the constant airflow coefficient message is dynamically determined based on the motor operating mode, avoiding invalid data transmission and improving the flexibility and efficiency of programming interaction.
[0092] This embodiment provides a multifunctional programmable motor control method, which can be used in motors, HVAC equipment, etc. Figure 3 This is a flowchart of a multi-functional programmable motor control method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:
[0093] Step S301: Receive the parameter message sent by the host computer and parse the operating mode parameters and programmable motor application parameters in the parameter message. For details, please refer to [link to relevant documentation]. Figure 2 Step S202 of the illustrated embodiment will not be described again here.
[0094] Step S302: Call the corresponding motor operating mode based on the operating mode parameters, and calculate the target value based on the corresponding programmable motor application parameters under the operating mode.
[0095] Specifically, the programmable motor application parameters include programmable PWM upper and lower limits, programmable speed upper and lower limits, programmable torque upper and lower limits, and programmable airflow upper and lower limits. Step S302 includes:
[0096] Step S3021: When the control mode parameter value is equal to the first preset value, the constant speed operation mode of the motor is called, and the target speed value is calculated based on the programmable PWM upper and lower limits and the programmable speed upper and lower limits.
[0097] Specifically, the first preset value is 01. If `contro_mode` = 01, the PWM upper and lower limits (which are the range limits of the motor drive signal) and the speed upper and lower limits (which are the allowable speed range limits of the motor) in Flash Zone 1 are called, and the corresponding standard formula is selected to calculate the target speed value. If there is an overflow, the default limit value is used. The default value refers to the user-defined speed limit value. Overflow occurs when the target speed value exceeds the user-defined speed limit value; in this case, the user-defined speed limit value is used as the target speed value.
[0098] In one optional implementation, the formula for calculating the target speed value based on the programmable PWM upper and lower limits and the programmable speed upper and lower limits (i.e., the linear speed formula) is as follows:
[0099] rpm_setting=min_speed_prog+(pwm_setting-min_pwm_prog)*(max_speed_prog-min_speed_prog) / (max_pwm_prog-min_pwm_prog);
[0100] Where rpm_setting is the target speed value, min_speed_prog is the programmable lower speed limit value, pwm_setting is the PWM setting value, min_pwm_prog is the programmable lower PWM limit value, max_speed_prog is the programmable upper speed limit value, and max_pwm_prog is the programmable upper PWM limit value.
[0101] Step S3022: When the control mode parameter value is equal to the second preset value, the constant torque operation mode of the motor is called, and the torque target value is calculated based on the programmable PWM upper and lower limits and the programmable torque upper and lower limits.
[0102] Specifically, the second preset value is 02.
[0103] If `contro_mode` = 02, the motor application parameters in Flash Zone 1 are called: PWM upper and lower limits and torque upper and lower limits (which are the torque range limits allowed for motor operation). The corresponding standard formula is selected to calculate the target torque value. If overflow occurs, the default limit is used. The default value refers to the user-defined torque limit. Overflow occurs when the target torque value exceeds the user-defined torque limit; in this case, the user-defined torque limit is used as the target torque value.
[0104] In one alternative implementation, the formula for calculating the target torque value based on the programmable PWM upper and lower limits and the programmable torque upper and lower limits (i.e., the linear torque formula) is as follows:
[0105] torque_setting=min_torque_prog+(pwm_setting-min_pwm_prog)*(max_torque_prog-min_torque_prog) / (max_pwm_prog-min_pwm_prog);
[0106] Where torque_setting is the target torque value, min_torque_prog is the programmable lower limit torque value, and max_torque_prog is the programmable upper limit torque value.
[0107] Step S3023: When the control mode parameter value is equal to the third preset value, the constant air volume operation mode of the motor is called, and the target air volume value is calculated based on the programmable PWM upper and lower limits and the programmable air volume upper and lower limits.
[0108] Specifically, if `contro_mode` = 03, the system calls the PWM upper and lower limits and airflow upper and lower limits (which are the limits on the airflow range allowed for motor operation) of the motor application parameters in Flash Zone 1, selects the corresponding standard formula to calculate the target airflow value, and handles overflow according to the default limit. The default value refers to the user-defined airflow limit. Overflow occurs when the target airflow value exceeds the user-defined airflow limit; in this case, the user-defined airflow limit is used as the target airflow value.
[0109] In one optional implementation, the formula for calculating the target airflow value based on the programmable PWM upper and lower limits and the programmable airflow upper and lower limits (i.e., the linear formula for airflow) is as follows:
[0110] cfm_setting=min_cfm_prog+(pwm_setting-min_pwm_prog)*(max_cfm_prog-min_cfm_prog) / (max_pwm_prog-min_pwm_prog);
[0111] Where cfm_setting is the target air volume value, min_cfm_prog is the programmable lower limit air volume value, and max_pwm_prog is the programmable upper limit air volume value.
[0112] Step S303: Control the operating mode of the motor based on the target value.
[0113] Specifically, step S303 includes:
[0114] Step S3031: Perform speed loop PID control on the constant speed operation mode of the motor based on the target speed value.
[0115] Specifically, in constant speed operation mode, the actual motor speed is collected in real time and compared with the target speed value to identify the deviation. The deviation is then adjusted using a PID algorithm to ensure the actual motor speed stably tracks the target value. This includes:
[0116] 1. Deviation Calculation: Real-time calculation of the speed deviation between the target speed and the actual speed:
[0117] If the speed deviation is positive, it means that the actual speed is lower than the target value and the output needs to be increased; if it is negative, it means that the actual speed is too high and the output needs to be reduced.
[0118] 2. Speed Loop PID Regulation: The PID controller calculates and outputs a proportional, integral, and derivative control quantity u_rpm based on the speed deviation, which is ultimately converted into the PWM duty cycle.
[0119] 3. The speed output control quantity calculated by PID is converted into PWM duty cycle (such as 0 to 100% in Table 1), and output to the motor drive circuit to adjust the motor power supply voltage and change the speed.
[0120] Step S3032: Perform torque loop PID control on the constant torque operation mode of the motor based on the torque target value.
[0121] Specifically, in constant torque operation mode, the motor output torque is collected in real time and compared with the target torque value to form a deviation. This deviation is then adjusted via PID control to ensure the actual torque stably tracks the target value. This includes:
[0122] 1. Deviation Calculation: Real-time calculation of the torque deviation between the target torque value and the actual torque.
[0123] 2. Torque loop PID control: The PID controller calculates the output control quantity u_torque based on the torque deviation, and finally converts it into a current command.
[0124] 3. The u_torque output by the PID controller is converted into a current command, which controls the winding current through the current loop of the motor driver, ultimately stabilizing the output torque.
[0125] Step S3033: Generate a constant air volume control function based on the target air volume value and the constant air volume coefficient, and perform air volume loop PID control on the constant air volume operation mode of the motor based on the constant air volume control function.
[0126] Specifically, in constant airflow operation mode, a corrected control function needs to be generated first by combining the target airflow value and the constant airflow coefficient, and then PID control is used to ensure that the actual airflow stably tracks the target value. This includes:
[0127] 1. Generation of constant air volume control function:
[0128] Function of constant air volume coefficient: The 10 constant air volume coefficients (e.g., K1 to K10) in Flash Zone 2 are used to compensate for the nonlinear relationship between air volume and motor speed / power (such as the nonlinearity of the fan characteristic curve and the influence of changes in duct resistance).
[0129] Based on the range of the target airflow value (cfm_setting), the corresponding coefficient is used to generate a corrected target value:
[0130] cfm_corrected = cfm_setting × (Kx + cfm_setting × Ky) (Kx and Ky are coefficients within the interval used to compensate for nonlinearity).
[0131] 2. Calculate the deviation between the corrected target air volume (cfm_corrected) and the actual air volume in real time.
[0132] 3. Airflow Loop PID Regulation: The PID controller calculates and outputs the control quantity u_cfm based on the airflow deviation, which is ultimately converted into a motor speed command.
[0133] 4. The u_cfm output by the PID is converted into a motor speed command, and then the motor speed is adjusted by the speed loop PID (nested control), which ultimately changes the air volume (the fan air volume is approximately proportional to the speed).
[0134] Linked with constant air volume coefficient: If the actual air volume deviates from the target value for a long period of time (e.g., more than 5% for 30 seconds), the constant air volume coefficient is automatically updated (e.g., Kx, Ky are fine-tuned), the constant air volume control function is optimized, and the system aging (e.g., fan efficiency decline) is adapted.
[0135] The multi-functional programmable motor control method provided in this embodiment designs the upper and lower limits of PWM, speed, torque, and airflow as programmable parameters. Users can flexibly adjust the parameter range according to specific application scenarios (such as different loads, environmental conditions, and equipment specifications) without modifying the underlying code or hardware circuit of the motor control. It has high programmability, adapts to diverse scenario requirements, and can freely switch between constant airflow control mode and other control modes, calling control parameters of different modes to support motor operation. For the different physical characteristics of different operating modes (different dynamic response laws of speed, torque, and airflow), mode-specific PID parameters and control loop designs are adopted to adapt to different physical characteristic requirements. The control logic of the three modes (speed loop PID, torque loop PID, and airflow loop PID) adopts a modular design, with each module operating independently and having clear interfaces. This achieves accurate, stable, and reliable motor control in multiple modes, while also considering scenario adaptability and system maintainability.
[0136] As one or more specific application embodiments of the present invention, combined with Figure 4 The multifunctional programmable motor control method provided by the present invention will be described in further detail, such as... Figure 4 As shown, the specific process is as follows:
[0137] Step S1, initialize relevant variables and arrays:
[0138] a. Define the motor application parameter variables and their numerical ranges that need to be programmed, and allocate the first interval of Flash memory for storage. The specific parameters are shown in Table 1 above.
[0139] b. Define the constant air volume coefficient variables (10, 20 bytes) required for constant air volume mode operation, and allocate the second interval of Flash to store them.
[0140] Step S2: After the motor is connected to the dedicated host computer software, the motor software communication interruption is activated. The motor receives and verifies the constant air volume model control parameter message sent by the host computer, or the motor receives and verifies the motor reference parameter message sent by the host computer.
[0141] Step S21: The motor receives and verifies the constant air volume mode control parameter message sent by the host computer. After the CRC verification is correct, the parameter message is parsed, decoded, and assigned to the various control parameter variables of the constant air volume mode of the motor and stored in Flash 2. The constant air volume function control module based on mathematical model is used to perform air volume loop PID control on the motor so that the motor works in constant air volume operation mode.
[0142] Step S22: The motor receives and verifies the motor reference parameter message sent by the host computer. After the CRC verification is correct, the parameter message is parsed, decoded, and assigned to the motor application parameter variable and stored in Flash 1. Then, it is determined whether the operating mode parameter control_mode is equal to 03.
[0143] Step S23: If control_mode equals 03, the motor needs to operate in constant airflow mode. At this time, the constant torque and constant speed application parameters are disabled, and the constant airflow application parameters are called. The lower limit of airflow min_cfm_prog and the upper limit of airflow max_pwm_prog, as well as the lower limit of PWM min_pwm_prog and the upper limit of PWM max_pwm_prog, are programmed. The target airflow value is calculated using the constant airflow linear formula. When the target airflow value exceeds the preset limit (i.e., the airflow limit value set by the user), the preset limit is used for calculation. Finally, the airflow loop PID control is performed based on the target airflow value.
[0144] Step S24: If control_mode is not equal to 03, then determine whether control_mode is equal to 02.
[0145] Step S25: If control_mode equals 02, it is determined that the motor needs to operate in constant torque mode. At this time, the constant air volume and constant speed application parameters are disabled, and the constant torque application parameters are called, including the programmable lower torque limit min_torque_prog and the programmable upper torque limit max_torque_prog, as well as the programmable lower PWM limit min_pwm_prog and the programmable upper PWM limit max_pwm_prog. The torque target value is calculated using the constant torque linear formula. When the torque target value exceeds the preset limit (i.e., the torque limit value set by the user), the preset limit is used for calculation. Finally, torque loop PID control is performed based on the torque target value.
[0146] Step S26: If control_mode is not equal to 02 but equal to 01, it is determined that the motor needs to operate in constant speed mode. At this time, the constant air volume and constant torque application parameters are disabled, and the constant speed application parameters are called, including the programmable lower speed limit min_speed_prog and the programmable upper speed limit max_speed_prog, as well as the programmable lower PWM limit min_pwm_prog and the programmable upper PWM limit max_pwm_prog. The constant speed linear formula is used to calculate the target speed value. When the target speed value exceeds the preset limit (i.e., the speed limit value set by the user), the preset limit is used for calculation. Finally, the speed loop PID control is performed based on the target speed value.
[0147] The multifunctional programmable motor control method provided in this embodiment enables free switching between constant airflow control mode and other control modes, and allows the use of control parameters from different modes to support motor operation. It allows for programmable setting of parameters, including PWM duty cycle range, speed range, torque range, airflow range, direction of rotation, and power. Motor application parameters and constant airflow control parameters are stored in different flash memory areas, facilitating access for different operating modes and solving the problem of limited motor control modes caused by the inability to programmable motors.
[0148] This embodiment also provides a multifunctional programmable motor control device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0149] This embodiment provides a multifunctional programmable motor control device, such as... Figure 5 As shown, it includes:
[0150] The parameter message receiving and parsing module 501 is used to receive parameter messages sent by the host computer and parse the programmable motor application parameters in the parameter messages.
[0151] The motor operation mode invocation and target value calculation module 502 is used to invoke the corresponding motor operation mode based on the programmable motor application parameters, and calculate the target value based on the corresponding programmable motor application parameters under the operation mode.
[0152] The motor operation mode control module 503 is used to control the motor's corresponding operation mode based on the target value.
[0153] In some optional implementations, the multi-functional programmable motor control device further includes:
[0154] The parameter setting and storage module is used to write the motor application parameters and the value range of each parameter to be programmed by the host computer and store them in the first flash memory area; and to set the constant air volume coefficient required for the constant air volume operation mode of the motor and store it in the second flash memory area.
[0155] In some optional implementations, the parameter message receiving and parsing module 501 includes:
[0156] The correctness verification unit is used to receive parameter messages sent by the host computer after the motor is connected to the host computer, and to verify the correctness of the parameter messages.
[0157] The parameter parsing and judgment unit is used to parse the operating mode parameters and motor application parameters in the parameter message after the verification is passed. If the value of the operating mode parameter is equal to the third preset value, it continues to receive and write the constant air volume coefficient.
[0158] In some optional implementations, the programmable motor application parameters include programmable PWM upper and lower limits, programmable speed upper and lower limits, programmable torque upper and lower limits, and programmable airflow upper and lower limits. The motor operating mode call and target value calculation module 502 includes:
[0159] The first calling and calculation unit is used to call the constant speed operation mode of the motor when the control mode parameter value is equal to the first preset value, and calculate the target speed value based on the programmable PWM upper and lower limits and the programmable speed upper and lower limits.
[0160] The second calling and calculation unit is used to call the constant torque operation mode of the motor when the control mode parameter value is equal to the second preset value, and calculate the torque target value based on the programmable PWM upper and lower limits and the programmable torque upper and lower limits.
[0161] The third calling and calculation unit is used to call the constant air volume operation mode of the motor when the control mode parameter value is equal to the third preset value, and calculate the target air volume value based on the programmable PWM upper and lower limits and the programmable air volume upper and lower limits.
[0162] In one optional implementation, the formula for calculating the target speed value based on the programmable PWM upper and lower limits and the programmable speed upper and lower limits is as follows:
[0163] rpm_setting=min_speed_prog+(pwm_setting-min_pwm_prog)*(max_speed_prog-min_speed_prog) / (max_pwm_prog-min_pwm_prog);
[0164] Where rpm_setting is the target speed value, min_speed_prog is the programmable lower speed limit value, pwm_setting is the PWM setting value, min_pwm_prog is the programmable lower PWM limit value, max_speed_prog is the programmable upper speed limit value, and max_pwm_prog is the programmable upper PWM limit value.
[0165] In one alternative implementation, the formula for calculating the target torque value based on the programmable PWM upper and lower limits and the programmable torque upper and lower limits is as follows:
[0166] torque_setting=min_torque_prog+(pwm_setting-min_pwm_prog)*(max_torque_prog-min_torque_prog) / (max_pwm_prog-min_pwm_prog);
[0167] Where torque_setting is the target torque value, min_torque_prog is the programmable lower limit torque value, and max_torque_prog is the programmable upper limit torque value.
[0168] In one optional implementation, the formula for calculating the target airflow value based on the programmable PWM upper and lower limits and the programmable airflow upper and lower limits is as follows:
[0169] cfm_setting=min_cfm_prog+(pwm_setting-min_pwm_prog)*(max_cfm_prog-min_cfm_prog) / (max_pwm_prog-min_pwm_prog);
[0170] Where cfm_setting is the target air volume value, min_cfm_prog is the programmable lower limit air volume value, and max_pwm_prog is the programmable upper limit air volume value.
[0171] In one optional implementation, the motor operating mode control module 503 includes:
[0172] The speed loop PID control unit is used to perform speed loop PID control on the motor in constant speed operation mode based on the target speed value.
[0173] The torque loop PID control unit is used to perform torque loop PID control on the constant torque operation mode of the motor based on the torque target value.
[0174] The air volume loop PID control unit is used to generate a constant air volume control function based on the target air volume value and the constant air volume coefficient, and to perform air volume loop PID control on the motor in constant air volume operation mode based on the constant air volume control function.
[0175] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0176] In this embodiment, the multifunctional programmable motor control device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0177] This invention also provides a computer device having the above-described features. Figure 5 The multi-functional programmable motor control device shown.
[0178] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 6 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 6 Take a processor 10 as an example.
[0179] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GPA), or any combination thereof.
[0180] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0181] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0182] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0183] The computer device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30, and output device 40 can be connected via a bus or other means. Figure 6 Taking the example of a connection between China and Israel via a bus.
[0184] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the computer device, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touchscreen.
[0185] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0186] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0187] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A multifunctional programmable motor control method, characterized in that, The method includes: Receive parameter messages sent by the host computer and parse the operating mode parameters and programmable motor application parameters in the parameter messages; Based on the operating mode parameters, the corresponding motor operating mode is invoked, and the target value is calculated based on the corresponding programmable motor application parameters within the operating mode. The operating mode of the motor is controlled based on the target value.
2. The method according to claim 1, characterized in that, Before receiving the parameter message sent by the host computer, the method further includes: The host computer writes the motor application parameters that need to be programmed and the range of values for each parameter to the first flash memory area. Set the constant air volume coefficient required for the motor's constant air volume operation mode and store it in the second flash memory area.
3. The method according to claim 2, characterized in that, The process of receiving parameter messages sent by the host computer and parsing the operating mode parameters and motor application parameters in the parameter messages includes: After the motor is connected to the host computer, it receives the parameter messages sent by the host computer and verifies the correctness of the parameter messages. Once the verification is successful, the operating mode parameters and motor application parameters in the parameter message are parsed. If the value of the operating mode parameter is equal to the third preset value, the constant air volume coefficient will continue to be received and written.
4. The method according to claim 3, characterized in that, The programmable motor application parameters include programmable PWM upper and lower limits, programmable speed upper and lower limits, programmable torque upper and lower limits, and programmable airflow upper and lower limits; Based on the programmable motor application parameters, the corresponding motor operating mode is invoked, and within the operating mode, the target value is calculated based on the corresponding programmable motor application parameters, including: When the control mode parameter value is equal to the first preset value, the constant speed operation mode of the motor is called, and the target speed value is calculated based on the programmable PWM upper and lower limits and the programmable speed upper and lower limits. When the control mode parameter value is equal to the second preset value, the constant torque operation mode of the motor is invoked, and the torque target value is calculated based on the programmable PWM upper and lower limits and the programmable torque upper and lower limits; When the control mode parameter value is equal to the third preset value, the constant air volume operation mode of the motor is invoked, and the target air volume value is calculated based on the programmable PWM upper and lower limits and the programmable air volume upper and lower limits.
5. The method according to claim 4, characterized in that, The formula for calculating the target speed value based on the programmable PWM upper and lower limits and the programmable speed upper and lower limits is as follows: rpm_setting=min_speed_prog+(pwm_setting-min_pwm_prog)*(max_speed_pr og-min_speed_prog) / (max_pwm_prog-min_pwm_prog); Where rpm_setting is the target speed value, min_speed_prog is the programmable lower speed limit value, pwm_setting is the PWM setting value, min_pwm_prog is the programmable lower PWM limit value, max_speed_prog is the programmable upper speed limit value, and max_pwm_prog is the programmable upper PWM limit value.
6. The method according to claim 4, characterized in that, The formula for calculating the target torque value based on the programmable PWM upper and lower limits and the programmable torque upper and lower limits is as follows: torque_setting=min_torque_prog+(pwm_setting-min_pwm_prog)*(max_torque_prog-min_torque_prog) / (max_pwm_prog-min_pwm_prog); Where torque_setting is the target torque value, min_torque_prog is the programmable lower limit torque value, and max_torque_prog is the programmable upper limit torque value.
7. The method according to claim 4, characterized in that, The formula for calculating the target air volume value based on the programmable PWM upper and lower limits and the programmable air volume upper and lower limits is as follows: cfm_setting=min_cfm_prog+(pwm_setting-min_pwm_prog)*(max_cfm_prog-min_cfm_prog) / (max_pwm_prog-min_pwm_prog); Where cfm_setting is the target air volume value, min_cfm_prog is the programmable lower limit air volume value, and max_pwm_prog is the programmable upper limit air volume value.
8. The method according to claim 4, characterized in that, The control of the motor's operating mode based on the target value includes: Speed loop PID control is performed on the motor in constant speed operation mode based on the target speed value; Torque loop PID control is performed on the motor in constant torque operation mode based on the torque target value; Based on the target air volume value and constant air volume coefficient, a constant air volume control function is generated, and based on the constant air volume control function, air volume loop PID control is performed on the constant air volume operation mode of the motor.
9. A multi-functional programmable motor control device, characterized in that, The device includes: The parameter message receiving and parsing module is used to receive parameter messages sent by the host computer and parse the operating mode parameters and programmable motor application parameters in the parameter messages. The motor operation mode invocation and target value calculation module is used to invoke the corresponding motor operation mode based on the operation mode parameters, and calculate the target value based on the corresponding programmable motor application parameters under the operation mode. The motor operation mode control module is used to control the motor's corresponding operation mode based on the target value.
10. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the multifunctional programmable motor control method according to any one of claims 1 to 8.