LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can anyone help me to solve me with Loadcell(HX711) + stepper using arduino?

Solved!
Go to solution

I really need help in this. I'm working on a project using stepper and loadcell. The scheme is stepper give some torque within a rod to a porous disk, and then the loadcell show the weight that stepper give to porous disk.

So I need to control the stepper speed and steps, and show the loadcell value. I'm using Arduino for the actuator (I attached the vi and arduino program). But it keep showing this 

brighti_0-1717251703768.png

 

I'm using this schematic for stepper and loadcell (I only use one arduino):

Episode 19.jpg

brighti_1-1717252051491.png

 

I hope you can help me with this problem. I already check the baudrate (115200)

brighti_2-1717252190048.pngbrighti_3-1717252225728.png

 

Download All
0 Kudos
Message 1 of 7
(521 Views)

A potential problem could be that Arduino communicates over the same port as you are trying to use.

 

Only one application can open a com port at the same time.

0 Kudos
Message 2 of 7
(472 Views)

oh, I see. But whenever I'm trying to run the labview it can't read the load cell. do have any example how to run the loadcell? especially using LINX?

0 Kudos
Message 3 of 7
(448 Views)

If I understand LINX correctly, it should simply be an interface between the HX711's serial port, the Arduino's serial ports, and your PC's serial port.

 

Can you rule out a hardware problem?

 

I'd first make this: Arduino with Load Cell and HX711 Amplifier (Digital Scale) | Random Nerd Tutorials work, purely on the Arduino. Then you know for sure the HW is working...

 

Next (or first) I'd try to make LINX work with a serial loopback work (connect RX and TX) on the Arrduino. Everything you send to the Arduino's serial port should be read back.

 

When both are working, you should be able to replace the loopback with the loadcell, and making it work should be a matter of correctly configuring the settings.

0 Kudos
Message 4 of 7
(425 Views)

I recommend that you search the Web for "Control Stepper Motor with Arduino".  You will probably find multiple sites that describe using NEMA 17 motors and the A4988 Driver chip.  Some also talk about using a LoadCell like the HX711.  With the A4988, pretty much all you need is the ability to create several bits of Digital Out lines to set stepper properties, one DO bit to set direction of rotation (CW/CCW), and one DO bit to generate a Pulse train that makes the motor go one step per pulse.  I'm doing this with an NI USB-DAQ device, not using an Arduino, and not using any Load Cell.

 

You can also search for "Stepper Motor and HX711" and find multiple "hits".  Maybe you can find some answers there ...

 

Bob Schor

0 Kudos
Message 5 of 7
(410 Views)

I have tried loadcell with purely arduino in IDE and yes it worked. I also tried using LIFA with HX711 library from https://forums.ni.com/t5/LabVIEW-Interface-for-Arduino/hx711-load-cell-arduino-using-LIFA/m-p/369900...

and it works, but I'm confused how to connect the loadcell and the stepper at the same time. I know this code probably wrong, can you tell me how to combine these two (the stepper and loadcell?) especially how to use only one lifa close. Whenever I want to use only one lifa close it keep showing error. Thanks before

brighti_0-1718106469791.png

 

0 Kudos
Message 6 of 7
(399 Views)
Solution
Accepted by brighti

So one close returns an error, because the top close already closed the port.

 

I'd simply delete the bottom close.

 

The wire has a reference, referring to the device (it's serial reference). It's opened once, then used, and then closed twice... It only needs to be closed once, as the top wire and bottom wire refer to the same internal reference.

 

You might run into problems when you call the device in parallel (e.g. after the event structure and below the event structure. If the device has synchronous communication (which is normal for serial devices), calling it in parallel is a good way to ruin it. There's a change this is no problem, because both VIs could use the same VI internally, and that VI might synchronize communication. It doesn't have to though...

 

TL;DR: call the device in a sequence, not in parallel.

0 Kudos
Message 7 of 7
(384 Views)