BODE-ROUTH v5.1 ¡Plus! (c)APO for the HP48-G,GX FIRST OF ALL ============ English is not my native language so I'd like to apologize for the errors in this doc. THE FILES ========= BodeR5x1.lib The spanish library v5.1 BodeReng.lib English version 5.1 BodeR5x1.esp Spanish manual. BodeR5x1.eng English manual. INSTALATION ========== WARNING !!! This library needs the polynomial lib NEOPOLYS (version 3.5 or better with Laplace transforms ) to work properly. Just download the .lib you want with the kermit server, press the key with the name of the file to push the library in level 1 and also push on the stack the number of the port where you want to store Bode-Routh and press STO. Now reboot your HP by pressing ON-C or turning it off and on. THINGS YOU HAVE TO KNOW ======================= Polynomials are represented as in the NEOPOLYS lib either by their coefficients or by their roots. For instance: X^3 - 2·X^2 - 5·X + 6 can be represented as { 1 -2 -5 6 } or { { 1 3 -2 } } All commands (except "Routh") work only with numerical coefficients. COMMAND REFERENCE ================= I think it's very obvious what each command does. Moreover they are very easy to understand because almost all of them were made with input forms with fields that have by default the correct values for a nice drawing. Bode ---- With this command you can draw both the magnitude and the angle Bode plots. In the magnitude plot the vertical axis is in decibels and in the angle one in degrees. In both the horizontal axis is Log(w). * The fields: NUM,DEN : Numerator and denominator of the transfer function. D : Delay of the transfer function if any. T : Choose the type of plot to draw. RES : Graphic resolution. A number between 0 and 1 representing the distance between two consecutive points of the plot. WARNING !!! When drawing the angle, a small value in this field can lead to draw an incorrect plot because this command uses a correction in the phase to surpass the ±180° limit. If you have doubts about changing or not this value let it as is to ensure that the plot will be correct. AUTO: Check this field to automatic scale vertical axis. HR VR : Horizontal and vertical ranges of the plot. * The menu: EDIT,CHK CHOOS: The normal input form menu for editing fields. PICT : Press here to go to PICTURE. ERASE: Erase PICT. DRAW : Press here to start drawing. After pressing NXT... LABL : To label the plot before drawing it with the minimum and maximum values for the axes. AXES : Check it to draw the axes. GFM : Gain and phase margins and associated frequencies. NOTES: Before entering Bode you can push on levels 1 and 2 the transfer function and the fields NUM and DEN will take those values. Likewise when exiting Bode you'll get the transfer function on the stack. At any moment you can press the DEL key to reset values of one field or the whole fields. When drawing the angle diagram you'll see a dotted line at -180° and 180°. Nyquist ------- * The fields: All fields have the same meanning that in the previous command. There is just one different which is "w". This value is the range of values that the variable w takes when drawing the plot. Thus a value of 6.5 means that the range is from -6.5 yo 6.5. You can increase this value to obtain more resolution near the (0,0). * The menu: Is exactly the same that in the previous command. NOTES: If you see that drawing takes a lot of time it must be due to a great value of the "w" field. Just press the ON key to abort at any moment. The autoscale function is not very efficient for great values of "w". Nichols ------- With this command you can plot ABS(G(jw)) vs ARG(G(jw)) also known as Nichols' diagram for the transfer function G(s). * The fields: They are exactly the same that those for the Nyquist. * The menu: The same thing of the same one. NOTES: The correction we talked about in the Bode plot to exceed the ±180° limit could have been applied here. But I prefered to let it as is because thus you can easily calculate the gain and phase margin. For instance: Push on the stack the next transfer function: 2: { 4 } 1: { 1 2 4 0 } and now press "Nichols". Choose a resolution of .1 and press "DRAW". After a while you'll see how the plot jumps from left to right of the LCD. Well, press the ON key and place the cursor where the plot cross the horizontal axis and if you press the (X,Y) menu key you'll see aproximately the next coords: X: -1.30E2 Y: -3.17E-1 Now add 180 degrees to the x value and you'll obtain the phase margin (or substract -180°): -130-(-180)=50°. To obtain the gain margin just place the pointer to the right, where the plot arrived after jumpping one side to another and you'll see the new coords: X: 180 Y: -6.03E0 and the gain margin is finally (-1)·(-6.03)=6.03. You can obtain the exact values of these gain and phase margins with the GFM option in the Bode command menu saw previously: gain margin = 6.020599... dB phase margin = 50.290385... ° Easy!. See also the Nyquist note about the field "w". RLoc ---- This command calculates and plots the locus of the roots of NUM 1 + K · ------- = 0 DEN for a set of gains K. * The fields: RES : Resolution. This is the increment of the gain K at each step. AU : Check it to autoscale horizontal and vertical axes automaticly. LIN : By default the root locus is drawing with points. Check this field to connect the points. * The menu: There is just one different option: DATA : By pressing this option you'll see another window where you can choose between calculate the closed loop poles, open loop zeros or stability. The first two options are trivial and the last one let you see the coords where the root locus cross the vertical axis and values of gain K for those points. NOTES: When drawing the root locus you'll see some "x" at the location of the closed loop poles and some "o" at the open loop zeros. When drawing, press any key to stop or the ON key to abort. Resp ---- With this command you can obtain and plot the response of a system to different inputs such as pulse, step, ramp and sine. * The fields: T : Type of the input signal. A : Its meanning is different for each input: * step: in this case this value is the magnitude of the step; * ramp: inclination; * pulse: in this case its value is not considered; * sine: wave amplitude. w : This field only has meanning with the sine input and it's the wave frequency. AUTO: Autoscale vertical axis. * The menu: INPU: Activate this option to draw the input with points. It has no meanning for a "Pulse" input. CNCT: Activate it to connect the points of the input graph when INPU is checked. NOTES: In the EQ variable you'll obtain the response function which is the reverse Laplace transform of the transfer function along with the input signal. Routh ----- Applies the Routh-Hurwitz stability test to the polynomial at level 1. The result is the first column of the Routh matrix at level 1 and the whole matrix at level 2. Special cases such as null rows or a null first coef of the previous row are also considered. In the last case this coef will be replaced with 1.E-50. You can also use constants and symbolic expressions. Example 1: 2: Routh 2: { { ......... } } 1: { 1 2 3 4 5 } ->->->->->-> 1: { 1 2 1 -6 5 } meanning: +-----------------------------------+ ¦ s^4 + 2·s^3 + 3·s^2 + 4·s + 5 = 0 ¦ +-----------------------------------+ +---+ s^4 : ¦ 1 ¦ 3 5 s^3 : ¦ 2 ¦ 4 0 s^2 : ¦ 1 ¦ 5 0 s^1 : ¦-6 ¦ 0 0 s^0 : ¦ 5 ¦ 0 0 +---+ Example 2: 2: Routh 2: { { ......... } } 1: { 1 '4/2+4' 3 2 K } ->->->->->->-> 1: { 1 3 2.33...etc} ->CL (Close the loop) ---- Given two transfer functions and a real number returns the closed loop transfer function consisting of the feedback connection of the two systems. Negative or positive feedback is considered depending on the sign of the real number at level 1. E U(s)---->0---> G(s) -------> Y(s) /\± | | | ---- H(s) <---- G(s) => F(s) = --------------- 1 ± G(s)·H(s) sign: + <=> negative feedback - <=> positive feedback For example: 5: { 1 } \ 4: { 1 2 4 } / G(s) 3: { 1 2 } \ 2: { 1 } / H(s) 1: 1 (positive feedb.) ->CL => 4: { 1 } \ 3: { 1 1 2 } / F(s) or: 5: { 1 } \ 4: { 1 2 4 } / G(s) 3: { 1 2 } \ 2: { 1 } / H(s) 1: -1 (negative feedb.) ->CL => 4: { 1 } \ 3: { 1 3 6 } / F(s) For H(s)=1 just push the polynomial { 1 } at levels 2 and 3. THANKS TO ========= Mika Heiskanen specially for his Jazz and for his help to all programmers through his docs and programs. Sebastian Carlier for his Emu48 for Windows 95. Really you got it !. All the persons who spend a bit of their time to contact the author and comment some bugs and suggestions. CHANGES FROM VERSION 5.0 ======================== There was corrected an error in the "Bode" command for which the re- sults in the calculations of the gain and phase margins was not correct when working in "RAD" mode. When drawing the response to an input of type "Pulse" the graph spent some time trying to draw the input function. That was corrected and now the "Pulse" input function is not drawn even when the option "INPU" is activated. CHANGES FROM VERSION 2.3 ======================== There are so many many many many ..... TO CONTACT THE AUTHOR ===================== I'd like to know if you found this lib usefull. If you found any bug or you have any suggestion please e-mail me to apolo@sorolla.eis.uva.es