LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview with LPT Encoder for gym

Hi,
I have a question about a project I'm developing on Labview. I would like to put my potentiometer attached to a barbell and take number of repetitions and average speed. At the moment my potentiometer only detects position based on time. I would like to be able to create a graph that highlights the average speed on y and on x the number of repetitions I do.

 

Anyone have any ideas?
I currently use a hardware MC Measurement Computing usb 202.

0 Kudos
Message 1 of 9
(1,978 Views)

@JacobRisk wrote:

Hi,
I have a question about a project I'm developing on Labview. I would like to put my potentiometer attached to a barbell and take number of repetitions and average speed. At the moment my potentiometer only detects position based on time. I would like to be able to create a graph that highlights the average speed on y and on x the number of repetitions I do.


Can't open that VI, still in LV20.

 

However, speed is the derivative of position. So, taking the derivative of speed (as a function of time) should give you the speed. A Derivative x(t).vi ir Derivative x(t) PtByPt.vi should do the trick.

 

Now you should have position and speed...

 

Use the position with a threshold (maybe with anti-hysteresis (Hysteresis - Wikipedia)) to store and reset the averages when a new cycle is detected.

Message 2 of 9
(1,916 Views)

wiebe@CARYA 

THANKS FOR THE REPLY.

 

I have attached a pdf in which there is a copy of the project.
I'm not sure how to enter the position threshold with hysteresis.

Can I ask you if from the pdf I shared you could reproduce a draft through LV? How should the block diagram be set up?

Clearly a png file is enough.

 

I would be grateful.

 

0 Kudos
Message 3 of 9
(1,871 Views)

Hi Jacob,

 


@JacobRisk wrote:

I have attached a pdf in which there is a copy of the project.


Which doesn't make sense as we cannot edit/debug/run images with LabVIEW…

Why don't you use AutoCleanup and "Save for previous"?

 

On your VI:

  • It also makes no sense to configure, start, stop and kill a DAQ task in each iteration of your loop! Usually you need to configure and start once before the loop and stop/kill once after the loop…
  • Why do you read a waveform when you request just a single sample?

 


@JacobRisk wrote:

I'm not sure how to enter the position threshold with hysteresis.


Once you read a sample you can compare it with your target limits - e.g. by using the InRangeAndCoeerce function…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 9
(1,856 Views)

This is my file in LV 2014.

 

 

 

 

 

 

 

 

0 Kudos
Message 5 of 9
(1,840 Views)

Hi Jacob,

 

you should have used atleast AutoCleanup before uploading the code - or even implement the suggestions…

 


@JacobRisk wrote:
I'm not sure how to enter the position threshold with hysteresis.

Use InRangeAndCoerce as said before:

Btw.:

  • When you set a SampleClock in your DAQ task then you should not use a Wait function in the loop…
  • You don't need two indicators for the very same value "Posizione"! Just make the "digital display" of the chart visible…
  • I only use WaveformComponents and IndexArray because YOU read a waveform from your ULx Read: when you want to read single samples then you should read them as single sample…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 9
(1,804 Views)

Hello, I followed your advice to create the repetitions, I see that I get only the wave-shaped position.

I put an example of an encoder that reproduces what I should do

(Minute 5.20)

Is it possible to recreate the same graph in labview?

How do I create reps with peak speed or position?

 

i try to defer the project using autocleanup and a png images

 

Download All
0 Kudos
Message 7 of 9
(1,723 Views)

Can anyone answer the question I asked in the previous post?

🙏

0 Kudos
Message 8 of 9
(1,588 Views)
@JacobRisk wrote:

Is it possible to recreate the same graph in labview?

How do I create reps with peak speed or position?


The problem is that these questions are pretty general.

 

 

@JacobRisk wrote:

Is it possible to recreate the same graph in labview?


Probably.

 

@JacobRisk wrote:

How do I create reps with peak speed or position?


So this is a problem to answer.

 

Answers range from anything like "in a shift register", "use an array" to "use actor framework" or "producer\consumer". 

 

Note that we know very little about both where you're at and where you want to be.

 

Providing a complete answer will take us a lot of time, or be fairly useless. If you have specific details that stop you from creating this, we could answer those. As it is, it's hard to know where you're stuck.

Message 9 of 9
(1,565 Views)