Development of an Insect-like Flapping-Wing Micro Air Vehicle with Parallel Control Mechanism

: Most traditional ﬂapping-wing micro air vehicles (FMAVs) adopt a serial control mechanism, which means that one drive corresponds to one degree of freedom. However, the serial mechanism often struggles to meet FMAV requirements in terms of stiffness, size, and reliability. In order to realize a compact reliable control mechanism, we developed a two-wing insect-like FMAV with a parallel control mechanism. The prototype possesses an optimized string-based ﬂapping wing mechanism, a 2RSS/U parallel control mechanism, and an onboard power supply and controller. The pulley’s proﬁle of the string-based mechanism was reﬁned to reduce the deformation and impact of the string. The parameters of the parallel mechanism were designed to enable the stroke plane to rotate a large angle to produce control torque. The prototype had a ﬂapping frequency of 25 Hz, a full wingspan of 21 cm, and a total weight of 28 g. A PID controller with a decoupler based on the kinetics solution of parallel mechanism was designed to control the FMAV. A force and torque (F/T) experiment was carried out to obtain the lift and control torque of the prototype. The measured data showed that the ﬂapping wing mechanism provided sufﬁcient lift and the control mechanism generated a toque caused by the stroke plane rotation and trailing edge movement and were linear to the control input. A ﬂight test was carried out to verify the ﬂight stability of the prototype. The result shows that the attitude angle only ﬂuctuates within a small range, which proved that the control mechanism and control strategy were successful.


