## 1 Introduction
As the load cell is an underdamping oscillation response requiring a longer time to be stable, a real-time filtering for compensating dynamic response is needed. Reference [24] presents an optimal G-shaped load cell design for measuring weight in two different ranges. Reference [25] proposes a linear time-varying continuous-time filter to dynamically compensate load cell response. Reference [26] presents an optimal neural network based on ALMNN for reducing serious non-linearity errors. A hardware mechanism design and control for shelf-based automatic Chinese medicine dispensing machine is presented in this study. The hardware contains a linear guide mechanism, a weighing mechanism, a retractable mechanism, a gallipot base discharge mechanism, and a lifting platform mechanism, all of which are controlled by an automatic weighing controller and lifting platform controller. These controllers control different motors for different purposes: the guide motor for the horizontal movement of the weighing mechanism to the assigned position of the traditional Chinese medicine gallipot; the retraction motor for extending the medicine spoon (which is connected to the weighing element) in order to hold powder or retracting the medicine spoon; the rotation motor for controlling the powder discharge amount; the medicine spoon motor for flipping the medicine spoon to pour powder into the mixing bowl; and the lifting motor for the lifting of the mixing bowl to hold the powder discharged from the medicine spoon. The completed software/hardware is proven, by means of an experiment, to conform to the requirements for the traditional automatic Chinese medicine dispensing machines, which are able to automatically feed and weigh prescribed powder according to the prescription order and pour powder into the mixing bowl. Moreover, the dose amount and dispensing details can be recorded in a database for further applications, such as gallipot inventory, gallipot location optimization, etc. Several Bayesian-based approaches [27; 28; 29; 30] have been proposed for tackling inventory and location optimization problems where dynamic decision-making is involved. The presented automatic Chinese medicine powder dispensing machine offers several innovative or important features that are beneficial to Chinese medicine. * The very first practical Chinese medicine powder dispensing machine with a weighing function: Such a commercial Chinese medicine powder dispensing machine is not yet available in the market. * The innovative and low-cost design of the gallipot base with powder discharge mechanism: Each gallipot is equipped with one gallipot base, which can be controlled by the weighing mechanism to discharge powder with the desired weight. An innovative gear push discharge element is designed in the gallipot base. The driving force of the gear push discharge element for discharging comes from the motor on the weighing mechanism; therefore, the cost of the gallipot base is low. * Avoidance of cross-contamination among different powders: Each individual gallipot has its own gallipot base when powder is being discharged; therefore, powder cross-contamination among different gallipots is avoided. * Flexible size: The number of shelves can be increased easily as needed; therefore, the number of powder gallipots can be increased as well. * Reduction of human error: Once the gallipots have been put correctly on the shelves, the presented machine can automatically dispense and precisely weigh the desired Chinese medicine powders without human effort, reducing human negligence significantly. * Implementation of a parabolic type of S mode speed control for stepping motor: The parabolic S mode speed control provides faster and more stable movement speed and accuracy than the trapezoidal mode. * Stepping motors are used in the presented machine for their ease of control, low cost, and durability.