Bean grinding flow weighing pre-judging method and circuit of coffee bean grinder
Through sliding window technology and dynamic control methods, the coffee bean grinder realizes real-time monitoring and precise control of the powder yield rate, solving the problem of large errors under timing control, and improving the stability and automation level of the bean grinding process.
Patent Information
- Application Number
- CN202510636676.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-17
- Publication Date
- 2025-08-26
AI Technical Summary
The existing coffee bean grinder adjusts the amount of coffee powder through timed control, which has large errors and insufficient accuracy, making it difficult to meet the high-standard coffee brewing consistency and precise ratio requirements.
Using the flow monitoring and prediction control method based on the sliding window, the sliding window is constructed by continuously collecting weighing data, the powder rate is calculated, and dynamic shutdown and deceleration control is carried out in combination with the target weight data, and an interpolation prediction model is constructed to achieve precise control.
It improves the accuracy and adaptability of the bean grinding process, reduces powder production errors caused by interference from multiple factors, and ensures real-time and accuracy of powder production control.
Smart Images

Figure CN120540150A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of bean grinding flow rate weighing prejudgment, and in particular to a method and circuit for weighing prejudgment of the bean grinding flow rate of a coffee bean grinder. Background Art
[0002] Currently, coffee grinders generally use a timer control method to adjust the amount of ground coffee delivered per grind. This involves setting a fixed grinding time to indirectly control the total amount of ground coffee produced. This method is primarily based on the average grinding rate of the grinder motor per unit time, which is then used to estimate the operating time required to achieve the target weight. However, due to the numerous factors that influence the grinding rate, such as real-time fluctuations in motor voltage, wear on the burrs, and variations in coffee bean type and hardness, the actual amount of ground coffee produced within a given timeframe can fluctuate, resulting in insufficient accuracy. Furthermore, environmental fluctuations such as air humidity, bean hopper level, and equipment temperature rise can further exacerbate the uncertainty in the amount of ground coffee produced. Because these variables cannot be dynamically adjusted through simple time settings, traditional grinding methods based on timer control suffer from large errors and inaccurate weighing in practice. This makes it difficult to meet the increasingly stringent demands for consistent and precise coffee brewing, limiting the stability and automation of the grinding process. Summary of the Invention
[0003] In order to solve the problem that the output coffee powder amount of a coffee bean grinder is not accurately controlled due to the timing control, the present application provides a method and circuit for predicting the bean flow rate weighing of a coffee bean grinder.
[0004] A method for weighing and predicting the bean grinding flow rate of a coffee bean grinder, comprising: Based on a preset fixed sampling time interval, continuously collecting a first preset set of weighing data, constructing a corresponding sliding window according to the weighing data, and calculating corresponding cumulative weight data; Calculating the corresponding powder output rate according to the sliding window; determining target weight data previously acquired through user interaction, and judging whether to execute a corresponding shutdown control operation based on the target weight data and the accumulated weight data; If the corresponding shutdown control operation is not performed, calculating the corresponding predicted powder output time according to the accumulated weight data and the target weight data, and determining whether to perform the corresponding deceleration control operation according to the predicted powder output time and the powder output rate; When the corresponding deceleration control operation is executed, a corresponding interpolation prediction model is constructed to calculate the corresponding predicted downtime, which is used to control the coffee grinder to perform an automatic stop operation within a corresponding time period.
[0005] By adopting the above technical solution, by continuously acquiring weighing data based on a fixed sampling time interval, and constructing a sliding window in real time to dynamically monitor the cumulative powder output weight, the powder output rate is then calculated, and shutdown and deceleration predictive control is performed in accordance with the target weight set by the user. This achieves precise control of the bean grinding process under multi-factor interference, effectively avoiding the problem of large errors in traditional timing control.
[0006] Preferably, the step of constructing a corresponding sliding window according to the weighing data and calculating the corresponding cumulative weight data includes: Calculate the weight difference between the weighing data of every two adjacent timestamps; Calling a window container, writing each weight difference into the window container in chronological order, and generating a corresponding sliding window; Each of the weighing data is added together to calculate the corresponding cumulative weight data.
[0007] By adopting the above technical solution, by calculating the weight differences between consecutive sampling data, building a sliding window to record these differences, and accumulating each group of data to obtain the cumulative weight, a smooth judgment of the powder output status in a short time can be achieved, thereby improving the system's tolerance and response speed to data fluctuations.
[0008] Preferably, the calling window container writes each weight difference into the window container in chronological order, and the step of generating the corresponding sliding window is specifically as follows: if new weighing data is obtained, the weighing data with the earliest timestamp is deleted, and the new weight difference is recalculated according to the new weighing data, and the new weight difference is written into the sliding window to update the sliding window.
[0009] By adopting the above technical solution, on the basis of continuous updating of sampling data, the sliding window is dynamically maintained by deleting the oldest data and introducing the latest data each time, which can ensure that the flow calculation model always reflects the current powder output trend, thereby maintaining the real-time and accuracy of predictive control.
[0010] Preferably, the step of calculating the corresponding powder output rate according to the sliding window includes: Calculate the sum of the weight differences by adding up the weight differences in the sliding window; Calculating a corresponding unit conversion value based on the preset fixed sampling time interval; Determine the system preset AD ratio; The weight difference, the unit conversion value, and the AD ratio are multiplied in sequence to calculate the corresponding powder output rate.
[0011] By adopting the above technical solution, during the flow rate calculation process, the current powder output rate can be accurately determined by summing all weight increments in the sliding window and converting the units based on the sampling time interval and the system-set AD conversion ratio. This can then achieve flow rate estimation during the bean grinding process, providing a quantitative basis for subsequent predictive control.
[0012] Preferably, the step of determining whether to execute a corresponding shutdown control operation based on the target weight data and the accumulated weight data comprises: determining a preset error tolerance value, subtracting the preset error tolerance value from the target weight data to generate a corresponding shutdown threshold; determining whether the accumulated weight data is greater than or equal to the shutdown threshold, and if so, executing a corresponding shutdown control operation; If it is not greater than or equal to the shutdown threshold, the corresponding shutdown control operation is not performed.
[0013] By adopting the above technical solution, a comparison mechanism between target weight and cumulative weight is introduced, and an adjustable error tolerance threshold is set. When it is detected that the current weight is close to or reaches the threshold, the shutdown operation is automatically triggered, which significantly enhances the error protection capability in the powder output control process and improves system reliability.
[0014] Preferably, the step of calculating the corresponding predicted powder output time based on the accumulated weight data, the target weight data and the powder output rate includes: Subtracting the accumulated weight data from the target weight data to calculate the accumulated difference; The accumulated difference is divided by the powder output rate to calculate the corresponding predicted powder output time.
[0015] By adopting the above technical solution, by calculating the difference between the current cumulative weight and the target weight and estimating the remaining grinding time in combination with the powder output rate, the system can determine the remaining time to reach the target weight in advance, thereby providing a more reasonable time window for deceleration and shutdown, and improving the foresight of powder output control.
[0016] Preferably, the step of determining whether to perform a corresponding deceleration control operation based on the predicted powder output time and the powder output rate includes: Determining whether the powder output rate is greater than a deceleration threshold; If it is not greater than the deceleration threshold, determining whether the predicted powder output time is less than the first time threshold; if it is not less than the first time threshold, continuing the determination; if it is less than the first time threshold, executing the corresponding deceleration control operation; If it is greater than the deceleration threshold, it is determined whether the predicted powder output time is less than the second time threshold. If it is not less than the second time threshold, the determination is continued. If it is less than the second time threshold, the corresponding deceleration control operation is performed.
[0017] By adopting the above technical solution, combined with the powder output rate and the predicted remaining grinding time, the system can automatically determine whether to execute deceleration control in advance to avoid overshoot caused by motor inertia, effectively control the endpoint error and implement an adaptive powder output curve control strategy.
[0018] Preferably, when the corresponding deceleration control operation is executed, before the step of obtaining the motor deceleration weight data set, the method includes: Calculate the corresponding weight standard deviation σ and mean u based on the weighing data collected continuously for the first preset group; According to the weight standard deviation and the mean, the corresponding normal distribution value N is calculated using the following formula: Determining an adjustable parameter, and judging whether the normal distribution value is less than the adjustable parameter; If it is less than the adjustable parameter, preparing to execute the step of obtaining the motor speed reduction weight data set; If it is not less than the adjustable parameter, the weighing data of the first preset group is continuously collected again to determine whether the normal distribution value is less than the adjustable parameter, until it is less than the adjustable parameter.
[0019] By adopting the above technical solution, before entering the interpolation prediction modeling, the system calculates the mean and standard deviation of a set of weighing data, and judges the stability of the weighing signal based on this. If the signal fluctuation is less than the set threshold, it is considered that the modeling process can be entered, thereby ensuring that subsequent interpolation predictions are based on high-reliability data, improving modeling accuracy and control accuracy.
[0020] Preferably, when the corresponding deceleration control operation is performed, the step of constructing a corresponding interpolation prediction model to calculate the corresponding predicted downtime includes: Determining the accumulated weight data when deceleration is started as the deceleration starting weight data, and calculating the deceleration difference between the target weight data and the deceleration starting weight data; Based on a preset fixed sampling time interval, continuously collecting a second preset group of weighing data to generate a corresponding motor speed reduction weight data set; Constructing a corresponding interpolation prediction model based on the motor speed reduction weight data set; The deceleration difference is substituted into the interpolation prediction model to generate a corresponding predicted downtime.
[0021] By adopting the above technical solution, during the deceleration stage, by recording multiple consecutive weighing data points during the deceleration process and constructing an interpolation prediction model based on this, the system can accurately predict the delayed downtime based on the current remaining powder output, thereby compensating for the powder output inertia during the deceleration period and achieving the target weight accurately.
[0022] A coffee bean grinder bean flow rate weighing prediction circuit uses a coffee bean grinder bean flow rate weighing prediction method. The coffee bean grinder bean flow rate weighing prediction circuit includes a main control module and an analog-to-digital conversion module. The analog-to-digital conversion module includes an analog-to-digital conversion chip U7. The analog-to-digital conversion chip U7 is provided with an excitation power output port for supplying power to a weighing sensor and a differential signal input port for receiving a differential voltage signal sent by the weighing sensor, as well as a communication port for data communication with the main control module. The weighing sensor is used to continuously collect weighing data of a first preset group based on a preset fixed sampling time interval.
[0023] By adopting the above technical solution, the system hardware adopts a collaborative architecture of analog-to-digital conversion chip and main control module. The analog-to-digital chip not only provides excitation power for the weighing sensor, but also collects its differential signal and transmits it digitally to the main control module for processing, realizing high-precision and high-stability weight collection capability, ensuring that the entire control algorithm has data-based reliability and hardware implementation feasibility.
[0024] In summary, this application includes at least one of the following beneficial technical effects: 1. This application solves the accuracy problem caused by the fluctuation of powder output rate in the traditional timing control method by constructing a flow monitoring and prediction control mechanism based on a sliding window. Specifically, based on a preset fixed sampling time interval, the weighing data fed back by the electronic scale during the grinding process is continuously collected to capture the trend of weight change over time in real time. The system does not directly use absolute weight to determine the timing of shutdown, but constructs the collected data into a sliding window structure, and calculates the powder output rate per unit time by the weight increment between each two adjacent time points in the sliding window. This sliding window mechanism has the ability to self-update and can reflect the latest changes in the powder output status during the grinding process, avoiding the problem of traditional solutions ignoring instantaneous fluctuations due to relying only on the average powder output rate; 2. Based on the real-time powder delivery rate, this application combines the difference between the user-set target weight and the current cumulative weighing value to dynamically calculate the remaining weight of coffee powder to be ground, as well as the time required to reach this difference at the current rate, thereby determining whether to implement deceleration control or early shutdown strategies. Compared to traditional static timing control, this solution can make real-time decisions based on actual weighing changes during each grinding process, rather than relying on fixed time settings based on empirical parameters, significantly improving the adaptability and accuracy of powder delivery control. 3. This system dynamically calculates the remaining weight of ground coffee, based on the real-time delivery rate and the difference between the user-set target weight and the current cumulative weight, as well as the time required to reach that difference at the current rate. This determines whether to implement deceleration control or premature shutdown. Compared to traditional static timing control, this solution makes real-time decisions based on actual weight changes during each grinding process, rather than relying on fixed timers set by empirical parameters. This significantly improves the adaptability and accuracy of delivery control. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a flow chart of a method for predicting the flow rate of coffee bean grinders by weighing in accordance with an embodiment of the present application.
[0026] Figure 2 This is a schematic flow chart of a partial circuit structure of a main control module in a bean grinding flow rate weighing prediction circuit of a coffee bean grinder in one embodiment of the present application; Figure 3 This is a schematic flow chart of a partial circuit structure of an analog-to-digital conversion module in a bean grinding flow rate weighing prediction circuit of a coffee bean grinder in one embodiment of the present application; DETAILED DESCRIPTION
[0027] The present application is further described in detail below with reference to the accompanying drawings.
[0028] In one embodiment, if Figure 1 As shown, the present application discloses a method for weighing and predicting the grinding flow rate of a coffee bean grinder, and the method comprises: S10. Continuously collect a first set of preset weighing data based on a preset fixed sampling interval, construct a corresponding sliding window based on the weighing data, and calculate the corresponding cumulative weight data. The preset fixed sampling interval refers to the fixed interval between two weighing data collection points set by the system. This interval is fixed and unchanging, for example, collecting weight data every 50 milliseconds to ensure continuity and stability of data collection. Continuously collecting the first set of preset weighing data means that during system initialization or initial operation, the system continuously obtains a certain number of weight readings at this fixed sampling interval, for example, 10 or 20 sets of data as a batch, to provide sufficient data for subsequent analysis. The weighing data is raw weight measurements obtained by an electronic scale system connected to the grinder, typically recording real-time values as coffee grounds accumulate over a period of time. The sliding window is a data cache structure used for dynamic updates. It adds the latest weight data and deletes the oldest entry at each sampling time, thereby maintaining a fixed-length data sequence and ensuring that the system analyzes the most recent coffee grounds output. The cumulative weight data refers to the current total powder output weight obtained by summing or superimposing the weight values at each time point in the sliding window, which is used to determine the degree of deviation from the target value.
[0029] S20. Calculate a corresponding powder output rate based on the sliding window. The powder output rate represents the actual output speed of coffee powder per unit time. It is a physical quantity obtained by the ratio of the weight change amplitude to the time length within the sliding window, and reflects the current efficiency of grinding beans.
[0030] S30. Determine the target weight data obtained in advance through user interaction, and judge whether to execute the corresponding shutdown control operation based on the target weight data and the cumulative weight data; the target weight data is the expected total powder output input by the user through the operation interface or preset parameters, and the system uses this as a reference for control judgment.
[0031] S40: If the corresponding stop control operation has not been executed, the corresponding predicted powder discharge time is calculated based on the accumulated weight data and the target weight data, and based on the predicted powder discharge time and powder discharge rate, a determination is made as to whether to execute the corresponding deceleration control operation. The predicted powder discharge time is the estimated remaining grinding time calculated by the system based on the difference between the current accumulated weight and the target weight, combined with the real-time powder discharge rate, and is the core parameter for enabling advance judgment. The deceleration control operation means that when the predicted powder discharge time approaches a preset time threshold, the system will proactively reduce the grinder speed to prevent motor inertia overshoot, thereby entering a smooth final stage.
[0032] S50. When the corresponding deceleration control operation is executed, a corresponding interpolation prediction model is constructed to calculate the corresponding predicted downtime. The predicted downtime is used to control the grinder to automatically stop within the corresponding time period. The interpolation prediction model is a mathematical function model constructed using multiple sets of weighing data during the deceleration process. Through this model, the powder discharge duration corresponding to a certain residual weight in the future can be predicted, making an advance judgment on the final downtime. The predicted downtime is the control time point determined by the system based on the interpolation model, indicating the delay from the current moment to stop grinding to ensure that the final powder discharge accurately matches the target value.
[0033] In one embodiment, step S10, i.e., the step of constructing a corresponding sliding window based on the weighing data and calculating the corresponding cumulative weight data, includes: S101. Calculate the weight difference between two consecutive timestamp weighing data. A timestamp refers to the specific collection time point corresponding to each weighing data item, and is used to identify the order in which data collection occurred. Calculating the weight difference between two consecutive timestamp weighing data items involves subtracting the weight at the previous time point from the weight at the next time point after the system collects two consecutive weight data items. This calculation determines the actual increase in coffee powder weight between these two time intervals, reflecting the change in powder yield per unit time.
[0034] S102: Calling a window container and writing each weight difference into the window container in chronological order to generate a corresponding sliding window. The timestamp refers to the specific collection time point corresponding to each weighing data item, which is used to identify the order in which data collection occurred. The weight difference between two weighing data items with adjacent timestamps is calculated. After the system collects two consecutive weight data items, the weight at the later time point is subtracted from the weight at the previous time point to obtain the actual increase in coffee powder weight between the two time intervals, which is used to reflect the change in coffee powder output per unit time.
[0035] S103. Add up each weighing data and calculate the corresponding cumulative weight data. Specifically, when the system collects weight data of 0.00g, 0.45g, 0.85g, and 1.30g at 0ms, 50ms, 100ms, and 150ms, respectively, the system will take each two adjacent time points as a group and calculate the difference as 0.45g, 0.40g, and 0.45g, respectively. Then, the system will write these three differences into the window container in sequence to construct the current sliding window. At the same time, all weighing data of 0.00g, 0.45g, 0.85g, and 1.30g are summed to obtain the cumulative weight data of 3.60g, which will be used for subsequent judgment of whether it is close to the target weight.
[0036] In one embodiment, in step S10, the window container is called, and each weight difference is written into the window container in chronological order. In the step of generating the corresponding sliding window, specifically: if new weighing data is obtained, the weighing data with the earliest timestamp is deleted, and the new weight difference is recalculated according to the new weighing data, and the new weight difference is written into the sliding window to update the sliding window.
[0037] In one embodiment, step S20, i.e., the step of calculating the corresponding powder output rate according to the sliding window, includes: S201. Calculate a weight difference sum by adding up the weight differences in the sliding window. The weight difference sum refers to the total incremental value obtained by summing the weight changes in multiple consecutive time periods contained in the sliding window, reflecting the total output of coffee powder during the entire sliding window and used to indicate the powder output trend per unit time.
[0038] S202. Calculate a corresponding unit conversion value based on a preset fixed sampling time interval. The unit conversion value is a coefficient derived from the time interval and is used to convert the cumulative weight difference into a powder output rate in a standard time unit. The unit conversion value is typically calculated as the ratio between the unit time length and the sliding window coverage time, so that the powder output rate is unified into a measurement method with units per second.
[0039] S203. Determine the system preset AD ratio; the system preset AD ratio refers to a fixed conversion factor in the digital signal conversion system that converts the original AD count value of the analog-to-digital converter into an actual mass unit (such as grams). It is usually obtained during the calibration process and is used to restore the original weighing signal to a real physical quantity.
[0040] S204: Multiply the weight difference sum, the unit conversion value, and the AD ratio in sequence to calculate the corresponding powder output rate. Multiplying the weight difference sum, the unit conversion value, and the AD ratio in sequence indicates that the system combines these three key factors in a logical order and ultimately determines the current powder output rate, i.e., the weight of powder output per unit time, through multiplication. This rate value will be used in the subsequent predictive control logic as an important basis for determining the remaining grinding time or whether to trigger deceleration. Specifically, when the weight differences contained in the sliding window are 0.45g, 0.40g, and 0.50g, the total is 1.35g, the sampling interval is 50ms, there are three difference data, and the total coverage time is 150ms, the corresponding unit conversion value is (1000 / 150) = 6.67. If the AD ratio is determined to be 1.0g / AD unit after system calibration, the final powder output rate is 1.35×6.67×1.0=9.0g / s, indicating that the current grinder is outputting coffee powder at a rate of 9 grams per second.
[0041] In one embodiment, in step S30, i.e., the step of determining whether to execute a corresponding shutdown control operation based on the target weight data and the accumulated weight data, the steps include: S301. Determine a preset error tolerance value, subtract the preset error tolerance value from the target weight data, and generate a corresponding shutdown threshold; the preset error tolerance value is the allowable error range set by the system according to the actual control accuracy requirements, and is used to prevent powder overshoot caused by factors such as motor inertia, data fluctuations or weighing delays. It is usually a fixed difference less than the target weight, such as 0.2 grams or 0.5 grams, and is used to trigger a shutdown judgment in advance before approaching the target weight.
[0042] S302. Determine whether the accumulated weight data is greater than or equal to the shutdown threshold. If it is greater than or equal to the first shutdown threshold, execute the corresponding shutdown control operation. The shutdown threshold is the actual judgment baseline obtained by subtracting the error tolerance value from the target weight data. It is the reference value used by the system to determine whether the current powder output is close to completion. It is lower than the target value and has the effect of early intervention control. The accumulated weight data is the real-time total powder output that is continuously updated by the system based on the sliding window or weighing results, reflecting the actual progress of the powder output. Determining whether the accumulated weight data is greater than or equal to the shutdown threshold is a logical judgment operation actively performed by the system to identify whether the shutdown condition has been met. If it is greater than or equal to the shutdown threshold, the system will immediately execute the shutdown control operation, that is, turn off the grinding motor and end the current grinding task to avoid excessive powder output.
[0043] S303: If the accumulated weight is not greater than or equal to the shutdown threshold, the corresponding shutdown control operation is not executed; if the accumulated weight has not yet reached the threshold, it means that the current state is still before the target output, and the system maintains the grinding state and continues sampling and monitoring.
[0044] In one embodiment, step S40, i.e., the step of calculating the corresponding predicted powder output time based on the accumulated weight data, the target weight data, and the powder output rate, includes: S4011. Subtract the cumulative weight data from the target weight data to calculate the cumulative difference. The cumulative difference is the numerical difference between the target weight set by the user and the current cumulative weight. It reflects the quality of coffee powder that the grinder still needs to output at the current moment and is a key parameter for evaluating the distance between the current progress and the completion target. The cumulative difference typically decreases as the grinding process progresses until it approaches zero, indicating that the target is about to be achieved. The predicted powder delivery time is the estimated remaining grinding time calculated by the system based on the current powder delivery rate and the cumulative difference. It is used to determine whether to enter the next stage of deceleration control or interpolation predictive modeling. This time value is dynamic and will be updated in real time as the actual powder delivery rate fluctuates. It is a time quantification indicator that plays a decision-making role in the entire grinding control process.
[0045] S4012: Divide the accumulated difference by the powder output rate to calculate the corresponding predicted powder output time. The predicted powder output time is the estimated remaining grinding time calculated by the system based on the current powder output rate and the accumulated difference. It is used to determine whether to enter the next stage of deceleration control or interpolation predictive modeling. The predicted powder output time is dynamic and updates in real time with fluctuations in the actual powder output rate. It is a time-based quantitative indicator that plays a decisive role in the overall grinding control process.
[0046] In one embodiment, in step S40, i.e., the step of determining whether to perform a corresponding deceleration control operation based on the predicted powder output time and powder output rate, the following steps are included: S4021. Determine whether the powder output rate is greater than the deceleration threshold. The deceleration threshold is a preset reference value used by the system to determine whether the current powder output rate is at a low level. It is usually a relatively conservative speed limit, used to identify whether the system needs to enter a deceleration phase when operating at a relatively stable state. The deceleration threshold is set to trigger deceleration only when the powder output rate is very close to the target completion time, avoiding premature interference with the grinding rhythm.
[0047] S4022. If it is not greater than the deceleration threshold, determine whether the predicted powder output time is less than the first time threshold. If it is not less than the first time threshold, continue to determine. If it is less than the first time threshold, execute the corresponding deceleration control operation. The first time threshold is a time judgment limit set for low-speed conditions that do not exceed the deceleration threshold. The system will decide whether to decelerate in advance based on whether the predicted powder output time is less than this value. It is generally set shorter, indicating that the operation will only be triggered when there is very little time left.
[0048] S4023: If the predicted powder output time is greater than the deceleration threshold, a determination is made as to whether it is less than a second time threshold. If not, the determination continues. If less than the second time threshold, the corresponding deceleration control operation is executed. The second time threshold is a relatively longer warning time interval set for high powder output rates. When the system detects that the current rate is too high, it uses this more relaxed threshold for judgment, allowing for earlier deceleration, thereby preventing target overshooting due to inertia. Deceleration control refers to the system's proactive reduction of the grinder motor speed before the remaining time has expired, in order to control final powder output accuracy, once a certain condition is recognized. This action buffers the powder output rhythm, allowing the system to more accurately approach the target value.
[0049] In one embodiment, before step S50, that is, when the corresponding deceleration control operation is performed, before the step of obtaining the motor deceleration weight dataset, the following steps are included: S41. Calculate the corresponding weight standard deviation σ and mean u based on the first preset set of continuously collected weighing data. The weight standard deviation refers to the fluctuation range of each data point relative to the mean within a set of weighing data, as assessed by the system. It is used to measure the degree of dispersion within the set of weighing data. A larger value indicates greater weight fluctuation and more unstable data. The mean refers to the value obtained by averaging the continuously collected set of weighing data. It represents the central tendency of the set of data and serves as a reference baseline for evaluating the standard deviation.
[0050] S42. Calculate the corresponding normal distribution value N based on the weight standard deviation and mean. The calculation formula is: The normal distribution value is the ratio obtained by dividing three times the weight standard deviation by the mean. It reflects the proportion of data fluctuation relative to the overall level. It is derived from the 3σ statistical law of the normal distribution and is used to quickly determine whether the weighing data is within a stable range.
[0051] S43, determining an adjustable parameter, and judging whether the normal distribution value is less than the adjustable parameter; S44: If the value is less than the adjustable parameter, prepare to execute the step of obtaining the motor speed reduction weight data set; S45, if it is not less than the adjustable parameter, continuously collecting the weighing data of the first preset group to determine whether the normal distribution value is less than the adjustable parameter, until it is less than the adjustable parameter; In this embodiment, the adjustable parameter is a threshold value pre-set by the system and flexibly adjusted by the user or developer based on accuracy requirements. It is used to compare the value with the normal distribution to determine whether the current weighing data is sufficiently stable to proceed to the next critical calculation or control process. If the normal distribution value is less than the adjustable parameter, indicating relatively small data fluctuations, the system determines that the weighing data is stable and can directly proceed to the subsequent deceleration weight data collection process used to build the interpolation model. If this condition is not met, the current data is considered to be too volatile and unreliable for modeling. The system will then recollect a new set of weighing data and repeatedly calculate the standard deviation and normal distribution value until a data set that meets the stability requirements is obtained.
[0052] In one embodiment, in step S50, i.e., when the corresponding deceleration control operation is performed, the step of constructing a corresponding interpolation prediction model to calculate the corresponding predicted downtime includes: S501. Determine the accumulated weight data at the start of deceleration as the deceleration start weight data, and calculate the deceleration difference between the target weight data and the deceleration start weight data. The deceleration start weight data refers to the accumulated weight corresponding to the moment the grinder enters the deceleration control state. It marks the starting weight for the motor's transition from normal operation to the low-speed phase and serves as a reference for subsequent interpolation modeling. The deceleration difference value is the value obtained by subtracting the user-set target weight from the deceleration start weight data. It represents the amount of grounds remaining to be ground by the system after deceleration begins and is a key input parameter for determining the delayed downtime.
[0053] S502. Based on a preset fixed sampling time interval, continuously collect weighing data for a second preset group to generate a corresponding motor deceleration weight data set; the second preset group is a set of continuous sampling times specifically set for interpolation modeling after the system starts deceleration control. Usually, the sampling frequency of this group remains consistent with the previous one, but the sampling content is specifically used to capture process data of the weight change of the motor during deceleration; the motor deceleration weight data set is a collection of multiple weight data points obtained by this group of continuous sampling. It accurately records the actual weight change corresponding to each sampling time point from the starting point of deceleration to near shutdown, and is the original input data for constructing the interpolation model.
[0054] S503. Construct a corresponding interpolation prediction model based on the motor deceleration weight data set. The interpolation prediction model is a mathematical function model established based on the motor deceleration weight data set, and is often constructed using Newton interpolation or other high-order difference methods. It can deduce the time required for any specified remaining weight based on the known weight change trend, thereby simulating the powder discharge behavior during motor deceleration.
[0055] S504: Substituting the deceleration difference into the interpolation prediction model to generate a corresponding predicted downtime. The predicted downtime is the result obtained by substituting the deceleration difference into the interpolation model. It represents the delay time from the start of deceleration to reaching the target weight and is the key control variable that ultimately controls the automatic shutdown of the coffee grinder. Specifically, the specific process of constructing the interpolation prediction model includes: the system uses the moment when the motor starts the deceleration operation as the starting reference time point, and from this time point onwards, continuously collects at least five sets of weight data at a fixed sampling time interval (such as every 50ms) to form a motor deceleration weight data set. Each set of data includes the corresponding timestamp information ti and the cumulative weight gi at that time point, constructing a data pair (xi, yi), where xi represents the increment of gi relative to the deceleration starting weight G1 (i.e., xi = gi-G1), and yi represents the time increment of the sampling time ti relative to the deceleration starting moment (i.e., yi = ti-t0, t0 is the deceleration starting time). Then, the system arranges these five sets of data in ascending order according to the order of xi, and uses the Newton interpolation method based on this sequence to construct the fourth-order difference quotient. The construction process includes: first determining the difference quotients Δ1, Δ2, Δ3, Δ4 between each point, and then calculating the coefficients of each order in the fourth-order Newton interpolation formula in sequence to form a complete interpolation polynomial function F(x). This function can be used to estimate the time required to achieve a weight increment of x starting from the deceleration starting point. That is, by substituting the deceleration difference M-G1 into the function F(x), the corresponding predicted downtime T2 can be obtained, which is used to delay the control of motor stopping operation.
[0056] For example, assume that the cumulative weight G1 = 16.0 grams at the beginning of deceleration, and then continuously collect five sets of data at 50ms intervals, which are: t1=50ms, g1=16.3g; t2=100ms, g2=16.7g; t3=150ms, g3=17.0g; t4=200ms, g4=17.3g; t5=250ms, g5=17.5g; Then we have xi = gi - 16.0 (e.g., x1 = 0.3), yi = ti - 0 (e.g., y1 = 50ms). Construct the data point pairs {(0.3, 50), (0.7, 100), (1.0, 150), (1.3, 200), (1.5, 250)}, and use this data to calculate the order difference quotients and construct the interpolation function F(x). When the target weight is M = 18.0g, then M - G1 = 2.0g. Substituting x = 2.0 into F(x), we obtain T2 ≈ 330ms, indicating that the motor should be stopped after a delay of another 330ms.
[0057] like Figure 2-3As shown, a coffee bean grinder bean flow rate weighing prediction circuit uses a coffee bean grinder bean flow rate weighing prediction method. A coffee bean grinder bean flow rate weighing prediction circuit includes a main control module and an analog-to-digital conversion module. The analog-to-digital conversion module includes an analog-to-digital conversion chip U7. The analog-to-digital conversion chip U7 is provided with an excitation power output port for supplying power to a weighing sensor and a differential signal input port for receiving a differential voltage signal sent by the weighing sensor, as well as a communication port for data communication with the main control module, wherein the weighing sensor is used to continuously collect weighing data of a first preset group based on a preset fixed sampling time interval.
[0058] In this embodiment, the coffee bean grinder bean flow rate weighing prediction circuit adopts a highly integrated electrical architecture design, which can realize real-time monitoring and predictive control of the powder output quality. The circuit includes two parts: a main control module and an analog-to-digital conversion module. The main control module adopts a low-power, high-performance 32-bit single-chip microcomputer chip, which is responsible for the core functions of the control system logic operation, data processing, deceleration and shutdown control signal output. The analog-to-digital conversion module integrates a 24-bit high-precision analog-to-digital conversion chip U7, which is HX717. The excitation power output port on one side is connected to the bridge excitation input end of the weighing sensor to provide a stable reference voltage for the weighing unit; the other side is provided with two differential signal input ports, which respectively receive the positive and negative weak voltage signals output by the weighing sensor bridge. The signal is proportional to the added weight and is converted into a digital signal through the built-in amplifier and high-precision ADC module, and is transmitted through I 2 C communication interface sends data to the main control module in real time; During use, the system sets the sampling period to 50 milliseconds, and the analog-to-digital conversion chip U7 converts the weight signal received every 50ms into a set of digital weighing data, and pushes it to the main control module at regular intervals. After receiving the first preset set of weighing data (for example, 10 groups) obtained by continuous sampling, the main control module processes it as the basic data of the sliding window, calculates the weight difference between each two adjacent weighing values in turn, and writes it into the difference cache queue to form a sliding window structure. Subsequently, the main control module calculates the current powder output rate by accumulating the difference in the sliding window, and dynamically compares the accumulated powder output weight with the set target weight to determine whether the current system is close to the shutdown threshold, whether it needs to slow down in advance, or build an interpolation prediction model; In the circuit board design, the SDA and SCL communication ports of the analog-to-digital conversion chip U7 are connected through I 2The C bus is connected to the main control module, with the communication rate set to standard mode to ensure data transmission stability. An RC low-pass filter circuit is also placed between the excitation output and the differential input to filter out noise and interference signals in the load cell circuit, further improving sampling accuracy. During system operation, the main control module centrally schedules sampling initiation and data reading for the analog-to-digital conversion module, ensuring real-time, accurate, and predictable weight changes during continuous coffee powder dispensing, thus achieving intelligent closed-loop control of the entire grinding and dispensing process.
[0059] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A method for predicting the bean flow rate of a coffee bean grinder by weighing, characterized in that: The method for predicting the bean grinding flow rate of a coffee bean grinder by weighing includes: Based on a preset fixed sampling time interval, continuously collecting a first preset set of weighing data, constructing a corresponding sliding window according to the weighing data, and calculating corresponding cumulative weight data; Calculating the corresponding powder output rate according to the sliding window; determining target weight data previously acquired through user interaction, and judging whether to execute a corresponding shutdown control operation based on the target weight data and the accumulated weight data; If the corresponding shutdown control operation is not performed, calculating the corresponding predicted powder output time according to the accumulated weight data and the target weight data, and determining whether to perform the corresponding deceleration control operation according to the predicted powder output time and the powder output rate; When the corresponding deceleration control operation is executed, a corresponding interpolation prediction model is constructed to calculate the corresponding predicted downtime, which is used to control the coffee grinder to perform an automatic stop operation within a corresponding time period.
2. A method for predicting the bean grinding flow rate of a coffee bean grinder according to claim 1, characterized in that: The steps of constructing a corresponding sliding window according to the weighing data and calculating the corresponding cumulative weight data include: Calculate the weight difference between the weighing data of every two adjacent timestamps; Calling a window container, writing each weight difference into the window container in chronological order, and generating a corresponding sliding window; Each of the weighing data is added together to calculate the corresponding cumulative weight data.
3. The method for predicting the bean grinding flow rate of a coffee bean grinder according to claim 2, characterized in that: The calling window container writes each weight difference into the window container in chronological order, and the step of generating the corresponding sliding window is specifically as follows: if new weighing data is obtained, the weighing data with the earliest timestamp is deleted, and the new weight difference is recalculated based on the new weighing data, and the new weight difference is written into the sliding window to update the sliding window.
4. The method for predicting the bean grinding flow rate of a coffee bean grinder according to claim 2, characterized in that: The step of calculating the corresponding powder output rate according to the sliding window includes: Calculate the sum of the weight differences by adding up the weight differences in the sliding window; Calculating a corresponding unit conversion value based on the preset fixed sampling time interval; Determine the system preset AD ratio; The weight difference, the unit conversion value, and the AD ratio are multiplied in sequence to calculate the corresponding powder output rate.
5. The method for predicting the bean grinding flow rate of a coffee bean grinder according to claim 1, characterized in that: The step of determining whether to execute a corresponding shutdown control operation based on the target weight data and the accumulated weight data comprises: determining a preset error tolerance value, subtracting the preset error tolerance value from the target weight data to generate a corresponding shutdown threshold; determining whether the accumulated weight data is greater than or equal to the shutdown threshold, and if so, executing a corresponding shutdown control operation; If it is not greater than or equal to the shutdown threshold, the corresponding shutdown control operation is not performed.
6. The method for predicting the bean grinding flow rate of a coffee bean grinder according to claim 1, characterized in that: The step of calculating the corresponding predicted powder output time based on the accumulated weight data, the target weight data, and the powder output rate includes: Subtracting the accumulated weight data from the target weight data to calculate the accumulated difference; The accumulated difference is divided by the powder output rate to calculate the corresponding predicted powder output time.
7. The method for predicting the bean grinding flow rate of a coffee bean grinder according to claim 1, characterized in that: The step of determining whether to execute a corresponding deceleration control operation according to the predicted powder output time and the powder output rate includes: Determining whether the powder output rate is greater than a deceleration threshold; If it is not greater than the deceleration threshold, determining whether the predicted powder output time is less than the first time threshold; if it is not less than the first time threshold, continuing the determination; if it is less than the first time threshold, executing the corresponding deceleration control operation; If it is greater than the deceleration threshold, it is determined whether the predicted powder output time is less than the second time threshold. If it is not less than the second time threshold, the determination is continued. If it is less than the second time threshold, the corresponding deceleration control operation is performed.
8. The method for predicting the bean grinding flow rate of a coffee bean grinder according to claim 1, characterized in that: When the corresponding deceleration control operation is performed, before the step of obtaining the motor deceleration weight data set, the method includes: Calculate the corresponding weight standard deviation σ and mean u based on the weighing data collected continuously for the first preset group; According to the weight standard deviation and the mean, the corresponding normal distribution value N is calculated using the following formula: Determining an adjustable parameter, and judging whether the normal distribution value is less than the adjustable parameter; If it is less than the adjustable parameter, preparing to execute the step of obtaining the motor speed reduction weight data set; If it is not less than the adjustable parameter, the weighing data of the first preset group is continuously collected again to determine whether the normal distribution value is less than the adjustable parameter, until it is less than the adjustable parameter.
9. The method for predicting the bean grinding flow rate of a coffee bean grinder according to claim 1, characterized in that: When the corresponding deceleration control operation is performed, the step of constructing a corresponding interpolation prediction model to calculate the corresponding predicted downtime includes: Determining the accumulated weight data when deceleration is started as the deceleration starting weight data, and calculating the deceleration difference between the target weight data and the deceleration starting weight data; Based on a preset fixed sampling time interval, continuously collecting a second preset group of weighing data to generate a corresponding motor speed reduction weight data set; Constructing a corresponding interpolation prediction model based on the motor speed reduction weight data set; The deceleration difference is substituted into the interpolation prediction model to generate a corresponding predicted downtime.
10. A coffee bean grinder bean flow rate weighing prediction circuit, characterized in that: A coffee bean grinder bean flow rate weighing prediction method as described in any one of claims 1 to 9 is used, and the coffee bean grinder bean flow rate weighing prediction circuit includes a main control module and an analog-to-digital conversion module, and the analog-to-digital conversion module includes an analog-to-digital conversion chip U7, and the analog-to-digital conversion chip U7 is provided with an excitation power output port for supplying power to a weighing sensor and a differential signal input port for receiving a differential voltage signal sent by the weighing sensor, as well as a communication port for data communication with the main control module, wherein the weighing sensor is used to continuously collect a first preset group of weighing data based on a preset fixed sampling time interval.
Citation Information
Cited By
Weight detection method and device of traditional Chinese medicine product, electronic equipment and storage medium
CN121007624A