Introduction
Insects are one of the most remarkable flying species in nature. Despite their small size, insects are highly skilled fliers. Mimicking insect flight has been a hot topic of research for many years. The mechanics of insect flight are a fundamental issue for FMAV design. In the past years, a lot of research has revealed aerodynamics at the insect scale. Some researchers have developed computable quasi-steady or unsteady aerodynamic models for insect flight. For example, Dickinson et al. applied the blade element theory (BET) in insect flapping [1] and Nabawy et al. proposed a quasi-steady aerodynamic model that could evaluate the steady translational force coefficients of flapping wings [2]. Some researchers have used computational fluid dynamics (CFD) to study the non-constant aerodynamic model. CFD is a widely used tool in aerodynamics and its utility was shown in [3,4]. For example, Nakata et al. proposed a novel CFD-informed quasi-steady model for insect flight [5] and Shahzad et al. assessed the effect on the aerodynamic hovering performance of wing shapes by the CFD tool [6]. Based on the advances in the mechanics of insect flight, micro-manufacturing, and avionics technologies, a number of successful flapping-wing micro air vehicles (FMAV) have been developed.
The flapping wing mechanism of this FMAV adopts a string-based mechanism that was first designed by [11] because the string-based mechanism has simpler components and a smaller size than other designs. In addition, it has a centrally located drive motor for easy integration with the control mechanism. The schematic of the string-based mechanism is shown in Figure 1. The upper-level strings are the sync strings that join the two pulleys together similar to a synchronous belt, allowing the two pulleys to rotate in reverse synchronously. The lower-level strings are the drive strings, one side of these strings is held to the pulley, and another side is wrapped around the projection of the crank, pulling the left and right pulleys, rotating in turn as the crank rotates. However, one of the problems with the string-based mechanism in the initial design is that the string does not fit perfectly into the pulley's profile every time, resulting in repeated stretching and impact of the string. The string is very susceptible to slackening after a period of operation. In order to make the string and pulley fit better, the pully profile needs to be designed according to the desired flapping trajectory.
The schematic diagram of the flapping wing mechanism is shown in Figure 2. The rectangular coordinate system (RCS) is fixed with the base and point is at the center of rotation of the crank.
indicates the position of crank. The , RCS is fixed with the right and left pullies and points , are the center of rotation of the pullies, respectively. , , RCS is fixed to the crank, right, and left pulley.
Assuming a uniform crank rotation and expecting a gentle rotation of the pulley, the rotations of pulleys can be expressed as Equation (1), where the initial angle is set to zero and the flapping amplitude is .
= − = cos(2 / ) + (1) However, one of the problems with the string-based mechanism in the initial design is that the string does not fit perfectly into the pulley's profile every time, resulting in repeated stretching and impact of the string. The string is very susceptible to slackening after a period of operation. In order to make the string and pulley fit better, the pully profile needs to be designed according to the desired flapping trajectory.
The schematic diagram of the flapping wing mechanism is shown in Figure 2. The xOy rectangular coordinate system (RCS) is fixed with the base and point O is at the center of rotation of the crank. OA indicates the position of crank. The x r O r y r , x l O l y l RCS is fixed with the right and left pullies and points O r , O l are the center of rotation of the pullies, respectively. Appl. Sci. 2022, 12, x FOR PEER REVIEW 3 of 18 The flapping wing mechanism of this FMAV adopts a string-based mechanism that was first designed by [11] because the string-based mechanism has simpler components and a smaller size than other designs. In addition, it has a centrally located drive motor for easy integration with the control mechanism. The schematic of the string-based mechanism is shown in Figure 1. The upper-level strings are the sync strings that join the two pulleys together similar to a synchronous belt, allowing the two pulleys to rotate in reverse synchronously. The lower-level strings are the drive strings, one side of these strings is held to the pulley, and another side is wrapped around the projection of the crank, pulling the left and right pulleys, rotating in turn as the crank rotates. However, one of the problems with the string-based mechanism in the initial design is that the string does not fit perfectly into the pulley's profile every time, resulting in repeated stretching and impact of the string. The string is very susceptible to slackening after a period of operation. In order to make the string and pulley fit better, the pully profile needs to be designed according to the desired flapping trajectory.
The schematic diagram of the flapping wing mechanism is shown in Figure 2. The rectangular coordinate system (RCS) is fixed with the base and point is at the center of rotation of the crank.
indicates the position of crank. The , RCS is fixed with the right and left pullies and points , are the center of rotation of the pullies, respectively. , , RCS is fixed to the crank, right, and left pulley.
Assuming a uniform crank rotation and expecting a gentle rotation of the pulley, the rotations of pulleys can be expressed as Equation (1), where the initial angle is set to zero and the flapping amplitude is . Assuming a uniform crank rotation and expecting a gentle rotation of the pulley, the rotations of pulleys can be expressed as Equation (1), where the initial angle is set to zero and the flapping amplitude is φ m . The coordinates of A in the xOy RCS can be converted to x r O r y r RCS by Equation (2).
Therefore we can obtain the expected trajectory of A under the x r O r y r RCS from Equations (1) and (2), and the trajectory is shown in Figure 3. The x r O r y r RCS is converted into the O r x r polar coordinate system (PCS) and a fitting curve replaces the desired curve by a polynomial fit. It should be noted that the rotation curve obtained using the fitted results was not a perfect sine curve because the law of motion of A was not symmetrical with respect to O r or O l . For the same reason, there were also slight differences in the rotation curves obtained for the left and right pulleys. However, the differences could be effectively reduced compared to the initial design.
Therefore we can obtain the expected trajectory of under the RCS from Equations (1) and (2), and the trajectory is shown in Figure 3. The RCS is converted into the polar coordinate system (PCS) and a fitting curve replaces the desired curve by a polynomial fit. It should be noted that the rotation curve obtained using the fitted results was not a perfect sine curve because the law of motion of was not symmetrical with respect to or . For the same reason, there were also slight differences in the rotation curves obtained for the left and right pulleys. However, the differences could be effectively reduced compared to the initial design. When the string is free of deformation and slack, Equation (3) should be satisfied, where = √ 2 + 2 − 2 , = cos( − ), = sin( − ).
We can obtain the expected profile by the numerical method from Equation (3). The results of the calculation are shown in Figure 4. The flapping wing mechanism had an amplitude of 180°, and a frequency of 23 Hz. A coreless DC motor (model 8520, Chaoli Corporation, China) was adopted to drive the flapping wing mechanism and the maximum output power was 11 W. The flapping wing mechanism included a motor, frame, gear set, pulleys, strings, leading edges, trailing edges, and connections. The physical drawing is shown in Figure 5. Laser cutting, CNC We can obtain the expected profile by the numerical method from Equation (3). The results of the calculation are shown in Figure 4.
Therefore we can obtain the expected trajectory of under the RCS from Equations (1) and (2), and the trajectory is shown in Figure 3. The RCS is converted into the polar coordinate system (PCS) and a fitting curve replaces the desired curve by a polynomial fit. It should be noted that the rotation curve obtained using the fitted results was not a perfect sine curve because the law of motion of was not symmetrical with respect to or . For the same reason, there were also slight differences in the rotation curves obtained for the left and right pulleys. However, the differences could be effectively reduced compared to the initial design.
We can obtain the expected profile by the numerical method from Equation (3). The results of the calculation are shown in Figure 4. The flapping wing mechanism had an amplitude of 180°, and a frequency of 23 Hz. A coreless DC motor (model 8520, Chaoli Corporation, China) was adopted to drive the flapping wing mechanism and the maximum output power was 11 W. The flapping wing mechanism included a motor, frame, gear set, pulleys, strings, leading edges, trailing edges, and connections. The physical drawing is shown in Figure 5. Laser cutting, CNC The flapping wing mechanism had an amplitude of 180 • , and a frequency of 23 Hz. A coreless DC motor (model 8520, Chaoli Corporation, Hangzhou, China) was adopted to drive the flapping wing mechanism and the maximum output power was 11 W. The flapping wing mechanism included a motor, frame, gear set, pulleys, strings, leading edges, trailing edges, and connections. The physical drawing is shown in Figure 5. Laser cutting, CNC machining, and 3D printing were used for the manufacture of the flapping wing mechanism. The frame of the flapping wing mechanism was made from carbon fiber reinforced plastic (CFRP) board by laser cutting. The gears and some connecting parts were made of copper and engineering plastics by CNC machining. The pully was made of resin by 3D printing and finally finished with polishing. The leading edge was made from 1 mm CFRP rod and the trailing edge was made from a 1.5 × 1 mm CFRP tube that can fit another part of the control mechanism.
Appl. Sci. 2022, 12, x FOR PEER REVIEW 5 of 18 machining, and 3D printing were used for the manufacture of the flapping wing mechanism. The frame of the flapping wing mechanism was made from carbon fiber reinforced plastic (CFRP) board by laser cutting. The gears and some connecting parts were made of copper and engineering plastics by CNC machining. The pully was made of resin by 3D printing and finally finished with polishing. The leading edge was made from 1 mm CFRP rod and the trailing edge was made from a 1.5 × 1 mm CFRP tube that can fit another part of the control mechanism.

