I'm driving a NEMA34 bipolar stepper motor with the following specifications:

  1. Holding torque 5.9 Nm
  2. Step angle 1.8°
  3. Resistance / phase 0.33±10% Ω
  4. Inductance / phase 3.00±20% mH
  5. Max load axial 65 N
  6. Max load radial 200 N


It is being driven by a DM860 leadshine with an output current of 1.0 - 7.2A , and an input voltage of 24 - 80 VDC (http://www.sah.co.rs/media/sah/techdocs/dm860h_manual.pdf). I have the driver configured with 24V power supply,PNP signals control signal conector and using a microstep of 4 (800 pulses / rev). I tried to create a code with ramp up and ramp down by following this example (joan answer) https://raspberrypi.stackexchange.com/questions/26216/how-to-generate-smooth-frequency-ramp

This is an example of my code:

import time

import pigpio

def working(longLoop):

    dirrection = 21

    pi = pigpio.pi()

    pi.set_mode(GPIO, pigpio.OUTPUT)


    # build initial ramp


    for delay in range(START_DELAY, FINAL_DELAY, -1):
       wf.append(pigpio.pulse(1<<GPIO, 0,       delay))
       wf.append(pigpio.pulse(0,       1<<GPIO, delay))


    # add lots of pulses at final rate to give timing lee-way


    # add after existing pulses

    offset = pi.wave_get_micros()

    print("ramp is {} micros".format(offset))

    wf.append(pigpio.pulse(0, 0, offset))

    for i in range(100):
       wf.append(pigpio.pulse(1<<GPIO, 0,       FINAL_DELAY))
       wf.append(pigpio.pulse(0,       1<<GPIO, FINAL_DELAY))


    wid1 = pi.wave_create()

    # short waveform to repeat final speed


    wf.append(pigpio.pulse(1<<GPIO, 0,       FINAL_DELAY))
    wf.append(pigpio.pulse(0,       1<<GPIO, FINAL_DELAY))


    wid0 = pi.wave_create()

    #ramp down


    for delay in range(FINAL_DELAY,START_DELAY):
       wf.append(pigpio.pulse(1<<GPIO, 0,       delay))
       wf.append(pigpio.pulse(0,       1<<GPIO, delay))


    wid2 = pi.wave_create()

    # send ramp, stop when final rate reached


    time.sleep(float(offset)/1000000.0) # make sure it's a float







The problem is, with my code, the stepper motor cannot move around 2000 rpm (my stepper motor moves lower than 2000 rpm). If I set the FINAL_DELAY lower than 155 the stepper motor would be lose the step motion and starts to vibrate. So what's the problem in my code? Thank you!

so this is my switch setup

enter image description here

SW1 = on SW2 = on SW3 = on

  • \$\begingroup\$ It might not be something wrong with your code! At high speeds, step motors develop an instability and lose synchronism. At some RPM every driver will be unable to maintain the currents that they do at low speeds. That is when the trouble begins..... \$\endgroup\$ Oct 16, 2018 at 2:59
  • \$\begingroup\$ @whitegreg56 then what should I do to make my stepper motor can move in 3000 RPM \$\endgroup\$ Oct 16, 2018 at 7:18
  • \$\begingroup\$ What are your switch settings? \$\endgroup\$ Oct 17, 2018 at 1:41
  • \$\begingroup\$ @whitegreg56 switch current table SW1 = off SW2 = off SW3 = off \$\endgroup\$ Oct 19, 2018 at 7:31
  • \$\begingroup\$ From your photo, it looks to me like SW1, SW2, SW3 are ON! \$\endgroup\$ Oct 19, 2018 at 17:29

2 Answers 2


The factor that controls step motor stability at high speed is the effective resistance seen by the back-EMF looking out of the motor and back into the driver. When the driver is "active" the resistance looking back into it will be large.....and, the motor stable. By selecting the minimum current the driver will stay "active" at higher speeds than if a larger current was selected (you have already selected the minimum current!).

The other thing that MIGHT help is to increase the pulses per revolution to 1600. Then, the driver has a brief time to go "active" as the current crosses near zero. This would not take place if the driver was full stepping....and, then the motor would be unstable.

If this doesn't work, you may have to increase the supply voltage, as noted in the first answer.


A spinning stepper motor acts as an alternator; a voltage whose magnitude is proportional to RPM (called back-electromotive force or back-EMF) gets induced in the windings. The driver has to output more voltage the faster the motor spins to overcome this back-EMF, or the current will decrease.

Torque is directly proportional to the current, so eventually the motor hits a maximum speed where the generated torque is less than the load torque and sync is lost:

characteristic curve

You may need to further increase the supply voltage to the driver to go faster. The motor is rated for up to 60 V.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.