Thread cutter project doesn't work for me

Good morning everyone
I state that I have little experience with arduino nano but on the net I found this project very interesting, I tried to quickly make the various connections between arduino and the nextion display and between arduino and the stepper motor driver but nothing works if I give the start command nothing goes from the display can anyone help me, even the libraries included in the sketch in my ide are not all there but when I program arduino nano everything works
https://electricdiylab.com/diy-arduino-based-wire-cutting-machine/
Here the code

#include <Stepper.h>
#include <Arduino.h>
#include "BasicStepperDriver.h"
#include "MultiDriver.h"
#include "SyncDriver.h"
#include <SoftwareSerial.h>
#include <Servo.h>
//SoftwareSerial mySerial(2, 3); // RX, TX
Servo myservo;
int A = 0;
int B = 0;
int state = 0;
String message;
int QTY, numMessages, endBytes;
byte inByte;
int flag = 0;
int C=0;
float D=0;
int E=0;
int Start = 22;
int End = 31;

#define MOTOR_STEPS 200
#define DIR_X 7
#define STEP_X 4
#define DIR_Y 6
#define STEP_Y 3
#define MICROSTEPS 16
#define MOTOR_X_RPM 50
#define MOTOR_Y_RPM 200

BasicStepperDriver stepperX(MOTOR_STEPS, DIR_X, STEP_X);
BasicStepperDriver stepperY(MOTOR_STEPS, DIR_Y, STEP_Y);
SyncDriver controller(stepperX, stepperY);

void setup()
{
numMessages, endBytes = 0;
myservo.attach(10);

Serial.begin(9600);
//mySerial.begin(9600);
stepperX.begin(MOTOR_X_RPM, MICROSTEPS);
stepperY.begin(MOTOR_Y_RPM, MICROSTEPS);
myservo.write(Start);
delay(2000);

}

void loop()
{

data();

if (A > 0 && B > 0 && C > 0) {
delay(2000);

for (int i = 0; i < C; i++){
controller.move(A25, 0 );
delay(500);
controller.rotate(0, 360 );
delay(500);
controller.move(B
25, 0 );
delay(500);
controller.rotate(0, 360 );
delay(500);
controller.move(A*25, 0 );
delay(500);
myservo.write(End);
delay(500);
controller.rotate(0, 360 );
delay(500);
myservo.write(Start);
delay(500);
Serial.print(i);
}
A=0;
B=0;
C=0;
}

}

void data() {
if (state == 0) {
if (numMessages == 1) { //Did we receive the anticipated number of messages? In this case we only want to receive 1 message.
A = QTY;
Serial.println(A);//See what the important message is that the Arduino receives from the Nextion
numMessages = 0; //Now that the entire set of data is received, reset the number of messages received
state = 1;
}
}

if (state == 1) {
  if (numMessages == 1) { //Did we receive the anticipated number of messages? In this case we only want to receive 1 message.
    B = QTY;
    Serial.println(B);//See what the important message is that the Arduino receives from the Nextion
    numMessages = 0; //Now that the entire set of data is received, reset the number of messages received
    state = 2;
  }
}

if (state == 2) {
if (numMessages == 1) { //Did we receive the anticipated number of messages? In this case we only want to receive 1 message.
C = QTY;
Serial.println(C);//See what the important message is that the Arduino receives from the Nextion
numMessages = 0; //Now that the entire set of data is received, reset the number of messages received
state = 0;
}
}

if (Serial.available()) { //Is data coming through the serial from the Nextion?
  inByte = Serial.read();

  // Serial.println(inByte); //See the data as it comes in

  if (inByte > 47 && inByte < 58) { //Is it data that we want to use?
    message.concat(char(inByte)); //Cast the decimal number to a character and add it to the message
  }
  else if (inByte == 255) { //Is it an end byte?
    endBytes = endBytes + 1; //If so, count it as an end byte.
  }

  if (inByte == 255 && endBytes == 3) { //Is it the 3rd (aka last) end byte?
    QTY = message.toInt(); //Because we have now received the whole message, we can save it in a variable.
    message = ""; //We received the whole message, so now we can clear the variable to avoid getting mixed messages.
    endBytes = 0; //We received the whole message, we need to clear the variable so that we can identify the next message's end
    numMessages  = numMessages + 1; //We received the whole message, therefore we increment the number of messages received.

    //Now lets test if it worked by playing around with the variable.

  }
}

}

Please read the forum guide in the sticky post at the top of most forum sections. That will tell you what you need to post in order for the forum to help, and how to post it. Right now your post is breaking forum rules, please edit and fix it.

Forgive me Paul, I didn't understand what to do

What do you mean "everything works"?

I mean that at the end of the compilation it doesn't give me errors and tells me loading completed

Did you install all these libraries?

"BasicStepperDriver"
"MultiDriver"
"SyncDriver"

Did you use the same exact components that were used in the video?
Did you connect everything according to the wiring diagram?

I downloaded the stepper motor library which includes :
basicstepperdriver
Multidrivers
syncdriver
I checked the electrical connections several times and they are correct, I tried to rewrite the arduino and now if I press start the motor starts but vibrates and doesn't turn

Are you using a 12V 10A power supply?

yes

Is it possible that I'm using the wrong library?

Can you post a picture of how you have everything connected.

of course at this moment it's all on a breadboard I'm fixing the connections to make them clearer from photography

You still don't. You put the code in quote tags, not code tags.

Great. Can you please also produce a wiring diagram? Don't link to it, re-post it.

I solved the problem, it was the nema 23 motor that works with a voltage of 24 volts and not 12 volts I replaced the motor with a smaller one that works at 12 volts and now everything works correctly, I advise anyone who wants to make this project to take a 24 volt power supply then to make a pcb with a 7812 to transform the voltage from 24 to 12 to power the arduino nano and the 12v servomotor and to power the display take from the gnd and the 5v pin of the arduino.
thank you all

I have another question, do you think the servo that is used is digital? Surely it works at a voltage of 12 volts seen the connection from the diagram

What servo? If you are referring to your off site link, most people won't follow those.

I'm not very knowledgeable about the forum and please forgive me for my forum rules errors. It is the servo that drives the thread into the cutter

The forum introductions are painstakingly written to address that specific situation. I don't blame anyone for posting errors, but explanations don't change the reasons why it is important to follow them. It's simply a practical need. So instead of referring me to an unknown thread and cutter, please

  • read the introduction
  • post the necessary information

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.