Control Mechanism
The parallel mechanism is suitable for FMAV control due to its compact construction and high stiffness. A 2RSS/U parallel mechanism was adopted to control the stroke plane of FMAV. The stroke plane determines the direction of aerodynamic forces and moments generated by the flapping wing mechanism. Controlling the orientation of the stroke plane can produce the required control torque.
The schematic of the control mechanism is shown in Figure 6, where the plane is the controlled plane with two degrees of freedom of rotation under the constraints of a Hooke hinge at point . Point and are plane hinges around the y-axis. Points , , , and are spherical hinges. Point is the projection of point in the plane . The outputs are the angles of rotation , around the x and y axes and the inputs are two angles of rotation 1 , 2 that by the servo.

Control Mechanism
The parallel mechanism is suitable for FMAV control due to its compact construction and high stiffness. A 2RSS/U parallel mechanism was adopted to control the stroke plane of FMAV. The stroke plane determines the direction of aerodynamic forces and moments generated by the flapping wing mechanism. Controlling the orientation of the stroke plane can produce the required control torque.
The schematic of the control mechanism is shown in Figure 6, where the plane AOD is the controlled plane with two degrees of freedom of rotation under the constraints of a Hooke hinge at point O. Point C and F are plane hinges around the y-axis. Points A, B, D, and E are spherical hinges. Point P is the projection of point O in the plane CPF. The outputs are the angles of rotation α, β around the x and y axes and the inputs are two angles of rotation ξ 1 , ξ 2 that by the servo.
Appl. Sci. 2022, 12, x FOR PEER REVIEW 5 of 18 machining, and 3D printing were used for the manufacture of the flapping wing mechanism. The frame of the flapping wing mechanism was made from carbon fiber reinforced plastic (CFRP) board by laser cutting. The gears and some connecting parts were made of copper and engineering plastics by CNC machining. The pully was made of resin by 3D printing and finally finished with polishing. The leading edge was made from 1 mm CFRP rod and the trailing edge was made from a 1.5 × 1 mm CFRP tube that can fit another part of the control mechanism.

