LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix direction ?

Greetings!
 
I am using a similar logic as attached VI for my application. That if my object have higher Position Coefficient then it is moving Right. Likewise if the Pos. Coefficient gets lower then it is moving Left. Similarly, when the object have higher height value then it is moving up, and when height gets lower then it is moving down.
 
This is my problem. Example;
If my object is for instance moving right, it will show right as the direction, and when it suddenly stops, the object swings a little but sometimes due to this swinging, the direction will change to left. I want to show and fix the last direction ignoring the swinging. This also happens on the Up/Down movement.
 
Kindly give me advise on how can I fix the direction if the object stops, so that it will tell me the direction correctly at all times.
 
Any advise I would greatly appreciate.
0 Kudos
Message 1 of 8
(1,103 Views)
Thank you very much for your kind reply. I got some idea from that Hysterisis VI's. I have revised my VI as attached. Its almost the correct VI that I want to make but there is something i cant improve yet when the object moves right.
 
If the object moves to the left, and stops, and slightly swing to the right, it will only indicate "L" led. But if the object moves to the right, and stops, and slightly swing to the left, it will indicate "L" led at first but then it will indicate "R" finally. How can i correct the last ?
0 Kudos
Message 3 of 8
(1,085 Views)

Hello,

It sounds like you need to find some detectable distinction between the "slight swinging" motion, and the usual motion, so that you can detect that the "slight swinging" motion has occurred, and correct for it.  Or it could simply be that you need to increase the amount of histeresis, to account for a slightly larger "swingback" when the object moves to the right.  The bottom line is, if you have the data to determine that this slight motion is occurring, and you would like to ignore it, or correct for it, then you just need to find a characteristic or metric which is unique for that kind of motion relative to the rest of the object's motion - then you simply check for that characteristic whenever relevant to detect, and correct for, the swingback motion you're trying to get around.

Best Regards,

JLS

Best,
JLS
Sixclear
0 Kudos
Message 4 of 8
(1,059 Views)

JLS,

Thank you for your reply and the helpful comments. In the VI that i made (attached on the previous post) I tried to increase the amount of hysterisis. I think this will fix the problem. I just need to determine the swingback and the actual hysterisis (shift register) that i need to put.

But looking on my VI, moving to the Left, even there is slight swingback will not change the direction. It will still show Left. Which means the swingback is not big enough that it did not change the direction. 

But if moving right, and there was a slight swingback it will show Left at first but eventually show Right direction. Smiley Sad

How can I correct the last? Is there a priority in the case struture when we are putting each other on top?

Thank you in advance.

0 Kudos
Message 5 of 8
(1,030 Views)

Hello,

No problem, and I wish I could be more specific, but we're talking in very vague terms here - I have no idea what your data looks like, and therefore cannot specifically tell you how to implement your desired functionality.  What I can give you is ideas about how to attack the problem, from which you can look at your specific data, and develop an algorithm for determining your swingback conditions.  You asked:

"How can I correct the last? Is there a priority in the case struture when we are putting each other on top?"

That really depends on what your data looks like - you need to distinguish that "swingback" condition - perhaps it's as simple as "looking for" a R-L or L-R transition in a short period of time.  If that kind of transition doesn't happen quickly at any other time, then it would be an indicator you could use to detect and correct for the swingback.  You're going to have to look at your data, and determine a condition which defines the swingback - and that can only be done by you with your data.

If you run into problems with LabVIEW or have more questions, feel free to post them here, but I don't think there's enough information here to give you a greater level of specificity on how to proceed.

Best Regards,

JLS

Best,
JLS
Sixclear
0 Kudos
Message 6 of 8
(1,006 Views)
Hi.
 
I am always grateful to the forum. Comments, new ideas, suggestions from experienced people is helping me a lot.
 
I will look deeply on my data and will distinguish the proper functionality. Thanks a lot.
 
best regards,
 
bong
0 Kudos
Message 7 of 8
(990 Views)
Hello,
 
Still feel free to post again if you're having trouble - it's only that without having more specific information about the data you have to perform the analysis on, it's hard to be more specific about how to achieve it.  If you have trouble but can post a sample of the data, showing which part of the data indicates the "swingback," we can try to give you some more ideas about how to "pick that out" or your streaming data.
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 8 of 8
(973 Views)