2003 Automatic Control Conference 2023 Design and Implementation of a Computerized Flat Knitting Machine 王明賢 1 ,梁耀星 2 ,廖鴻文 3 ,陳旺承 3 ,葉育杰 2 Ming-Shyan Wang 1 , Yao-Hsing Liang 2 , Houang-Wen Laio 3 , Wang-Cheng Chen 3 , and Yeh-Yu Chieh 2 2 南台科技大學電機工程系 南台科技大學電子工程研究所 Department of Electrical Engineering Research Institute of Electronic Engineering Southern Taiwan University of Technology 1, Nan-Tai St. Yung Kang City, Tainan Hsien, Taiwan, 710 Tel: (06) 2533131 ext. 3342 E-mail: mswang@mail.stut.edu.tw 3 Eternity Electronics Industry Co., Ltd. TEL: (06)2797611 1 Abstract In the paper, the control system of a computerized flat knitting machine is designed and implemented. A permanent magnet synchronous motor is used to operate the machine. We design the motor drive that discrete power MOSFETs are adapted in the inverter to reduce the cost. In order to get zero steady-state error, the PI control is considered in the velocity control loop. Microcontroller, 8052, programs the drives of seven step motors to manipulate the controls of cam, left stitch, and right stitch of front-end and back-end, and racking. The color and style of the accessories of clothing is programmed by using the keyboard, PC, or the external memory card. There are three communication protocols, RS232, RS422, and RS485, used in the system to transfer the instructions and data. Keywords: Computerized flat knitting machine; permanent magnet synchronous motor; PI control; communication protocol. National Science Council to look for professors that are expert in programmable control of a flat knitting machine. It lets us see that this mechatronic system will be more interesting in the market. “Design and implementation of a computerized flat knitting machine” is the second project that we co-operate with Eternity Electronics Industry Co., Ltd. “Original design manufacture an AC servo motor drive” was the first project [2]. The technique and experience in the design of AC servo motor drives is transferred to the design in the computerized flat knitting machine such that the cost of the computerized control system has been reduced to be half of that made in Japan. The paper divides into four branches with further discussion as follows: Section 1, the introduction; section 2, the architecture of a computerized flat knitting machine; section 3, the driving and control of step motors and AC servo motors, and; section 4, conclusions. 2. System architecture 摘要 本文介紹電腦化自動橫編織機電控系統之設 計與製作,系統內我們使用一永磁同步馬達帶動機 頭之移動,馬達驅動器自行設計,並以獨立功率 MOSFET 元件設計換流器以降低成本,並採 PI 控 制速度以達零穩態誤差。使用 8052 規劃七個步進 馬達之驅動,完成前床及後床之三角、左度目及右 度目,與搖床之控制。規劃布片及領子等之花色及 式樣的程式可由鍵盤輸入,PC 下載,或記憶卡讀 取。系統內之通訊協定有 RS232,RS422 及 RS485 等作為指令與資料之傳輸。 關鍵詞: 電腦化自動橫編織機,永磁同步馬達, PI 控制,通訊協定。 1. Introduction A mechatronic system designer must assemble digital and analog circuits, microprocessors and computers, mechanical devices, sensors and actuators, and controls so that the final design achieves a desired goal [1]. In September 2002, there was an email from The block diagram of the control system of a micro-computerized flat knitting machine is shown in Figure 1. Each block is described as follows: 2.1 Human-machine interface, PC, LCD, keyboard, and memory card : The generation of the accessories with the desired color and style of clothing is programmed such that the operation of a flat knitting machine proceeds in order. There are three ways for human-machine interface to obtain the program, using a keyboard to keyin the program, downloading it from a PC via RS232C communication, or reading it from an external memory card. Similarly, after a program has been modified in the human-machine interface, we are able to upload it to PC or store it to the external memory card. The 128x64 LCD is used to display the keyined program or machine parameters and monitor the operation of the flat knitting machine. The human-machine interface transfers the instructions and data to the main drive block via a RS422 transceiver. Figure 2 depicts the more detailed block 2024 diagram of the human-machine interface. The CPU-1 is microcontroller 8052. 2.2 Main drive, AC servo motor, torque motor, magnetic valve and its drive circuit, and I/O unit: The main drive includes CPU-2, RS422 transceiver, RS485 transceiver, torque motor control, I/O control, and AC servo motor drive, shown in Figure 3. The main drive receives the program from human-machine interface via RS422 and transmits commands to three step motor drives by using RS485 protocol. AC servo motor drive controls the servo motor and transmission belt to run the machine at programmed speed during machine operation. The specification of the AC servo motor 6CC401 that is a permanent magnet synchronous motor (PMSM) is listed in Table 1. The block diagram shown in Figure 4 is a well-known architecture, consisting of position, velocity, and current control loops, of an AC servo drive [3-7]. The feedback currents are sensed by the current transducers (CTs), and the optical encoder provides the information of velocity and position. There are one Z pulse and 2000 phase A and B respective pulses per revolution for this encoder. Of course, these pulses are output via line transmitters 26LS31 in differential form. The CPU-2 used in the drive is M16C that is a 16-bit microcontroller [2]. The family of M16C provides different size but sufficient ROM for program instructions, multifunctional 16-bit timers to generate three-phase PWM signals and a periodic interrupt, 25 internal and 8 external interrupt sources, serial I/O for RS232C and RS485, 8 10-bit ADC channels, 2 8-bit DAC channels, one watchdog timer, and some programmable I/Os, etc. The shortest instruction execution time is only 50 ns at 20MHz clock source. Generally, it takes 2 or 3 clock cycles to complete one instruction since it is not a DSP. The interface between CPU and encoder has been designed in a CPLD. In order to reduce the cost, discrete power MOSFETs are adapted to be switches of the inverter, instead of intelligent power module (IPM) that provides protections from over-current, overheat, load short-circuit, and under-voltage. There are four yarn feeders with different color driven by magnetic valves. And, the take-down roller is driven by the torque motor to work at programmed level. I/O unit composes of circuits to detect the abnormal conditions and emergency, such as yarn breakage, fabric drop, over-wrap, over-torque, press-off, needle shocking, and others. 2.3 Step motors and their drives: There are seven step motors and drives for front-end cam, left stitch, and right stitch, back-end cam, left stitch, and right stitch, and racking controls. Figure 5 shows the block diagram of front-end (or 2003 Automatic Control Conference back-end) step motor drive. The racking one is similar to, but simpler than that. CPU-3, 8052, controls three step motors and accepts the commands from main drive via RS485. The programmed color and style of the accessories of clothing is executed by the seven step motors. There is one more block not shown in Figure 1, power modular, to be considered in the system. The AC 110V is connected to R and S pins in the main drive, and rectified by full-bridge diodes to generate 310 V DC as DC link of the inverter. There are other power supplies in the system, such as 5V for digital circuits, 15V for operational amplifier circuit, step motor drive, and photo-couplers, 24V for I/O detection circuits and solenoids. 3. Driving and control 3.1 Step motor: There are three modes of excitation in use for step motors, single-phase excitation, two-phase excitation, and half-step operation [8]. In Figure 5, the step motor drive comprises two step motor drive ICs, NJM3370A, that provide the selection of half-step and full-step operation, selection of 0%, 20%, 60%, and 100% of rated current output, LS-TTL input stage, high power H-bridge output stage, and wide voltage range 10-45V. Figure 6 depicts the timing of the operation of 3370A. 3.2 AC servo motor: It is well-known that the dq-transformation is often used in the drive design for a PMSM [3-7]. That is, the abc-model, 0 0 ia ea va R pL v 0 R pL 0 ib eb b vc 0 0 R pL ic ec (1) where L is the phase inductance, R is stator resistance, v j , i j , and e j , j a, b, c , represent the phase j voltage, current, and back emf, respectively, and becomes dq-model after p d dt , transformation as vd R pL re L id 0 v q re L R pL iq eq (2) where v e , i e , and e e , e d , q , represent the direct and quadrature voltage, current, and back emf, respectively, and re is the electric velocity. If the model (2) is used, we know that the control of (2) is easier than that of (1). The output torque of the motor 2003 Automatic Control Conference 2025 i g 2 A (generator output current), is only controlled by i q . And, the motor has higher TLMT TR , id 0 , and works magnetic field weakening for negative i d . However, it’s and k p 0.1875 and k p 0.4375, efficiency on power for necessary to compute the dq-transformation and inverse dq-transformation in the control loop. Although the calculations of them can be replaced with a lookup table, it would need a while time for a general non-DSP type micro-controller, for example, 16-bit M16C/62 group. And, because of the trapezoidal back emf and the consequent non-sinusoidal variation of the motor inductances with rotor angle for the blushless DC motor (BLDCM), the dq-model is not necessarily the best approach for modeling and simulation [4]. The single phase model (1) offers many advantages. Moreover, there are several similarities in the overall drive scheme of the PMSM and the BLDCM. The configuration of the power stage, inverter, is same for both motors. The main difference is on current control that sinusoidal stator current are designed to output a steady torque in the PMSM, whereas rectangular current is generated to give a steady torque in the BLDCM. So, for the uniform design algorithm of drives of PMSM and BLDCM, the single phase model (1) is adopted even the necessary compensation for e j in the control loop. When the current control loop is simplified by 1 (1 Tc s) and 1 Tc is its bandwidth, the speed control block diagram will become as shown in Figure 7. The PI control is applied to the speed control loop of the drive to get zero steady-state error, k (3) Gs ( s) k p I s 2J M kp (4) 5 K T Tc kI 2J M k p 25 K T Tc (5) And, the proportional gain constant k p and integral gain constant k I are determined on Bode plot, shown in Figure 8, and adjusted according to the load. Figure 9 manifests the 3000 rpm step responses for k p 0.1875 and torque limit TLMT TR and shows the corresponding waveforms of current command and i a . Figure 10 discloses the results for k p 0.4375 and TLMT TR . It is easily seen that the higher k p the system supplies, the faster response and less overshooting it possesses. And, with the rated torque constraint, the current command and phase current i a are clamped to the rated current of the motor. Replacing the dummy load with some other PMSM, the solutions come in Figure 11 that it was tested by respectively. The 3000 rpm of the speed has abruptly dropped as soon as the load is applied. But, it recovers itself immediately. 4. Conclusions The mechatronic control of a computerized flat knitting machine is considered in the paper. The cost and performance of a mechatronic system play the main role on automation market. The drive of a PMSM is designed by us, instead of buying a universal one which is more expensive. And, the excellent speed response and load recovery of the servo system have been shown. We hope that the completion of this project is a milestone on research of mechanic control systems. References: [1] M. B. Histand and D. G. Alciatore, Introduction to Mechatronics and Measurement systems, McGraw-Hill, New York, 1999. [2] 王明賢, “全數位 AC 伺服馬達驅動器研製”,第 一屆全國技專校院工程技術類產學合作暨技術 移轉成果發表會,電機 10-1,2001. [3] P.Pillay and R.Krishnan , “ Modeling, Simulation,, and analysis of Permanent-Magnet Motor Drives, Part I : The Permanent-Magnet Synchronous Motor Drive “ , IEEE Trans. on Ind. Appl., vol. 25, No. 2, pp.265-273, 1989. [4] P.Pillay and R.Krishnan, “ Modeling, Simulation, and analysis of Permanent-Magnet Motor Drives, Part II: The Permanent-Magnet Synchronous Motor Drive “, IEEE Trans. on Ind. Appl. , vol. 25 , No. 2 , pp.274-279 , 1989. [5] J.P.Karunadasa and A.C. Renfrew, “ Design and implementation of microprocessor based on sliding mode controller for brushless servomotor “, IEE Proc-B, vol. 138, No. 6, pp.345-363, 1991. [6] J.-L. Hsien , Y.-Y. Sun, and M.-C. Tsai, “ H∞ control for a sensorless permanent-magnet synchronous drive “ , IEE Proc-Electr. Power Appl., vol. 144 , No. 3 , pp.173-181 , 1997. [7] 劉昌煥主編,電機機械, 東華書局, 1999. [8] Takashi Kenjo, Steeping Motors and Their Microprocessor Controls, Oxford University Press, New York, 1999. Acknowledgments The authors would like to express their appreciation to NSC for supporting under contact NSC 91-2213-E-218-023. 2026 2003 Automatic Control Conference Magnetic Valve RS232 PC Front-end Step Motor Drive Magnetic Valve Drive Human Machine Interface LCD Keyboard RS422 Main Drive AC Servo Motor Memory Card Cam Step Motor RS485 Torque Motor Left Stitch Step Motor Right Stitch Step Motor Cam Step Motor Back-end Step Motor Drive Left Stitch Step Motor Right Stitch Step Motor Racking Step Motor Racking Step Motor Drive I/O Unit Figure 1 The block diagram of the control system of a computerized flat knitting machine. RS232 Transceiver RS422 Transceiver RS422 Transceiver I/O Unit External EEPROM Torque Motor Control CPU-1 LCD R S KEY Power Module AC Servo Drive RAM E Figure 2 The block diagram of interface. Position command + human-machine Velocity command - Torque Motor BUS CPU-1 EEPROM RS485 Transceiver Position gain + - M Figure 3 The block diagram of main drive. Current command Velocity gain + - Current gain PWM inverter M E Current loop Velocity loop Position loop Figure 4 Block diagram of a drive Velocity sensor + Position sensor + 2003 Automatic Control Conference 2027 RS485 Transceiver Step Motor Drive 1 Step Motor Drive 2 CPU-3 Step Motor Drive 3 Power Module Figure 5 The block diagram of front-end step motor drive. Figure 6 The timing of the operation of 3370A. TL r* + r Gs (s) 1 1 Tc s KT Te + 40 dB / dec 1 JM s K sp r 20 dB / dec 0 dB pi K si s G c ( s ) c sc 20 dB / dec KT JM s 1 Tcs 1 40 dB / dec Figure 7 Speed control block diagram. Figure 8 The Bode plot for PI control. 2028 2003 Automatic Control Conference (a) Speed command and response. (a) kp=0.1825, (b) ia and current command. Figure 9 The 3000rpm step responses for kp=0.1875 and TLMT=TR. (b) kp=0.4375, Figure 11 The speed loop load shock recovery tests: speed response and load shock for ig=2A and TLMT=TR . Table 1 Parameters of PMSM 6CC401. (a) Speed command and response. (b) ia and current command. Figure 10 The 3000rpm step responses for kp=0.4375 and TLMT=TR. Output power Torque Stator current Speed Torque constant Back emf constant Inertia Stator resistance Stator inductance PR TR IR NR KT 400W 1.274 N.m 3.5A 3000 rpm 0.409 Nm/A KE 42.8 V/Krpm JM R 0.29 Kg.cm2 0.937 L 2.11 mH