LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW simple pendulum simulation

Hi GregTheEgg,

 


@gregTheEgg wrote:

I asked about how to use labview for the 5th time.


Where did you ask that? You just answered smitty

Where's your "original comment" mentioned here?

 

When it comes on "how to use LabVIEW" then my answer, given 3 years ago, still is valid: do the "Training" courses as offered at the top of the LabVIEW board…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 21 of 52
(2,539 Views)

@gregTheEgg wrote:

I don't believe I asked about trig. I asked about how to use labview for the 5th time.


Can we assume that you are the same "Greg" as 3 years ago, just with a new profile? That would help us to see more context.

If this is correct, you had 3 hours of LabVIEW training back in 2018. Did anything change since?. 

Your (?) original post was tagged with "LabVIEW NXG".  Are you still using NXG or did you switch to classic LabVIEW?

 

As you obviously noticed, the problem has two parts:

 

  • Fully understanding the math, independent of any programming language.
  • Implementing the math in the programming language of you choice. Since you are posting here, we assume you want to use LabVIEW. I agree that LabVIEW is a great choice to do pure math and simulation (my examples), but as with any programming language, you need to have some basic skills and understanding of specifics such  as dataflow and architecture.

Unfortunately we have absolutely no idea where you are stuck and very specific questions would help.

 

Some hints:

  • Obviously, the simulation should run for a long time, so you need a toplevel while loop.
  • Since regular timing is involved, you need to define the loop rate, for example with a small wait function.
  • From the loop rate and [i], you can calculate elapsed time from first principles.
  • All you need to do is implement the given formulas based on time and the other parameters (length, mass, damping, etc.). Have you worked out the math?
  • As I said, using complex datatype will somewhat simplify the problem because instead of two linked variables (x, and y vs. time), you reduce the problem to one variable (angle vs time) with r=constant. The nice thing is that xy graphs in LabVIEW directly understand complex numbers, so if you create an array of two complex points A&B  (A:(0,0) and (B) the result of your calculation), you get a graphical representations of your pendulum basically for free (make sure that the x and y axes have the same range and size (no auto-scale) to avoid distortions).
  • Let us know how far you get.

 

0 Kudos
Message 22 of 52
(2,532 Views)

@altenbach wrote:
As I said, using complex datatype will somewhat simplify the problem because instead of two linked variables (x, and y vs. time), you reduce the problem to one variable (angle vs time) with r=constant. The nice thing is that xy graphs in LabVIEW directly understand complex numbers, so if you create an array of two complex points A&B  (A:(0,0) and (B) the result of your calculation), you get a graphical representations of your pendulum basically for free (make sure that the x and y axes have the same range and size (no auto-scale) to avoid distortions).

As a very simplified example, here's a "pendulum" in zero gravity, no damping, and with a constant rotation speed.

 

All you need is to substitute the more complicated formulas that include gravity, mass, length, and damping. The code skeleton can stay the same 😄

 

altenbach_0-1640800510248.png

 

 

0 Kudos
Message 23 of 52
(2,522 Views)

Hi Altenbach,

 

thanks, that demo is what we're after to get started.

 

Because the uni recycles this challenge each year, the students search for clues, that is, anything pendulum related, in this forum. And I am the same Greg, the thread might make more sense now: I couldn't find my old password and I was only here out of curiosity because I get asked by the current students of the year if I sussed this problem out because of my initial inquirey.

 

But genuinely, thanks for the detailed info, it'll definitely be of use to them in the future, unless they change the challenge now, of course

 

gregTheEgg_0-1640814310983.png

 

 

Message 24 of 52
(2,508 Views)

Hi,

im currently doing that project right now but I’m struggling to implement damping to the model. When I do I get a linear zig zag shape, I’ve kept the maximum value for damping coefficient 1 . I’ve also used the equation with exponential in, but formulated the equation from the calculator which I’ve put in a case structure. However I’ve noticed that the e value isn’t continuous. Is there any way I can damp the pendulum model without using calculus as we haven’t been taught it yet. 

0 Kudos
Message 25 of 52
(2,345 Views)

It is difficult to tell what you are doing wrong without seeing what you are doing. Your description is way too ambiguous.

0 Kudos
Message 26 of 52
(2,271 Views)

@Plasma46 wrote:

Hi,

im currently doing that project right now but I’m struggling to implement damping to the model. When I do I get a linear zig zag shape, I’ve kept the maximum value for damping coefficient 1 . I’ve also used the equation with exponential in, but formulated the equation from the calculator which I’ve put in a case structure. However I’ve noticed that the e value isn’t continuous. Is there any way I can damp the pendulum model without using calculus as we haven’t been taught it yet. 


Calculus isn't needed.  Humans have been using the 7 basic tools since shortly after the invention of the Screw.  A basic understanding of math and the scientific process will help!  What hypothesis are you looking from and what is the experiment design to disprove it?

 

Or, elsewise stated, we cannot tell you what you have done wrong until you show us what you have done

 

what you have done is probably wrong or, you wouldn't be stuck would you?


"Should be" isn't "Is" -Jay
0 Kudos
Message 27 of 52
(2,233 Views)

I have this same issue, I actually hand replicated one of the code skeletons from a previous reply however its not as polished and I also need to implement dampening AND gravity, preferably in an optional way where I can turn either on and off. I have actually tried some methods but none have worked and I have since removed them from my code.

 

File is below.

0 Kudos
Message 28 of 52
(1,946 Views)

Hey Altenbach,

 

How do you substitute the more complicated formulas that include gravity, mass, length, and damping as I have clue how to do it.

0 Kudos
Message 29 of 52
(1,881 Views)

@Afzan1 wrote:

 as I have clue how to do it.


If you already have a clue, just follow it!

0 Kudos
Message 30 of 52
(1,864 Views)