Slew Speed


dougthomas408-1@yahoo.com
 

Hi all,

I just got my setup working and I'm wondering if there is a way to increase the slew speed. I have increased the rate from 2 up to 8 on the config.h file, but the motor only seems to rotate about 1 or 2 rotations per second. I am not certain, but would expect the motor to be capable of higher speeds. I also increased the acceleration distance up to 15 degrees on config.h file, thinking it might help, but the speed seems to remain the same. Is there something that I am missing here? Any insight would be appreciated.

My setup:
Motors: Nema 17 Stepper Motor 1.5A 12V 45Ncm (63.74oz.in) 4-Lead. 1.8 degree
Board: WeMos R32 with CNC V3 Shield
Stepper driver: LV8729 4-layer PCB Driver, max driver current of 1.8A
Power supply: 12 volts
Gear ratio 1 (GR1): 3:1 belt drive
Gear ratio 2 (GR2): RA 144/1, Dec 120/1
Microsteps: 1/128

Thanks


Mike Ahner
 

On Wed, Apr 27, 2022 at 05:16 PM, dougthomas408-1@... wrote:
Microsteps: 1/128

Hi Doug,

It's not just about the mechanical ability of the motors to turn faster, it's also about the mpu's ability to calculate correct step pulses and issue them at the microsecond timing require to track. 

Because you're using 128 microsteps, the mpu is likely maxed out, Onstep calculates the max speed possible given your config.h desired speed, but adjusts downward to allow for the background overhead of calculating positions in the sky. Some boards/gear ratio, microstep combinations won't go much faster than 1~2 deg per second. Try changing steps to 64 or even 32, more is unlikely to produce any improvement you can see or measure.

You can also change the STEP_WAVE_FORM from SQUARE TO PULSE which usually will give good improvements in speed.
From the Config.h:
#define STEP_WAVE_FORM             SQUARE // SQUARE, PULSE Step signal wave form faster rates. SQUARE best signal integrity.


 

Yes, taken that we have similar setup, I can confirm You that with your current setup (MCU, gear ratio and motors) and with SQUARE wave form these are expected max GoTo speed:

1/128 microstepping = max goto speed ~1.75 deg/sec
1/64  microstepping = max goto speed ~2.5 deg/sec
1/32  microstepping = max goto speed ~5 deg/sec

With PULSE waveform just multiply further by factor of 1.6. So you have options: first to change STEP_WAVE_FORM to PULSE and then to reduce microstepping if you need even greather speed.

And one more thing, for drivers which supports native 1/256 interpolation there is no practical benefits from going more than 1/32 microstepping, but I think LV8729 are not capable of that. For otpimal speed vs resolution you should switch to 0.9 deg/step motors and drivers which supports interpolation for instance TMC2209 which you then run in smaller microstepping mode like 1/32...


Drew 🔭📷🚴‍♂️
 

How are you controlling OnStep? A common beginners misconception is that OnStep starts with the Max Speed available. For safety reasons, it does not. Depending on what version of OnStep you are using, it may start with the minimum speed or the 1X speed.

If you are using the Webserver this can be changed on the setup tab. The Android App has it under “Goto Speed” and the SHC has it under Setting/Configuration, "GoTo Speed".

OnStep can remember the max setting. Set "SLEW_RATE_MEMORY" to ON in the config file.


dougthomas408-1@yahoo.com
 

Excellent. I appreciate the responses... I wondered if there was a tradeoff in microstepping but couldn't find anything that suggested it would affect the speed. Thanks for the help.



On Wednesday, April 27, 2022, 06:56:00 PM EDT, Vladimir <cyberianice@...> wrote:


Yes, taken that we have similar setup, I can confirm You that with your current setup (MCU, gear ratio and motors) and with SQUARE wave form these are expected max GoTo speed:

1/128 microstepping = max goto speed ~1.75 deg/sec
1/64  microstepping = max goto speed ~2.5 deg/sec
1/32  microstepping = max goto speed ~5 deg/sec

With PULSE waveform just multiply further by factor of 1.6. So you have options: first to change STEP_WAVE_FORM to PULSE and then to reduce microstepping if you need even greather speed.

And one more thing, for drivers which supports native 1/256 interpolation there is no practical benefits from going more than 1/32 microstepping, but I think LV8729 are not capable of that. For otpimal speed vs resolution you should switch to 0.9 deg/step motors and drivers which supports interpolation for instance TMC2209 which you then run in smaller microstepping mode like 1/32...


dougthomas408-1@yahoo.com
 

I use the Android app. I will double check the speed setting. Thanks.



On Wednesday, April 27, 2022, 07:13:36 PM EDT, Drew 🔭📷🚴‍♂️ <drewbolce@...> wrote:


How are you controlling OnStep? A common beginners misconception is that OnStep starts with the Max Speed available. For safety reasons, it does not. Depending on what version of OnStep you are using, it may start with the minimum speed or the 1X speed.

If you are using the Webserver this can be changed on the setup tab. The Android App has it under “Goto Speed” and the SHC has it under Setting/Configuration, "GoTo Speed".

OnStep can remember the max setting. Set "SLEW_RATE_MEMORY" to ON in the config file.


 

In Android App, GoTo speed can be adjusted from 0.5x/0.75x/1x/1.5x/2x in application menu, which appears when you tap on three dots in top right part of main activity.


George Cushing
 

Yes, but is it doing that while slewing? It should be going to full steps to slew. At a base rate of 3 we get:

Axis1 (RA/Azm)
216.0 RPM
3.6 RPS
0.7 kHz (full step)
Axis2 (Dec/Alt)
180.0 RPM
3.0 RPS
0.6 kHz (full step)

0.7-0.6kHz is not too much to ask of an ESP32. It should be able to handle a base rate of 5 (µs/step →  2.5°/s → 10°/s slew rate). 

Now what's 128 µsteps/full step, 25,600? Yes, that's µsteps/rotation of the motor or 76,800 per rotation of the worm (RA)? That advances the axis 2.5° of arc. The fastest rate w/run-time adjustment of 3° base rate gets us a 6°/s slew rate. That assumes full steps or 1.4kHz pulse rate. To attain that we need 35,840 PPS or 2,150,400 PPM. At 240mHz the ESP32 is willing, but the driver may and motor will not be.

How do you have the driver wired? You need to have a dedicated pin for MS1, 2 and 3 to shift between modes.

image.png

Additionally, the default CNCv3 pinmap doesn't include MS3 except as an output.

// Axis1 RA/Azm step/dir driver
#define Axis1_EN             12     // Enable [must be low at boot 12]
#define Axis1_M0             32     // Microstep Mode 0 or SPI MOSI
#define Axis1_M1             33     // Microstep Mode 1 or SPI SCK
#define Axis1_M2             15     // Microstep Mode 2 or SPI CS
#define Axis1_M3           Aux2     // SPI MISO/Fault, Aux2 defined pin 18
#define Axis1_STEP           26     // Step
#define Axis1_DIR            16     // Dir
#define Axis1_DECAY    Axis1_M2     // Decay mode
#define Axis1_HOME         Aux3     // Sense home position

Thus you need an instruction to pull pin 18 LOW for slewing. Unless pin Aux2 is pulled high by default I doubt you even are running 128 µsteps. Get TMC2130s. Dump the 1.8 step angle motors and get 400s. Run TMC stealthChop tracking.