A method and system for controlling the amount of feed for feeding pigs by means of a distance sensor
By installing a distance sensor inside the feed pipe to collect distance data from multiple measurement directions, and combining this with the dimensions of the feed trough to establish an empty trough baseline, the effective distance is determined, the calculation area is divided, and the feed volume and weight are calculated. This solves the problem of inaccurate feed quantity control in existing technologies and achieves precise control of irregular feed surfaces and environmental adaptability.
Patent Information
- Application Number
- CN202611330814.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-20
AI Technical Summary
Existing technologies struggle to accurately control feed volume, especially on irregular feed surfaces and under environmental disturbances, leading to issues such as repeated feeding or premature cessation of feeding.
By installing distance sensors inside the feed pipe, distance data from multiple measurement directions is collected. Combined with the angle and feed trough size, an empty trough space benchmark is established to determine the effective distance data, divide the calculation area, calculate the feed volume and weight, control the feeding device in conjunction with the bulk density, and adjust the feeding parameters through a remote management server.
It enables accurate feed quantity control on irregular feed surfaces, reduces erroneous feeding caused by environmental disturbances, adapts to the actual consumption rate of different pig groups, improves feed utilization, and reduces the workload of manual inspection.
Smart Images

Figure CN123126249A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of feed quantity control technology, specifically to a method and system for controlling the amount of feed fed to pigs using a distance sensor. Background Technology
[0002] In large-scale pig farming, the amount of feed directly affects the pigs' growth, feed utilization, and farming costs. To reduce the workload of manual inspection and feeding, existing automatic feeding equipment typically includes a feed level detection mechanism at the storage device or feed trough, which starts or stops the feeding device based on the detection result. One existing detection method used in feed troughs employs a metal rod as a detection electrode, determining the presence of feed in the trough by forming a conductive circuit between the feed, liquid, and metal detection components. This type of detection method is dependent on the moisture content and conductivity of the detected material. When the feed in the trough is granular dry feed, the feed moisture content changes, residues adhere to the surface of the conductive components, or the conductive contact state changes, the detection signal is prone to change. For structures that require water to form an effective conductive path, additional water supply and conductive detection structures are added, making it difficult to directly obtain the continuous remaining weight of feed in the trough.
[0003] Another type of detection method uses non-contact distance sensors, such as ultrasonic or optical sensors, to detect whether the feed has reached a specific height, or to convert the measured distance in one direction into feed level. Because pelleted feed in pig troughs typically accumulates naturally from the feed inlet outwards, the feed surface is not a stable horizontal plane, but rather an irregular surface that is higher in the center and lower at the periphery, constantly collapsing as pigs eat. Relying solely on a single feed level data point is insufficient to accurately represent the amount of feed remaining in the entire trough. Existing non-contact feed level technologies themselves cannot automatically solve the problem of continuous control from distance value to actual feed quality and then to real-time replenishment. When distance sensors are applied in pigpen environments, they are also affected by feed dust, particle obstruction during feeding, feed rolling, and disturbance from pigs while eating. If instantaneous distance values are directly used as the basis for feeding, abnormal distance measurements may cause repeated feeding or premature cessation of feeding. Fixed-time, fixed-weight feeding programs cannot be adjusted according to the actual feed consumption rate and remaining feed status of different pig herds. Summary of the Invention
[0004] The purpose of this invention is to provide a method and system for controlling the amount of feed for pigs using a distance sensor, thereby solving the problems existing in the prior art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: 1. A method for controlling the amount of feed for pigs using a distance sensor, characterized in that it includes: A distance sensor facing the feed trough is installed inside the feed pipe. Distance data in multiple measurement directions is collected when the trough is empty. The empty trough space reference is established by combining the angle of each measurement direction and the size of the feed trough. During the feeding process, current distance data is collected at multiple locations on the feed surface. The validity of the current distance data is determined, and the valid distance data is compared with the corresponding empty trough space reference to determine the feed surface height at each measurement location. The feed surface height distribution is established based on the spatial location of each measurement point and the feed surface height. The feed trough is divided into multiple calculation areas. The total feed volume is determined based on the area of each calculation area and the corresponding feed height. The current feed weight is determined by combining the feed bulk density. The control panel controls the feeding device to feed according to the difference between the target feed weight and the current feed weight, and re-detects the current feed weight after feeding. Based on the re-detection result, the subsequent feeding amount is adjusted until the feeding stop condition is met. The control panel records the change in feed weight over time, determines the amount of feed consumed and the corresponding consumption time, and sends it to the remote management server. The remote management server updates the target feed weight or feeding time for subsequent feeding cycles based on the amount of feed consumed, the remaining feed weight, and the consumption time for multiple feeding cycles of the same pig herd.
[0006] Specifically, when establishing the empty trough space reference data, multiple frames of distance data are continuously acquired when the feeding device stops and the trough is empty. The multiple frames of distance data in the same measurement direction are sorted, and the distance data in the middle position after sorting is used as the empty trough reference distance corresponding to that measurement direction. Simultaneously, the echo quality data and distance fluctuation data corresponding to each measurement direction are recorded to form the measurement quality benchmark for the corresponding feed trough; The distance sensor is one of the following: time-of-flight distance sensor, laser distance sensor, scanning distance sensor, or millimeter-wave distance sensor, capable of outputting multiple distance measurement data and corresponding direction information for each distance measurement data. The control panel stores the mapping relationship between each distance measurement data and the corresponding spatial measurement direction.
[0007] Specifically, before determining the feed surface height, echo quality judgment, empty trough boundary judgment, and time continuity judgment are performed on the current distance data; When the echo quality of a measurement location is lower than the quality threshold determined according to the measurement quality benchmark, the measurement location is marked as an invalid measurement location; When the current distance of a measurement location is greater than the sum of the corresponding empty slot reference distance and the installation measurement error, the measurement location is marked as an invalid measurement location. When the distance change of a measurement location relative to the previous stable measurement cycle is greater than the jump threshold determined based on static distance fluctuation data, and the direction of distance change of the measurement location is inconsistent with the direction of distance change of adjacent measurement locations, the measurement location is marked as a transient interference location, and the transient interference location is prohibited from participating in the calculation of the current total feed volume.
[0008] Specifically, the reliability of the current measurement is determined by comparing the bottom coverage area of the feed trough corresponding to the effective measurement location with the bottom coverage area of the feed trough that can be measured under normal installation conditions of the distance sensor. After the distance sensor is installed, the normal effective coverage area is continuously measured in the empty slot. 80% of the normal effective coverage area is used as the first effective coverage threshold, and 60% of the normal effective coverage area is used as the second effective coverage threshold. When the current effective coverage area is not lower than the first effective coverage threshold, the current feed weight can be updated based on the current distance data and a feeding control command can be generated. When the current effective coverage area is lower than the first effective coverage threshold and not lower than the second effective coverage threshold, the current distance data is used for feed weight trend recording and not for generating control commands to increase feed amount; When the current effective coverage area is lower than the second effective coverage threshold, discard the current detection result and reacquire distance data.
[0009] Specifically, for any valid measurement direction, the current distance of the measurement direction is converted into the current vertical distance according to the angle between the measurement direction and the vertical direction, and the corresponding empty trough reference distance is converted into the empty trough vertical distance according to the same angle. The difference between the empty trough vertical distance and the current vertical distance is used as the feed surface height at the measurement position. The projection position of the measurement location on the bottom plane of the trough is determined based on the current distance and the corresponding measurement direction. The bottom of the feed trough is divided into multiple calculation areas with known bottom areas. The average feed height of the corresponding calculation area is determined based on the effective measurement positions located within each calculation area. The feed volume of the corresponding calculation area is obtained by multiplying the bottom area of each calculation area by the average feed height. The total feed volume is obtained by summing the feed volumes of all calculation areas.
[0010] Specifically, the bulk density is read from the pre-stored bulk density according to the type of feed when the equipment is initially running, and is updated during operation using calibration feeding with known quality. When calibrating the feeding device, perform at least 5 feeding operations with the same feeding control quantity, remove the maximum and minimum feeding weights, and take the average of the remaining feeding weights to determine the calibrated feeding weight for the corresponding feeding control quantity. During operation, the total volume of the first stable feed in the trough is obtained before calibration feeding. The feeding device is controlled to perform the calibration feeding with known mass. After feeding is completed and the feed accumulation state is stable, the total volume of the second stable feed is obtained. The measured bulk density is obtained by dividing the calibrated feeding weight of the calibration feeding by the difference between the total volume of the second stable feed and the total volume of the first stable feed. The measured bulk density is used to update the current bulk density of the feed only when the total volume of the feed is stable before and after calibration, there is no obstruction during calibration that would invalidate the test results, and the difference between the total volume of the second stable feed and the total volume of the first stable feed is greater than three times the static volume measurement error.
[0011] Specifically, the material feeding control includes a coarse feeding stage and a precise feeding stage; When the difference between the target feed weight and the current feed weight is greater than the coarse and fine feed switching threshold, the feed device is controlled to feed continuously or coarse feed is executed by multiple continuous feed control units. When the difference between the target feed weight and the current feed weight is not greater than the coarse and fine feed switching threshold, the feed control device performs precise feeding according to a single or predetermined number of minimum feed control units. After each precise feeding is completed, the current feed weight is re-determined after the feed accumulation state stabilizes. The threshold for switching between coarse and fine feed is the larger of the calibrated feed weight corresponding to 3 times the minimum feed control unit and the measurement error of 2 times the current feed weight. The stopping feeding threshold is the larger of the calibrated feeding weight corresponding to a minimum feeding control unit and the measurement error of 3 times the current feed weight.
[0012] Specifically, whether the feed accumulation state is stable is determined based on the change in the total feed volume over multiple consecutive testing periods; After the feeding device stops, at least 5 frames of distance data are continuously acquired, and the total feed volume corresponding to each frame is determined. When the change in the total feed volume of adjacent frames in 3 consecutive detection windows is not greater than the stable change threshold, the feed accumulation state is determined to be stable. The stable change threshold is determined by collecting multiple frames of volume data when the feeding device stops and the feed in the trough remains stationary. The volume change amounts of adjacent frames are sorted, and three times the volume change amount corresponding to the 95th percentile is taken as the stable change threshold.
[0013] Specifically, the effective feed weight data obtained continuously within a feeding cycle is divided into a feeding section, a stable section, and a consumption section, and the feed consumption in the trough for the corresponding pig herd is determined based on the consumption section. When the feed weight is decreasing in at least three consecutive valid detection windows, and the cumulative decrease in weight is greater than three times the current feed weight measurement error, a consumption segment is determined to begin. The consumption segment is determined to end when the feed weight change is within the current feed weight measurement error range for at least three consecutive valid detection windows, or when a new feeding process begins. The remote management server updates the feeding plan based on at least three recent effective feeding cycles for the same pig herd. If there is feed exceeding the remaining upper limit for three consecutive feeding cycles before the next scheduled feeding time, the target feed weight for the next feeding cycle is reduced. If the remaining lower limit is reached before the next scheduled feeding time for three consecutive feeding cycles, and the time before reaching the remaining lower limit is greater than 10% of the current feeding interval, the target feed weight for the next feeding cycle is increased or the next feeding time is brought forward. The remaining upper limit is the greater of 5% of the current target feed weight and 3 times the measurement error of the current feed weight, and the remaining lower limit is the greater of 2% of the current target feed weight and 2 times the measurement error of the current feed weight. The adjustment range of the target feed weight in a single adjustment is 5% to 15% of the target feed weight before adjustment.
[0014] On the other hand, the present invention also provides a feeding system for controlling the amount of feed for pigs by means of a distance sensor, for implementing the above-mentioned method, including a distance sensor, a feed tube, a metal bracket, a feed trough, a control panel, a feeding device, a storage device, and a remote management server. The feed pipe is installed on the feed trough via a metal bracket, and the storage device is connected to the feed pipe via a feeding device. The side wall of the feed tube is provided with a sensor mounting hole. The detection end of the distance sensor extends into the feed tube through the sensor mounting hole. The sensor fixing plate is set on the outside of the feed tube and the distance sensor is fixed by screws. The detection end of the distance sensor is provided with a sensor dust cover. The detection area of the distance sensor faces the feed trough and corresponds to the feed pile formed after the feed falls into the feed trough through the feed tube. The distance sensor is connected to the control panel, and the control panel is connected to the feeding device and the remote management server for communication. The control panel is configured to determine the spatial height distribution of feed in the trough, the total volume of feed, and the current feed weight based on multiple distance measurement data and corresponding direction information output by the distance sensor, control the feeding device based on the difference between the target feed weight and the current feed weight, and record the change of the current feed weight over time. The remote management server is configured to update the target feed weight and feeding time for the subsequent feeding cycle of the corresponding pig herd based on the current feed weight, feed consumption, and corresponding consumption time uploaded by the control panel.
[0015] As can be seen from the above technical solution, the present invention has the following beneficial effects: The distance sensor obtains the feed status in the trough in a non-contact manner, eliminating the need for water or liquid to form a conductive circuit, thus reducing the need for conductive electrodes, water supply, and corresponding detection connection components. Instead of using a single distance value to directly represent the remaining amount in the entire trough, it utilizes multiple distance values with spatial directional correspondences to reconstruct the feed surface height distribution, thereby adapting to the actual conditions of pelleted feed forming conical shapes, eccentric stacking, and localized depressions after feeding.
[0016] By establishing a spatial benchmark for each device through empty trough measurements, the fixed errors caused by the trough installation height, distance sensor installation position, and trough dimensions are included in the calibration data of the corresponding device. It is not required that all devices have completely identical mechanical installation dimensions. By filtering the ranging data through echo quality, empty trough boundary, time continuity, and effective coverage, the probability of abnormal ranging caused by dust, falling particles, and momentary obstruction directly triggering erroneous feeding can be reduced.
[0017] The feed volume is further converted into feed weight, and the known feed amount is used to correct the bulk density during operation. Compared with the long-term use of a fixed theoretical density, it can adapt to the changes in the bulk state of the same feed formula in different batches.
[0018] Feeding employs a feedback method that combines coarse feeding with precise replenishment. Once the feed weight approaches the target level, the amount of feed fed at one time is reduced, and the decision to continue feeding is based on the actual feed weight obtained from a re-detection. This reduces the cumulative error caused by timed feeding in a single operation. The control panel continuously generates a time series of the remaining feed weight, and the remote management server adjusts the subsequent target amount based on the actual consumption, remaining amount, and the time it takes to reach a low-remaining state ahead of schedule. This allows different pig groups to form their own independent feeding parameters. Attached Figure Description
[0019] Figure 1 This invention provides a flowchart of a method for controlling the amount of feed for pigs using a distance sensor; Figure 2 This is a schematic diagram of the overall device of the present invention; Figure 3 This is a detailed internal diagram of the present invention; Figure 4 This is a schematic diagram of the feed distance detection method of the present invention.
[0020] 1. Distance sensor; 2. Feed pipe; 3. Metal bracket; 4. Feed trough; 5. Feed pile; 6. Control panel; 7. Feeding device; 8. Storage device; 9. Remote management server; 10. Screws; 104. Sensor mounting plate; 105. Sensor dust cover. Detailed Implementation
[0021] 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, and 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.
[0022] like Figures 1-4 As shown, the present invention provides a technical solution: a method for controlling the amount of feed for pigs using a distance sensor, comprising: A distance sensor facing the feed trough is installed inside the feed pipe. Distance data in multiple measurement directions is collected when the trough is empty. The empty trough space reference is established by combining the angle of each measurement direction and the size of the feed trough. During the feeding process, current distance data is collected at multiple locations on the feed surface. The validity of the current distance data is determined, and the valid distance data is compared with the corresponding empty trough space reference to determine the feed surface height at each measurement location. The feed surface height distribution is established based on the spatial location of each measurement point and the feed surface height. The feed trough is divided into multiple calculation areas. The total feed volume is determined based on the area of each calculation area and the corresponding feed height. The current feed weight is determined by combining the feed bulk density. The control panel controls the feeding device to feed according to the difference between the target feed weight and the current feed weight, and re-detects the current feed weight after feeding. Based on the re-detection result, the subsequent feeding amount is adjusted until the feeding stop condition is met. The control panel records the change in feed weight over time, determines the amount of feed consumed and the corresponding consumption time, and sends it to the remote management server. The remote management server updates the target feed weight or feeding time for subsequent feeding cycles based on the amount of feed consumed, the remaining feed weight, and the consumption time for multiple feeding cycles of the same pig herd.
[0023] Example 1: In this embodiment, distance sensor 1 is installed inside feed tube 2, which is fixed to the middle area of feed trough 4 by metal bracket 3. The upper end of feed tube 2 is connected to feeding device 7 and storage device 8. Sensor mounting holes are formed on the side wall of feed tube 2, and the detection end of distance sensor 1 enters feed tube 2 through the sensor mounting holes, positioned to measure towards the bottom of feed trough 4. Sensor fixing plate 104 is attached to the outside of feed tube 2, and screws 103 pass through sensor fixing plate 104 to position distance sensor 1. Sensor dust cover 105 covers the detection end of distance sensor 1, ensuring that the distance measurement signal can pass through the side facing feed trough 4.
[0024] In this embodiment, the distance sensor 1 employs a distance detection structure with multiple detection areas. Each detection area corresponds to a different detection direction. The control panel 6 stores the directional relationship of each detection area relative to the center position of the distance sensor 1 during device installation, including the angle between the detection direction and the vertical direction, and its direction in the bottom plane of the feeding trough 4. This directional relationship remains unchanged after installation; therefore, each time the distance sensor 1 outputs a set of distance data, the control panel 6 can determine which spatial direction within the feeding trough 4 each set of distance data belongs to.
[0025] Before the first operation of the equipment, the feeding trough 4 is kept empty, and the feeding device 7 remains stopped. Distance sensor 1 performs 60 consecutive measurements. For the same detection area, the 60 distance measurement results are arranged from smallest to largest, and the data at the middle position is taken as the reference distance for the empty trough from that detection area to the bottom of the feeding trough 4. This method avoids deviations in individual distance data caused by dust particles or occasional reflections during installation and calibration. The reference distances for the empty troughs in each detection area together constitute the measured spatial model of the bottom of the feeding trough 4.
[0026] Furthermore, after the feed falls downwards through the feed pipe 2 into the feed trough 4, a higher area is initially formed around the outlet of the feed pipe 2. Subsequently, the particles roll outwards under their own gravity, forming a feed pile 5. During a valid detection, the control panel 6 stops sending new feeding drive commands to the feeding device 7, and the distance sensor 1 obtains the current distance in multiple measurement directions. For each measurement direction, the current distance is converted into a vertical distance according to the angle between that direction and the vertical direction. The conversion process involves multiplying the current distance value by the cosine of the corresponding angle to obtain the current vertical distance. Then, the same processing is applied to the empty trough reference distance in the same direction. The vertical distance in the empty trough state is subtracted from the current vertical distance, and the difference represents the height of the feed surface in that measurement area relative to the corresponding trough bottom position.
[0027] In one example implementation, the position of the measurement point on the bottom surface of the feeding trough 4 is obtained using both distance data and the measurement direction. Specifically, the projected length of the distance value in the horizontal direction is determined by multiplying the distance value by the sine of the corresponding angle. Then, based on the orientation of the measurement direction in the horizontal plane, this projected length is converted into a planar position relative to the perpendicular projection point of the distance sensor 1. Since the bottom boundary of the feeding trough 4 is saved during equipment installation, it is possible to determine whether the corresponding spatial point is within the effective feeding range of the feeding trough 4.
[0028] In this embodiment, the bottom surface of the feed trough 4 is divided into several calculation units with fixed areas according to the longitudinal and transverse dimensions. When a detection point falls into a certain calculation unit, the feed height calculated by that detection point is used as the height data of that calculation unit. When the same calculation unit contains multiple detection points, the height data after validity screening are sorted and the median value is taken. When there is no direct detection point in the calculation unit, the calculation unit adjacent to it with a valid detection value is used for interpolation. The interpolation area must not cross the physical boundary of the feed trough 4.
[0029] As shown above, after obtaining the height representing the degree of feed accumulation at each calculation unit, the feed volume in that calculation unit is obtained by multiplying its bottom area by its average feed height. For edge calculation units, only the effective bottom area actually located inside the boundary of the feed trough 4 is used. After obtaining the feed volumes of all calculation units using the same process, the volumes are summed to obtain the total feed volume corresponding to this detection. This calculation process directly performs discrete integration on the actual feed surface and does not require the feed pile 5 to maintain a complete conical shape.
[0030] In a preferred embodiment, when the device first configures a certain feed, the initial bulk density of the feed is saved in the control panel 6. The control panel 6 multiplies the total volume of the feed obtained this time by the current bulk density to obtain the current feed weight in the feed trough 4. The administrator sets the target feed weight for the corresponding pig herd through the remote management server 9. The remote management server 9 sends the target feed weight to the control panel 6, and the control panel 6 subtracts the current feed weight from the target feed weight to obtain the feed weight that needs to be increased this time.
[0031] Therefore, the method of this application allows for the initial coarse feeding of feed according to the calibrated feeding capacity of the feeding device 7 when a large increase in feed weight is required. After the feeding device 7 stops, the weight is not immediately determined using the distance data from the first frame, but the feed volume is continuously monitored. Once the feed volume changes in three consecutive monitoring windows have all fallen within a stable change threshold, it is determined that the particles that just fell into the feed trough 4 have completed the main rolling process affecting the measurement results, and the actual feed weight is then recalculated.
[0032] Furthermore, when the difference between the target feed weight and the measured feed weight has entered the precise feeding range, the control panel 6 switches to controlling the feeding device 7 to execute the minimum feeding unit or a small number of continuous minimum feeding units. Stability judgment and weight detection are re-executed after each feeding. When the remaining difference is not greater than the stop feeding threshold, the feeding device 7 stops. The switching threshold between coarse feeding and precise feeding is the larger of three times the weight corresponding to the minimum feeding unit and two times the current weight measurement error; the stop feeding threshold is the larger of the weight corresponding to one minimum feeding unit and three times the current weight measurement error, thus avoiding mistaking fluctuations in the distance sensor 1's own measurements as incomplete feeding amounts.
[0033] Example 2: In another specific implementation, when the equipment completes the empty tank calibration, it not only saves the empty tank distance but also the echo quality of each detection area. For 60 consecutive frames of empty tank data, the median echo quality and the degree of echo quality deviation are statistically analyzed. The median value minus three times the median absolute deviation is used as the lower limit of the echo quality during the operation of that detection area. When the calculated result is lower than the minimum effective echo quality specified by distance sensor 1, the minimum effective value specified by distance sensor 1 is used as the lower limit. A threshold is established using on-site installation data, allowing for the use of judgment criteria that match the machine for different tank materials and surface reflection conditions.
[0034] Optionally, the same set of empty slot calibration data is also used to establish a distance jump threshold. Control panel 6 calculates the absolute deviation of each distance result for each detection area relative to the empty slot reference distance for that area. All static deviations are sorted numerically, and the 95th percentile value is obtained and amplified by 1.5 times to form the static jump reference for that detection area under normal conditions. If a detection point suddenly experiences a distance change exceeding the reference during operation, the measurement point is not immediately deleted, but is further compared with its adjacent detection areas and previous / next detection cycles.
[0035] Furthermore, when a detection area experiences a significant reduction in distance, while its adjacent areas do not change in the same direction, and this anomaly disappears within the next 1 to 2 detection cycles, this data is marked as interference data caused by particles passing through the detection path, dust clumps, or localized transient occlusion. If multiple adjacent areas exhibit continuous distance changes and maintain the corresponding new height in subsequent detections, these are treated as actual material surface changes and included in volume calculations. This distinguishes between continuous material surface changes and transient occlusions, and the validity of the data is not determined by a single distance threshold.
[0036] In some embodiments, the empty trough reference distance formed when the feed trough 4 is empty also serves as the geometric upper limit of the measurement results. Under normal installation conditions, the feed surface is above the bottom surface of the feed trough 4; therefore, the effective feed distance obtained in the same measurement direction should not continuously exceed the corresponding empty trough distance. When the detection distance is greater than the empty trough distance and exceeds the static distance error range of the detection area, the control panel 6 excludes that point from the current feed surface reconstruction. This process can identify some of the over-distance measurement results caused by multipath reflections.
[0037] It should be noted that this application does not require valid data to be obtained from all detection areas in each frame, but rather to statistically analyze the area that can be reliably mapped to the bottom of the feed trough 4 in this frame. During the installation and calibration phase, the area of the bottom of the feed trough that the distance sensor 1 can normally cover is recorded. During operation, the bottom areas corresponding to the valid detection areas are accumulated. When the effective area reaches more than 80% of the normal coverage area, the current frame is used for normal weight update; when the effective area is less than 80% but still reaches 60%, it is only used for display and trend recording, and does not trigger an increase in feeding amount; when the effective area is less than 60%, this frame is directly determined as an invalid control frame and remeasured.
[0038] Therefore, in this embodiment, even if there is a small amount of dust on the surface of the sensor dust cover 105 or if part of the measurement direction is temporarily obstructed by particles during the feeding process, as long as the remaining measurement area meets the reliability requirements, the control panel 6 can still obtain a valid feed status. When the degree of obstruction is so high that it cannot support reliable weight judgment, automatic feeding is restricted, rather than misinterpreting an abnormally large distance as a lack of feed in the trough 4. This processing sets a direct control constraint to address the problem of repeated feeding caused by erroneous measurements in automatic feeding equipment.
[0039] Example 3: In one optional implementation, the feeding device 7 establishes feeding quantity calibration data during the installation and commissioning phase. The control panel 6 controls the feeding device 7 to perform at least five independent feeding operations using the same minimum control unit. The actual feeding weights for each operation are obtained during the commissioning phase, the maximum and minimum values are deleted, and the average of the remaining results is taken to form the calibrated feed weight corresponding to a minimum control unit. After this calibration is completed, there is no need to install a continuously operating weighing sensor under the feed trough 4 during normal farming.
[0040] In this embodiment, when the system needs to correct the feed bulk density, it first selects the moment when the current feed level in the feed trough 4 is stable to record the total feed volume before calibration. Then, the feeding device 7 executes several feeding control units that have completed weight calibration. After feeding is completed, it waits for the feed pile 5 to complete the main rolling process according to the aforementioned feed level stability judgment method, and then obtains the new total feed volume. The actual bulk density of this batch of feed in the current feed trough 4 is obtained by dividing the known feeding weight by the detected increase in feed volume.
[0041] In this embodiment, not every feeding is used to correct the bulk density. When continuous measurements before feeding show a clear trend of feed reduction, the effective detection area during feeding is insufficient, or the feed surface continues to change significantly after feeding, the data is only used for normal feeding and is not included in the density learning data. Only when the stability conditions are met before and after feeding, and the volume increase exceeds three times the static volume measurement error, is a valid density sample formed.
[0042] As can be seen from the foregoing embodiments, the method of this application can save the five most recent effective density samples, delete the highest and lowest values, and use the average of the remaining three samples as the updated current bulk density. When there are fewer than three effective density samples, the initial density continues to be used. After adopting this update rule, when the particle diameter, powder content, or moisture content of a feed batch changes, the mass conversion parameter is corrected by the volume measured by the distance sensor 1 and the actual amount fed by the feeding device 7, without requiring frequent manual modification of the feed density by management personnel.
[0043] In addition, the control panel 6 saves the feed weight and time in the feed trough 4 according to a fixed collection cycle, and marks the start, end, and stable feeding times in the data. When the server performs consumption statistics, it first deletes the feeding interval and the unstable interval after feeding. In the remaining continuous data, when the feed weight decreases in three consecutive valid detection windows and the cumulative decrease exceeds three times the current weight measurement error, a feed consumption segment in the trough is determined to begin; when the weight remains basically within the current measurement error range in three consecutive valid detection windows, or when the feeding device 7 is restarted, the current consumption segment ends.
[0044] As can be seen, this embodiment records the target feed weight, the actual weight added in this cycle, the highest stable weight after the start of the cycle, the cumulative weight reduction in each consumption segment, the time when the remaining lower limit is reached, and the remaining weight still existing at the next feeding time for each effective feeding cycle. Here, the consumption amount is limited to the amount of feed reduced in the feed trough 4, and is not directly equivalent to the actual intake of a single pig, so that the data that the distance sensor 1 can directly measure and the data recorded by the server have a clear correspondence.
[0045] In one example implementation, if a pig herd still has feed exceeding the remaining upper limit when the next scheduled feeding time arrives after three consecutive feeding cycles, the server will adjust the target feed weight for the next cycle downwards. The remaining upper limit is the greater of 5% of the target feed weight for the current cycle and three times the current weight measurement error. The minimum downward adjustment percentage is 5% of the original target amount, and the maximum is 15%; if the actual remaining amount is between 5% and 15%, the reduction is preferentially based on the median remaining weight of the most recent three cycles.
[0046] In some embodiments, if the same pig herd reaches the remaining lower limit before the next predetermined feeding time for three consecutive feeding cycles, and the time to reach this state is at least 10% earlier than the current feeding interval, the server determines that the original feeding rhythm is insufficient. The remaining lower limit is the greater of 2% of the target feed weight and twice the current weight measurement error. The server first increases the target feed weight for the next cycle by 5%; if the remaining lower limit is reached earlier for three consecutive cycles again, it continues to increase in increments of 5%, with each adjusted target amount not exceeding 15% of the original target amount.
[0047] Therefore, the method of this application allows the server to generate subsequent feeding parameters based on the continuously measured feed trough remaining volume and time data from the distance sensor 1, rather than simply repeatedly executing the same feed amount according to a fixed age table. Control panels 6 corresponding to different pig houses and different pens respectively store their own feed trough space baseline and current feed density. The remote management server 9 stores feeding records according to device number and pig herd number, enabling a single server to simultaneously send different target feed weights and feeding times to multiple control panels 6.
[0048] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for controlling the amount of feed given to pigs using a distance sensor, characterized in that, include: A distance sensor facing the feed trough is installed inside the feed pipe. Distance data in multiple measurement directions is collected when the trough is empty. The empty trough space reference is established by combining the angle of each measurement direction and the size of the feed trough. During the feeding process, current distance data is collected at multiple locations on the feed surface. The validity of the current distance data is determined, and the valid distance data is compared with the corresponding empty trough space reference to determine the feed surface height at each measurement location. The feed surface height distribution is established based on the spatial location of each measurement point and the feed surface height. The feed trough is divided into multiple calculation areas. The total feed volume is determined based on the area of each calculation area and the corresponding feed height. The current feed weight is determined by combining the feed bulk density. The control panel controls the feeding device to feed according to the difference between the target feed weight and the current feed weight, and re-detects the current feed weight after feeding. Based on the re-detection result, the subsequent feeding amount is adjusted until the feeding stop condition is met. The control panel records the change in feed weight over time, determines the amount of feed consumed and the corresponding consumption time, and sends it to the remote management server. The remote management server updates the target feed weight or feeding time for subsequent feeding cycles based on the amount of feed consumed, the remaining feed weight, and the consumption time for multiple feeding cycles of the same pig herd.
2. The method for controlling the amount of feed for pigs using a distance sensor according to claim 1, characterized in that: When establishing the reference data for the empty trough space, multiple frames of distance data are continuously acquired when the feeding device is stopped and the trough is empty. The multiple frames of distance data in the same measurement direction are sorted, and the distance data in the middle position after sorting is used as the reference distance for the empty trough in that measurement direction. Simultaneously, the echo quality data and distance fluctuation data corresponding to each measurement direction are recorded to form the measurement quality benchmark for the corresponding feed trough; The distance sensor is one of the following: time-of-flight distance sensor, laser distance sensor, scanning distance sensor, or millimeter-wave distance sensor, capable of outputting multiple distance measurement data and corresponding direction information for each distance measurement data. The control panel stores the mapping relationship between each distance measurement data and the corresponding spatial measurement direction.
3. The method for controlling the amount of feed for pigs using a distance sensor according to claim 2, characterized in that: Before determining the feed surface height, perform echo quality assessment, empty trough boundary assessment, and time continuity assessment on the current distance data; When the echo quality of a measurement location is lower than the quality threshold determined according to the measurement quality benchmark, the measurement location is marked as an invalid measurement location; When the current distance of a measurement location is greater than the sum of the corresponding empty slot reference distance and the installation measurement error, the measurement location is marked as an invalid measurement location. When the distance change of a measurement location relative to the previous stable measurement cycle is greater than the jump threshold determined based on static distance fluctuation data, and the direction of distance change of the measurement location is inconsistent with the direction of distance change of adjacent measurement locations, the measurement location is marked as a transient interference location, and the transient interference location is prohibited from participating in the calculation of the current total feed volume.
4. The method for controlling the amount of feed for pigs using a distance sensor according to claim 3, characterized in that: The reliability of the current measurement is determined by comparing the bottom coverage area of the feed trough corresponding to the effective measurement location with the bottom coverage area of the feed trough that can be measured under normal installation conditions of the distance sensor. After the distance sensor is installed, the normal effective coverage area is continuously measured in the empty slot. 80% of the normal effective coverage area is used as the first effective coverage threshold, and 60% of the normal effective coverage area is used as the second effective coverage threshold. When the current effective coverage area is not lower than the first effective coverage threshold, the current feed weight can be updated based on the current distance data and a feeding control command can be generated. When the current effective coverage area is lower than the first effective coverage threshold and not lower than the second effective coverage threshold, the current distance data is used for feed weight trend recording and not for generating control commands to increase feed amount; When the current effective coverage area is lower than the second effective coverage threshold, discard the current detection result and reacquire distance data.
5. The method for controlling the amount of feed for pigs using a distance sensor according to claim 1, characterized in that: For any valid measurement direction, the current distance of the measurement direction is converted into the current vertical distance according to the angle between the measurement direction and the vertical direction, and the corresponding empty trough reference distance is converted into the empty trough vertical distance according to the same angle. The difference between the empty trough vertical distance and the current vertical distance is used as the feed surface height at the measurement position. The projection position of the measurement location on the bottom plane of the trough is determined based on the current distance and the corresponding measurement direction. The bottom of the feed trough is divided into multiple calculation areas with known bottom areas. The average feed height of the corresponding calculation area is determined based on the effective measurement positions located within each calculation area. The feed volume of the corresponding calculation area is obtained by multiplying the bottom area of each calculation area by the average feed height. The total feed volume is obtained by summing the feed volumes of all calculation areas.
6. The method for controlling the amount of feed for pigs using a distance sensor according to claim 1, characterized in that: The bulk density is read from the pre-stored bulk density according to the type of feed when the equipment is initially running, and is updated during operation using calibration feeding with known quality. When calibrating the feeding device, perform at least 5 feeding operations with the same feeding control quantity, remove the maximum and minimum feeding weights, and take the average of the remaining feeding weights to determine the calibrated feeding weight for the corresponding feeding control quantity. During operation, the total volume of the first stable feed in the trough is obtained before calibration feeding. The feeding device is controlled to perform the calibration feeding with known mass. After feeding is completed and the feed accumulation state is stable, the total volume of the second stable feed is obtained. The measured bulk density is obtained by dividing the calibrated feeding weight of the calibration feeding by the difference between the total volume of the second stable feed and the total volume of the first stable feed. The measured bulk density is used to update the current bulk density of the feed only when the total volume of the feed is stable before and after calibration, there is no obstruction during calibration that would invalidate the test results, and the difference between the total volume of the second stable feed and the total volume of the first stable feed is greater than three times the static volume measurement error.
7. The method for controlling the amount of feed for pigs using a distance sensor according to claim 1, characterized in that: The material feeding control includes a coarse feeding stage and a precise feeding stage; When the difference between the target feed weight and the current feed weight is greater than the coarse and fine feed switching threshold, the feed device is controlled to feed continuously or coarse feed is executed by multiple continuous feed control units. When the difference between the target feed weight and the current feed weight is not greater than the coarse and fine feed switching threshold, the feed control device performs precise feeding according to a single or predetermined number of minimum feed control units. After each precise feeding is completed, the current feed weight is re-determined after the feed accumulation state stabilizes. The threshold for switching between coarse and fine feed is the larger of the calibrated feed weight corresponding to 3 times the minimum feed control unit and the measurement error of 2 times the current feed weight. The stopping feeding threshold is the larger of the calibrated feeding weight corresponding to a minimum feeding control unit and the measurement error of 3 times the current feed weight.
8. The method for controlling the amount of feed for pigs using a distance sensor according to claim 7, characterized in that: Whether the feed accumulation state is stable is determined based on the change in the total feed volume over multiple consecutive testing periods; After the feeding device stops, at least 5 frames of distance data are continuously acquired, and the total feed volume corresponding to each frame is determined. When the change in the total feed volume of adjacent frames in 3 consecutive detection windows is not greater than the stable change threshold, the feed accumulation state is determined to be stable. The stable change threshold is determined by collecting multiple frames of volume data when the feeding device stops and the feed in the trough remains stationary. The volume change amounts of adjacent frames are sorted, and three times the volume change amount corresponding to the 95th percentile is taken as the stable change threshold.
9. The method for controlling the amount of feed for pigs using a distance sensor according to claim 1, characterized in that: The effective feed weight data obtained continuously within a feeding cycle is divided into feeding section, stable section and consumption section, and the feed consumption in the trough of the corresponding pig group is determined according to the consumption section. When the feed weight is decreasing in at least three consecutive valid detection windows, and the cumulative decrease in weight is greater than three times the current feed weight measurement error, a consumption segment is determined to begin. The consumption segment is determined to end when the feed weight change is within the current feed weight measurement error range for at least three consecutive valid detection windows, or when a new feeding process begins. The remote management server updates the feeding plan based on at least three recent effective feeding cycles for the same pig herd. If there is feed exceeding the remaining upper limit for three consecutive feeding cycles before the next scheduled feeding time, the target feed weight for the next feeding cycle is reduced. If the remaining lower limit is reached before the next scheduled feeding time for three consecutive feeding cycles, and the time before reaching the remaining lower limit is greater than 10% of the current feeding interval, the target feed weight for the next feeding cycle is increased or the next feeding time is brought forward. The remaining upper limit is the greater of 5% of the current target feed weight and 3 times the measurement error of the current feed weight, and the remaining lower limit is the greater of 2% of the current target feed weight and 2 times the measurement error of the current feed weight. The adjustment range of the target feed weight in a single adjustment is 5% to 15% of the target feed weight before adjustment.
10. A feeding system for controlling the amount of feed for pigs using a distance sensor, for implementing the method according to any one of claims 1 to 9, characterized in that, It includes distance sensors, feed tubes, metal supports, feed troughs, control panels, feeding devices, storage devices, and remote management servers; The feed pipe is installed on the feed trough via a metal bracket, and the storage device is connected to the feed pipe via a feeding device. The side wall of the feed tube is provided with a sensor mounting hole. The detection end of the distance sensor extends into the feed tube through the sensor mounting hole. The sensor fixing plate is set on the outside of the feed tube and the distance sensor is fixed by screws. The detection end of the distance sensor is provided with a sensor dust cover. The detection area of the distance sensor faces the feed trough and corresponds to the feed pile formed after the feed falls into the feed trough through the feed tube. The distance sensor is connected to the control panel, and the control panel is connected to the feeding device and the remote management server for communication. The control panel is configured to determine the spatial height distribution of feed in the trough, the total volume of feed, and the current feed weight based on multiple distance measurement data and corresponding direction information output by the distance sensor, control the feeding device based on the difference between the target feed weight and the current feed weight, and record the change of the current feed weight over time. The remote management server is configured to update the target feed weight and feeding time for the subsequent feeding cycle of the corresponding pig herd based on the current feed weight, feed consumption, and corresponding consumption time uploaded by the control panel.
