LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Linear motor: change direction with threshold function

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.

0 Kudos
Message 1 of 15
(3,001 Views)

@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.

0 Kudos
Message 2 of 15
(2,974 Views)

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.

0 Kudos
Message 3 of 15
(2,937 Views)

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?

0 Kudos
Message 4 of 15
(2,926 Views)

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.

 

0 Kudos
Message 5 of 15
(2,909 Views)

@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.

0 Kudos
Message 6 of 15
(2,898 Views)

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?

 

0 Kudos
Message 7 of 15
(2,896 Views)

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. 

0 Kudos
Message 8 of 15
(2,891 Views)

luna30_0-1677490182732.png

This is an example of the code, I'm using myRio to read the encoder. 

0 Kudos
Message 9 of 15
(2,887 Views)

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?

 

example.jpeg

0 Kudos
Message 10 of 15
(2,878 Views)