Discontinuity in S-Function in C

Discussion in 'MATLAB' started by Robert, Aug 23, 2005.

  1. Robert

    Robert Guest

    Hi,

    I am building a model of a clutch as an S-Function in C.
    There are three inputs (nDrive (revolution), nOutput(revolution) and
    Force) and two outputs (MDrive and MOutpt - torques).

    The clutch can be in two states - glide (M_Friction < M_load) and
    adherence/adhesion (M_Friction between the plates > M_load).

    For bot of the states I use the different differential equations:

    Glide - the plates are apart:
    i. e. n2dot = (M2-M_Friction)/J2

    Adherence - they are together:
    n2dot = (M2-M1)/(J1+J2) + d*(n1-n2)

    The thing is, that the change of the states should be modelled as a
    step - adhesion factor as a function of a difference between the
    revolution of the inner plates (Coulomb-model).

    When I change the states changes, the different equations are used,
    this causes discontinuity.... And here´s my problem.

    I tried to use the solution as in :
    * File : stvctf.c
    * Abstract:
    * Time Varying Continuous Transfer Function block

    two sample-times and two continuous states. I have two banks of
    parameters (for both states and the last friction torque). But
    whenever I reset my solver, it starts from the glide state
    (M_Friction = 0) - it´s clear but causes the instability or
    inaccuracy.

    the simulation should go with a fixed-step, this is a demand for the
    other blocks and simulation programmes.

    I hope you will understand what I mean...

    I would be the most grateful I you could give me some hints.

    Best regards,
    Robert
     
    Robert, Aug 23, 2005
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.