LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pendulum simulation

hello, i need help with making pendulum simulation. i made a block diagram but i would like a gauge needle to work as a pendulum. i wan't to make it possible for the person to click on the place on gauge where the needle needs to go and than as a pendulum come back in the initial position. i'm new at working with labview and don't know which functions to use to make this work. thanks a lot..
0 Kudos
Message 1 of 7
(4,972 Views)

Hi shangaj.bejbi,

How does your block diagram work?  Do you calculate numerical values to represent the position of the pendulum?  If so, it should be fairly simple to have the needle move as a pendulum.

I have developed a very small VI that somewhat imitates a pendulum (written in LabVIEW 8.0 so it will open with all later versions as well).  Without going through all the physics and developing an algorithm, this VI simply waits for you to click somewhere on the gauge and then increments or decrements the value by 1 until passing zero and then gets stuck bouncing between two points.

Basically, the VI resets the gauge needle to point to a default value (0) and continuously reads the value of the gauge control.  Once you click somewhere on the gauge, the next time through the loop, this value is read and passed to the control by use of the Value property node of the gauge.  If you are calculating numerical values to represent the pendulum’s motion, this should go a long way in getting you started.  If this does not help, please let me know more about the implementation of your algorithm and we will work on getting this up and running for you.

Donovan
0 Kudos
Message 2 of 7
(4,928 Views)
unfortunately, i have labview 7.1 and can not open your solution. that's the only version available at my collage. could you please send me a PrtSc of your solution so i could try to make it at labview 7.1? the block diagram and the front panel. i would be very grateful if you did that. tnx a lot for your help. i hope it's not a problem.
0 Kudos
Message 3 of 7
(4,917 Views)
The block diagram I made is a solution of the differential equations that I wrote. The most simple one is the one I attached for you below ( I took out the radius and mass variable because I don't have a load (hope you understand me :)) . But I do not know how to put the gauge in the sheme so that the angle is the variable that defines its behavior nor how to initialize that in my front panel. Also, I've tried to compare the angle with initial conditions to be stop the simulation but I didn't know how to do that in LabView and couldn't find anything similar on the web.
0 Kudos
Message 4 of 7
(4,910 Views)
I made a small adjustment to your VI.  To set the angle by clicking on the gauge, the gauge must be a control.  What the program now does, is takes the angle set by clicking on the gauge and then starts the simulation.  The gauge is updated by writing the output of your differential equations to the Value property node of the gauge.
 
I'm not sure what you would like to do with the initial conditions.  Could you be more specific?  Let me know if you have any other questions.
Donovan
0 Kudos
Message 5 of 7
(4,862 Views)
Hello, I was able to look at your solution without any diff. equations involved and it is much more simple then this one. Now things are much clearer to me. The only problem with this solution that you just sent me is that I would like for the needle to stop in zero. So, I want it to come to my initial condition at the end of the simulation(which is -0.995 here (theta init), also I added g= 9,81 and l=1). But this doesn't happen here. Am I right? How could I solve this problem? I would be very greatfull if you could answer me as soon as possible if you read my post because I'm trying to solve this all evening and can't figure it out on my one. Thanks for your help, Sanja

Message Edited by shangaj.bejbi on 12-04-2007 06:20 PM
0 Kudos
Message 6 of 7
(4,857 Views)
I just noticed that the angle probably comes to zero but the simulation doesn't last long enough? Once again, thank you. No more questions. Bye
0 Kudos
Message 7 of 7
(4,849 Views)