LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pid controlled quadcopter steadies then oscillates again

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.

 

Message 11 of 16
(570 Views)

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 🙂

0 Kudos
Message 12 of 16
(547 Views)

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

Message 13 of 16
(539 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 14 of 16
(531 Views)

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 🙂

0 Kudos
Message 15 of 16
(516 Views)

Not necessary beeing embarassed.Smiley Happy

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.

 

 

 

0 Kudos
Message 16 of 16
(502 Views)