%!PS % CONVERTING MAGIC SINEWAVE SEQUENCES TO THREE PHASE PORT VALUES % ============================================================== % THIS VERSION CALCULATES STEPLOCK 44Q DELTA FRIENDLY 533 % Copyright c 2001 by Don Lancaster & Synergetics, Box 809, Thatcher, AZ, 85552 % (928) 428-4073 Email: don@tinaja.com Website: http://www.tinaja.com % Consulting services available http://www.tinaja.com/info01.html % All commercial rights and all electronic media rights ~fully~ reserved. % Linking usually welcome. Reposting expressly forbidden. Version 1.5 % Relating a single phase sequence to actual delta friendly three phase sequences % is a nonobvious process. This utility and tutorial gives you needed guidelines. % Example results for a Steplock Delta-28 appear below. % To use, modify the code for the number of pulses per quadrant. Copy typical values % (must not round significantly). Send to Distiller. View PDF file. Read log file. % IMPORTANT NOTE: Don Lancaster's file gonzo.ps is required for this program. % After obvious location mods, uncomment ONE of the following two lines: (C:\\windows\\desktop\\gonzo\\gonzo.ps) run % use internal gonzo % (A:\\gonzo.ps) run % use external gonzo % NOTE THAT ALL PS FILENAME STRINGS !!!DEMAND!!! DOUBLE REVERSE SLASHES. % GONZO20A Guru Gonzo PostScript power tools (Interim release) % Includes gonzo justification and layout utilities. % Copyright c 1990,1996,2001 by Don Lancaster and Synergetics, Box 809, % Thatcher Arizona, 5552 (928) 428-4073 don@tinaja.com support % via http://www.tinaja.com All commercial rights and all electronic % media rights **FULLY** reserved. Reposting is expressly forbidden. /guru { gonzo begin ps.util.1 begin printerror nuisance begin} def % guru % activate gonzo utilities 50 50 10 setgrid % create grid 36 21 showgrid % show grid under waveforms % /firstquad returns a 1 or a 0 for an angle input, showing whether the waveform % was high or low. /firstquad { % data specific to steplock 533 ang1 0 ge ang1 p1s lt and {0} if % before first pulse ang1 p1s ge ang1 p1e lt and {1} if % during first pulse, etc... ang1 p1e ge ang1 p2s lt and {0} if ang1 p2s ge ang1 p2e lt and {1} if ang1 p2e ge ang1 p3s lt and {0} if ang1 p3s ge ang1 p3e lt and {1} if ang1 p3e ge ang1 p4s lt and {0} if ang1 p4s ge ang1 p4e lt and {1} if ang1 p4e ge ang1 p5s lt and {0} if ang1 p5s ge ang1 p5e lt and {1} if ang1 p5e ge ang1 p6s lt and {0} if ang1 p6s ge ang1 p6e lt and {1} if ang1 p6e ge ang1 p7s lt and {0} if ang1 p7s ge ang1 p7e lt and {1} if ang1 p7e ge ang1 p8s lt and {0} if ang1 p8s ge ang1 p8e lt and {1} if ang1 p8e ge ang1 p9s lt and {0} if ang1 p9s ge ang1 p9e lt and {1} if ang1 p9e ge ang1 p10s lt and {0} if ang1 p10s ge ang1 p10e lt and {1} if ang1 p10e ge ang1 p11s lt and {0} if ang1 p11s ge ang1 p11e lt and {1} if ang1 p11e ge ang1 90 lt and {0} if } def % /findval finds whether a waveform is -1 0 or +1 over the full 360 degree range % and with 0 120 240 phase adjustments... /findval { phase add /ang exch store ang 360 gt {/ang ang 360 sub store} if % two cycles for advanced phases ang 0 ge ang 90 lt and {/ang1 ang store firstquad 1 mul} if ang 90 ge ang 180 lt and {/ang1 180 ang sub store firstquad 1 mul} if ang 180 ge ang 270 lt and {/ang1 ang 180 sub store firstquad -1 mul} if ang 270 ge ang 360 lt and {/ang1 360 ang sub store firstquad -1 mul} if }def % /plotval plots a magic sinewave sequence... /plotval { /phase exch store 0 0 moveto % remember phase set position 0 0.005 360 {/ang exch store % draw waveform ang 10 div ang findval howhigh mul lineto } for } def % Data for demo -- must be more accurate than increment used. From steplock calculators. /p1s 6.961026928461848 store % data sepcific to 0.53 amplitude Delta 533 /p1e 7.448537451239758 store /p2s 12.45680755936742 store /p2e 12.774564100860743 store /p3s 16.442108969139333 store /p3e 17.566715450632657 store /p4s 22.35685844328519 store /p4e 22.767291471061625 store /p5s 25.70621261893848 store /p5e 27.641978536714802 store /p6s 34.29378738106152 store /p6e 37.232708528938375 store /p7s 43.55789103086067 store /p7e 47.225435899139256 store /p8s 53.03897307153815 store /p8e 57.32124042123966 store /p9s 62.67875957358225 store /p9e 67.44853745123976 store /p10s 72.45680755936742 store /p10e 77.56671545063265 store /p11s 82.35685844328519 store /p11e 87.6419785367148 store %%%%% demos %%%%% /howhigh 2 store % plot three waveforms gsave 0 8 translate 120 plotval line1 stroke grestore gsave 0 13 translate 240 plotval line1 stroke grestore gsave 0 18 translate 0 plotval line1 stroke grestore gsave /howhigh 2.0 store 1 0.6 0 setrgbcolor % merge three color waveforms 0 3 translate 240 plotval closepath fill grestore gsave /howhigh 2.0 store 0 1 1 setrgbcolor 0 3 translate 120 plotval closepath fill grestore gsave /howhigh 2.0 store 1 0 1 setrgbcolor 0 3 translate 0 plotval closepath fill grestore black /phase 0 store % /finalpat produces final pattern [ x y z ] from [a b c ]. A clockwise current % is assumed as positive. Motor reverses by reversing the entire sequence. % x--(winding a)--y--(winding b)--z--(winding c)--x -- % The allowable delta friendly sequences (all MUST sum to zero) are... % [-1 +1 0] ---> [ 1 0 1 ] % [-1 0 +1] ---> [ 1 0 0 ] % [ 0 -1 +1] ---> [ 1 1 0 ] % [ 0 0 0] ---> [ 0 0 0 ] ( or [ 1 1 1 ] ) % [ 0 +1 -1] ---> [ 0 0 1 ] % [+1 -1 0] ---> [ 0 1 0 ] % [+1 0 -1] ---> [ 0 1 1 ] % while possible, the redundant [1 1 1] is not yet used here. % Under certain circumstances, it might slightly reduce transitions from [0 0 0]. % But leaving ports high can be a bad scene. % /finalpat does the above lookup logic... /finalpat { [ (bad sequence) ] aaa -1 eq bbb 1 eq ccc 0 eq and and {pop [1 0 1]} if aaa -1 eq bbb 0 eq ccc 1 eq and and {pop [1 0 0]} if aaa 0 eq bbb -1 eq ccc 1 eq and and {pop [1 1 0]} if aaa 0 eq bbb 0 eq ccc 0 eq and and {pop [0 0 0]} if aaa 0 eq bbb 1 eq ccc -1 eq and and {pop [0 0 1]} if aaa 1 eq bbb -1 eq ccc 0 eq and and {pop [0 1 0]} if aaa 1 eq bbb 0 eq ccc -1 eq and and {pop [0 1 1]} if } store % /report writes the levels and the phase patterns to the log file. /reportnew { /rawpat mark aaa bbb ccc ] store (% [ ) print aaa 10 string cvs print ( ) print bbb 10 string cvs print ( ) print ccc 10 string cvs print ( ] ---> [ ) print finalpat 0 get 10 string cvs print ( ) print finalpat 1 get 10 string cvs print ( ) print finalpat 2 get 10 string cvs print ( ]\n) print /aaahold aaa store /bbbhold bbb store /ccchold ccc store } def /aaahold 999 store % makes sure of an initial change /bbbhold 999 store /ccchold 999 store % /scanforchanges is a crude way of walking through the waveform and noting every % time a needed pattern changes... /scanforchanges { 0 0.1 360 {/curang exch store curang 0 add findval /aaa exch store curang 120 add findval /bbb exch store curang 240 add findval /ccc exch store aaa aaahold ne bbb bbbhold ne or ccc ccchold ne or {reportnew} if } for } def scanforchanges % /verifyspacing checks the delays needed for the first 120 degrees /spacing [ 0 %%% inputs needed /t1 60 p8e sub store /t2 p1s store /t3 p1e store /t4 p2s store /t5 p2e store /t6 p3s store /t7 p3e store /t8 p4s store /t9 p4e store /t10 p5s store /t11 p5e store % 0 to 30 degrees t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 % 30 to 60 degrees 60 t11 sub 60 t10 sub 60 t9 sub 60 t8 sub 60 t7 sub 60 t6 sub 60 t5 sub 60 t4 sub 60 t3 sub 60 t2 sub 60 t1 sub % 60 to 90 degrees 60 t1 add 60 t2 add 60 t3 add 60 t4 add 60 t5 add 60 t6 add 60 t7 add 60 t8 add 60 t9 add 60 t10 add 60 t11 add % 90 to 120 degrees 120 t11 sub 120 t10 sub 120 t9 sub 120 t8 sub 120 t7 sub 120 t6 sub 120 t5 sub 120 t4 sub 120 t3 sub 120 t2 sub 120 t1 sub 120 ] def /verifyspacing {line1 spacing { 10 div 0 mt 0.5 u } forall 0 0 mt 12 r } def verifyspacing % note mirror symmetry about 30 degrees. %%%%%%%%%%%%%%%%%%%%%%%%%% IMPORTANT ANALYSIS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Note that a delta friendly steplock-44 only requires ELEVEN delay values! % A twelvth convenience value can be added for defined cycle boundaries. % As the verifyspacing plot shows, these values are read in frontwards sequence % from 0 to 30 degrees, backwards from 30 to 60 degrees, frontwards from 60 to 90 % degrees, and so on. % The calculators can show the required amplitude table resolution. While eight % bit data is sometimes possible, 16 is recommended. % Note also that the transient latency would be approximately 4.28 degrees worst % case and half that typically. %%%%%%%%%%%%%%%%%%%%%%% CALCULATING DELAY VALUES %%%%%%%%%%%%%%%%%%%%%%%% % Eight differential delay values can be defined per amplitude for the 0 to 30 % degree interval. See above for the t1 - t11 definitions % a = t1 - 0 % really only half the time between output changes % b = t2 - t1 % c = t3 - t2 % d = t4 - t3 % e = t5 - t4 % f = t6 - t5 % g = t7 - t6 % h = t8 - t7 % i = t9 - t8 % j = t10 - t9 % k = t11 - t10 % l = 30 - t11 % really only half the time between output changes % The algorithm for the first 30 degrees becomes... % output [000] delay a % output [001] delay b % output [011] delay c % output [000] delay d % output [011] delay e % output [001] delay f % output [011] delay g % output [000] delay h % The delay values repeat WITH DIFFERENT PATTERNS for successive intervals. From % 30 to 60, values go BACKWARDS from h to a. From 60 to 90 values go FRONTWARDS % from a to h. From 90 to 120, values go BACKWARDS from h to a. % Patterns are shown below. Note that no pattern change happens when crossing a % 0 30 60 ... boundary. While delays of 2a and 2h could be used, it would seem % to be a good idea to preserve these phase reference boundaries. Especially zero. % Above 120 degrees, the entire pattern repeats phase shifted by one leg. For instance, % the pattern associated with delay b just past zero is [001]. Just past 120 is [010}. % Just past 240 is [100]. Note that a FIVE element array of [00100] can be used with % selectable offsets of 0, 1, or 2. % Actual delay times relate both to the magic sinewave frequency and amplitude. As % an example, a 60 Hertz waveform repeats every 16.667 milliseconds or 16,667 % microseconds. One degree of such a waveform is 16,667/360 or 46.29722 microseconds. % a through h values can be found by multiplying by the current microseconds per % degree constant. For instance delay c = 46.29722 (p1e - p1s). % Or, in this specific example of 0.53 amplitude steplock 28R 60 Hertz, % delay c = 46.2922 ( 7.4485 - 6.9610 ) = 22.5674 microseconds. % Note that timing accuracies of 1 part in 30,000 or so normally MUST be maintained! %%%% add annotation %%%%%%%%%%% links menu directory %%%%%%%%%%%% % This code locks pdfmark commands out of a PostScript printer. /pdfmark where {pop}{userdict /pdfmark /cleartomark load put} ifelse % /surl "start url" marks the beginning of a text sequence to be urled. % It also paints the text blue... /surl {mark /blue cvx 0.33 /setgray cvx % change text to blue /currentpoint cvx % remember box start /urly /exch cvx /store cvx /urlx /exch cvx /store cvx ] cvx % complete deferred command printlist exch 3 index exch put % stuff into gonzo printlist exch 1 add exch % increment gonzo list count } def % /eurl "end url" unmarks the end of a text sequence and sets up % the pdfmark needed to define the Acrobat web link. /eurl {mark % start deferred proc exch % position url string % /black cvx 0 /setgray cvx % turn blue marker off maintextcolor /setrgbcolor cvx % reset to main text color??? /makeurl cvx % defer call of url builder ] cvx % complete deferred proc printlist exch 3 index exch % stuff into gonzo printlist put exch 1 add exch % increment gonzo list count } def % /makeurl generates the pdfmark, receiving a {(urlstring) makeurl}. % Note that it is not called until formatted printlist time... /urlover 0.2 def % fraction of hot area over bounds /makeurl { /cururlname exch store % save the url string mark % start pdfmark currentfont /ScaleMatrix get 3 get /fsize exch store % guess height /Rect [ urlx fsize urlover mul sub % set box left x urly fsize urlover mul sub % set box left y currentpoint exch fsize urlover mul add exch fsize add ] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ .7 0 0 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators } def % /makeurlx generates the box specific pdfmark, receiving % a {(urlstring) makeurl}. % Note that it is not called until formatted printlist time... /makeurlx { /cururlnamex exch store % save the url string mark % start pdfmark /Rect [ xpos % set box left x ypos 0.9 sub % set box left y xpos 2.8 add % box right x ypos 0.9 sub 2.8 add % box right y ] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ .7 0 0 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators } def /maintextcolor {0 0 0 } def % text link specific data /tinaja {(http://www.tinaja.com/magsn01.asp) eurl} def /font1 /StoneSans-Bold 1.6 gonzofont /font2 /StoneSans 0.60 gonzofont /font3 /StoneSans-Bold 0.55 gonzofont /cstretch 0.02 store /sstretch 0.02 store /amacro {0 0 .3 setrgbcolor} def /bmacro {0 0 0 setrgbcolor} def 0 .5 .5 setrgbcolor font1 18 22.6 (SL44 Delta Friendly 533 Waveforms)cc font2 black 12.5 0.2 (<--- timing check -- see |/surl |3http://www.tinaja.com|2|/tinaja sourcecode for algorithms) cl showpage % complete first plot % DATA BELOW MUST BE HAND PATCHED FROM LOG FILE % logfile should return these abc phase values. Should be valid % for all amplitudes of Delta28R. % Should compare exactly to PDF plot. % (+1) = clockwise phase winding current % (-1) = counterclockwise phase winding current. % (0) = no phase winding current % [ 0 0 0 ] ---> [ 0 0 0 ] from 0 degrees to (60 - p8e) % [ 0 1 -1 ] ---> [ 0 0 1 ] from (60-p8e) to p1s % [ 1 0 -1 ] ---> [ 0 1 1 ] from p1s to p1e % [ 0 0 0 ] ---> [ 0 0 0 ] % [ 1 0 -1 ] ---> [ 0 1 1 ] ...etc per above % [ 0 1 -1 ] ---> [ 0 0 1 ] % [ 1 0 -1 ] ---> [ 0 1 1 ] % [ 0 0 0 ] ---> [ 0 0 0 ] % [ 1 0 -1 ] ---> [ 0 1 1 ] % [ 0 1 -1 ] ---> [ 0 0 1 ] % [ 1 0 -1 ] ---> [ 0 1 1 ] % [ 0 0 0 ] ---> [ 0 0 0 ] % [ 0 1 -1 ] ---> [ 0 0 1 ] % [ 1 0 -1 ] ---> [ 0 1 1 ] % [ 0 1 -1 ] ---> [ 0 0 1 ] % [ 0 0 0 ] ---> [ 0 0 0 ] % [ 0 1 -1 ] ---> [ 0 0 1 ] % [ 1 0 -1 ] ---> [ 0 1 1 ] % [ 0 1 -1 ] ---> [ 0 0 1 ] % [ 0 0 0 ] ---> [ 0 0 0 ] % [ 0 1 -1 ] ---> [ 0 0 1 ] % [ 1 0 -1 ] ---> [ 0 1 1 ] % [ 0 0 0 ] ---> [ 0 0 0 ] % [ 1 0 -1 ] ---> [ 0 1 1 ] % [ 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