## 2 Materials and Methods  
### Materials  
#### 2.1.1 Setup and Control Method of the Automatic Sorting System  
A single-source DE-XRT system with energy integrating detector was used in this study. The system consisted of a vibration feeder mechanism, belt conveyor, X-ray source, line scan dual-energy detector, incremental encoder and trolley wheel component, control system, line array of gas-ejection separation component (electro-pneumatic proportional valve, fast-switching valve and ejector) and a gas supply system, etc. The part for detection and identification is similar to security inspection equipment. The schematic diagram of the system is shown in Figure 2. A SRB401 X-ray source of Spellman Company was used with 100-220 kV adjustment range of tube voltage, 0.5-2 mA at 200 kV adjustment range of tube current, 400 W maximum power, 85\({}^{\circ}\)\(\times\) 4\({}^{\circ}\) collimated fan beam, tungsten-made anode target with 0.8 mm \(\times\) 0.5 mm focal size, and 390 mm height between focus and detector \(H_{f2d}\). A LINK-1605-301 X-ray linear detector array of Sens-Tech Company was used with 1.6 mm x-accuracy (pitch), 320 pixel for both low-energy channels and high-energy channels, 10-50,000 us settable integration time, 1.875-15 with 8 sections settable channel gain. It is sandwich-like with three layers, including an upper layer of low-energy scintillator Gadox B (Gd\({}_{2}\)S\({}_{2}\)O), a middle layer of 3 mm-thickness copper sheet, and a lower layer of high-energy scintillator CdWO\({}_{4}\). An Advantech (Taiwan, China) IPC-610 industrial PC (IPC) equipped with a GTS-400-PV-PCI MCIO (motion control and I/O) card of Googoltech (Shenzhen, China) through PCI (peripheral component interconnect) bus was utilized. A rotary incremental encoder with 10,000 pulse counts per revolution was installed over a 63.6 mm-diameter trolley wheel. Its values were read by IPC through an MCIO card. When the encoder fed back a pulse, the conveyor belt advanced about 0.02 mm. The 400 mm-width belt was driven by a deceleration servo motor at a 0-3 m/s adjustable speed. A line array of gas-ejection separation components was used to separate materials. The operation parameters are summarized in Table 2, and the design principles can be found in Reference [39].  
The accelerated high-speed cathode rays (electron) in the X-ray source bombarded the anode target to produce bremsstrahlung continuous spectrum X-rays. The X-rays then formed a fan-shaped beam after filtering and collimating. After the X-ray beam reached and interacted with the material, part of the X-rays was absorbed or scattered by the material, and the rest reached the detector through the material. The X-rays attenuated by the material first interacted with the detector's low-energy scintillator (sensitive to low-energy rays) and the detector circuit converted and integrated them into energy signal \(T_{L}\). The transmitted X-rays continued to interact with the middle-layer copper sheet. Most of the low-energy X-rays were absorbed or scattered by the copper sheet, and the rest of the X-rays (high energy) reached and interacted with the high-energy scintillator. Similarly, the detector circuit converted and integrated them into the energy signal \(T_{H}\). After each set integration time, the detector could acquire a line of low-energy and high-energy signals at the same time.  
Under the PC (personal computer) general OS (operating system) Windows 7, the software was developed with the C language of Visual Studio 2012. The system achieved accurate and coordinated control, and integrated data reading, image processing, identification, logic control separation, communication and HMI (human-machine interface) [39].