Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Control System Question

  1. Feb 25, 2013 #1
    I am trying to implement a digital state space control and am confused about something. The system has the standard state space form:
    [itex] x(k+1) = Ax(k) + Bu(k)[/itex]
    [itex]y(k) = Cx(k)[/itex]

    The vector y(k) comes from the sensors measurements and u(k) is what is sent to the actuator, right?
     
  2. jcsd
  3. Feb 25, 2013 #2
    I am confused because I am reading the following in a book that uses standard state space notation:

    o8w387.png
    The flow diagram assumes that the real-time processor provides the following capabilities.

    "A real-time clock enabling execution of the update loop at integer multiples of the sampling interval h.

    Input devices for reading the plant sensors.

    Output devices that enable the controller to drive the plant actuators."
     
  4. Feb 25, 2013 #3
    If you are talking about a diagram like this:

    StateSpaceTutorial_ControlDesign_BlockDiagram.png

    then Y is your output and U is the input into the system.

    Your sensor measurement would happen somewhere after Y and feedback through a controller that would generate U. Remember, the state space diagram is a model of the system you are trying to control and does not include the controller.
     
  5. Feb 25, 2013 #4
    That block diagram is what we are trying to implement.

    So we are measuring two out of four of the states. The system is fully controllable and observable. We want to implement state feedback, and have generated a gain matrix K. So we would like to implement the following algorithm:

    1. Get values from sensors, store in [itex]y[/itex].
    2. Estimate the state, store in [itex]x[/itex].
    3. Calculate [itex]u=-Kx[/itex].
    4. Send [itex]u[/itex] to the actuator.
    5. Repeat.

    Is my logic correct?
     
  6. Feb 26, 2013 #5
    Sure, if your closed-loop estimator and process poles are placed right.

    Does your process model include the dynamics of your actuator though? Otherwise you might not be feeding your process the input you're expecting.
     
  7. Feb 26, 2013 #6
    No I am not. The system is an inverted pendulum on a cart. The actuator is a DC motor. The value produced for [itex]u[/itex] is the force that is supposed to be applied to the cart to move it.

    I would like to just combine the models. How do I do that because the matrices describing the dynamics of the inverted pendulum and the motor are different dimension and also have different state variables.

    How do I combine state space models? Here are the models I am using:

    Inverted Pendulum:
    http://ctms.engin.umich.edu/CTMS/index.php?example=InvertedPendulum&section=ControlStateSpace

    Motor:
    http://ctms.engin.umich.edu/CTMS/index.php?example=MotorPosition&section=ControlStateSpace
     
    Last edited: Feb 26, 2013
  8. Mar 2, 2013 #7
    You generally combine state space models by including their interconnections as internal state information instead.

    Here's your 'DC Motor Position' state space model split into electrical and mechanical subsystems:

    [tex]
    \frac{\mathrm{d}}{\mathrm{dt}}i = -\frac{R}{L}i +
    \begin{bmatrix}
    \frac{1}{L} & -\frac{K}{L}
    \end{bmatrix}
    \begin{bmatrix}
    V\\
    \dot{\theta}
    \end{bmatrix}
    [/tex]

    [tex]
    \frac{\mathrm{d}}{\mathrm{dt}}
    \begin{bmatrix}
    \theta\\
    \dot{\theta}
    \end{bmatrix} =
    \begin{bmatrix}
    0 & 1\\
    0 & -\frac{b}{J}
    \end{bmatrix}
    \begin{bmatrix}
    \theta\\
    \dot{\theta}
    \end{bmatrix} +
    \begin{bmatrix}
    0\\
    \frac{K}{J}
    \end{bmatrix}i
    [/tex]

    You can see how they're easily combined by adding more states to account for their interconnections.
     
    Last edited: Mar 2, 2013
  9. Mar 2, 2013 #8
    The variable [itex]\theta[/itex] is what relates the motor to the inverted pendulum system. This is because the torque the motor exerts is converted to the linear force applied to the cart through a pulley gear system.

    But I still don't see how I combine their state space models. Do I augment the matrices together - resulting in a higher order system, or do I combine them in some other sense?
     
    Last edited: Mar 2, 2013
  10. Mar 2, 2013 #9
    I used the state space model on the page you have linked to, 'DC Motor Position', as a simple example. I have split it into two state space models (I do not include the output equation for each) so you can see how they're combined to form the model on the 'DC Motor Position' page.

    First model has current, i, as state and motor terminal voltage and angular velocity as inputs, V and theta_dot, respectively.

    Second model has angular position and angular velocity as states, theta and theta_dot, respectively and current, i, as input.

    Can you try to make a combined model of these two? Start with states:
    [tex]
    \begin{bmatrix}
    \theta\\
    \dot{\theta}\\
    i
    \end{bmatrix}
    [/tex]
     
  11. Mar 2, 2013 #10
    Okay, so would the states be augmented like this:

    [tex]
    \begin{bmatrix}
    \theta\\
    \dot{\theta}\\
    i\\
    x\\
    \dot{x}\\
    \phi\\
    \dot{\phi}
    \end{bmatrix} [/tex]
     
    Last edited: Mar 2, 2013
  12. Mar 2, 2013 #11
    The input for your cart-pendulum model is a force. The DC motor produces torque K*i, so the force applied to the cart will only be a function of current, i. You don't need theta, theta_dot. States could be:

    [tex]
    \begin{bmatrix}
    x\\
    \dot{x}\\
    \phi\\
    \dot{\phi}\\
    i
    \end{bmatrix}
    [/tex]
     
  13. Mar 2, 2013 #12
    Well, from your equations that separate the electrical and mechanical description of the motor:
    [tex]
    \frac{\mathrm{d}}{\mathrm{dt}}i = -\frac{R}{L}i +
    \begin{bmatrix}
    \frac{1}{L} & -\frac{K}{L}
    \end{bmatrix}
    \begin{bmatrix}
    V\\
    \dot{\theta}
    \end{bmatrix}
    [/tex]

    [tex]
    \frac{\mathrm{d}}{\mathrm{dt}}
    \begin{bmatrix}
    \theta\\
    \dot{\theta}
    \end{bmatrix} =
    \begin{bmatrix}
    0 & 1\\
    0 & -\frac{b}{J}
    \end{bmatrix}
    \begin{bmatrix}
    \theta\\
    \dot{\theta}
    \end{bmatrix} +
    \begin{bmatrix}
    0\\
    \frac{K}{J}
    \end{bmatrix}i
    [/tex]


    The equations written out of matrix notation are:
    [itex]
    \frac{d}{dt}i=-\frac{R}{L}i + \frac{1}{L}V -\frac{K}{L}\dot{\theta}\\
    \frac{d}{dt} \dot{\theta} = -\frac{b}{J} \dot{\theta}+\frac{K}{J}i
    [/itex]

    But I need to separate [itex] i [/itex] from the variables [itex]V[/itex] and [itex]\theta[/itex] in order to put in in the matrix equation with the state vector you wrote:
    [tex]
    \begin{bmatrix}
    x\\
    \dot{x}\\
    \phi\\
    \dot{\phi}\\
    i
    \end{bmatrix}
    [/tex]

    But I can't figure out how to do that. Where is my logic going wrong?
     
    Last edited: Mar 2, 2013
  14. Mar 2, 2013 #13
    You need to know the angular velocity of the motor shaft in order to calculate the back-emf, but if you assume the motor shaft to be connected to the cart through rigid interconnects, then the cart velocity, x_dot, is also a measure of the angular velocity of the motor shaft.

    Edit: The motor terminal voltage, V, is still an input to the combined model.
     
  15. Mar 2, 2013 #14
    Okay, I will walk through what I have done to try to figure out [itex]i[/itex] in terms of [itex] V [/itex]:

    [itex]
    \frac{d}{dt}i=-\frac{R}{L}i + \frac{1}{L}V -\frac{K}{L}\dot{\theta}\\
    \frac{d}{dt} \dot{\theta} = -\frac{b}{J} \dot{\theta}+\frac{K}{J}i
    [/itex]


    Solve the first equation for [itex]\dot{\theta}[/itex]:
    [tex]
    \dot{\theta}=-\frac{L}{K} \dot{i} - \frac{R}{K}i +\frac{1}{K}V
    [/tex]

    Differentiate:
    [tex]
    \frac{d}{dt}\dot{\theta}=-\frac{L}{K}\frac{d}{dt} \dot{i} - \frac{R}{K}\frac{d}{dt}i +\frac{1}{K}\frac{d}{dt}V
    [/tex]

    Plug these two equations into the second of the first two equations:
    [tex]
    (-\frac{L}{K}\frac{d}{dt} \dot{i} - \frac{R}{K}\frac{d}{dt}i +\frac{1}{K}\frac{d}{dt}V) = -\frac{b}{J} (-\frac{L}{K} \dot{i} - \frac{R}{K}i +\frac{1}{K}V)+\frac{K}{J}i
    [/tex]

    But the terms with the derivatives of [itex]i[/itex] don't fit into the equation with the state vector:
    [tex]
    \begin{bmatrix}
    x\\
    \dot{x}\\
    \phi\\
    \dot{\phi}\\
    i
    \end{bmatrix}
    [/tex]

    What am I doing wrong here?
     
    Last edited: Mar 2, 2013
  16. Mar 2, 2013 #15
    You need to fill this out:

    [tex]
    \frac{\mathrm{d}}{\mathrm{dt}}
    \begin{bmatrix}
    x\\
    \dot{x}\\
    \phi\\
    \dot{\phi}\\
    i
    \end{bmatrix} =
    \begin{bmatrix}
    ? & ? & ? & ? & ?\\
    ? & ? & ? & ? & ?\\
    ? & ? & ? & ? & ?\\
    ? & ? & ? & ? & ?\\
    ? & ? & ? & ? & ?
    \end{bmatrix}
    \begin{bmatrix}
    x\\
    \dot{x}\\
    \phi\\
    \dot{\phi}\\
    i
    \end{bmatrix} +
    \begin{bmatrix}
    ?\\
    ?\\
    ?\\
    ?\\
    ?
    \end{bmatrix}V
    [/tex]

    I can not do it for you because I do not know the details of what connects the motor shaft to the cart (I have assumed rigid interconnects). Here are some things you need to get straight before you proceed if you decide to use the state vector I have suggested:

    - How is the force applied to the cart related to the motor armature current, i?
    - How is the angular velocity of the motor shaft related to the linear velocity of the cart, x_dot?
     
  17. Mar 4, 2013 #16
    Okay, so referring to my previous post, I am getting to this point:
    [tex]
    (-\frac{L}{K}\frac{d}{dt} \dot{i} - \frac{R}{K}\frac{d}{dt}i +\frac{1}{K}\frac{d}{dt}V) = -\frac{b}{J} (-\frac{L}{K} \dot{i} - \frac{R}{K}i +\frac{1}{K}V)+\frac{K}{J}i
    [/tex]

    I can simplify this further to get the last row of the state space equation, but you can already see that the derivatives of [itex]i[/itex] don't fit into the equation:
    [tex]
    \frac{\mathrm{d}}{\mathrm{dt}}
    \begin{bmatrix}
    x\\
    \dot{x}\\
    \phi\\
    \dot{\phi}\\
    i
    \end{bmatrix} =
    \begin{bmatrix}
    0 & 1 & 0 & 0 & 0 \\
    0 & \frac{-(I+ml^2)b}{(M+m)I+Mml^2} & \frac{m^2gl^2}{(M+m)I+Mml^2} & 0 & 0\\
    0 & 0 & 0 & 1 & 0\\
    0 & \frac{-mlb}{(M+m)I+Mml^2} & \frac{(M+m)mgl}{(M+m)I+Mml^2} & 0 & 0\\
    ? & ? & ? & ? & ?
    \end{bmatrix}
    \begin{bmatrix}
    x\\
    \dot{x}\\
    \phi\\
    \dot{\phi}\\
    i
    \end{bmatrix} +
    \begin{bmatrix}
    0\\
    0\\
    0\\
    0\\
    ?
    \end{bmatrix}V
    [/tex]
     
    Last edited: Mar 4, 2013
  18. Mar 4, 2013 #17
    I'm not sure what it is you want from that equation.

    As I see it, this:
    [tex]
    \frac{\mathrm{d}}{\mathrm{dt}}i = -\frac{R}{L}i +
    \begin{bmatrix}
    \frac{1}{L} & -\frac{K}{L}
    \end{bmatrix}
    \begin{bmatrix}
    V\\
    \dot{\theta}
    \end{bmatrix}
    [/tex]

    fits perfectly well into the last row if you can express the angular velocity, theta_dot, as a function of the linear velocity, x_dot.

    Also, shouldn't the force applied to the cart affect its acceleration?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Control System Question
  1. Control system (Replies: 1)

  2. Control systems (Replies: 5)

  3. Control systems (Replies: 6)

Loading...