Problems with AccelStepper on ESP8266 with DM860A and Nema 34 1600oz/in



  • Hi All,

    I am currently setting up a carriage positioning system using a Nema 34 1600oz/in with a DM860A driver at 60 volts.

    I am using an ESP8266 (Wemos D1 r2) to operate the DM860A

    When using th2 Wemos the stepper is not running smoothly at all it seems to be skipping steps or
    having an harmonic like beat at regular intervals.

    Since we just received this drive, I suspected that It might be faulty.

    I then verified it using the breakout board and Mach3

    With mach3 i have no problem at all I can run the motor a any reasonable speeds

    Questions:
    1- (Given the DM860A has its interface inputs rated for 5 volts)
    and since I am using the pulse - and dir - as opposed of pul+ and dir+
    thus syncing voltage.
    Is it necessary to use a logic level shifter to interface my esp8266 to the driver
    (I am assuming not)
    2- I have tried to adjust the minPulseWidth (no change)
    3- I have tried to setPinsInverted(true,true) and false, false (no change)
    4- Can i expect my stepper driver & motor to run as smoothly as when paired to mach3 through the breakout board

    References
    DM860A same as DM860h from leadshine url=http://www.leadshine.com/UploadFile/Down/MA860Hm.pdf
    The esp8266 was used to achieve 37kHz here https://groups.google.com/forum/#!topic/accelstepper/0FS0ZowR3WE

    here is the very simple code I am testing with

    /*
    Stepper Motor Control - speed control

    /*
    microstep driver DM860A
    Pul+ goes to +5V
    Pul- goes to Arduino Pin 9 D7 on Wemos D1
    Dir+ goes to +5V
    Dir- goes to to Arduino Pin 8 D6 on Wemos D1
    Enable+ to nothing
    Enable- to nothing
    */

    byte direcPin = D6;
    byte pulsePin = D7;

    #include <AccelStepper.h>

    // Define a stepper and the pins it will use
    AccelStepper stepper(1, pulsePin, direcPin);

    void setup()
    {
    stepper.setMinPulseWidth(3);
    stepper.setMaxSpeed(5000.0);
    stepper.setAcceleration(1000.0);
    stepper.setPinsInverted(false,false);
    stepper.setPinsInverted(true,true);
    stepper.moveTo(100000);
    }
    void loop()
    {

    // Change direction at the limits
    if (stepper.distanceToGo() == 0)
        stepper.moveTo(-stepper.currentPosition());
    stepper.run();
    

    }

    Some pictures of the hardware 3_1492088405613_DSCN0744-1.JPG 2_1492088405613_DSCN0743-1.JPG 1_1492088405613_DSCN0742-1.JPG 0_1492088405613_DSCN0741-1.JPG



  • Hello @Franck63

    if I understand it correctly the driver has an optocoupler input interface.

    In general, 5V is not good with the Wemos device.
    You should either use a simple open collector interface from Wemos to the driver, similar to the description of "Connections to open-collector signal (common-anode)"

    Or it might even work with the 3.3V.
    Connect DIR- and PUL- to GND, connect DIR+ and PUL+ to the "+5V". Please double check before, if my assumption of the input is correct. It would be similar to the "Connection to PNP signal (common-cathode)" description.
    7th Dwarf


Log in to reply
 

Looks like your connection to WEMOS Forum was lost, please wait while we try to reconnect.