Control Mechanism
The parallel mechanism is suitable for FMAV control due to its compact construction and high stiffness. A 2RSS/U parallel mechanism was adopted to control the stroke plane of FMAV. The stroke plane determines the direction of aerodynamic forces and moments generated by the flapping wing mechanism. Controlling the orientation of the stroke plane can produce the required control torque.
The schematic of the control mechanism is shown in Figure 6, where the plane is the controlled plane with two degrees of freedom of rotation under the constraints of a Hooke hinge at point . Point and are plane hinges around the y-axis. Points , , , and are spherical hinges. Point is the projection of point in the plane . The outputs are the angles of rotation , around the x and y axes and the inputs are two angles of rotation 1 , 2 that by the servo.  The control chain of the parallel mechanism can be described by Equation (4).
The position of rocker BC and EF is defined by ξ 1 , ξ 2 as Equation (5).
The attitude of the controlled plane can be defined by α, β as Equation (6).
The required drive force can be calculated by the principle of virtual work, as shown in Equation (8). The loads on the control plane are defined as M x , M y , and the drive torque required by servos are defined as M 1 , M 2 . ϕ is the generalized coordinate. After obtaining the relationship of ξ 1 , ξ 2 , and α, β, we can calculate the partial differential numerically to obtain the required drive torque of the servos under different servo angles, which helps to avoid overload.
In order to determine the appropriate mechanism parameters, we need to take into account the relationship between the dimensions of the components, the maximum control angle required, the working angle of the servo, and the maximum output torque. This set of parameters is chosen as the design parameters for the parallel mechanism, as shown in Table 1. Considering the input and output variables of this mechanism, the numerical method is effective to obtained the forward and inverse solutions. The different drive platform angles corresponded to the output angles of the left and right servos, as shown in Figure 7. When a pitch toque is required, needs to be changed to rotate the stroke plane around the x-axis. When a roll toque is required, needs to be changed to rotate the stroke plane around the y-axis. The left and right servos work in coordination to obtain the appropriate , .
In addition, a separate servo was used to generate the yaw torque. Unlike pitch and roll toque, the generation of yaw torque is dependent on wing twist instead of stroke plane modulation. Because the flapping wing mechanism and the control mechanism are relatively independent units in our design, the mechanism required by wing twist modulation is relatively simple and easy to integrate into the control mechanism.
The schematic of wing twist modulation is shown in Figure 8. The plane indicates the stroke plane, which is controlled by the parallel mechanism independently. , , , are four spherical joints. The and indicate the trailing edges, which resemble cylinder straight-line rails and allow for the length of and to be changed. The rod is driven by the servo that rotates around the z-axis. The rotation angle is defined as 3 . When a pitch toque is required, α needs to be changed to rotate the stroke plane around the x-axis. When a roll toque is required, β needs to be changed to rotate the stroke plane around the y-axis. The left and right servos work in coordination to obtain the appropriate α, β.
In addition, a separate servo was used to generate the yaw torque. Unlike pitch and roll toque, the generation of yaw torque is dependent on wing twist instead of stroke plane modulation. Because the flapping wing mechanism and the control mechanism are relatively independent units in our design, the mechanism required by wing twist modulation is relatively simple and easy to integrate into the control mechanism.
The schematic of wing twist modulation is shown in Figure 8. The plane GOH indicates the stroke plane, which is controlled by the parallel mechanism independently. G, H, I, J are four spherical joints. The GI and H J indicate the trailing edges, which resemble cylinder straight-line rails and allow for the length of GI and H J to be changed. The rod I J is driven by the servo that rotates around the z-axis. The rotation angle is defined as ξ 3 . When a pitch toque is required, needs to be changed to rotate the stroke plane around the x-axis. When a roll toque is required, needs to be changed to rotate the stroke plane around the y-axis. The left and right servos work in coordination to obtain the appropriate , .
In addition, a separate servo was used to generate the yaw torque. Unlike pitch and roll toque, the generation of yaw torque is dependent on wing twist instead of stroke plane modulation. Because the flapping wing mechanism and the control mechanism are relatively independent units in our design, the mechanism required by wing twist modulation is relatively simple and easy to integrate into the control mechanism.
The schematic of wing twist modulation is shown in Figure 8. The plane indicates the stroke plane, which is controlled by the parallel mechanism independently. , , , are four spherical joints. The and indicate the trailing edges, which resemble cylinder straight-line rails and allow for the length of and to be changed. The rod is driven by the servo that rotates around the z-axis. The rotation angle is defined as 3 . Therefore, the position of the trailing edge can be controlled by a servo and the movement of the trailing edge γ can be expressed as Equation (9) for small ξ 3 .
The movement of the trailing edge leads to a change in wing twist, which in turn affects the angle of attack at different positions during wing flapping. When the right and left trailing edges move in the opposite direction, the change in angle of attack causes a pair of opposite drag and produces the yaw torque. Therefore, γ can be adopted to control yaw rotation.
The control mechanism allows 20 • of stroke plane tilt change and 1 cm trailing edge movement by using three servos. The left and right servo (model D1602, AFRC Corporation, Dongguan, China) were used to control pitch and roll. The middle servo (model D1302, AFRC Corporation, Dongguan, China) was used to control yaw. The control mechanism contained frames, servos, rocker, and trailing edges. The physical drawing of the control mechanism is shown in Figure 9. The structural components of the control mechanism were laser cut and CNC machined from 0.5 and 1 mm CFRP board and bonded together with other components by means of structural glue. The trailing edge was made from a 0.8 mm CRFP rod and could fit into another part of the flapping-wing mechanism.
Appl. Sci. 2022, 12, x FOR PEER REVIEW 8 of 18 Therefore, the position of the trailing edge can be controlled by a servo and the movement of the trailing edge can be expressed as Equation (9) for small 3 .
The movement of the trailing edge leads to a change in wing twist, which in turn affects the angle of attack at different positions during wing flapping. When the right and left trailing edges move in the opposite direction, the change in angle of attack causes a pair of opposite drag and produces the yaw torque. Therefore, can be adopted to control yaw rotation.
The control mechanism allows 20° of stroke plane tilt change and 1 cm trailing edge movement by using three servos. The left and right servo (model D1602, AFRC corporation, China) were used to control pitch and roll. The middle servo (model D1302, AFRC corporation, China) was used to control yaw. The control mechanism contained frames, servos, rocker, and trailing edges. The physical drawing of the control mechanism is shown in Figure 9. The structural components of the control mechanism were laser cut and CNC machined from 0.5 and 1 mm CFRP board and bonded together with other components by means of structural glue. The trailing edge was made from a 0.8 mm CRFP rod and could fit into another part of the flapping-wing mechanism.

