Elektrotehniški vestnik 85(5): 241-247, 2018 Original scientific paper Attitude Detection for the Permanent-Magnet Spherical Motor Using two Optical Sensors Xiwen Guo 1'2'3, Jian Li 1,2, Qunjing Wang 1'2'3, Yan Wen 1,2 , Nengwei Gong 1,2 1 School of Electrical Engineering and Automation, Anhui University, Hefei, Anhui, China 2 National Engineering Laboratory of Energy-saving Motor & Control Technique, Anhui University, Hefei, Anhui, China 3 Engineering Research Center of Power Quality, Ministry of Education, Anhui University, Hefei, Anhui, China E-mail: xwguo2008@126.com Abstract. A rotor attitude-detection method for the permanent-magnet spherical motor (PMSM), using two optical sensors is proposed. A hemispherical shell is fixed on the PMSM rotor output shaft. The sensors are fixed on the stator shell, at a clearance of 90 degrees. When the spherical rotor moves, the sensors detect the displacement of the hemispherical shell surface. Using this information, the yaw and pitch angle of the hemispherical shell are obtained by calculating the displacement. Accordingly, the position coordinates of any point on the hemispherical shell can be determined. Since the rotor is concentric with the hemispherical shell, the coordinates of any point on the spherical rotor can be obtained. Keywords : Permanent-magnet spherical motor, optical sensor, attitude detection, yaw and pitch angle, hemispherical shell. Določanje položaja rotorja električnega motorja s trajnimi magneti z optičnima senzorjema V članku predstavljamo metodo za določanje položaja rotorja električnega motorja s trajnimi magneti z optičnima senzorjema. Na gred motorja je pričvrščeno ohišje v obliki poloble. Dva optična senzorja, med seboj oddaljena pod kotom 90°, se nahajata na gredi statorja. Premik rotorja je zaznan z optičnima senzorjema. Na podlagi te informacije lahko z izračunom določimo kot zasuka in naklona ohišja. Posledično lahko določimo koordinate poljubnega premika rotorja. 1. Introduction With the progress of science and technology, robots, manipulators and other precision devices for a multidimensional motion have been widely used in industrial control and other fields. Some special structural devices for complex motion require multiple motors to achieve multi-degree of freedom motion [2], which not only makes the whole system huge, but also makes the drive efficiency low, The accumulative error of the mechanical transmission system will lead to the accuracy decline of the whole control system [3].PMSM has a simple structure and small size, and can complete a multiple-degree of freedom motion independently. As soon as it was put forward, it received a high attention from academic circles worldwide. The rotor-position detection is one of the key methods to achieve a high-performance motion control of spherical motors. The spherical-motor position- detection methods can be roughly divided into four categories: 1) The measurement method of the encoder and sliding-rail module [4-6]. 2) Visual measurement method to identify spherical features [7-9]. 3) Hallelement measurement method based on the variation the rotor spherical magnetic field [10-11]. 4) Photoelectric encoded detection method [12-16]. This kind of the method involves to a non-contact measurement. It effectively avoids the impect of friction caused by a contact measurement on the rotor dynamic response .In this paper,a PMSM attitude-detection method using two optical sensors is proposed. 2 PMSM STRUCTURE 2.1 The basic PMSM structure Relecting to [17], a new PMSM is proposed. 40 PMs with a uniform and symmetrical polarity distribution are embedded in the rotor in four layers. The rotor is embedded in the stator shell. The spherical rotor is concentric with the stator shell. The magnetic gap is about 1mm. 24 symmetrical and evenly distributed coils are embedded in the stator shell in two layers. The rotor output shaft is fixed on the spherical rotor. The spherical motor structure is shown in Figure 1. Limited by the structure of the stator shell, the maximum inclination angle of the output shaft is 75 degrees. Received 15 August 2018 Accepted 25 September 2018 242 GUO, LI, WANG, WEN, GONG Figure 1.Structure PMSM 3 THE PRINCIPLE OF THE ROTOR ATTITUDE DETECTION 3.1 The attitude-detection scheme As shown in Figure 2, the hemispherical shell is fixed on the output shaft of the spherical rotor. The hemispherical shell is concentric with the spherical rotor. Two optical sensors are fixed on the stator shell. They are 90 degrees apart. The projection of the two optical sensors in the XOY plane falls on the X and Y axes, O is the spherical rotor center. The two optical sensors are named optical sensor 1 and optical sensor 2. There is a 45 degree angle between the XOY plane and the connection which is between the central point of the two optical sensors and the sphere center of the spherical rotor. The two optical sensors are fixed at the upper position, to ensure that the output shaft of the spherical rotor spins and inclines within the maximum inclination angle of 37.5 degrees, and avoids the existence of a non-detection zone. Figure 2.Structure of the detection scheme As shown in Figure 3, C is the hemispherical shell, U is the spherical rotor, P is the pending point on the hemispherical shell. S is the pending point on the spherical rotor. The initial static position of the spherical-rotor output shaft coincides with the Z axis of the geodetic coordinate system. When the spherical rotor is in a steady-state, the optical sensors 1 and 2 are placed in points 5X and S2, respectively. The yaw angle of point 5X is ZMOX and the pitch angle is ZS1 OP. The yaw angle of point S2 is ZQOX and the pitch angle is Z51OP. The initial values of the yaw and pitch angle for points 51 and S2 correspond to the position of the optical sensor when it is in its initial stationary state. 3.2 Coordinate calculation of the spherical-rotor points: (1) When the spherical rotor spins an angle from the initial position, the pitch angle of the spherical rotor is constant and the yaw angle varies with the motor rotation. The variation of the yaw angle for point S can be detected by optical sensor 1, thus, the position of the spherical rotor is determined. (2) When the spherical rotor inclines an angle from its initial position, optical sensor 1 is moving from point 51 to point A. The tracking of optical sensor 1 on the hemispherical shell is arc S1A. During this motion, the data detected by optical sensor 1 is the projection of dx1, dy1 on the hemispherical shell which is the arc length. Lx1, Ly1, dx1, dy1 are the tangents along the horizontal and vertical direction of point 51. The arc length component Lx1 takes T as a center of a circle and a section of a circular arc with a radius of ST. This component changes the yaw angle of the spherical rotor. Arc length component Ly1 takes O as a center of a circle and a section of the circular arc with radius R. This component changes the pitch angle of the spherical rotor. R is the radius of the spherical rotor. The variation of the yaw and pitch angle of the hemispherical shell is calculated by using Lx1 and Ly1. After the variation of the yaw and pitch angle of the hemispherical shell is determined, the coordinate calculation method for point P is as usual: when the spherical rotor rotates an angle in the initial position, all parts of the hemispherical shell will rotate the same angle around the axis of the rotation apart from the axis of rotation. The variation of the yaw and pitch angle of point P is the same as the point 51. The initial position of point P and its variation of the yaw and pitch angle are known. According to the relationship between their radius, position coordinates of point P can be obtained through position calculation, then the position coordinates of point S on the spherical rotor are obtained. (3) When the spherical rotor rotates around the 51O axis, optical sensor 1 cannot detect the displacement data of the hemispherical shell on the surface. The data detected by optical sensor 2 is a projection of dx2, dy2 on the hemispherical shell which are arc lengths L x2 Ly2. dx2, dy2 are the tangents along the horizontal and vertical directions of point S2. In this case, the displacement data detected by optical sensor 2 are used to calculate the yaw and pitch angle of the spherical rotor. The calculation method for the position coordinates of the P and S points is similar to the method described in 2.2.1 and 2.2.2. ATTITUDE DETECTION FOR THE PERMANENT-MAGNET SPHERICAL MOTOR USING TWO OPTICAL SENSORS 243 Figure 3. Diagram of the detection scheme 3.3 Algorithm realization of the rotor attitude detection for PMSM (1) As shown in Figure 3, when the spherical rotor spins an angle from the initial position, the arc length component of Lx1 is set to positive, the arc length to zero and the pitch angle of the rotor does not change. Point 51 can be characterized. The pitch and the yaw angle of point 51 are expressed as follows: Pitch angle: S1OP_S1= SxOP_0 Yaw angle: MOX_S1= MOX 0 - R/V2 (1) (2) Therefore, the coordinates of point S1 in the three-dimensional space are as follows: S _X = R * sin(S1OP_S1 ) * cos(MOX_S1 ) S _Y = R * sin(S1OP_S1 ) * sin(MOX_S1 ) S _Z = R * cos(S1OP_S1 ) (3) s1op_s1= MOX_S = Where: R n R/V2 (4) (5) © Taking 5X as the reference point, the displacement of the optical sensor detected in direction of dx1 and is positive. Otherwise it is negative. © The range of the pitch angle is 0. 90°, and that of the yaw angle is 0.360°. The rotor position in characterized by point S in the process of an inclining motion: The variation of the pitch angle of point S is: s1op p= iyi*^ 1 - R n The variation of the yaw angle of point S is: MOX P= - R/V2 n Where: (6) (7) © The pitch angle of point P: the angle between the Z axis and OP; the yaw angle: the angle between the positive direction of the X axis and the projection of OP on the XOY plane. © The variation range of the pitch and yaw angle for point P is the same as the 51. Therefore, after the rotation of the spherical rotor, the coordinates of point P in the three-dimensional space are calculated: © When the arc-length component of Lx1 and Ly1 is positive, projection of point P on the XOY plane is in the area which belongs to the negative part of the X-axis and positive part of the Y-axis. The pitch angle of point P is S1 OP_P. The yaw angle is 90° +MOX_P. The coordinates of point P in the three-dimensional space are as follows: (2) When the spherical rotor inclines an angle from the initial position, the calculation method of the yaw and pitch angle of point S on the spherical rotor is as follows: The initial pitch angle of point S1 is S1 OP_0 and the initial yaw angle is MOX_0 in the process of the rotor motion. The variation of the yaw and pitch angle of point S is: S _X= - R * sm(SßP P) * sin(MOXP) S _Y =R * sin(SjOP P) * cos(MOX P) S _Z=R *cos(S1OP_P) (8) © Pitch angle of point 51: the angle between the Z axis and the OS1 segment; yaw angle: MO is a projection of OS1 on the XOY plane, the yaw angle is between MO and positive direction of the X axis. © When the arc-length component of Lx1 and Ly1 is negative, the projection of point P on the XOY plane is in the area which belongs to the positive part of the X-axis and the negative part of the Y-axis. The pitch angle of point P is - S1 OP_P. The yaw angle is 270° + (-MOX_P). The coordinates of point P in the three-dimensional space are as follows: S _X =R * sin(S1OP_P) * sin(MOXP) S _Y =R * sin(S1OP_P) * cos(MOXP) (9) S _Z=R *cos(S1OP_P) @ When the arc length component of Lx1 is negative and of Ly1 is positive, the projection of point P on the XOY plane is in the area which belongs to the positive part of the X and Y-axis. The pitch angle of point P is S1 OP_P. The yaw angle is 90° - (-MOX_P). The Lx1 ^180 n L 180 xl n 244 GUO, LI, WANG, WEN, GONG coordinates of point P in the three-dimensional space are as follows: S _X= -R * sin(S1OP_P) * sin(MOX_P) Sl _Y =R * sin(SjOP P) * cos(MOX P) S _Z=R *cos(S1OP_P) in the Ly1, Lx2 direction. The calculation method of the rotor position is as follows: © When the arc length component of Ly1 is positive, (10) the rotor output shaft moves to the positive axis of Y. The variable quantity of the pitch angle is ^y1 * ^^. © When the arc length component of Lx1 is positive and of Ly1 is negative, the projection of point P on the XOY plane is in the area which belongs to the negative part of the X and Y-axis. The pitch angle of point P is -S1 OP_P. The yaw angle is 270° -MOX_P. The coordinates of point P in the three-dimensional space are as follows: S _X =R * sin(SjOP P) * sin(MOXP) Sl _Y =R * sin(SjOP P) * cos(MOX_P) S _Z=R *cos(S1OP_P) (11) (3) Special movement 1: when the rotor output shaft moves on the XOZ plane, the track of the detected optical sensor 1 is a circle using the Y-axis as the rotating shaft, R as the radius, and the arc length component of Ly1, Lx2 is zero. There is an arc-length component only in the Lx1 , Ly2 direction. The calculation method of the rotor position is as follows: © When the arc length component of Ly2 is positive, the rotor output shaft moves to the positive axis of X. The variable quantity of the pitch angle is ^y2 * ^^. Therefore, the coordinates of point P in the three-dimensional space are as follows: Lv2 .,.180° S, X = R *sin( R ) S _Y = 0 S1_Z = R*cosfe*—) R n (12) © When the arc length component of Ly2 is negative, the rotor output shaft moves to the negative axis of X. The variable quantity of the pitch angle is -Ly2 Therefore, the coordinates of point P in the three-dimensional space are as follows: Sl_X = -R*sm('-^-* — ) R n S _Y = 0 £ Z = R*C0S('-^-*—) R n (13) Therefore, the coordinates of point P in the three-dimensional space are as follows: S _X = o S _Y = R * sin(^ S _Z = R * cos(—— LlL> . 180° k R n LlL> . 180° k R n (14) © When the arc length component of Ly1 is negative, the rotor output shaft moves to the negative axis of Y. The variable quantity of the pitch angle is p . Therefore, the coordinates of point P in the three-dimensional space are as follows: S _X = o -L , S, Y = —R * sin(—— * R 180° (15) S Z = R * cos(— R An ...180° So, the position coordinates of point S on the spherical rotor are as follows: The radius of the hemispherical shell is R, the radius of the spherical rotor is r, and the set is r=t*R, where t is the proportional coefficient. The position coordinates of point S are as follows: S _X = t * P _X S _Y = t * P _Y S Z = t * P Z (16) (4) Special movement 2: when the rotor output shaft moves on the YOZ plane, the track of the detected optical sensor 2 is a circle using the X-axis as a rotating shaft, R as the radius, and the arc-length component of Lx1, Ly2 is zero. There is an arc-length component only 4 SIMULATION STUDY Using a physical model of the PMSM rotor in the ADAMS software, the coordinate system is established in the center of the spherical rotor which is called the geodetic coordinate system, By determining points 51 and S2, which are 90 degrees apart, the system establishes the coordinate system at points 51 and S2 which are termed the moving coordinate system. There is an angle of 45 degrees between the XOY plane and the connection between 51, S2 and the center of the spherical rotor. The projection of 51 and S2 falls on the X and Y axes, respectively. As shown in Figure 4, the arc lengths lx1 -. lx2 are a projection of x1 y2 on the spherical rotor, respectively. n n n ATTITUDE DETECTION FOR THE PERMANENT-MAGNET SPHERICAL MOTOR USING TWO OPTICAL SENSORS 245 It changes the yaw angle of the spherical rotor. The arc lengths ly1, ly2 are a projection of zx, z2 on the spherical rotor, respectively. It changes the pitch angle of the spherical rotor. The Cartesian coordinates of the S1, S2 points are S1 (0, 0. 0325>/2 , 0.0325>/2 ), S2 ( 0.0325n/2 ,0, 0.0325^ ). The spherical coordinates of points Si and S2 are Si (R > 0iO > ^10), S2(R, 620- ^20). The translational displacement of points S1, S2 in the geodetic coordinate system are obtained by using the ADAMS post-processing module. According to the translational displacement, the rectangular coordinates of points S1 and S2 are obtained after the motion of the spherical rotor. Then the spherical coordinates of points 51 and S2 are obtained after the motion of the spherical rotor , expressed as S1(R, 01, ^^ S2(R, 02, ). Therefore, the variation of the yaw angle of point 51 is 61 -610, the variation of the pitch angle of point 51 is -^10. Then the arc lengths lx1 and ly2 are obtained. The variation of the yaw angle of point S2 is 02-020, the variation of the pitch angle of point S2 is ^2-^20.Then the arc lengths lx2 and ly2 are obtained. According to the arc-length components lx1 , ly1 and lx2, ly2, the yaw and pitch angle of points 51 or S2 on the spherical rotor are calculated using methods described in 2.1, 2.2, and 2.3. then obtained position coordinates of point P. spherical rotor is obtained by processing the simulation data with Matlab, as shown in Figure 5. Figure 5.Trajectory of point 5X for the rotor spin motion 4.2 Axial incline motion When the spherical rotor inclines, point P is used to characterize the position of the spherical rotor. The trajectory of the incline for point P on the spherical rotor is obtained by processing the simulation data with Matlab, as shown in Figure 6. Figure 4. Physical model of the PMSM rotor Based on the above theoretical analysis and adding a torque to the spherical rotor model in ADAMS, the spherical rotor can spin and incline according to the added torque. The trajectory of point P on the spherical rotor is obtained by processing the simulated data. 4.1 Center-point spin motion When the spherical rotor spins, point P spins in the place of origin. So the motion state of the spherical rotor can't be characterized by point P. In this case, we can use point 5X to characterize the spin angle of the spherical rotor. The spin trajectory for point 5X on the Figure 6. Point P trajectory for the rotor incline motion 5 COMPARITIVE EXPERIMENT 5.1 Hardware setup for comparitive experiments The experimental setup consists of PMSM, hemispherical shell, control circuit, power supply, drive circuit, hardware detection circuit using two optical sensors, position detection device using one MEMS sensor MPU6050, ARM and PC, as shown in Figure 7. The optical sensor detects the displacement data of the hemispherical shell. ARM receives the optical sensor data and sends it to PC, to process them. 246 GUO, LI, WANG, WEN, GONG 5.3 Axial incline motion The comparitive experiment of the spherical rotor axial incline motion takes one second. The rotor inclines at 37.5 degrees. The data detected by using the optical and MEMS sensor is processed by PC. The trajectory curve of point P is then obtained, as shown in Figure 10. Figure 7. Comparitive experiment setup In the experiment, two methods are used to detect the rotor position in the same motion process, as shown in Figure 8. The detected data of the optical sensor is processed by PC. The trajectory curve of point P on the spherical rotor is obtained by comparing the motion trajectories of point P detected by the two methods and calculating their error. The reliability of the detection method described in this paper is verified. Due to limitations of the experimental conditions, the experiments can be performed only on center point spin and at axial incline motion. Figure 8. Flow chart of the comparitive experiment 5.2 Center-point spin motion In the comparitive experiment of the center-point spin motion, the experiment takes four seconds. The rotor spins at 360 degrees, and is affected by gravity and other factors. The movement of point P deviates from the Z axis about 10mm. The data detected by using the optical and MEMS sensor is processed by PC. The trajectory curve of point P is then obtained, as shown in Figure 9. Figure 10. Trajectory of point P for the rotor axial incline motion 5.4 Error comparison From the trajectory of rotor point P calculated by the detection method using the MEMS sensor and the trajectory of the rotor point P calculated by the proposed detection method ,the error curves are obtained for the directions of the X,Y and Z axes for the center-point spin motion and axial-inclin motion experiment, as shown in Figure 11 (a) Error curve of the rotor center-point spin motion Figure 9. Trajectory of point P for the rotor spin motion and center-point spin motion ATTITUDE DETECTION FOR THE PERMANENT-MAGNET SPHERICAL MOTOR USING TWO OPTICAL SENSORS 247 (b) Error curve of the rotor axial incline motion Figure 11. Error curve of the comparative experiment 6 Conclusion A PMSM rotor attitude detection method is proposed. A hemispherical shell is fixed on the rotor output shaft. An optical sensor detects a displacement change in the hemispherical shell. The attitude information of the spherical rotor is obtained by calculating its yaw and pitch angle. The simulation results show that the feasibility of the rotor attitude can be calculated by crawing the change in surface displacement. The experimental results verify the simulation results. A comparitive experiment shows the effectiveness and feasibility of the proposed method. The detection error is relatively small, providing a valuable reference for the research and application of the spherical motor position-detection method. Acknowledgement This work is supported in part by the National Natural Science Foundation of China (No. 51637001, No. 51307001), the Natural Science Research Key Program of Anhui Provincial Education Ministry (KJ2017A001), the Young Core Teacher Program of Anhui University (J01005126), and the Academic and Technology Leaders Introduction Project of Anhui University (02303203(32030049)) References [1] Wang Q, Qian Z, Li Z, et al. "Method of measuring the rotor position of permanent magnetic spherical stepper motor based on machine vision" [J]. China Journal of electrical engineering, 28 (36), 2008. [2] Wang Y. "Research on position detection for rotor of permanent magnetic spherical motor based on optical sensors" [D]. Anhui University, 2015. [3] Zhang X. "Design and research of rotor detection system for magnetic suspension spherical active joint" [D]. Yangzhou University, 2016. [4] Foong S, Lee K M, Bai K. "Magnetic field-based sensing method for spherical joint" [C].IEEE International Conference on Robotics and Automation Anchorage Convention District, Alaska, USA, 58(1) , pp.5447-5452, 2010. [5] Kahlen K, Voss I, Priebe C, et al. "Torque control of a spherical machine with variable pole pitch" [J].IEEE Transactions on Power Electronics, 19(6), pp.1628-1634, 2004. [6] Cho C-H, Kang D-W, Kim S-Y, et al. "Using mathematical method of torque simulation for reducing calculation time of permanent magnet spherical wheel motor" [C].Proceedings of the International Conference on Electrical Machines and Systems, Wuhan ,pp.3112-3115, 2008. [7] Garner H, Klementt M, Lee K M. "Design and analysis of an absolute non-contact orientation sensor for wrist motion control" [C]. Proceeding of IEEE/ASME international Conference on Advanced Intelligent Mechatronics, Como, ltaly, pp.69-74, 2001. [8] Qian Z, Wang Q, Ju L, et al. "Studies on vision based absolute orientation detection method of spherical motor" [C]. Proceedings of the International Conference on Electrical Machines and Systems, Tokyo, pp.1-6, 2009. [9] Maeda S, Hirata K, Shohei I, et al. "Feedback control of electromagnetic spherical actuator with three-degree-of-freedom" [C] International Conference on Electrical Machines, Rome, pp.1-6, 2010. [10] Wang W, Wang J, Jewell G W, et al. "Design and control of a novel spherical permanent magnet actuator with three degree of freedom" [J]. IEEE/ASME Transactions on Magnetics, 8(4), pp.457-468, 2003. [11] Son H, Lee K M. "Two-DOF magnetic orientation sensor using distributed multipole models for spherical wheel motor" [J]. Mechatronics, 21(1), pp.156-165, 2011. [12] Lee K M, Zhou D. "A real-time optical sensor for simultaneous measurement of 3-DOF motion" [J]. IEEE Transactions on Mechatronics, 9(3), pp.499-506, 2004. [13] Kumagai M, Hollis R L. "Development and control of a three dof spherical induction motor" [C]. IEEE International Conference on Robotics and Automation, Karlsruhe, Germany, pp.1520- 1525, 2013. [14] Xin J, Xia C, Li H, et al. "A novel orientation measurement using optical sensor for spherical motor" [J]. Science China (Technological Sciences), 56(6), pp.1330-1339, 2013. [15] Bhatia, Ankit, Kumagai, Masaaki, Hollis, Ralph. "Six-stator spherical induction motor for balancing mobile robots" [C]. IEEE International Conference on Robotics and Automation (ICRA). Seattle, WA.pp.226-231, 2015. [16] Seyfarth, Greg; Bhatia, Ankit; Sassnick, Olaf. "Initial results for a ballbot driven with a spherical induction motor" [C]. IEEE International Conference on Robotics and Automation (ICRA). Royal Inst Technol, Ctr Autonomous Syst, Stockholm, SWEDEN, pp.3771-3776, 2016. [17] Qian Z, Wang Q, Ju L, et al. "Torque modeling and control algorithm of a permanent magnetic spherical motor" [C]. Proceedings of the 12th International Conference on Electrical Machines and Systems. Tokyo, Japan: IEEJ Industry Applications Society, pp. 944-949, 2009. Xiwen GUO graduated from the Anhui University of Science & Technology, College of Electrical and Information Engineering in Huainan, China, in 2005. He received his PhD degree in electrical engineering from the Hefei University of Technology, China, in 2012. Currently, he is an Associate Professor at the Anhui University. His research interest is in special motors and their control, power electronics and electric drives, intelligent control, and motor-pump modelling. Jian LI He is currently working towards his M.Sc degree at the School of Electrical Engineering and Automation at the Anhui University. His research interest is in PMSM position-detection.