# Developing an I4.0 Cyber-Physical System to Enhance Efficiency and Competitiveness in Manufacturing
## 4 Case Study--A Cold-Chain Insulated Packaging Manufacturing Process
### Sensors  
According to the estimation approaches introduced in Section 4.1, the key physical parameters that need to be captured are \(r_{\text{roll}}(t)\) and \(v\). Optical solutions were sought for capturing both parameters to avoid any physical contact with the materials that could disrupt the alignment of the materials and their feed rates. For \(r_{\text{roll}}(t)\), a depth sensor based on the time-of-flight principle was chosen, while for \(v\), an optical flow sensor (OFS) was selected.  
Figure 5 demonstrates how to derive \(r_{\text{roll}}\) from the readings of the depth sensor. The distance \(d(t)\) is the depth reading from the sensor at time \(t\) to the surface of the material  
Figure 4: An illustration of using the cross-sectional area of the roll to approximate the length of material remaining on it.  
Figure 3: An illustration of the cross-sectional area of the roll. The cross-hatched area indicates the amount of material being fed into the machine, the area filled with concentric dotted circles indicates the remaining materials on the roll, and the shaded area indicates the core of the roll.  
roll. Because \(r_{\text{core}}\) is given, and the distance \(d_{\text{depleted}}\) between the sensor and the core when the roll is fully depleted is also known, \(r_{\text{roll}}(t)\) can be measured as  
\[r_{\text{roll}}(t)=d_{\text{depleted}}-d(t)+r_{\text{core}}. \tag{6}\]  
The depth sensor chosen for this project is the URM14 ultrasonic sensor from DFRobot. The URM14 uses ultrasonic waves to measure the distance between itself and the surface off which the waves reflect. The adoption of ultrasonic waves allows it to deliver readings with millimetre-grade accuracy for measurements ranging from 10 cm up to 150 cm, with a deviation of 0.1% as stated by the manufacturer. It has an RS-485 interface and operates using the Modbus communication protocol. Modbus is a widely used communication protocol in the context of industrial automation due to its ease of use, simplicity, cost-effectiveness, and reliability.  
The Modbus protocol adopts a simple master-slave architecture where the master, in this case, an SBC, initiates the data retrieval process by sending a request message to the slave device, i.e., the URM14 sensor. The sensor has been configured to continuously capture depth data and store them on its onboard register memory. The request message carries a specific Modbus function code and memory address to instruct the sensor on where to retrieve the requested data from its memory. The sensor then returns the depth data as a response message back to the SBC.  
Figure 6 further demonstrates the setup of the OFS on top of the unwound material with a translational displacement. The sensor returns the amount of displacement over two timestamps, which is used for deriving \(v\).  
The optical-flow sensor chosen for this project is the PMW3901 from Pimoroni. The PMW3901 was originally designed for drone navigation. Drones utilise this sensor to attain their relative locations while hovering in the air and avoid drifting. The sensor uses a camera to track the motion of objects and surfaces relative to the camera itself. It has a field of vision of 42 degrees, a frame rate of 121 FPS, and can capture motions up to 7.4 rad/s. According to its manufacturer, its operating range is from 80 mm to infinity. It uses the serial peripheral interface (SPI), which is a synchronous serial communication interface that transmits data synchronously with a clock signal. It also has a master-slave configuration enabling communication between a master, i.e., an SBC, and single or multiple slave devices, i.e., sensors. It is a protocol that uses only a single byte or word for data transmission, avoiding all addressing and handshake mechanisms. This makes it efficient for transmitting small chunks of data quickly. It is very commonly used to connect sensors and MCUs, and hence, can easily be connected to a range of embedded systems.  
Figure 5: An illustration of the setup of the depth sensor.