Control and state monitoring method of seeding unit controller based on FOC algorithm
Through the single seeding controller based on the FOC algorithm, which integrates motor drive and monitoring functions, it solves the high cost and complex installation problems of electric drive seeders, achieves high-precision motor control and monitoring, and promotes the promotion of variable seeding technology.
Patent Information
- Application Number
- CN202311447485.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-02
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2043-11-02
AI Technical Summary
The promotion of electric-driven seeders in China is limited by high cost, complex installation and low-speed control accuracy. Moreover, the existing drive design is not compatible with the seeder functions, which increases the difficulty of use and system instability.
Design a single seeding controller based on FOC algorithm, integrating motor drive and current sampling circuit, monitoring information sampling circuit, dual full-bridge two-coil independent drive module, current sampling module, position speed sampling module and timer interrupt interface, realized through CAN communication Motor control and status monitoring reduce installation complexity and improve motor operation accuracy.
It achieves high-performance motor operation, reduces seeding costs, simplifies the installation process, and achieves high-precision seeding monitoring through microcontrollers and timers, promoting the promotion of variable seeding technology.
Smart Images

Figure CN117348478B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent agricultural equipment, and in particular to a control and state monitoring method of a sowing unit controller based on a FOC algorithm. Background Art
[0002] Variable seeding is an important technology that increases production and efficiency in planting operations. The core of the technology lies in that when the main controller obtains different soil information and high-precision satellite positioning information, it can send different control commands to each seeding device through bus technology, thereby realizing independent control of different seeding rows by multiple-row seeding devices.
[0003] The core of the electric drive seeding device control method is that each seeding device motor has an independent signal receiving and processing unit. With the continuous exploration of new variable seeding technologies, the requirements for variable seeding electric drive methods are gradually increasing. Not only are they satisfied with high speed and scalability, but they also need to meet the requirements of high integration, easy installation, fast response when speed switching, and smooth rotation at low speed. Foreign single drives are often installed in an integrated manner with seeding devices, and customized motors are used, which reduces the size of the motor and strengthens the integrity of the system. At present, there are relatively few machines in China that use electric drives for seeding, and they generally use larger servo motors or brushless motors with reducers. In addition to the large size, the drives they are equipped with are often expensive. If you want to improve the motor control accuracy at low speed, you need to further install a high-precision photoelectric encoder at the tail, which further increases the size of the motor body. Since the current common electric drive implementation method in China is to combine motors and drivers from different manufacturers, the system connection method is also cumbersome and complicated. The various problems mentioned above have made it difficult to promote the current electric drive technology in China. In addition, since the driver used in the current electric drive system was not designed for seeding, it is difficult to be compatible with many functions of the seeder, and researchers can only achieve it by continuing to expand it, which not only increases the difficulty of use for researchers and users, but also reduces the combined stability of the system. Therefore, it is necessary to design an integrated and dedicated high-performance motor driver specifically for driving the seeding machine. Summary of the invention
[0004] The purpose of the present invention is to propose a control and state monitoring method of a sowing unit controller based on a FOC algorithm.
[0005] A sowing monomer controller based on FOC algorithm, including a motor drive and current sampling circuit, a monitoring information sampling circuit, a dual full-bridge two-coil independent drive module, a current sampling module, a position speed sampling module, a timer interrupt interface, and a CAN communication line;
[0006] Among them, the motor drive and current sampling circuit are respectively connected to the dual full-bridge two-coil independent drive module, the current sampling module, and the position speed sampling module to control the motor operation; the monitoring information sampling circuit is connected to the timer interrupt interface to read the monitoring information; the motor drive and current sampling circuit, and the monitoring information sampling circuit respectively send motor operation control instructions and sowing condition monitoring information to the CAN communication line for two-way communication.
[0007] The control and state monitoring method of the sowing unit controller based on the FOC algorithm includes the following steps:
[0008] Step 1: Initialize the drive;
[0009] Step 2: Enter the motor control task, then go to step 3;
[0010] Step 3: Determine whether the start task flag is set to 1. If so, go to step 4; if not, go to step 2;
[0011] Step 4: Determine whether the stall flag is set to 1, if so, go to step 5; if not, go to step 6;
[0012] Step 5: Publish a node abnormality signal to the bus and enter the stall recovery task;
[0013] Step 6: The system uses the FOC control algorithm and the remaining number of steps to calculate the output current and the direction of the motor, and then goes to step 7;
[0014] Step 7: Determine whether the remaining number of steps is 0. If so, go to step 8; if not, go to step 9;
[0015] Step 8: Wait for a new round of bus data transmission;
[0016] Step 9: The single chip microcomputer sends a motor operation command to determine whether the motor operation speed monitored by the position sensor is lower than the calculated speed. If so, go to step 10; if not, go to step 11;
[0017] Step 10: Determine whether the motor running speed monitored by the position sensor is equal to the calculated speed. If so, go to step 6; if not, reduce the drive current and then go to step 6;
[0018] Step 11: Determine whether the motor phase current monitored by the position sensor exceeds the protection current. If so, increase the drive current and then go to step 6; if not, start the stall flag timer and then go to step 12;
[0019] Step 12: Determine whether the total timing of the stall flag timer exceeds 200ms. If so, go to step 5; if not, go to step 9.
[0020] The calculation formula of motor running speed is as follows:
[0021] MAG.angle_per_unit=(MAG.mag_per_unit / PPR)*360
[0022] MAG.speed=(MAG.angle_per_unit / C_F)*(1000 / 360)
[0023] Where MAG.angle_per_unit is the rotation angle per unit time, PPR is the resolution of the encoder, MAG.speed is the final calculated speed, and C_F is the time calibration coefficient of the Hall encoder.
[0024] Step 1 specifically includes the following sub-steps:
[0025] Step A1: After the system is powered on, the MCU first completes the initialization of the system clock and interrupt, and completes the initialization of the serial port. After the above initialization is completed, the serial port prints important working parameters;
[0026] Step A2: Complete the initialization of the driver and set the default output current to zero;
[0027] Step A3: complete the initialization of the sensor and the communication link, including the initialization of the CAN bus, the initialization of the IIC / SPI bus, the initialization of the analog-to-digital converter ADC and the digital-to-analog converter DAC, and the initialization of the built-in FLASH; then go to step A4;
[0028] Step A4: Determine whether the communication test is passed, if yes, go to step A5; if no, go to step A3;
[0029] Step A5: Determine whether the driver is installed on the motor for the first time. If so, the calibration indicator light flashes, and the calibration mode is entered until the calibration is completed, and then the process goes to step A6; if not, the motor angle calibration data in the FLASH is read and loaded, and then the process goes to step A6;
[0030] Step A6: Initialize the control structure and filter;
[0031] Step A7: Use the FreeRTOS real-time operating system to create running tasks, including LOG recording, bus communication, sensor monitoring, motor control, and FOC state calculation;
[0032] Step A8: Continuously run the task, the controller continuously receives CAN bus information and controls and monitors the seed metering device and the seed metering operation status through the CAN bus.
[0033] Step A8 specifically includes the following sub-steps:
[0034] Step 801: After completing the motor initialization, keep the sowing monitoring timer in the on state;
[0035] Step 802: Analyze and save the parameter information about the sowing distance of the CAN bus; then go to step 803;
[0036] Step 803: Analyze the CAN signal and determine whether the node speed is 0. If so, go to step 802; if not, go to step 804;
[0037] Step 804: Use the analyzed node speed to convert the theoretical seed placement time difference T at the corresponding seed spacing and the calibrated single seed passing time T_C; then go to step 805;
[0038] Step 805: Wait for the motor to drive the seed meter to plant seeds, and then go to step 806;
[0039] Step 806: Determine whether the first rising edge interrupt signal is stably received. If so, go to step 807; if not, determine that it is external electromagnetic interference, and then go to step 805;
[0040] Step 807: At this time, it is determined that the seed has passed, the timer starts timing, and then goes to step 808;
[0041] Step 808: Determine whether the falling edge interrupt signal is stably received, if so, go to step 809; if not, go to step 807;
[0042] Step 809: Determine whether the current node speed is 0. If so, turn off the timer and wait until the sowing speed is not 0 to turn it on, and then go to step 802 and step 813 at the same time; if not, save the time difference t1 at this time, reset the timer data, and then go to step 810;
[0043] Step 810: Wait for the seed meter to continue to meter seeds, then go to step 811;
[0044] Step 811: Determine whether the second rising edge interrupt signal is stably received, if so, go to step 812; if not, go to step 810;
[0045] Step 812: Save the time difference t2 at this time, reset the timer data, and then go to step 803 and step 813 simultaneously;
[0046] Step 813: Compare the timing time t with the theoretical seeding time difference T, and then go to step 814 and step 815 simultaneously;
[0047] Step 814: determine whether t1 is less than or equal to 0.5T_C, if so, determine it as a broken clock; if not, go to step 816;
[0048] Step 815: determine whether t2 is equal to 0, if so, it is determined that the system count is wrong; if not, go to step 817;
[0049] Step 816: determine whether t1 is greater than or equal to 1.5T_C. If so, determine it as an overlapping seed; if not, determine it as a single seed;
[0050] Step 817: determine whether t2 is less than or equal to 0.5T, if so, determine it as replay; if not, go to step 818;
[0051] Step 818: Determine whether t2 is greater than or equal to 1.5T. If so, determine it as missed broadcast; if not, determine it as qualified.
[0052] When t1 is greater than 5T, the system generates an alarm indicating that the broadcast volume is zero.
[0053] The beneficial effects of the present invention are:
[0054] The present invention integrates the motor control with the driver and the stepper motor, which reduces the installation complexity and also reduces the problems caused by bus failure during sowing; the FOC control algorithm is used to drive the stepper motor to achieve high-performance motor operation; in conjunction with the single-chip microcomputer chip, the seeding quality monitoring function is implemented on the motor drive circuit, and in conjunction with the timer, high-precision seeding monitoring is achieved; compared with the traditional brushless motor solution, the present invention is cheaper and has practical use significance, which is conducive to the further promotion and application of variable seeding technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is the overall structure diagram of the sowing unit controller based on FOC algorithm of the present invention;
[0056] Figure 2 It is the internal function diagram of the sowing unit controller based on FOC algorithm;
[0057] Figure 3 This is a connection diagram of the power management module;
[0058] Figure 4 It is the connection scheme diagram of the motor used, the single controller and the seed meter;
[0059] Figure 5 It is a schematic diagram of the scalability of the single controller used;
[0060] Figure 6 It is the system initialization flow chart of the stepper motor FOC control algorithm and state monitoring algorithm;
[0061] Figure 7It is the operation flow chart of the state monitoring algorithm of the stepper motor sowing unit controller;
[0062] Figure 8 It is a flow chart of the algorithm for monitoring the operation status of the seed meter;
[0063] Fig. 9 is a flow chart of the current calculation scheme. DETAILED DESCRIPTION
[0064] The present invention proposes a control and state monitoring method of a sowing unit controller based on the FOC algorithm, which will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0065] Figure 1 , Figure 2 They are respectively the overall structure diagram and internal function schematic diagram of the sowing unit controller based on FOC algorithm of the present invention; wherein, the motor drive and current sampling circuit are respectively connected to the dual full-bridge two-coil independent drive module, the current sampling module, and the position speed sampling module to control the motor operation; the monitoring information sampling circuit is connected to the timer interrupt interface to read the monitoring information; the motor drive and current sampling circuit and the monitoring information sampling circuit respectively send the motor operation control instructions and the sowing condition monitoring information to the CAN communication line for two-way communication. The internal specifically includes a power management circuit 101, a communication circuit 102, a main control circuit 103, and a circuit drive and sampling circuit 104. Among them, the power management circuit 101 includes a boost and buck circuit, which is used to power the motor and sensor while matching the tractor's 12V power supply voltage; the communication circuit 102 mainly includes two communication circuits, an outer ring and an inner ring. The outer ring CAN bus communication circuit 201 is used to connect to the main controller during actual sowing through the CAN bus, and the inner ring SPI / IIC communication circuit and the monitoring data TTL communication circuit 202 are mainly used for sensor communication and sowing monitoring communication; the main control circuit 103 mainly includes a system clock circuit 301, a debugging download circuit 302, a sowing status monitoring circuit 303, etc., which are used to realize the basic functions of single-chip microcomputer control while completing high-performance control of the stepper motor; the motor drive and sampling circuit 104 mainly includes a full-bridge drive circuit 401 that independently drives the two coils of the two-phase stepper motor; the sampling circuit mainly includes a current sampling chip 402 and a position sampling chip 403 for motor operation. The motor driver chip has a total of four interfaces available for bus connection, namely the high and low interfaces of the CAN bus and the 12V power supply interface. This can minimize the increase in the potential system failure rate caused by the complex circuit connection when using a single controller.
[0066] The boost and buck circuit mainly completes the power conversion from the on-board 12V battery to the 24V motor, the 12V battery to the 5V sensor chip, and the 5V power supply to the 3.3V power supply. It is connected to the power bus connected to the tractor through a waterproof plug and a high-power power converter at the interface. The power bus is directly connected to the positive and negative poles of the tractor's 12V power supply through a power clip. In order to prevent the wires from being exposed, a waterproof hose needs to be installed on its outer layer and fixed to the tractor body with a cable tie to prevent the running parts from getting the wires involved during operation.
[0067] The outer ring CAN bus communication circuit 201 of the communication circuit is connected to the CAN bus interface of the master controller in the tractor cockpit through a waterproof plug. In order to ensure the stability of the CAN bus transmission, two 120Ω resistors are installed at the starting end and the end of the CAN bus. The data is transmitted to the single-chip microcomputer for analysis through the CAN protocol conversion chip. At the same time, the data entering the single-chip microcomputer for analysis also includes sensor data, mainly including the current data of the current sampling chip 402 and the position data of the position sampling chip 403. The current sampling data is obtained through the internal converter ADC of the single-chip microcomputer system, and the sampling chip data is obtained through the SPI bus. In order to improve the integration of the circuit, two independent full-bridge driver chips are used to drive the AB phase coils of the two-phase stepper motor respectively. The driver chip controls the output current by receiving the voltage output by the single-chip microcomputer digital-to-analog converter DAC, which can achieve high-speed control of the motor.
[0068] In order for the position sensor to stably identify the position of the motor and then calculate the operating parameters of the motor, it is necessary to install a radially magnetized magnet on the rear output shaft of the motor.
[0069] In order to avoid the problem that traditional motor drivers need to occupy a lot of space and require separate wiring connections, the driver is directly installed on the rear end of the stepper motor, which not only reduces the volume but also facilitates the control of the motor. When in use, just connect the interface left by the driver to the CAN bus interface of the main controller to achieve control of the motor and monitor its status.
[0070] like Figure 3 The figure shows the connection diagram of the power management module. The common power supply for tractors is 12V. In order to drive the motor with a more stable and large torque and minimize or avoid stalling, the motor power supply voltage needs to be boosted. At the same time, the 12V voltage needs to be stepped down to power the system. Therefore, continuous voltage reduction is required to power the sensor and microcontroller.
[0071] like Figure 4 Shown is a connection diagram of the motor used, the single-unit controller and the seed meter.
[0072] like Figure 5 The figure shows the scalability diagram of the single controller used.
[0073] like Figure 6 As shown, it is the system initialization process of the stepper motor FOC control algorithm and the state monitoring algorithm. After the system is powered on, the single-chip microcomputer first completes the initialization of the system clock and interrupt, and completes the initialization of the serial port. After the initialization is completed, the serial port prints important working parameters. After the initialization of the motor driver, the default output current is set to zero. After that, the initialization of the sensor and the communication link is completed, mainly including the initialization of the CAN bus, the initialization of the IIC / SPI bus, the initialization of the analog-to-digital converter ADC and the initialization of the digital-to-analog converter DAC and the initialization of the built-in FLASH. In this embodiment, it is assumed that the driver is installed on the motor for the first time, and the data of the Hall encoder needs to be calibrated first. After the calibration is completed, the system enters the initialization of the control structure and the initialization of the filter. Use the FreeRTOS real-time operating system to create a running task, including LOG recording, bus communication, sensor monitoring, motor control and FOC state calculation. The task continues to run, and the controller continuously receives bus information and realizes the control and monitoring of the running status of the seed meter and the seed metering work through the CAN bus.
[0074] like Figure 7 The figure shows the operation flow of the state monitoring algorithm of the stepper motor sowing unit controller. It includes the following steps:
[0075] Step 1: Initialize the drive;
[0076] Step 2: Enter the motor control task, then go to step 3;
[0077] Step 3: Determine whether the start task flag is set to 1. If so, go to step 4; if not, go to step 2;
[0078] Step 4: Determine whether the stall flag is set to 1, if so, go to step 5; if not, go to step 6;
[0079] Step 5: Publish a node abnormality signal to the bus and enter the stall recovery task;
[0080] Step 6: The system uses the FOC control algorithm and the remaining number of steps to calculate the output current and the direction of the motor, and then goes to step 7;
[0081] Step 7: Determine whether the remaining number of steps is 0. If so, go to step 8; if not, go to step 9;
[0082] Step 8: Wait for a new round of bus data transmission;
[0083] Step 9: The single chip microcomputer sends a motor operation command to determine whether the motor operation speed monitored by the position sensor is lower than the calculated speed. If so, go to step 10; if not, go to step 11;
[0084] Step 10: Determine whether the motor running speed monitored by the position sensor is equal to the calculated speed. If so, go to step 6; if not, reduce the drive current and then go to step 6;
[0085] Step 11: Determine whether the motor phase current monitored by the position sensor exceeds the protection current. If so, increase the drive current and then go to step 6; if not, start the stall flag timer and then go to step 12;
[0086] Step 12: Determine whether the total timing of the stall flag timer exceeds 200ms. If so, go to step 5; if not, go to step 9.
[0087] The Hall sensor actually obtains the position difference of the motor. The actual motor running speed needs to be calculated according to the following formula:
[0088] MAG.angle_per_unit=(MAG.mag_per_unit / PPR)*360
[0089] MAG.speed=(MAG.angle_per_unit / C_F)*(1000 / 360)
[0090] In the above formula, MAG.angle_per_unit is the rotation angle per unit time, PPR is the resolution of the encoder, MAG.speed is the final calculated speed, and C_F is the time calibration coefficient of the Hall encoder.
[0091] like Figure 8As shown, it is an algorithm for monitoring the operation status of the seed meter. When the system is initialized, the controller will parse the bus data and save the relative data, mainly the seed spacing data and the calibrated single seed passing time T_C, parse the CAN bus data, and when the speed is not zero, use the parsed speed V to calculate the seed drop time T corresponding to the initial theoretical seed spacing data. When the external interrupt of the single-chip microcomputer stably receives a rising edge interrupt signal, it is judged that a seed begins to pass, and the timer starts timing. If the rising edge signal disappears after a short time, it is considered to be external electromagnetic interference. When the external interrupt of the single-chip microcomputer stably receives a falling edge interrupt signal, it is judged that the seed has passed. If the current node speed is not zero, the time difference between the rising edge and the falling edge is saved as t1, and the timer data is reset, while waiting for the seed meter to continue seeding. When the system stably receives the second rising edge interrupt signal, the difference between the second rising edge interrupt signal and the first falling edge signal is saved as t2, and the timer data is reset. After completing a cycle, the time parameters obtained above are compared. The specific comparison logic is shown in the following formula:
[0092]
[0093]
[0094] like Fig. 9 As shown in the figure, it is a flow chart of the current calculation scheme. When there are many remaining steps, the motor still needs to run for a long time. The current sensor collects the current information of the current AB phases respectively, recorded as I_a and I_b, and obtains the actual q-axis and d-axis currents after Park transformation, recorded as I_q and I_d. After that, the theoretical q-axis and d-axis current data and the actual measured current are fed back and adjusted through the control algorithm. The adjusted d-axis and q-axis currents are subjected to inverse Park transformation to obtain the feedback current data I_A and I_B. After the calculation is completed, the microcontroller uses SVPWM to control the DAC to output the corresponding voltage to control the motor operation, and control the motor drive chip to output the calculated current.
[0095] When the number of remaining steps is small, the current output by the motor will gradually decrease, thereby slowing down the motor and eventually stopping it. At the same time, when the motor starts, the current output by the motor will gradually increase, thereby gradually increasing the motor speed until the target speed is reached. In this case, the current output by the motor needs to be added with a step coefficient S_F. The specific coefficient value is determined by the set acceleration and deceleration acceleration. In this case, the current output by the motor is S_F*I_A and S_F*I_B.
[0096] The embodiment of the present invention reduces the complexity of installation and also reduces the problems caused by bus failure during sowing, thereby achieving high-performance motor operation; in conjunction with the single-chip microcomputer chip, the function of monitoring the seeding quality is realized on the motor drive circuit, and in conjunction with the timer, high-precision seeding monitoring is achieved.
Claims
1. A control and state monitoring method for a sowing unit controller based on FOC algorithm, characterized in that: The sowing unit controller includes a motor drive and current sampling circuit, a monitoring information sampling circuit, a dual full-bridge two-coil independent drive module, a current sampling module, a position speed sampling module, a timer interrupt interface, and a CAN communication circuit; Among them, the motor drive and current sampling circuit are respectively connected to the dual full-bridge two-coil independent drive module, the current sampling module, and the position speed sampling module to control the motor operation; the monitoring information sampling circuit is connected to the timer interrupt interface to read the monitoring information; the motor drive and current sampling circuit, and the monitoring information sampling circuit respectively send motor operation control instructions and sowing condition monitoring information to the CAN communication line for two-way communication; The control and state monitoring method of the sowing unit controller based on the FOC algorithm includes the following steps: Step 1: Initialize the drive; Step 2: Enter the motor control task, then go to step 3; Step 3: Determine whether the start task flag is set to 1. If so, go to step 4; if not, go to step 2; Step 4: Determine whether the stall flag is set to 1, if so, go to step 5; if not, go to step 6; Step 5: Publish a node abnormality signal to the bus and enter the stall recovery task; Step 6: The system uses the FOC control algorithm and the remaining number of steps to calculate the output current and the direction of the motor, and then goes to step 7; Step 7: Determine whether the remaining number of steps is 0. If so, go to step 8; if not, go to step 9; Step 8: Wait for a new round of bus data transmission; Step 9: The single chip microcomputer sends a motor operation command to determine whether the motor operation speed monitored by the position sensor is lower than the calculated speed. If so, go to step 10; if not, go to step 11; Step 10: Determine whether the motor running speed monitored by the position sensor is equal to the calculated speed. If so, go to step 6; if not, reduce the drive current and then go to step 6; Step 11: Determine whether the motor phase current monitored by the position sensor exceeds the protection current. If so, increase the drive current and then go to step 6; if not, start the stall flag timer and then go to step 12; Step 12: Determine whether the total timing of the stall flag timer exceeds 200ms. If so, go to step 5; if not, go to step 9.
2. The control and state monitoring method of the sowing unit controller based on the FOC algorithm according to claim 1 is characterized in that: The calculation formula of motor running speed is as follows: MAG.angle_per_unit=(MAG.mag_per_unit / PPR)*360 MAG.speed=(MAG.angle_per_unit / C_F)*(1000 / 360) Where MAG.angle_per_unit is the rotation angle per unit time, PPR is the resolution of the encoder, MAG.speed is the final calculated speed, and C_F is the time calibration coefficient of the Hall encoder.
3. The control and state monitoring method of the sowing unit controller based on the FOC algorithm according to claim 1 or 2 is characterized in that: The step 1 specifically includes the following sub-steps: Step A1: After the system is powered on, the MCU first completes the initialization of the system clock and interrupt, and completes the initialization of the serial port. After the above initialization is completed, the serial port prints important working parameters; Step A2: Complete the initialization of the driver and set the default output current to zero; Step A3: complete the initialization of the sensor and the communication link, including the initialization of the CAN bus, the initialization of the IIC / SPI bus, the initialization of the analog-to-digital converter ADC and the digital-to-analog converter DAC, and the initialization of the built-in FLASH; then go to step A4; Step A4: Determine whether the communication test is passed, if yes, go to step A5; if no, go to step A3; Step A5: Determine whether the driver is installed on the motor for the first time. If so, the calibration indicator light flashes, and the system enters the calibration mode until the calibration is completed, and then proceeds to step A6; If not, read and load the motor angle calibration data inside the FLASH, and then go to step A6; Step A6: Initialize the control structure and filter; Step A7: Use the FreeRTOS real-time operating system to create running tasks, including LOG recording, bus communication, sensor monitoring, motor control, and FOC state calculation; Step A8: The task is continuously run, and the controller continuously receives CAN bus information and controls and monitors the seed metering device and the seed metering operation status through the CAN bus.
4. The control and state monitoring method of the sowing unit controller based on the FOC algorithm according to claim 3 is characterized in that: The step A8 specifically includes the following sub-steps: Step 801: After completing the motor initialization, keep the sowing monitoring timer in the on state; Step 802: Analyze and save the parameter information about the sowing distance of the CAN bus; then go to step 803; Step 803: Analyze the CAN signal and determine whether the node speed is 0. If so, go to step 802; if not, go to step 804; Step 804: Use the analyzed node speed to convert the theoretical seed placement time difference T at the corresponding seed spacing and the calibrated single seed passing time T_C; then go to step 805; Step 805: Wait for the motor to drive the seed meter to plant seeds, and then go to step 806; Step 806: Determine whether the first rising edge interrupt signal is stably received. If so, go to step 807; if not, determine that it is external electromagnetic interference, and then go to step 805; Step 807: At this time, it is determined that the seed has passed, the timer starts timing, and then goes to step 808; Step 808: Determine whether the falling edge interrupt signal is stably received, if so, go to step 809; if not, go to step 807; Step 809: Determine whether the current node speed is 0. If so, turn off the timer and wait until the sowing speed is not 0 to turn it on, and then go to step 802 and step 813 at the same time; if not, save the time difference t1 at this time, reset the timer data, and then go to step 810; Step 810: Wait for the seed meter to continue to meter seeds, then go to step 811; Step 811: Determine whether the second rising edge interrupt signal is stably received, if so, go to step 812; if not, go to step 810; Step 812: Save the time difference t2 at this time, reset the timer data, and then go to step 803 and step 813 simultaneously; Step 813: Compare the timing time t with the theoretical seeding time difference T, and then go to step 814 and step 815 simultaneously; Step 814: determine whether t1 is less than or equal to 0.5T_C, if so, determine it as a broken clock; if not, go to step 816; Step 815: determine whether t2 is equal to 0, if so, it is determined that the system count is wrong; if not, go to step 817; Step 816: determine whether t1 is greater than or equal to 1.5T_C, if so, determine it as an overlapping seed; if not, determine it as a single seed; Step 817: determine whether t2 is less than or equal to 0.5T, if so, determine it as replay; if not, go to step 818; Step 818: Determine whether t2 is greater than or equal to 1.5T. If so, determine it as missed broadcast; if not, determine it as qualified.
5. The control and state monitoring method of the sowing unit controller based on the FOC algorithm according to claim 4 is characterized in that: When t1 is greater than 5T, the system generates an alarm indicating that the broadcast volume is zero.
