Design and Implementation of Coprocessor for Digital Motor Control
NSC 88-2213-E-110-018 87/08/01 - 88/07/31 !"#$%&'()*+,-+ ./0123451467894:;< +4=>?@ABCDEFGHI JK&L*!"M#NOPQRSNTUV M#NW3*JK+,XYTZ3[ !"-\O#$C]PQRSN^./H I[_0123N`HIabcde <(transcendental functions) +Oc& L = > ? f @ + N CORDIC (Coordinate Rotation Digital Computer)-+ ghC
i+j+,4CORDIC4dkl mno4 !"#$
C
The most utilized arithmetic operations used in digital motor control include multiplication-accumulation (MAC), square-root, division, trigonometric functions
(sine, cosine, tangent), coordinate transform, exponential/logarithmic operations… etc. a special-purposed coprocessor for the micro-controller dedicated to motor control applications is designed in order to execute efficiently the newly added arithmetic instructions. The major components in this co-processor is a CORDIC (COordinate Rotation Digital Computer) processing unit. Keywords: computer arithmetic, CORDIC, VLSI, digital motor control.
p!" #$qrOMRSjst uvHwT./HIMRSgh4HI PQRSN4xygh4zgh4 {|}~{gh4gh4#$ g h Z ` H I PWM (Pulse-Width Modulation)ghC MRSgh4 PQRSgh PWM gh]#$ qrO^hCDO>G vHwO+,PQRSNC bus extension bus control bus address bus data
(ROM & RAM) memory unit modulator PWM controller interrupt Timers analog I/O digital I/O communication coprocessor Math. MPU vHi!" #$qrOMRSjstC dklmno,*Tb c !"-\#$qrM#N4 R S N % &lmno (ASIC)C ¡¢*M#N (u Intel* MCS q£4Motorola * 68HC q¤) R S N ¥ u ¦ § ¨ N * TMS320q¤©T^Hp&L* ICT ª«*%&¬®¯T°±./#$
RS¢²O%&Tu³´µ&!" -\#$]¶JK%&·¸T_¹ º»¼O½'T¾¿1"ÀÁ*»³C Â]DEFGHIJK&L*!" M#NOPQRSNT¢»!"#$( )O+,-+XYTZ3[!"-\O#$C !"#$%&'()*+,-+ . / 0 1 4 3 à 1 4 0 1 2 3 (multiplication-accumulation or MAC)4514 67894:;<+4X{Ä+4 =>?@ABCDÅÆ& CORDIC Ç+ 1 [1][2]TÈÉÊË31NÌ NB Íg*ÎmTÏaÄÐÑÒ*f@T +bcÓÔ*-+TÕu:;{Ö :;<+4Ä{X4678945 1401×BTÂ]bc^ØÙ_*JK &L VLSI noqr'T=>? f@ +N (CORDIC)RSNÚÛÜÝÀÞßTà áâD+,RSghOHC¡È*^& L RS%& [3]T]ã CORDIC äå%&jNO#$'[4]C =>? f@+N£&Hæç йèé*g Òf@êàëc¶| *<CÈ*Ç+1a&ì¤*íî½ wï½w: − = = + = = − + = = − ∈ + = − = + = − − − + + + 1 , tanh 0 , 1 , tan , mode hyperbolic , 1 mode linear 0, mode circular , 1 , 2 }, 1 , 1 { , 1 1 ) ( 1 1 1 m t m t m t m t z z x t y y y t m x x i i i i i f i i i i i i i i i i i i i i i i θ σ θ σ σ σ (1) 'ï*îðX> i ñ 1 H´À b , ò hóô¹ b I hCõ m +1, -1 0 OH , öß]+NR*÷ïT øù÷ï4de÷ïú÷ïCûσi +1 –1, üýïûþCòR;¹-+ ýïT y hòR Òf@ýïT ^Å z h Cûf@*g õT 2 f(i) i t = − T] ̤f(i)HæçíW* Cò ú÷ïøù÷ïT] f(i) = i−1Cò de÷ïTÏÊ^HÞÓaÇ+ 1C(1)TIîðÊ^*-+ ÎmÏÉggÊ^3Ã1N`Ì NÍ g*ÎmC HI=>? f@+N*-+ T*ÐÑÒv [x y ]T 1 1 1= Hæç * g f @ H I Ò T b b b x y v+1=[ +1 +1] TG b f@C] Ò Ò ¢ H I ² T á
∏
= + b i i mt 1 2 1 C^!f@*Ò"¹ Ò"¹H#TÏÊ^0'HÂT u³ b $ m %Ú&þT' Km’ %ÏÚ&þáHI(T¾(ZÅO)*àá IT+ n/4 ITÌ 3Ã*-+C,] -ã*îðá./"¹îðC 0001r31N¢ 23*»%T !ò-+óô¹ÙT4à*Iîð *-+é5!6"CÅ1r*31N7A à8Âó9¹Ùû¢:c 23*;< 31N=>?@@A0B?CD0?EED@FG* *H81TIf@*=>? f@+ NTf@õ i i t = 2 CûZIf@*81− á*[_=>? f@+N*;¹-+ýï`Òf@ýïZ½wà0JKLi0
b i b w w x y y y m x x b i w w x y m y y y m x m x x y w b i b z z x w w x x b i z z x w m w w w m x m x x y w i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i ≤ ≤ + + = − = + = ≤ ≤ + = − − = + − = = • ≤ ≤ + + = − = = ≤ ≤ + = − − = + − = = • + + − + + − + + + − − + + − − + − + + + + − + + − − + − 1 2 , 2 2 2 2 , 2 1 , 2 2 2 2 2 2 ) 2 ( CORDIC unified redundant in rotation Vector , 1 2 , ] [ 2 , 2 1 , ] 2 [ 2 2 2 ) 2 ( CORDIC unified redundant in n calculatio Angle 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1 2 1 2 2 2 1 1 θ α α α θ α α β α β θ α α θ α α β α β (2) Ì ¤ : ¶ ÷ ï M H # } , , 2 , 1 , ) ( {f i =i i= L b C*de÷ï* =>? f@+NTÈ*Ì ¤Ê , 1 3 , , 13 , 4 L i+ ÞÓHTZôÇ+1* C NTOÀ[_Ç+1ò ¾8Ê^#*ÞÓC f@P*QR üS½HC AC VR Estimate i α βi αi βi 0 ˆ >i w 1 1 -1 1 0 ˆ =i w 0 -1 0 -1 0 ˆ <i w -1 1 1 1 ½ Hif@PQR αi]+Ng f@*8Tû 1 = i β βi =−1 X^QRTUÒf@ Ò " ¹ O . / C . / " ¹ Â
∏
= + − = b i i m m K 1 1 2 2 1 VW(Còi ≥ b/ +2 1 Tíîï b I hó9¹X*Y 2 * hZå[ûÍ\CDÅ£&−b ]*Í\ïÅDÊ-ã^*./" ¹îð_`TÅ<ì./"¹îð Ê^*é =>? f@+N^¢a¶s tiHábcï*(folded)THádï* (pipelined)Cbcï*=>? f@+N Ê^¢eïÌ N(barrel shifter)`31NT &ZêàIîðMÊ^^*Ì f3*-+CvÐbcïst*ÍvC vÐibcï=>? f@+Ngh dï*=>? f@+NTÚ ÅIîði6TZÌ NZ<ìT& Îmj´µêàC 31NId klVÊ^CDÆ&bcïstTZ ÃmÎmnlC op)q8nT£&Îm÷rï! À*s³Tøù÷ï`de÷ïT * hó9¹a8QTZ÷r) àat)C Tu vwA0xy` z xy )6TvwA xy+*Y{ x á |}Tû z xyZ`&x~âDf@; *xym*Y{ xá |zC *îðxá D@? BTH÷ r!À* hóô¹Cv:vop) qOs³Tøù÷ïìT^!ÀÐ ½ wTY{ì óôÊ^ vwA xy*ó ô¹ÀY{ì Tû z xy`x ymÊ^ÀY{ì T(Ê^^ îðC de÷ïìT0vwA xy Ê^Y{ì Tz xy`xym Ê^ÀY{ì T^ îðC0 0 v:iøù÷ïìò |zTD@? T|} ó9¹*² 0 vide÷ïìò |zTD@? T|} ó9¹*² 0 0 0 ì½ÐDGO _k R SNOaT51r*3Ã05-+O ãT]PQRSNä:;<+4 X{Ä+469BT!"#$() O-+°±.]RSNOa½ TZ *hêà *GC½:* ¡Z ¢D¢££0`0¤}D@¢££0÷r*s³C ¥t*x hó9¹ÀY{ì Tûãt*~ hó9¹Z"ÀY {ì C-º*ùé K BC t¦+2.7×2.7mm2 TÙ-º§¼ ¨©zC0 0 ~ ~ x1 y1 z1 xb+1 yb+1 zb+1 -+s³ x y ª « ª ª 2 2 y x + (cir. norm) x y 0 ª ª « tan−1(y/x) x y z « ª ª xcos −z ysinz 1 0 z « ª ª cos z x y z ª « ª ycos +z xsinz 1 0 z ª « ª sin z x y z ª ª « z+ y/x (div. accu.) x y 0 ª ª « y / x x y z ª « ª y+x×z (mul. accu.) x 0 z ª « ª x × z x y ª « ª ª 2 2 y x − (hyp. norm) x y 0 ª ª « tanh−1(y/x) x y z « ª ª xcosh +z ysinhz 1 0 z « ª ª cosh z x y z ª « ª ycosh +z xsinhz 1 0 z ª « ª sinh z 1 1 z « ª ª exp z w+ 1 w-1 0 ª ª « (ln w)/2 w+ 1 w-1 ª « ª ª 2 w 1 0 z R1 R2 ª ª R1 R2 0 ª ª « tan z 1 0 z R3 R4 ª ª R3 R4 0 ª ª « tanh z ½Ði _k CORDIC +,RSNOa 0
function coprocessor Ext. accuracy 16 bits
Int. accuracy 22 bits time per iteration 15 ns
Total Gate count 12,491 Core area 2.7×2.7mm2 ½:iOnl_¹C
ɀƋ
[1] J. E. Volder, “The CORDIC Trigonometric Computing Technique”, IRE Trans. Electronics Computers, Vol. EC-8, No. 3, pp. 330-334, Sept. 1959
[2] J. S. Walther, “ A Unified Algorithm for Elementary Functions”, AFIPS Conf. Proc., Vol.38, pp. 389-385, 1971.
[3] Y. H. Hu, “CORDIC-Based VLSI Architecture for Digital Signal Processing”, IEEE Signal Processing Mag., Vol. 9, No. 3, pp. 17-35, July 1992.
[4] Lee C.S.G. and Chang P.R., “A Maximum Pipelined CORDIC Architecture for Inverse Kinematic Position Computation”, IEEE Journal of Robotics and Automation, vol. 3, pp. 445-458, Oct. 1987.
[5] S.-F. Hsiao and J.-Y. Chen, “Design, Implementation and Analysis of a New Redundant CORDIC Processor with Constant Scaling Factor and Regular Structure”, Journal of VLSI Signal Processing, Vol. 20, pp. 267-278, Dec. 1998.