Wing
FMAV wings require low inertia and high strength. A lot of previous research has described how to design and manufacture suitable wings for FMAV. Some studies have explored the suitable wing shape and kinematics [6,26,27]. Some studies have focused on wing structures [28,29]. Some research examines the effect of wing stiffness and deformation [28,30,31]. Referring to these designs, we determined the parameters for the wing. The main parts of the wing included the wing membrane, main vein, branch vein, reinforcement membrane, leading-edge sleeve, and trailing edge sleeve. The wing length was set to 80 mm, the chord length was 25 mm, the aspect ratio was 3.2, and the total weight was only 120 mg.
The wing membrane was made from 5 μm polyimide (PI) film. When the veins are too thin, the wing veins are easy to break because of the collision of wings or some other objects, especially in the situation of large flapping amplitude. When veins are too thick, the inertia of the wings increases, the load on the motor also increases and the gears connected to the motor tend to fall out. Therefore, we chose the wing that contained 0.6 mm leading-edge and 0.3 mm other veins, which could work for the longest time without

Wing
FMAV wings require low inertia and high strength. A lot of previous research has described how to design and manufacture suitable wings for FMAV. Some studies have explored the suitable wing shape and kinematics [6,26,27]. Some studies have focused on wing structures [28,29]. Some research examines the effect of wing stiffness and deformation [28,30,31]. Referring to these designs, we determined the parameters for the wing. The main parts of the wing included the wing membrane, main vein, branch vein, reinforcement membrane, leading-edge sleeve, and trailing edge sleeve. The wing length was set to 80 mm, the chord length was 25 mm, the aspect ratio was 3.2, and the total weight was only 120 mg.
The wing membrane was made from 5 µm polyimide (PI) film. When the veins are too thin, the wing veins are easy to break because of the collision of wings or some other objects, especially in the situation of large flapping amplitude. When veins are too thick, the inertia of the wings increases, the load on the motor also increases and the gears connected to the motor tend to fall out. Therefore, we chose the wing that contained 0.6 mm leading-edge and 0.3 mm other veins, which could work for the longest time without problems on our prototype. All components were pressed together by the bag mold technique of vacuum pressure impregnation.

Prototype
The FMAV prototype consisted of flapping-wing mechanisms, parallel control mechanisms, wings, flight control board, battery, and skeleton. The FMAV prototype shown in Figure 10 had a frequency of 25 Hz, a full wingspan of 21 cm, a total weight of 28 g, a battery capacity of 250 mah, total power of 11 W, and a maximum lift of 34 gf. The length of the main body was 15 cm and the width was 4 cm. The main properties of the prototype are shown in Table 2 and the mass distribution of the prototype is shown in Figure 11. anisms, wings, flight control board, battery, and skeleton. The FMAV prototype shown in Figure 10 had a frequency of 25 Hz, a full wingspan of 21 cm, a total weight of 28 g, a battery capacity of 250 mah, total power of 11 W, and a maximum lift of 34 gf. The length of the main body was 15 cm and the width was 4 cm. The main properties of the prototype are shown in Table 2 and the mass distribution of the prototype is shown in Figure 11.     problems on our prototype. All components were pressed together by the bag mold technique of vacuum pressure impregnation.

Prototype
The FMAV prototype consisted of flapping-wing mechanisms, parallel control mechanisms, wings, flight control board, battery, and skeleton. The FMAV prototype shown in Figure 10 had a frequency of 25 Hz, a full wingspan of 21 cm, a total weight of 28 g, a battery capacity of 250 mah, total power of 11 W, and a maximum lift of 34 gf. The length of the main body was 15 cm and the width was 4 cm. The main properties of the prototype are shown in Table 2 and the mass distribution of the prototype is shown in Figure 11.    Figure 11. The mass distribution of the FMAV.

