08-18-2014 09:32 AM
Did you have a look at Anti Windup behaviour of the PID
controller?
Did you find model equations and try to linearize it for
working points around the zero?
These quads seem to have nonlinear charactersitic an i'm not
sure if it can be stable without linearization.
But i'm sure one can find the model equations somewhere on the net.
08-18-2014 02:58 PM
GerdW:
Sequence frames limit parallel execution to their frames. Bad with modern CPUs…
- Use DATAFLOW to sequence steps of your algorithm. The error wire is recommended to enforce dataflow…
- You named some steps of your algorithm: use a state machine to execute your states…
-I still don't get that point:
Why is limiting parallel execution to a frame a bad thing when I want the steps to run at a specific order? isn't that exactly what I want? what is the advantage of using the error wire over a sequence frame? (I'm not trying to argue my point, I'm just trying to understand the data flow consept, because I'm obviously missing something here. coming from C programming, a sequence frame seems to be the natural thing to use)
-I'm not sure what you mean by a "state machine". do you mean writing a case structure inside of a while loop, when each case is a step in the algorithm? isn't that the same thing as using a sequence structure?
thanks again for your comment and patience 🙂
08-18-2014 05:13 PM
Consider a situation where you might like to update the Pitch and Roll control values much more often than Height, say during level flight in turbulent air, but the opposite might be true when climbing in still air. (I am not an aeronautical engineer, so that example might not be valid but it illustrates the point). With a sequence structure everything has to occur in the same order every time. With a state machine each state determines which state will run next based on the data and conditions which exist (technically these are "the state variables") at the end of the execution of the state.
Someone suggested that the behavior of the quadcopter is non-linear. A state machine makes it relatively straightforward to adapt the PID settings according to which linearized segment of the non-linear curve is currently operating.
State machines are extremely flexible when handling errors or out of range conditions, precisely because the states can execute in a different order when needed.
C programming, like most text-based languages, rely on a sequence of instructions which is determined by the position on the page (with the exception of branch instructions of course). LabVIEW relies on dataflow. The underlying principle of dataflow is that any node which has data at all its input can execute and that no data is available at the output of any node until all the code within the node has executed. A node is basically anything on the block diagram with a box around it. The simplest nodes are control terminals and constants. They do not really execute and their output data is immediately available when wth VI starts. Other nodes are functions and subVIs. Still others are for and while loops and case structures. Your sequence structure is also a node although there are a few quirks which are irrelevant to this discussion. The primary consequence of the dataflow paradigm is that LV code is inherently parallel. Each of the case structures inside the while loop in your VI can run in parallel with hte others and with the for loop. Depending on how many processors your computer has and how many processing threads can be defined by LV and the OS, these things can literally run simultaneously. Generally C cannot do that without a lot of effort on the part of the programmer.
Lynn
08-18-2014 09:04 PM - edited 08-18-2014 09:07 PM
@shayelk wrote:
GerdW:
Sequence frames limit parallel execution to their frames. Bad with modern CPUs…
- Use DATAFLOW to sequence steps of your algorithm. The error wire is recommended to enforce dataflow…
- You named some steps of your algorithm: use a state machine to execute your states…
-I still don't get that point:
Why is limiting parallel execution to a frame a bad thing when I want the steps to run at a specific order? isn't that exactly what I want? what is the advantage of using the error wire over a sequence frame? (I'm not trying to argue my point, I'm just trying to understand the data flow consept, because I'm obviously missing something here. coming from C programming, a sequence frame seems to be the natural thing to use)-I'm not sure what you mean by a "state machine". do you mean writing a case structure inside of a while loop, when each case is a step in the algorithm? isn't that the same thing as using a sequence structure?
thanks again for your comment and patience 🙂
Sequence structures slow you down in ways you wouldn't imagine. For instance, say you are making a calculation that feeds into a subVI in one of your frames. You just limited your code to waiting to do the calculation until that frame is executed when the caclulation could've been done while other things were happening. Why hamstring your code like this?
That's what they really mean when they talk about "parallel execution." You're severely limiting the myriad things LabVIEW could be doing while waiting for other stuff to get done.
08-19-2014 12:59 AM
Did you have a look at Anti Windup behaviour of the PID
controller?
Did you find model equations and try to linearize it for
working points around the zero?
I'm embarrassed to say that I actually have no Idea what Anti Windup behaviour is. I will google it though, so thanks for the idea 🙂
08-19-2014 05:00 AM
Not necessary beeing embarassed.
With anti windup you get the limits of the plant under control and
it does not become instable in the border regions.
But in yout case i think this might be a second step after finding
the region of center stability.
If the axis of the quad is fixed like in the video i see
dynamics of a rocker what the pid has to balance.
The most important question is: Is the axis stable without motors?
Then the mass is below the tipping point and it has dynamics like
a pendulum. Otherwise it might have dynamics like inverted pendulum.