## 3 Design and Fabrication of the Haptic CDPR
### Embedded Controller  
To build a small-sized control system in our development, Nucleo microprocessors were selected after considering compactness, performance, and accessibility. To increase the computation time, we used two microprocessors based on parallel processing communication. In the control part, the Nucleo-64 obtains the signals from the force sensor through the amplifier and the Nucleo-144 drives the motor. The force sensor signals from the Nucleo-64 are transferred to the Nucleo-144 through serial communication. When selecting the digital/analog pins in the microprocessor, the number of channels in the microprocessor was also considered, preventing collisions between the signals. Figure 4 shows the controller components of the developed haptic device.  
The other components for the controller are the power supply (VSF220-24) to the device, the drivers (AM-DC2-2D) for amplifying low current signals from the microprocessor and producing a high current signal that can control and drive the motor, the terminal blocks, and a separately fabricated external board for convenient troubleshooting. The external board comprises the following components: an on/off switch for the device, a resistor for preventing overcurrent from the device, a DC/DC converter (PS15-24-5) for converting high voltage from 24 to 5 V (to power the components that need 5 V power, such as microprocessors, encoders, drivers, and amplifiers), microprocessors that communicate signals between other components, amplifiers (HX711) for amplifying low current signals from the force sensor and producing high current signals to enable the microprocessor to read the signals, and connectors for conveniently connecting the signals.  
\begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{2}{*}{**Cable No.**} & \multicolumn{2}{c}{**Position (mm)**} \\ \cline{2-3}  & **Pulleys (\(A_{i}\))** & **Edge of End Effector (\(B_{i}\))** \\ \hline
1 & \([-110,\,-80,72.5]\) & \([-20.5,\,-24.5,\,-27.5]\) \\
2 & \([80,\,-110,\,72.5]\) & \([20.5,\,-24.5,\  
Based on the prototyped microprocessor and sensors, the haptic CDPR control algorithm was developed including robot kinematics, inverse kinematics, force control, and admittance control. Figure 5 depicts a block diagram of the proposed control algorithm for the developed haptic device. For the given desired movement of the end-effector by an operator, the adjusted force related to the stiffness and haptic feeling of the operator can be provided to the operator with motion command generation to the slave CDPR.  
First, if the operator applies an external wrench force \(w\) to the end-effector, \(w\) is calculated by multiplying the structure matrix \(-A^{T}\) with the cable tensions \(f_{cable}\) measured from the force sensors, as described in Section 2.1. Second, the wrench force to implement the admittance control \(w_{adm}\) can be derived using the initially calculated wrench force (\(w_{adm}=w-w_{init}\)) in order to eliminate the initial measurement error of the force sensor. Then, the target position \(r_{set}\) for the admittance control can be derived based on the SPD system and additional data filtering using a \(1^{st}\)-order low-pass filter with a cut-off frequency of 1 Hz. Lastly, the transformed target cable length for admittance control \(I_{adm}\) on the joint space is obtained from the inverse kinematics and the error between \(I_{adm}\) and \(I_{init}\) is compared to the measured value from the encoder to be an input to the motors via the PID controller. The respective gains for the SPD system (\(I=3,\ D=50I,\ C=183I\)) and the PID controller (\(K_{p}=4.88\times 10^{-4},\ K_{j}=0.08K_{p},\ K_{d}=0.024K_{p}\)) were determined by trial and error. The developed control system was implemented using C++ through the Mbed compiler, provided by STMElectronics, Geneva, Switzerland with a sampling time of 15 ms.