0.3 degree offset at 1030 steps... (esp32)

34 views
Skip to first unread message

Мини ТПА

unread,
Dec 20, 2025, 7:01:10 AM (2 days ago) Dec 20
to accelstepper
At 1030 steps, there's a 0.3 degree shift, and at 1040 steps, everything returns to 0.
Maybe someone has encountered similar problems?


IMG_20250418_121708.jpg
#include "AccelStepper.h" // esp32

AccelStepper stepper4(AccelStepper::FULL2WIRE, 23, 27); // 4_A
bool en;

void setup()
{
    stepper4.setMaxSpeed(25000);
    stepper4.setAcceleration(25000);
}
void loop()
{
 
en = 1;

if (en == 1)  
    {
        stepper4.setMaxSpeed(25000); //4_ A
        stepper4.setAcceleration(25000);
        stepper4.runToNewPosition(1030); //                         ??????? 1040 ??????
        delay(50);

        stepper4.runToNewPosition(0);
        stepper4.setCurrentPosition(0);
        delay(50);
    }    
 }

Jim Larson

unread,
Dec 20, 2025, 4:29:32 PM (2 days ago) Dec 20
to accelstepper
Welcome to the Accelstepper Forum!
When I know more, I can perhaps ask better questions, but here's a start.
- What driver board exactly are you using? The only reference I can find for "x42_v1.3" is in Chinese, which I cannot read.
- The comment in the code implies you are using an esp32. Correct? What version?
- Why are you using the FULL2WIRE and not the DRIVER interface type? Markings on the board show STP and DIR. You might try using this interface type.
- Are you using microstepping? If so, what ratio?
- Have you tried using lower step rates? You could try 2500 and even 250 and see if the problem persists.

I look forward to knowing more about your driver board, stepper motor, and microcontroller. In the mean time, try the things suggested and let me know what happens.

                  -jim
Message has been deleted
Message has been deleted
Message has been deleted

Мини ТПА

unread,
Dec 21, 2025, 6:26:27 AM (yesterday) Dec 21
to accelstepper
Hi Jim!
Thanks for your reply!
I'm not sure I understand the difference  FULL2WIRE and DRIVER .....?   The step and direction driver works.
Yes, the Chinese driver has a magnetic encoder and displays an error, but with a different driver, the motor also shifts on odd numbers (1030). When set to 1040, the motor returns to 0 correctly.
Board  ESP32-38pin
I changed the microswitch, speed, acceleration, and step loss...
I don't have access to the machine at the moment, but I'll test the DRIVER mode next week.
Sorry for my English! )
Best regards, Andre!

Jim Larson

unread,
Dec 21, 2025, 8:13:22 PM (11 hours ago) Dec 21
to accelstepper
Hi Andre -

The FULL2WIRE is designed to hook directly to the A and B sides of the motor and generate the pulses and phase needed to move the motor. The interface is assumed to be a dual H-Bridge. 
The DRIVER is designed to provide step and direction signals to the interface. The interface drives the dual H-Bridge. 
Since your interface is clearly intended to receive step and direction signals, I'm not sure what will happen when the FULL2WIRE is used. I'm eager to hear what happens when you try the DRIVER. We'll both learn something, I expect.
Do you have a data sheet for your interface board? If so, perhaps you can post a link to it.

Your English is very good, by the way! Don't worry.

                       -jim

                    -
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages