Sampling data


Richards

Recommended Posts

My project is to built a shock absorber dynamometer

The load of the shock will be capture by a S type load cell that will be represent in lbs on the Y on the graph,

The stroke of the shock will be capture by a rod displacement sensor that will represent the velocity vs time on the X on the graph,

The 2 sensors will be capture with a labjack u3-hv

Is it something doable.

I include a picture of the graph .

Capture d’écran_20221031_213311.png

Link to comment
Share on other sites

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

Absolutely.  Many people have done very similar applications.  Just collect the two data points from the LabJack at the same data rate and create a graph that plots Force vs Velocity.  Just make sure and set the bottom axis type to Lin instead of Date/Time so that it becomes an XY graph instead of a trend graph.

Link to comment
Share on other sites

  • 2 weeks later...

We do not recommend using the HX711 with the U3 unless you are familiar with serial protocols or want to learn more about working with low level digital communications. The HX711 uses what seems to be its own special serial protocol for communications. It does not appear to be a standard serial protocol, we do not directly support the serial protocol it uses, so it could require more attention to the low level communication details than other devices.

An alternative amplifier could be our LJTick-InAmp:
https://labjack.com/products/ljtick-inamp

Are you using a breakout board, and if so could you please provide a link to its documentation? I think that there are a couple of different HX711 breakout boards, and the wiring might vary slightly depending on which one you are using.

Link to comment
Share on other sites

This is the breakout board , but if the  LJTick-InAmp would be more appropriate ,i will go for it.

i am very novice in programation.

Description:

- The Load Cell is breakout board for the HX711 IC that allows you to easily read load cells to measure weight.
- By connecting the to read the changes in the resistance of the load cell and calibration you’ll be able very accurate weight measurements.
- This creating your own industrial scale, process control, or simple presence .
- The HX711 uses wire interface (Clock and Data) .
- Any ’s GPIO pins should numerous libraries have been written making to read data from the HX711.

Specification:

- Automatic reset circuit
- Simple digital control and serial communication: All are controlled by input pins, the chip registers without programming
- Selectable output of 10Hz or 80Hz
- Simultaneous rejection of 50Hz and 60Hz power interference
- Power consumption (including circuit): Typical operating current:
- Operating voltage range: 2.6 ~ 5.5V
- Operating temperature range: -20 ~ + 85 ℃



 

Capture d’écran_20221114_213526.png

Link to comment
Share on other sites

For the HX711 breakout, the color line side is all connections the load cell. That is described in the hookup guide here: https://learn.sparkfun.com/tutorials/load-cell-amplifier-hx711-breakout-hookup-guide?_ga=2.112634116.1828129323.1668558706-926891264.1636485443&_gac=1.127184639.1668558706.CjwKCAiAjs2bBhACEiwALTBWZQ17wY2q-S72-lITy9etdzRgpVlqs6s0DTZPlVHxjDIrFQ3UMMBlhBoCRYgQAvD_BwE#hardware-hookup-

VCC could be connected to one of the DAC outputs set to 3.3V on the U3, GND to GND on the U3, then finally DAT and CLK to any of the digital IO such as FIO4 and FIO5. We have not tested with this board, but I suspect that the serial protocol could be implemented using our SPI feature, configuring the SPI clock to the CLK DIO pin and DAT to the MISO DIO pin. Both of those are configurable in software. From there, you should be able to clock out the necessary pulses to CLK by setting the number of bytes transfered. Some related SPI info:
https://labjack.com/pages/support?doc=/datasheets/u3-datasheet/4110-spi-serial-communication-u3-datasheet/

 

If the SPI feature does not work well enough to handle the HX711 protocol, it might be possible to implement the protocol by using AddRequest calls to the DIO states directly, and putting small delays between them using the wait IOType as documented in the following pseudocode:
https://labjack.com/pages/support?doc=/datasheets/u3-datasheet/4114-miscellaneous-u3-datasheet/

 

Link to comment
Share on other sites

You will need to create a global variable or channel to hold the tare weight.  A variable should work fine.  In a sequence marked Auto-Start put:

global tareOffset = 0

Then create a conversion for your weight channel:

Value - tareOffset

Then apply that conversion to your weight channel.

Finally, in your button for setting the Tare, create a Quick Sequence action and put:

tareOffset = (myWeightChannel + tareOffset)

where myWeightChannel is the name of the channel you applied the conversion to.

 

Link to comment
Share on other sites

No, I mean a variable.  See 5.10 in the user's guide.  Its just a place to store a value, kind of like a channel, but simpler.

As for the sequence, create a new one (5.2 in the user's guide).  Call it, say, "StartUp", and then make sure it is marked Auto-Start (5.22 in the user's guide).

Link to comment
Share on other sites

 In a sequence marked Auto-Start i have put :global tareOffset = 0

Then create a conversion :Value - tareOffset

Then create a Quick Sequence action and put: tareOffset = (myWeightChannel + tareOffset)

 

As soon  i make the conversion , the weight channel on the graph is stuck to 0

before i hit the tare weight button.

i dont understand :''Then create a conversion for your weight channel''

and     ''Then apply that conversion to your weight channel''

i all ready have a conversion for the weight channel, do i have to create a second one.                         

Link to comment
Share on other sites

Again, I really need to see your complete document, though I am guessing you just have typos.  I see one right in your StartUp sequence where you called the variable tareOff, but then the next line reference it as TareOffset.  Computers aren't smart enough to recognize that one is short for the other, and truthfully, having computers think for themselves in this way is a bad thing, especially in programming.  DAQFactory is not case sensitive, so tareOffset and TareOffset are the same, but tareOff and tareOffset are two completely different names.  

Also, "Value" is only valid inside a conversion, so line 2 of your startup sequence is incorrect.

The button component looks fine as long as you rename the variable as I already mentioned.

Link to comment
Share on other sites

The easiest way is to clear the history of both channels:

myChannelX.clearHistory()
myChannelY.clearHistory()

Do this from the action of a button.

A better way is to create a variable that holds the start of the run, and then subset from that variable to the current time.  So in an auto-start sequence put something like:

global graphStartTime = systime()

Then, in your trend graph where you are plotting X vs Y (I am assuming) change your Y Expression to:

myYChannel[graphStartTime,systime()]

and your X Expression to:

myXChannel[graphStartTime,systime()]

Then, in the button to reset the graph, put:

graphStartTime = systime()

This can then be extended to make the graph stop updating with a graphEndTime variable.

There are several other ways to do this as well depending on your end goal.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.