Error in Mathscript (FOPDT Transfer Function)

Hi all, i am trying to write a First Order Plus Dead Time system into the mathscript, unfortunetaly i found that it appear an error (please refer to the attachements), do anyone have idea or approach to write an FOPDT Transfer function in mathscript? 
Thankyou veery much.
Solved!
Go to Solution.
Attachments:
error.png ‏18 KB

Thank you very much barp, both method work for me, but now i had face another problem.
I had try your method and design the PI controller, but the result (overshoot) is different compare to the result (overshoot) by using Matlab.
I had try to copy and paste the code from the Mathscript to the Matlab and step plot it. Consequently, the overshoot shown different value. 
I also had try to check all the value and i found that everything is ok until the last line sys_cl=feedback(Gf,1), Labview has given the answer in transfer function but Matlab has show the answer in continuous time state space model. 
The value of the transfer function : Gain = 58.46; Time constant = 0.55 and time delay = 0.06.
The value of Pi controller : Kp = 0.0784 and the Ti = 0.24. 
I had attach some picture which show the difference.
Am i did something wrong in the mathscript and should i do it in Labview by different way?
Thankyou very much
Attachments:
matlab1.png ‏24 KB
labview bd1.png ‏28 KB
labview bd2.png ‏43 KB

Similar Messages

  • How to create a filter using mathscript transfer function in labview

    Dear all,
    I am currently designing a filter in labview using a Mathscript looping. The filter can be represented in transfer function. I have attachted the transfer function equation together with its value and the desire frequency vs. amplitude graph that I should obtained from it. Also, following are the transfer function written in Matlab.
    B1= tf ([57.5221845],[1 51.017077 205.1868]);
    B2 = tf ([1 0],[7.6991]);
    B3 = tf ([1 0],[14.32433403]);
    B4 = tf ([1 0],[137.6017]);
    F = B1 * ( (1+B3)/((1+B2)*(1+B4)));
    plot(F)
    I have also modify the coding as Labview Mathscript does not support the Matlab coding "tf" as transfer function to "bilinear"
    Problem I am facing are:
    1) Unable to display the graph of the filter in labvie.
    2) Unable to have sinewave as an input to the filter.
    3) The output cannot be display in graph format. 
    Hope to have the soonest reply from you guys. Many thanks in advance 
    Solved!
    Go to Solution.
    Attachments:
    transfer function.jpg ‏18 KB
    Weighting Filter.vi ‏266 KB

    Thank you again for offering to help me in writing the code.
    I suppose that I should do a frequency sweep on the transfer
    function to prove that it behave as the sample graph. Example, if I have an input sine
    wave with the frequency of 8.8Hz passing through the transfer function filter, the
    output that I should be getting is 1 according to the transfer function graph
    and of cause the frequency range of my input sine wave would only be between
    the ranges of 0.5 Hz to 30 Hz.
    Attachments:
    Weighting FilterTest1.vi ‏53 KB

  • Error message "No internal transfer number found"

    Hi everyone,
    I'm trying to setup the self-billing- (ERS)-functionality for scheduling agreements.  The problem I'm currently facing is that I created a test-iDoc which while being processed causes an error.
    The test-iDoc is sent out with the basic type GSVERF03 (I just tried the same using type GSVERF01). On my customer's side the reception is configured to use the message type SBWAP.
    I also did the customizing-settings from within the ERS-monitor for the partner function (TCodes OVD5 & OVD7.... with reference number "E" & Delivery Note Number to Determine Sales Document), but in the end I still receive the error-message:"No internal transfer number found" even though it's available in the iDoc.
    Does anybody have any ideas on this?!?
    Any help greatly appreciated!
    Thx & regards,
    Bobby

    Hi Boban,
    I had same issue I solved   creating  number range in SNRO for object TRMNO_INT,
    Regards

  • Formal error: Invalid calling sequence for function modules

    Hi All,
    I have developed a function module for FQEVENT 620 Payment: Transfer Line Items for Clearing.
    The clearing works fine.
    After clearing the open items i need to post an FI-CA Document(BAPI : BAPI_CTRACDOCUMENT_CREATE) for each open item(cleared item)
    I have used the bapi : BAPI_CTRACDOCUMENT_CREATE in the same function module that i have developed for FQEVENT 620 Payment: Transfer Line Items for Clearing.Here i am getting an error "Formal error: Invalid calling sequence for function modules".
    So please let me know where i can use this bapi to post fi-ca document.Is there a BAdi or Enhancement Spot where i can use this BAPI or tell me what should i do to overcome this error.
    Regards
    Venkat

    Venkat:
    While I am confused about your business process - creating an open item when clearing one seems strange.  Look into event 0020 which is called after documents are posted - it may present the opportunity to post process additional documents.
    regards,
    bill.

  • The transfer function of the PID block doesn't show the derivator.

    Hello,
    I am trying to use the PID vi, but I when I try the box by itself, it doesn't behave as a "clasic" PID should behave. The main problem is that I don't manage to see the derivator. In the attached vi I compare the transfer function of the PID vi with the transfer function of a PID built by me. My version shows all what a PID should have: integral section (with decreasing magnitude and -90 phase), center area (with constant magnitude and 0 phase), and derivative area (with increasing magnitude and +90 phase).
    The PID vi only shows the integral part.
    You can also select a step input, and see the output directly. If you choose a large enough derivative time (100 times bigger than the integrator time), and you look closely to the first part of the output, you will see the pick due to the derivator in my version, but not in the PID.vi version.
    Does anyone knows what am I doing wrong? 
    Kind regards,
    Pablo Estevez
    Solved!
    Go to Solution.
    Attachments:
    TestPID.vi ‏31 KB

    Dear Nathand,
    Thanks for your answer, I tried the change and you are right. That shows that this not a standard PID, since that means (and actually I can see it now by checking inside the vi) that it is not using the derivative of the error but the derivative of the process variable. I know that this is used sometimes to prevent the effect of fast changing set-points, but it is a shame that they do not comment on it in the help, and that this is not a selectable feature. Do you know if there is a way to edit these pre-packaged vi's? 
    One more question, about the labview style. I included the sequences just to group terms and make the code more readable to separate the integrator from the derivator and not have a knot of entangled signals. Specially when I run the clean-up diagram, it gets very entangled. I have been looking for another way to do that (container boxes, groups). It would be nice if you could suggest me something I can do for it.
    Thanks again,
    Pablo 

  • System Identification and Transfer Function of the LEGO MINDSTORM NXT Robot

    Can anybody please help with the below question.
    Using your LabView interface, input different values of power and record the output value of the number of wheel rotations. You can convert the latter into speed by measuring the diameter of the wheel. Then, type ‘ident’ in the command line of Matlab to launch a graphical user interface for system identification. Using the data collected for input power and recorded speed, you can derive the transfer function for your robot in the Laplace domain.
    You will notice that it is possible to approximate the transfer function to a first order system.
    Add disturbance to your system such as wind drag, road profile or friction. You might want to model the disturbance as a sinusoidal waveform.
    Analyse the system response in LabView in order to tune the response.
    Finally, write a LabView program to test your controller.
    Set both Integral and Derivative to 0
    Increase the value for Proportional controller to 0.5, 0.8, 1, 1.1, 1.3, and 1.5
    Select a suitable simulation stop time.
    Compare each simulation results and draw some conclusions.
    Record the steady-state error. Has it dropped to near zero?
    Record the rise time. Has it decreased to less than 0.5 second? And for what values of Kp?
    Check whether this response is realistic i.e. a real cruise control system generally cannot change the speed of the vehicle from 0 to 10m/s in less than 0.5 second.
    Adjust the gain (Kp) to give a reasonable rise time and add an integral controller to eliminate the steady-state error.
    Change both Kp and Ki and see what happens to the response. When you adjust the integral gain Ki, start with a small value since a large Ki can destabilise the response. (Ki =0.001, 0.002, 0.003, 0.004).
    Then you need to adjust both the proportional gain Kp and the integral gain Ki to obtain the desired response. Record the values of Kp and Ki that can meet all the design criteria.
    Write the PID-feedback control LabVIEW program as described above.
    Does it work? Quantify! Show us it is working
    Hand in a short report on the PID project on the cruise control of the LEGO MINDSTORM NXT Robot. Your report should contain an introduction to cruise control and uses of PID controllers, a brief explanation of how PID feedback control works. The printout of the Block Diagram and Front Panel of your LabVIEW program should be attached at the end of your report.
    Put it all together. There are many questions that can be explored and written up in the result section. Be creative.
    Here are some things that may be addressed: Check whether your system can stabilise speed to within 1%. What are the optimal PID parameters that you have found? Can you choose PID parameters to both reach the set speed quickly and also maintain the speed within good accuracy once the system has reached the set speed? Can you control the speed of small steps? Explain your results?

    Thanks for that.
    DanHarryman wrote:
    HI ToolMonkey
    You should be able to build control system to do this using PID control VIs. The following paper is a good place to start when working with PID systems. 
    http://www.ni.com/white-paper/6440/en
    Let me know how you get on using some of the functions in this. 
    Thanks 
    Dan.H
    UKAE

  • S-domain transfer function

    I am trying to recreate my partners Matlab filter in Labview whereby a sine wave goes through a low pass filter. I am using a sinewave array as the input and am trying to impose the s-domain low-pass transfer function s/(1+sT) on the wave as is done in Matlab. Can a formula node from matlab be pulled into Labview.
    Thanks
    kilyg

    Hello.
    It is possible to execute Matlab code in LaVIEW, if you have both LabVIEW and MATLAB installed in the computer. You have to use a "Matlab Script" node found in Functions >> Analyze >> Mathematics >> Formula.
    However, I recommend using LabVIEW native functions, unless it is absolutely necessary to use MATLAB, because whenever I have had to interface to MATLAB, I have found, that error reporting is very bad. For example, if you use an undeclared variable in MATLAB, it immediately tells you there is an error. But when you use the MATLAB script node it does not, so, debugging is a pain. You have to make sure your Matlab code is error-free.
    To use that Matlab script node, you have to right-click on the edge of it, and create inputs and outputs, and give them the exact same name as the variables you will use inside in the Matlab code.
    One possible solution for this particular application in which you want to apply a simple filter, is to use the "Filter" VI, found in Functions >> Analyze >> Waveform Conditioning. You can set it to low-pass filter, and set the cut-off frequency, and stuff like that. (I am using LabVIEW 7.1, so if you have an older version, I am not sure if you have that VI available, especially if it is older than 7.0).
    I do recall seeing a VI in which you could directly specify a transfer function, like what you want to do, but I could not find it. Perhaps it is because I do not have the control design toolkit installed, and it was part of that, but I will keep looking and let you know if I find it.
    Good luck.
    Alejandro

  • Transfer Function (s-domain)

    Hello,
    I'm not sure that my previous message made it, so here goes again...
    I am trying to implement special analog filters in Labview that are
    specified by s-domain transfer functions. The only way I can think of
    to do it is to do a bilinear transformation from the s to z-domain and
    use an IIR filter. But this raises a number of other questions such as
    pre-warping frequency (is it needed, which freq. to choose)and what
    error, if any, is involved in this process.
    Has anyone been successful with accomplishing this through any method?
    Thanks in advance,
    David DeLoach
    Sent via Deja.com http://www.deja.com/
    Share what you know. Learn what you don't.

    wrote in message news:[email protected]...
    > Hello,
    >
    > I'm not sure that my previous message made it, so here goes again...
    >
    > I am trying to implement special analog filters in Labview that are
    > specified by s-domain transfer functions. The only way I can think of
    > to do it is to do a bilinear transformation from the s to z-domain and
    > use an IIR filter. But this raises a number of other questions such as
    > pre-warping frequency (is it needed, which freq. to choose)and what
    > error, if any, is involved in this process.
    >
    > Has anyone been successful with accomplishing this through any method?
    >
    > Thanks in advance,
    >
    > David DeLoach
    Hi
    Do you want an off-line filter or an on-line filter? Off-line filtering
    functions are available in an "advanced installation" of LV (if I remember
    right) and in Signal Processing Toolset. Off-line filters handle *given*
    time-series. If you want an on-line filter, which calculates a new filter
    output as soon as a new filter input is ready (the input may be a newly
    sampled signal some discretization method (as bilinear transformation) and
    implementation using a while-loop is a solution, as you suggest. (However,
    the Signal Processing Toolset also contains such on-line functions, if I am
    reading the NI Catalogue correctly.) An on-line algorithm can of course be
    used off-line, too (the new input sample is then the new value fetched from
    the existing time-series).
    Assuming you want to implement the filter yourself (with while-loop and some
    discr. method): If there are no significant signal frequencies above
    approximately 0.2 * Nyquist frequency (in other words: if the sampling
    frequency is sufficiently high), you should not have to bother about
    prewarping (i.e. you do not have to adjust the filtering coefficients for
    prewarping), and you may even develop the filter algorithm using the simple
    Euler forward method for discretization (I have done this in several
    projects, and it works fine). Theory for designing/analysing prewarping can
    be found in for example Franklin and Powell: Digital Control of Dynamic
    Systems, and in most Signal Processing textbooks. Prewarping is particularly
    important for filters with "critical" specifications, for example
    notch-filters where one well defined frequency component is to be removed.
    With respect to the while-loop implementation, if you want to keep the block
    diagram well-structured and with good overview, you may write a SubVI for
    the filter (with connectors for input and output and filter parameters), and
    use this SubVI in the (main) while-loop. Within the SubVI, the previous
    filter variables (needed in the filter algorithm) are stored using local
    variables rather than using a shift register (as I found it easier to
    implement re-setting the filter variables (to initial values) when using
    local variables than when using shift register).
    Regards,
    Finn Haugen
    Telemark College, Norway

  • What does it mean when it says transfer function normalized

    I am running my VI which is control system model. I have changed transfer function into a cluster of Numerator and Denominator and through a cluster unbudle into transfer function subVI. It does not show any fault until I run it and then it shows message "Transfer function normalized" what could be the problem. I will try and attach the vi. The Vi is created in GSim Tool set

    This error is because the order of your numerator is higher than the order of the denominator of your transfer function. This is an impossible physical situation and leads to a delta function and its derivatives in the output response. Physically realizable systems must have the order of the denominator in the transfer function greater than the order of the numerator.
    Marc

  • Error While including the Multisite functionality

    Error While including the Multisite functionality & trying to click on SiteAdministraion tab in BCC
    Background: We have migrated our application from ATG v9.1 to ATG v 10.0.2 and implementing Multisite on the same
    Getting this error on BCC console:
    12:55:36,893 INFO [ServerImpl] JBoss (Microcontainer) [5.0.0.GA (build: SVNTag=JBPAPP_5_0_0_GA date=200910202128)] Started in 2m:44s:727ms
    12:57:24,234 ERROR [SiteAdminActivitySource] The acl for the custom workflow activity named siteadmin.manageSiteAssets is invalid. This activity will not be available.
    atg.security.InvalidPersonaException: Profile$role$siteAdminUser
    at atg.security.AccessControlListParser.setPersona(AccessControlListParser.java:239)
    at atg.security.AccessControlListParser.parseAce(AccessControlListParser.java:277)
    at atg.security.AccessControlListParser.parse(AccessControlListParser.java:193)
    Thanks in Anticipation1

    Hello Sudheer,
    Increasing the Swap space is the only thing i noticed in all SAP Notes for your problem.
    Configure more swapspace please and restart the installation.
    Regards,
    Siddhesh

  • Error message in compliing a function

    Hi All,
    I am trying to compiling the following function, but it is throwing the an error.
    CREATE OR REPLACE FUNCTION parapage_discosessions
    RETURN bumber
    IS
    discosessions number;
    BEGIN
    discosessions := select count(*) from gv$session where username IN ('DISCOFIELD', 'DISCOUSER','DISCOADMIN');
    RETURN discosessions;
    EXCEPTION
    WHEN OTHERS THEN
    raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END;
    The above function is giving the following error message
    Error(9,21): PLS-00103: Encountered the symbol "SELECT" when expecting one of the following: ( - + case mod new not null <an identifier> <a double-quoted delimited-identifier> <a bind variable> avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date <a string literal with character set specification> <a number> <a single-quoted SQL string> pipe <an alternatively-quoted string literal with character set specification> <an alternatively-quo
    Please give me any suggestions

    SQL> CREATE OR REPLACE FUNCTION parapage_discosessions
      2  RETURN number IS
      3  discosessions number;
      4  BEGIN
      5  select count(*) into discosessions
      6  from gv$session
      7  where username IN ('DISCOFIELD', 'DISCOUSER','DISCOADMIN');
      8  RETURN discosessions;
      9  EXCEPTION
    10  WHEN OTHERS THEN
    11  raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    12  END;
    13  /
    Function created

  • Error while determining the form function module

    Hi everyone,
    We are experiencing problems while displaying one adobe form in ESS. It’s the Travel Expense form (PTRV_EXPENSE_FORM). When pressing the button to “Display/Print” the form we get an error message: "Error while determining the form function module", and no form I shown. The ADS server is configured correctly and there are other forms that are actually working, for example the Travel Request form. We are running WAS 7.0 with SP12.
    Anyone has an idea what can cause the problem? Any help is greatly appreciated.
    Thanks in advance!
    Regards,
    Sophie

    Viktor,
    Thank you for your answer, it solved our problem!
    Regards,
    Sophie

  • Error in import/export of functions - for the apex team

    After exporting functions, the import gives an error.
    Reason :
    the export generates a script with
    function \
    function
    importing this script gives an error because only the first function is imported. or the functions seems to be togheter one function
    the export should generate
    function
    function
    Leo

    Leo - I logged into your workspace and exported the functions. The generated script looks perfectly good. I then uploaded that file into my own workspace and ran the script. The functions were all created as separate functions.
    There must be something happening at your end causing newline characters in the file to be lost or something. Or maybe I didn't follow exactly the steps you did.
    BTW, when you mentioned the "\" character in your original post, I assumed you meant the "/" character.
    Scott

  • Error when calling a package function

    any insight why my object is erroring out when calling a function. the error is
    oracle.apps.fnd.framework.OAException: java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 1
    it errors out when the cs.execute() is . is it the placement ? thanks for the help....
    then pkg func is xxx.get_log
    Get_Log(rmode IN NUMBER , doc_type IN VARCHAR2 DEFAULT 'TEL', doc_id IN VARCHAR2 DEFAULT NULL,
    doc_num IN VARCHAR2 DEFAULT NULL -- , p_out out varchar2 --
    RETURN varchar2 IS....
    the co
    Serializable paramDocLocatorParamList [] = {paramRMODE, paramDOC_TYPE, paramDOC_ID, paramDOC_NUM, p_out };
    OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean);
    OADBTransaction dbtrans;
    OAViewObject docLocator = (OAViewObject)am.findViewObject("DocLocatorVO1");
    rtxt0.setValue(pageContext, "here it is" + am.invokeMethod("getHTMLString", paramDocLocatorParamList));
    docLocator.executeQuery();
    // am.invokeMethod("getHTMLString", paramDocLocatorParamList);
    the impl
    public String getHTMLString ( String paramRMODE, String paramDOC_TYPE, String paramDOC_ID, String paramDOC_NUM, String p_out )
    System.out.println("Entering The AM Impl");
    CallableStatement st = null;
    OADBTransaction txn = (OADBTransaction)getDBTransaction();
    Connection conn = txn.getJdbcConnection();
    String sql = " BEGIN :5 := test_proc.get_log(:1, :2, :3, :4 ); END; ";
    CallableStatement cs = txn.createCallableStatement(sql,1);
    String ErrorExist = "";
    String getHTML = "";
    try
    cs.setString(1, paramRMODE);
    cs.setString(2, paramDOC_TYPE);
    cs.setString(3, paramDOC_ID);
    cs.setString(4, paramDOC_NUM);
    cs.setString(5,p_out); // --param   
    /* cs.registerOutParameter(1,Types.CHAR);
    cs.registerOutParameter(2,Types.CHAR);
    cs.registerOutParameter(3,Types.CHAR);
    cs.registerOutParameter(4,Types.CHAR);*/
    cs.registerOutParameter(5,Types.CHAR);
    cs.execute();
    getHTML = cs.getString(5 ) ;
    /* System.out.println("getHTML is " + getHTML );
    cs.close();
    // if ( "E".equals(ErrorExist))
    /// throw new OAException ("Payment Request Is Already Cancelled" );
    catch (SQLException sqle)
    try { cs.close(); }
    catch (Exception e) {}
    throw OAException.wrapperException(sqle);
    String doctype = paramDOC_TYPE;
    String docnum = paramDOC_NUM;
    String html ;
    System.out.println( "paramDOC_TYPE in IMPL is " + doctype) ;
    System.out.println( "paramDOC_Numb in IMPL is " + docnum) ;
    return getHTML;

    resolved.....
    public String getHTMLString (String p_out , String rmode, String doc_type, String doc_id, String doc_num )
    System.out.println("");
    System.out.println("Entering The AM Impl");
    // System.out.println("Passing getDocAbbrForHTML in IMPL -------> " +getDocAbbrForHTML     );
    // System.out.println("Passing paramDOC_NUM in IMPL -------> " + paramDOC_NUM );
    System.out.println("Passing getDocAbbrForHTML in IMPL -------> " +doc_type     );
    System.out.println("Passing paramDOC_NUM in IMPL -------> " + doc_num );
    CallableStatement st = null;
    OADBTransaction txn = (OADBTransaction)getDBTransaction();
    Connection conn = txn.getJdbcConnection();
    String sql = " BEGIN :1 := test_proc.get_log(:2, :3, :43, :5 ); END; ";
    CallableStatement cs = txn.createCallableStatement(sql,1);
    String ErrorExist = "";
    String getHTML = "";
    try
    cs.setString(2, rmode);
    cs.setString(3, doc_type);
    cs.setString(4, doc_id);
    cs.setString(5, doc_num);
    cs.registerOutParameter(1,Types.VARCHAR);
    cs.execute();
    getHTML = cs.getString(1 ) ;

  • Error while Testing the Inbound Function Module

    Hi,
           I have created a Z Function Module (Posting Program) for Testing the EDI Shipment Tender Status. When I try to process the IDoc with the Transaction WE19 and when I enter the name of the Z function Module , it gives me an error saying that "Interface for Function Zxxxx is incorrect". Can somebody give me a solution for this? Answer would attract reward points.
    Thanks,
    Venkat.

    Hi,
    You need to register this Function Module against Message Type.
    Transaction code is : WE57.
    Nilesh

Maybe you are looking for