04-30-2020 04:14 AM
Hi all, I am a student currently using LabView and I am tasked to create a 3D simulation which is something I am not experienced in. However, after looking through some examples supplied by NI on 3D graphics I was able to create some semblance of a 3D Mobile Robot.
But my issue comes is that I do not really understand how to create "movement" of the robot. Currently, the movement of the Robot is by moving its axis using the translation vi. The issue is that I want to use speed instead of axis because if I were to put 0 as a value, the 3D model will just reset its axis instead of staying on the spot.
Is there a way I can solve this issue? The project file is attached in case you want an example.
Solved! Go to Solution.
04-30-2020 06:38 AM
Hi,
@JosiahTham wrote:
The issue is that I want to use speed instead of axis
So you want to be able to change the speed of motion ?
Why changing the speed constant into a control isn't what you want ? And then you don't even need the boolean and the select VI
There must be something I am misunderstanding...
Yddet
04-30-2020 09:08 AM
If you remember your Freshman Calculus (boy, am I dating myself -- I should have said "High School Calculus"), you will recall that Speed (really, velocity) is the derivative of position, approximated by "Change in position per (small) Change in Time". LabVIEW is one of the few Programming Languages that has Time as a "real" part of the language (see the Timing Palette on the Block Diagram). It has a While Loop inside of which you could put a "Wait" function to "clock" the Loop, it even has a "Timed Loop" (which is better used in Real-Time OS environments, rather than in Windows). So if you want to move at a speed of, say, K units/sec (e.g. K meters/sec, or K °/sec for a rotation), you could set your Loop clock to, say, 10 ms and each time through the loop add K * 0.01 sec units to your current position. Because Position is changing each step through the Loop, you want to keep it in a Shift Register, so on entering the Loop, you wire in Initial Position (to initialize the Shift Register), then inside the Loop, you use the current value, update it by K * dt (where dt is your Time interval, such as 0.01 sec), and store it in the Shift Register for the next time through the Loop.
If you are still having problems, attach your VI (or VIs) (no pictures, please) and someone will probably help.
Bob Schor
05-01-2020 01:49 AM
Hi Yddet,
Sorry for the confusion what you are currently seeing is just controlling using a button to move front, back, left and right. This was meant to test how to move 3D objects. However, in the actual simulation, I am supposed to be using speed instead to move the 3D Robot but I have no clue on how to do it. Hopefully, it clears it up.
05-01-2020 01:53 AM
Hi Mr Schor
Thank you for your response. I will try my best to use your answer as a reference. However, I am still a bit fresh to LabVIEW so if I have any queries I will posting so more. But for now, thank you for your response I really appreciate it!
Josiah Tham