Attitude Control
The number and performance of sensors that FMAV can carry are limited due to the size and weight. To achieve the flight of the vehicle with an onboard controller and battery, gyroscopes and accelerometers were adopted to obtain the attitude of FMAV. Therefore, the attitude of FMAV in flight can be solved by the Newton-Euler Equation (10).
where J is the inertia matrix; . ω, ω are the angular acceleration and velocity vector; and M is the total external torque vector.
The M is produced by the control mechanism changing stroke plane rotation and wing twist. Therefore, it can be divided into two parts, where M s indicates the torque produced by rotating the stroke plane, which can be expressed as Equation (11), where the lift is defined as T and the input is defined as U = (α, β, γ) T . When α, β are small angles, M s is proportional to α, β, respectively.
M t indicates the torque produced by the movement of the trailing edge. With reference to the previous research [19], we can assume that there is a linear relationship between M t and movement of trailing edge. Therefore, M t can be expressed as Equation (12).
The external torque vector M can be expressed as the sum of M s , M t and is shown in Equation (13).

PID Control
Considering the essentially linear relationship between control torque and input, the PID controller is useful for making the attitude stable. Referring to research, we designed a PID controller, which is indicated in Figure 12.
where α, β, γ are considered as the virtual input of the PID diagram. Next, the virtual servo inputs α, β, γ need to be converted to an actual input ξ 1 , ξ 2 , ξ 3 . Through the inverse kinematic solution of the parallel mechanism, the values of ξ 1 , ξ 2 are obtained by bilinear interpolating α, β. Based on the analysis of the numerical solution, we can also add a decoupler to implement the decoupled control as shown in Figure 13. The number and performance of sensors that FMAV can carry are limited due to the size and weight. To achieve the flight of the vehicle with an onboard controller and battery, gyroscopes and accelerometers were adopted to obtain the attitude of FMAV. Therefore, the attitude of FMAV in flight can be solved by the Newton-Euler equation (10).
where is the inertia matrix; ̇, are the angular acceleration and velocity vector; and is the total external torque vector. The is produced by the control mechanism changing stroke plane rotation and wing twist. Therefore, it can be divided into two parts, where indicates the torque produced by rotating the stroke plane, which can be expressed as Equation (11), where the lift is defined as and the input is defined as = ( , , ) . When , are small angles, is proportional to , , respectively. 11) indicates the torque produced by the movement of the trailing edge. With reference to the previous research [19], we can assume that there is a linear relationship between and movement of trailing edge. Therefore, can be expressed as Equation (12).
The external torque vector can be expressed as the sum of , and is shown in Equation (13).

PID Control
Considering the essentially linear relationship between control torque and input, the PID controller is useful for making the attitude stable. Referring to research, we designed a PID controller, which is indicated in Figure 12.
where , , are considered as the virtual input of the PID diagram. Next, the virtual servo inputs , , need to be converted to an actual input 1 , 2 , 3 . Through the inverse kinematic solution of the parallel mechanism, the values of 1 , 2 are obtained by bilinear  interpolating , . Based on the analysis of the numerical solution, we can also add a decoupler to implement the decoupled control as shown in Figure 13.

Wing Kinematics
We used high-speed cameras to capture the kinematic of the wings, similar to the high-speed motion capture system mentioned in [32]. The motion capture system contained three high-speed cameras around the prototype and the high-speed cameras were pre-calibrated so that we could calculate the trajectory of the marker point from captured movies by the DLT algorithm. The DLT algorithm and software are presented in [33].

Wing Kinematics
We used high-speed cameras to capture the kinematic of the wings, similar to the high-speed motion capture system mentioned in [32]. The motion capture system contained three high-speed cameras around the prototype and the high-speed cameras were precalibrated so that we could calculate the trajectory of the marker point from captured movies by the DLT algorithm. The DLT algorithm and software are presented in [33].
L 0 expresses the length of the leading edge and l expresses the distance between the marker point and flapping axis along the leading edge. The marker points are located at l = 0.25L 0 , 0.5L 0 and 0.75L 0 of the wing to obtain the wing kinematics at different positions. The angles of wing rotation and flapping are shown in Figure 14.
Appl. Sci. 2022, 12, x FOR PEER REVIEW 1 interpolating , . Based on the analysis of the numerical solution, we can also add coupler to implement the decoupled control as shown in Figure 13.

