• Luís Moreira
  • Junior Member
  • Posts 3
  • Reputation 0
  • Member Since
  • Last Active
  • Name Luís Moreira
    This user has not added any photos yet.
All Posts Topics Started Likes
Programming Problem

Hi,
I'm programming the arduino for the project I've shared and I have a problem with the delay of the load cell, because I used a while fuction to stop the motor only when the value that I want be reach. Because of this, the value is reading in steps and the motor also runs in steps.

This is the code:

#include <AccelStepper.h>
#include <MultiStepper.h>

// Load cell Setup

#include "HX711.h"

#define calibration_factor 80000.0 //This value is obtained using the SparkFun_HX711_Calibration sketch
#define zero_factor 38154 //This large value is obtained using the SparkFun_HX711_Calibration sketch

#define DOUT  3
#define CLK  2

HX711 scale(DOUT, CLK);

long loadvalue; // Used to store the clamping load value


// Stepper Setup


AccelStepper stepper(4, 8, 9, 10, 11);
//

void setup() {
  Serial.begin(9600);

  // Set the parameters for the Load Cell
  scale.set_scale(calibration_factor); //This value is obtained by using the SparkFun_HX711_Calibration sketch
  scale.set_offset(zero_factor); //Zero out the scale using a previously known zero_factor

  // Set Max Speed
  stepper.setMaxSpeed(1000.0);
  stepper.setSpeed(500);
 

}

void loop() {
     
   while (scale.get_value() < 1){
    stepper.runSpeed();
   }
}  
 
If you could help me, i'll be very happy!

Luís Moreira
Portugal 

0 0
Automating a machine using arduino

Yes, because I need forces arround 1400 N, I have a four 50kg load cells from a scale and a NEMA 23 with 1,2 Nm 24V 4A coupling to a ball screw to move the carriage. The other motor it's a NEMA 17 with 0,4 Nm, because I do not need very torque.

What is the best way to move the motors? Perhaps using the function move() and create 2 variables one read by the load cell and the other read by a keypad, and when equal stop the motion.

I'm sorry for some beginner questions, but I know how should the program worked but it's still very difficult to convert in arduino programming.

Best regards,
Luís Moreira

0 0
Automating a machine using arduino
I'm automating a machine using arduino. The machine has two pitch motors (vertical and horizontal), a load cell and a device that only needs to be switched on and off. The operation will be as follows:
- The horizontal pitch motor is activated until it reaches a certain distance entered by the user.
Then the vertical pitch motor is driven and moves a carriage that will at some point exert a force on the load cell, when it reaches the force that the user chose the motor must stop.
- After this the device is switched on for a certain time and then it is switched off and all the motors must back off.

My big question is to make the engine stop when it reaches the force that the user of the equipment selected.

They could help me and even carry out a tutorial with load cells to do a scale.

Yours sincerely,
Luís Moreira
0 0
count post selected

Add a Website Forum to your website.