04-27-2015 05:18 AM - edited 04-27-2015 05:20 AM
Good morning everyone,
I am using LabVIEW for CAD/CAM purposes, and the aim of my program is to control a trajectory along several consecutive straight lines defined by its corner points (x and y coordinates).
My program uses only mathematical equations (parametric equations) and I am using a simulate signal (time normalization) between 0 and 1. To perform the straight lines my idea is to replace the position of the points and, at the same time, invert the time (from 0 to 1 to 1 to 0) - please see the attached image - and so on.
Because I am a new Labview user, I would like to know it this point replacement is in fact possible, and also how to invert the time normalization.
Hope to have been the clearest as possible.
Thanks you very much in advance.
04-27-2015 05:51 AM - edited 04-27-2015 05:53 AM
Hi fgoulao,
I would like to know it this point replacement is in fact possible
Yes.
how to invert the time normalization.
You can assign any value you like to your "variable" t…
Why do you want to "invert" t in your equations? When you apply a linear interpolation those "ups and downs" are handled by the sign/direction of your vectors between the points…
04-27-2015 03:45 PM
Cheers,
The inversion of the variable t (time) is made with the purpose of having a continuous time signal and also to allow us to replace only one of the two points when a segment is finished.
Thus, I need to know how to invert these variable, and also how to replace the points, "automatically", in the block diagram window. I suppose that some loops will have to be used.
Although this is a mathematical problem, my inexperience using Labview makes me wonder how to perform such an apprach.
Perhaps, the attached note can help you understand to understand what I exactly would like to do in Labview.
Thank you very much,
Francisco
04-27-2015 05:48 PM
04-28-2015 12:46 AM - edited 04-28-2015 12:48 AM
Hi Francisco,
so why don't you use the formula given in your PDF, just after "Indeed … is the same…"? You need to replace your variable t by x, where x is the result of the equation (1-t)!
Yes, it is just a mathematical problem and all you have to do is applying some (very basic) math operation…
04-28-2015 05:35 AM
Good morning,
The difficult "thing" for me to do under Labview, since I am a new user, is the loop. I mean, I have to implement a loop where: WHEN a value of input signal EQUAL 0 OR 1, it REPLACES the first of the two points by a new one.
This red-highlighted words are the mechanisms I would like to know how to do. I have tried to find them out and implement them by myself, as well, but without success.
At least, I think the most difficult part for me is the replacement, as I do not know which Labview functionality allows me to do this.
Sorry for being insistent.
Many thanks,
Francisco Goulão
04-28-2015 05:41 AM - edited 04-28-2015 05:41 AM
Hi Francisco,
the words "WHEN condition THEN do" usually (aka "in most programming languages") are translated to "IF-THEN-ELSE".
This is not a LOOP, it's a CASE structure:
IF value == 0 OR value ==1 THEN first_point := new_point ENDIF