## 1 Introduction
The magnetic force and torque are controlled by adjusting the position and orientation of the permanent magnet. However, this control mode has three obvious drawbacks: first, the frequency of the change of the magnetic field is low since it takes time for the permanent magnet to move to the next suitable position; second, external mechanical equipment for moving the permanent magnet requires a large working space; third, the magnetic field generated by permanent magnets cannot be quickly eliminated, which has potential safety hazards in medical treatment [16]. The second type is to generate a varying magnetic field by changing the driven current of coils. Various electromagnetic systems have been reported in works of literature [17; 18; 19; 20; 21] with different  
Figure 1: Schematic diagram of three types of magnetic field actuation methods. Their movement trends are all from right to left. (**a**) Compound magnetic field actuation; (**b**) Rotating magnetic field actuation; (**c**) Oscillating magnetic field actuation. characters of electromagnet configuration, workspace, and magnetic field distributions. [PERSON] et al. proposed OctoMag which used a total of eight cylindrical coils to control the milli/microrobot with five degrees of freedom. They used a point dipole model that was fit to field data obtained from a FEM model to describe magnetic contribution which mainly focused on the central area of the workspace. However, the complex magnetic field of OctoMag is hard to be accurately modeled over a large workspace [17]. [PERSON] et al. established a magnetic distribution database by using a numerical (linear interpolation) method based on the FEM results to make a microparticle that can be manipulated in a larger workspace [21]. At present, almost all electromagnets of electromagnetic drive systems are based on cylindrical coils, but we use a rectangular coil winding method. Compared to systems with circular coils, the rectangular coil has accurate closed-form analytical expression for the calculation of the magnetic field and gradient. Therefore, it is more suitable for the control of magnetic force and torque. Additionally, the analytical mathematic model is much more accurate at the test position than the general magnetic dipole model [22; 23]. Therefore, in this paper, we take advantage of the rectangular coil to construct a novel magnetic field device, as shown in Figure 2.  
The detailed works and contributions of this paper are listed in the following three perspectives. 1. An electromagnetic actuation system has been built based on rectangular coils, which can achieve 5-DoF control of a milli/microrobot in 3D working space. Moreover, the accurate mathematical model of the magnetic field has been used for force and torque estimation. Compared to other models, such as the magnetic dipole model, it can describe the distribution of the magnetic field more accurately. As a result, better performance of movement control of the robot can be achieved. 2. The dynamics model of the milli/microrobot moving in the liquid environment has been established. Moreover, two kinds of control strategies, namely fixed-point actuation and displacement actuation have been proposed. Linear optimization (programming) has been applied to optimize the current values for magnetic field generation. 3. Experiments with open-loop control and closed-loop control have been carried out to verify the effectiveness of the proposed system and algorithm. The rest of this paper is organized as follows: modeling of the magnetic field will be shown in Section 2, and the control method of the milli/microrobot will be introduced in Section 3. Moreover, experimental results will be shown in Section 4. Finally, conclusions will be drawn in Section 5. Figure 2: The proposed Rectmag3D prototype designed and constructed at Harbin Institute of Technology, Shenzhen. (**a**) Main mechanical structure of the system; (**b**) Top view of the main structure.