Understanding Digital State Space Control to Sensors and Actuators"

In summary: 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?Augmenting the matrices together results in a higher order system.
  • #1
NeuralNet
24
0
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?
 
Engineering news on Phys.org
  • #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."
 
  • #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.
 
  • #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?
 
  • #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.
 
  • #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:
  • #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:
  • #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:
  • #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]
 
  • #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:
  • #11
The variable θ 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.

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]
 
  • #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:
  • #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.
 
  • #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:
  • #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?
 
  • #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:
  • #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?
 

Related to Understanding Digital State Space Control to Sensors and Actuators"

1. What is digital state space control?

Digital state space control is a method of controlling a system using digital signals. It involves using sensors to measure the current state of the system and actuators to adjust the system's state based on the desired outcome. This allows for precise and efficient control of the system.

2. Why is understanding digital state space control important?

Understanding digital state space control is important for anyone working with systems that require precise and efficient control. This includes fields such as engineering, robotics, and automation. It allows for the design and implementation of effective control systems that can improve performance and productivity.

3. What are sensors and actuators in the context of digital state space control?

Sensors are devices that measure physical quantities, such as temperature, pressure, or position, and convert them into digital signals that can be processed by a computer. Actuators, on the other hand, are devices that can adjust the state of a system based on digital signals. They can be motors, valves, or any other devices that can produce physical changes in the system.

4. How does digital state space control differ from analog control?

Digital state space control differs from analog control in that it uses digital signals to measure and adjust the system's state, whereas analog control uses continuous signals. Digital control offers more accuracy and flexibility, as well as the ability to process and analyze data from multiple sensors in real-time.

5. What are some examples of applications for digital state space control?

Digital state space control can be used in a wide range of applications, including industrial automation, robotics, aerospace and aircraft control, and medical devices. It is also commonly used in home automation systems, such as smart thermostats and security systems. Basically, any system that requires precise and efficient control can benefit from digital state space control.

Similar threads

Replies
2
Views
1K
  • Electrical Engineering
Replies
4
Views
1K
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
11
Views
1K
Replies
14
Views
2K
  • Advanced Physics Homework Help
Replies
12
Views
1K
Replies
7
Views
290
  • Engineering and Comp Sci Homework Help
Replies
6
Views
1K
Back
Top