02-24-2023 09:15 AM
I have a linear motor with an encoder.
I would like to change the direction of a linear motor using the threshold function.
In output I have the counter value and the counter direction.
If the value is >0 and <1.000, it goes in one direction... If the value is <1.000, it goes in the opposite direction.
How can I apply this, using Labview?
Thank you.
02-24-2023 12:14 PM
@Uniali wrote:
If the value is >0 and <1.000, it goes in one direction... If the value is <1.000, it goes in the opposite direction.
It cannot go in both directions if the value is <1.000. Please explain.
02-26-2023 09:32 AM
I made a mistake... I should have written:
If the value is >0 and <1.000, it goes in one direction... If the value is >1.000, it goes in the opposite direction.
02-26-2023 10:16 AM - edited 02-26-2023 10:21 AM
It helps to define the problem fully. For example:
Where should it go if the value is zero or negative?
If the first value is 0.5, which direction should it go?
If the first value is 1.5, should it reverse direction or travel towards the valid range?
If it overshoots slightly and the value is >1 twice in a row, should it reverse twice (getting stuck at the limit forever)?
Could it be you simply want it to reverse whenever it hits one of the limits?
02-26-2023 10:42 AM
We don't know the limits yet, but we know that it has to go one way and then the other way really really fast... so we thought to apply the threshold function to it.
02-26-2023 11:13 AM
@Uniali wrote:
We don't know the limits yet, but we know that it has to go one way and then the other way really really fast... so we thought to apply the threshold function to it.
Sorry, none of this is useful information.
02-27-2023 03:23 AM - edited 02-27-2023 03:24 AM
I have a linear motor connected to an encoder. This motor should go in one direction until the counter value of the encoder reaches a certain value, for example, 1000. Then once it reaches this position, it should reverse direction until for example a value of 500. The motor should do this movement cyclically. I need to apply this motor to a test bench to simulate the heartbeat. How can I do it?
02-27-2023 03:26 AM
What code have you got so far?
How are you reading the encoder value?
Once you can read the encoder value, you can apply a T/F state to the direction.
02-27-2023 03:30 AM
This is an example of the code, I'm using myRio to read the encoder.
02-27-2023 03:34 AM
I explain you better...
I have a linear motor connected to an encoder, using myrio.
This motor should go in one direction until the counter value of the encoder reaches a certain value, for example, 1000. Then once it reaches this position, it should reverse direction until for example a value of 500. The motor should do this movement cyclically.
I need to apply this motor to a test bench to simulate the heartbeat.
How can I do it?