Wing Kinematics
We used high-speed cameras to capture the kinematic of the wings, similar high-speed motion capture system mentioned in [32]. The motion capture system tained three high-speed cameras around the prototype and the high-speed cameras pre-calibrated so that we could calculate the trajectory of the marker point from cap movies by the DLT algorithm. The DLT algorithm and software are presented in [33 0 expresses the length of the leading edge and expresses the distance betwe marker point and flapping axis along the leading edge. The marker points are loca = 0.25 0 , 0.5 0 and 0.75 0 of the wing to obtain the wing kinematics at different tions. The angles of wing rotation and flapping are shown in Figure 14.

Force and Torque Measurement
Some previous research has examined the force/torque (F/T) measurement system for FMAV [32,34]. Drawing on these designs, an F/T measurement system based on 6-axis sensors (model Nano17, ATI Industrial Automation, Apex, NC, USA) was built to detect the control torque at different control inputs. Figure 15 shows the F/T system for the lift and control torque measurements. Appl. Sci. 2022, 12, x FOR PEER REVIEW 12 of 18

Force and Torque Measurement
Some previous research has examined the force/torque (F/T) measurement system for FMAV [32,34]. Drawing on these designs, an F/T measurement system based on 6-axis sensors (model Nano17, ATI Industrial Automation, USA) was built to detect the control torque at different control inputs. Figure 15 shows the F/T system for the lift and control torque measurements.  Figure 15a shows the connection between the sensor and the prototype. The test plate of the sensor was fixed to the FMAV and the fixing plate was fixed to the base. The base was padded away from the ground and the prototype was inverted to reduce the ground effects. Figure 15b shows the connection of the peripherals. A two-channel DC supply powered the prototype. One channel provided the required voltage for the motor of the flapping-wing mechanism and another channel provided 3.7 V voltage for the servos of the control mechanism. A microcontroller outputted the PWM signal needed to control the servos. The initial data obtained by the sensor were sent to the interface devices to solve, and the solved F/T data were acquired by DAQ. Figure 16 shows the setup for control torque generated by the trailing edge movement using the F/T measurement system.  Figure 15a shows the connection between the sensor and the prototype. The test plate of the sensor was fixed to the FMAV and the fixing plate was fixed to the base. The base was padded away from the ground and the prototype was inverted to reduce the ground effects. Figure 15b shows the connection of the peripherals. A two-channel DC supply powered the prototype. One channel provided the required voltage for the motor of the flapping-wing mechanism and another channel provided 3.7 V voltage for the servos of the control mechanism. A microcontroller outputted the PWM signal needed to control the servos. The initial data obtained by the sensor were sent to the interface devices to solve, and the solved F/T data were acquired by DAQ. Figure 16 shows the setup for control torque generated by the trailing edge movement using the F/T measurement system. Figure 16a shows that the flapping wing mechanism was fixed to the fixture with an adjustment board. The adjustment plate had a set of holes to fit the trailing edge rod that allowed the trailing edge to be placed in the expected position. Figure 16b shows the correspondence between the trailing edge movement directions and the control torque.  Figure 16a shows that the flapping wing mechanism was fixed to the fixture with an adjustment board. The adjustment plate had a set of holes to fit the trailing edge rod that allowed the trailing edge to be placed in the expected position. Figure 16b shows the correspondence between the trailing edge movement directions and the control torque.     Figure 18 shows , the control torque produced by the trailing edge movement. As the roll command increases, the roll torque increases while the pitch and yaw torque changed little and showed no tendency. Roll and yaw followed the same pattern as pitch. The maximum and minimum roll torque were about 1.6 Nmm and −1.6 Nmm, respec-  Figure 18 shows M t , the control torque produced by the trailing edge movement. As the roll command increases, the roll torque increases while the pitch and yaw torque changed little and showed no tendency. Roll and yaw followed the same pattern as pitch. The maximum and minimum roll torque were about 1.6 Nmm and −1.6 Nmm, respectively. The maximum and minimum pitch torque were about 1.3 Nmm and −2 Nmm, respectively. The maximum and minimum yaw torque were about 0.6 Nmm and −0.6 Nmm, respectively. The result verifies the relationship between M t and trailing edge movement as represented in Equation (12). M t and input U were linearly related and the coupling between the individual control inputs was low.  Figure 18 shows , the control torque produced by the trailing edge movement. As the roll command increases, the roll torque increases while the pitch and yaw torque changed little and showed no tendency. Roll and yaw followed the same pattern as pitch. The maximum and minimum roll torque were about 1.6 Nmm and −1.6 Nmm, respectively. The maximum and minimum pitch torque were about 1.3 Nmm and −2 Nmm, respectively. The maximum and minimum yaw torque were about 0.6 Nmm and −0.6 Nmm, respectively. The result verifies the relationship between and trailing edge movement as represented in Equation (12). and input were linearly related and the coupling between the individual control inputs was low.   Figure 19 shows M, the measured total control torque at different servo angle input and M s , the calculated torque using the lift and rotation angle of the stroke plane. The angle value of the servo was converted from the input PWM signal and the angle values were set to zeros when the stroke plane was horizontal. M, as demonstrated in Figure 19a

Flight Test
To verify the feasibility of the control mechanism and algorithms, a flight test was carried out with the onboard power supply and controller. A motion capture system based on the Vicon high-speed cameras was set up to track the FMAV, which was similar to the motion capture system described in [35]. Eight cameras simultaneously captured images of the vehicle and calculated the position and attitude of the vehicle over a capture space of 3 m × 3 m × 2 m. The FMAV was initially cupped in the hands of the testers for take-off using a 250 mah high-voltage lithium battery (G8 1S 220 mAh, Hyperion). angle value of the servo was converted from the input PWM signal and the angle values were set to zeros when the stroke plane was horizontal. , as demonstrated in Figure  19a-c, had similar trends with , as demonstrated in Figure 19b-d. The absolute value of was greater than and the difference was in the same order of magnitude with . The result showed that Equation (13) was correct. Although there was some error at larger servo angles, could be decomposed into and . and were positively superimposed and the contribution of a to was dominant.

Flight Test
To verify the feasibility of the control mechanism and algorithms, a flight test was carried out with the onboard power supply and controller. A motion capture system based on the Vicon high-speed cameras was set up to track the FMAV, which was similar to the motion capture system described in [35]. Eight cameras simultaneously captured images of the vehicle and calculated the position and attitude of the vehicle over a capture space of 3 m×3 m×2 m. The FMAV was initially cupped in the hands of the testers for take-off using a 250 mah high-voltage lithium battery (G8 1S 220 mAh, Hyperion). Figure 20 shows the attitude angle when the prototype hovers in the air. Figure 21 shows three trajectories indicating the position and attitude. A flight video is available as Video S1.  Figure 20 shows the attitude angle when the prototype hovers in the air. Figure 21 shows three trajectories indicating the position and attitude. A flight video is available as Video S1.  The results showed that the prototype could maintain its attitude stability during flight with the cooperation of the controller and the control mechanism, had an oscillation of roll and pitch angle of no more than 10 • , the yaw angle remained stable, and turned back to zero in time. The results verified the effectiveness of the adopted parallel control mechanism and the corresponding control algorithm.  The results showed that the prototype could maintain its attitude stability during flight with the cooperation of the controller and the control mechanism, had an oscillation of roll and pitch angle of no more than 10°, the yaw angle remained stable, and turned back to zero in time. The results verified the effectiveness of the adopted parallel control mechanism and the corresponding control algorithm.

Conclusions
This paper designed an insect-like FMAV with a string-based flapping wing mechanism and a parallel control mechanism. Compared to previous research, a method to optimize the pulley profile was proposed for a string-based mechanism that helped reduce the string deformation and impact. A parallel mechanism that controlled the stroke plane was designed and the positive and negative kinematic solution of the mechanism was derived. A set of parameters was selected to provide the mechanism with a maximum

Conclusions
This paper designed an insect-like FMAV with a string-based flapping wing mechanism and a parallel control mechanism. Compared to previous research, a method to optimize the pulley profile was proposed for a string-based mechanism that helped reduce the string deformation and impact. A parallel mechanism that controlled the stroke plane was designed and the positive and negative kinematic solution of the mechanism was derived. A set of parameters was selected to provide the mechanism with a maximum simultaneous rotation angle of 20 • . A prototype that had a frequency of 25 Hz, a full wingspan of 21 cm, and a total weight of 28 g was developed. The attitude control of the FMAV using a PID controller and a decoupler was added to solve the input coupling of the parallel mechanism. The force and torque measurement showed (1) that the lift of the string-based flapping wing mechanism was linear to the input voltage and the maximum lift was 34 gf at 4 V, which ensures that the FMAV has sufficient drive; and (2) the total pitch and roll torque of this FMAV could be divided into the torque produced by trailing edge movement and the torque produced by stroke plane rotation. These torques were both linear to the rotation angle of the stroke plane and the maximum pitch and roll torque was about 4 Nmm, which ensures that the FMAV can quickly recover in the case of attitude disturbance. The flight test showed that our prototype could fly with an onboard power supply and controller. The attitude angle had little fluctuation during the flight, which demonstrated that our control mechanisms and control strategies were successful.

Conflicts of Interest:
The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.