# Design and Construction of a Low-Cost Test Bench for Testing Agricultural Spray Nozzles
## 2 Materials and Methods
### Control Subsystem Design  
A dedicated electrical cabinet was developed in order to accommodate all the necessary devices. In Figure 3, a block diagram is reported. The PMDC motor for the mobile platform was controlled by a Roboteq MDC1460 controller. This controller is able to read any quadrature magnetic/optical encoder and handle two limit switches used to bound motor run between two ends. The controller is able to implement a PID closed-loop control over position/speed in an internal loop running at 1 kHz and is able to implement regenerative braking. This allows for better controller performance, but the power supply subsystem must be carefully designed in order to avoid over-voltage on the power supply rails. In battery-powered systems, the excess energy coming from the regenerative braking is used to recharge the batteries, but in systems powered from mains, this is not possible. To overcome this aspect, a low-cost, high-power, bidirectional TVS (transient voltage suppression) diode from Littelfuse (1.5 KE30 ca) was used to dissipate the braking back energy. The diode is able to safely dissipate 1500 W for about 1 ms and can handle about 200 A current flow for about 8 ms, with a response time of about 1 ps. These specifications are in excess to the estimated back energy coming from the programmed motor deceleration and also for the back energy coming from an emergency (immediate) motor stop. The motor controller is powered by a 480 W 230  
Figure 3: Block diagram of the control system architecture. V AC to 24 V DC AC/DC power supply unit (PSU). The power subsystem is completed by different fuses (with a high-power recirculating diode in parallel to the fuse to avoid system damages in case of a fuse blown) and a relay to allow the system to be selectively powered up (control subsystem and motor power subsystem). An emergency mushroom push-button with a mechanical key is provided for safety reasons. With this stop button, the system can be immediately powered down. The control section, the sensors, and acquisition system, are powered up by a separate AC/DC PSU that is a 60 W 230 V AC to 12 V DC. Figure 3 also describes the data acquisition and valve control subsystem. To acquire the two sensor signals (flow and pressure), two Advantech Ethernet modules with a maximum sample rate of 10 Hz were used: one ADAM6024 was used to read the output of the pressure transmitter (4-20 mA output) and one ADAM6060 to control a two-way electromagnetic valve, used to send the water flow to the nozzle. The valve has a 12 V DC 12 W coil and is actuated by means of a power relay. The same ADAM6060 module is able to read the output of the flow sensor that is typically a square wave signal with a frequency proportional to the flow rate. The ADAM6060 can read a maximum frequency of 3 kHz while the maximum expected frequency with a flow rate of about 1 L/min is about 100 Hz. The ADAM6060 can also be configured to count output pulses from the flowmeter, allowing us to measure the total water volume passed through the sensor. The ADAM modules have a standard 10/100 Base-TX Ethernet interface. They use different communication protocols based on Transmission Control Protocol/Internet Protocol (TCP/IP) and user datagram protocol (UDP). In this application, an ASCII UDP based protocol was selected. The Roboteq controller has, among others, an RS232 interface able to send/receive configuration parameters as well as receive commands for the motor. In order to connect this serial interface with the other part of the system, an NPort 5100 (Moxa Inc., New Taipei City, Taiwan, R.O.C.) was used. This is a 1-port RS-232/422/485 serial device server able to act as a managed or transparent bridge between the RS232 bus and the Ethernet network. It has to be configured using its web interface and initialized using Telnet access; after that phase, it is possible to send and receive RS232 data/command to the Roboteq controller, using an UDP connection to the NPort 5100.