confusion over settings for stepper motors


Guy Brandenburg
 

We are having some difficulty getting the settings right for our stepper motors. I know this because on my desk, the RA stepper turns about twice as slow as it should (1 rotation every ~24 seconds instead of every 12 seconds that the previous drive made) and because both steppers make horrible screaming noises that rise both in pitch and in volume; the steppers eventually stop moving at all but continue with the noises when we try to slew towards any dummy target.

Here are the data:

We have two MAXesp boards that were kindly put together by George Cushing and Ken Hunter, respectively, and have NEMA23 steppers that have 200 steps per turn. We installed TMC5160 stepper drivers, and used Khaled B's spreadsheet and Ken's advice to try to set the proper parameters in CONFIG.H. 

The RA drive that we are replacing used to turn at 5 RPM when tracking. From the stepper gear to the worm gear is a 10:1 ratio, and the Byers main gear has 359 teeth. I attach what I think are the pertinent parts of our CONFIG file.

#define AXIS1_STEPS_PER_DEGREE    7977.77778  //  12800, n. Number of steps per degree: 2393    
                                              //         n = (stepper_steps * micro_steps * overall_gear_reduction)/359.0
#define AXIS1_STEPS_PER_WORMROT       16000   //      0, n. Number steps per worm rotation (PEC Eq mode only, 0 disables PEC.)   <-Req'd
                                              //         n = (AXIS1_STEPS_PER_DEGREE*360)/reduction_final_stage

#define AXIS1_DRIVER_MODEL  TMC5160_VQUIET    //    OFF, (See above.) Stepper driver model.                                  <-Often
#define AXIS1_DRIVER_MICROSTEPS       8       //    OFF, n. Microstep mode when tracking.                                        <-Often
#define AXIS1_DRIVER_MICROSTEPS_GOTO  OFF     //    OFF, n. Microstep mode used during gotos.                                     Option
#define AXIS1_DRIVER_IHOLD            OFF     //    OFF, n, (mA.) Current during standstill. OFF uses IRUN/2.0                    Option
#define AXIS1_DRIVER_IRUN             800     //    OFF, n, (mA.) Current during tracking, appropriate for stepper/driver/etc.    Option
#define AXIS1_DRIVER_IGOTO            1000    //    OFF, n, (mA.) Current during slews. OFF uses same as IRUN.                    Option
#define AXIS1_DRIVER_REVERSE          OFF     //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.   <-Often
#define AXIS1_DRIVER_STATUS           TMC_SPI //    OFF, TMC_SPI, HIGH, or LOW.  Polling for driver status info/fault detection.  Option

#define AXIS1_LIMIT_MIN              -180    //   -180, n. Where n= -90..-270 (degrees.) Minimum "Hour Angle" for Eq modes.      Adjust
                                             //         n. Where n=-180..-360 (degrees.) Minimum Azimuth for AltAzm mode.
#define AXIS1_LIMIT_MAX               180    //    180, n. Where n=  90.. 270 (degrees.) Maximum "Hour Angle" for Eq modes.      Adjust
                                             //         n. Where n= 180.. 360 (degrees.) Maximum Azimuth for AltAzm mode.

and

#define AXIS2_STEPS_PER_DEGREE   7977.77778  //  12800, n. Number of steps per degree:                                          <-Req'd
                                             //         n = (stepper_steps * micro_steps * overall_gear_reduction)/360.0

#define AXIS2_DRIVER_MODEL  TMC5160_VQUIET  //    OFF, (See above.) Stepper driver model.                                      <-Often
#define AXIS2_DRIVER_MICROSTEPS       8     //    OFF, n. Microstep mode when tracking.                                        <-Often
#define AXIS2_DRIVER_MICROSTEPS_GOTO  OFF     //    OFF, n. Microstep mode used during gotos.                                     Option
#define AXIS2_DRIVER_IHOLD            OFF   //    OFF, n, (mA.) Current during standstill. OFF uses IRUN/2.0                    Option
#define AXIS2_DRIVER_IRUN             800   //    OFF, n, (mA.) Current during tracking, appropriate for stepper/driver/etc.    Option
#define AXIS2_DRIVER_IGOTO            1000  //    OFF, n, (mA.) Current during slews. OFF uses same as IRUN.                    Option
#define AXIS2_DRIVER_POWER_DOWN       OFF   //    OFF, ON Powers off 10sec after movement stops or 10min after last<=1x guide.  Option
#define AXIS2_DRIVER_REVERSE          OFF   //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.   <-Often
#define AXIS2_DRIVER_STATUS           OFF   //    OFF, TMC_SPI, HIGH, or LOW.  Polling for driver status info/fault detection.  Option
#define AXIS2_TANGENT_ARM             OFF   //    OFF, ON +limit range below. Set cntr w/[Reset Home] Return cntr w/[Find Home] Infreq

#define AXIS2_LIMIT_MIN               -90   //    -90, n. Where n=-90..0 (degrees.) Minimum allowed declination.                Infreq
#define AXIS2_LIMIT_MAX                90   //     90, n. Where n=0..90 (degrees.) Maximum allowed declination.                 Infreq



Thanks in advance for any advice.



Khalid Baheyeldin
 

I don't know how you reached the steps per degree value that you have in Config.h
with the numbers you are quoting (GR1 = 10).

Your spreadsheet should be like this:

31,911.11111    = 200,    16,    10, 359
31,911.11111    = 200,    16,    10, 359

Go to the Online Configuration Generator, and enter those values again,
then edit the file to add the IRUN and IGOTO values, and you should be
good.

Oh, and don't use VQUIET, just QUIET will do.


Guy Brandenburg
 

Our stepper motors are still behaving badly: they squeal and scream when given a goto command, but in fact hardly move at all. The SHC thinks the mount is moving, but it's not. 

(The tracking speed appears to be correct. I have not yet tried installing these in our mount - it's 50 miles away.)

 Suggestions would be most welcome!

I made a little video of the experience, and wrote down some other details, and thanked a number of you. You can read and view information here:




          Axis1 is for Right Ascension or Azimuth            
          Axis2 is for Declination or Altitude   AXIS1_DRIVER_                 Gear Reduction    
    Stepper-Steps MICROSTEPS GR1 (Other stages) GR2 (Final stage)  
AXIS1_STEPS_PER_DEGREE 15955.55556 200 4 20 359    
AXIS2_STEPS_PER_DEGREE 15955.55556 200 4 20 359    
  <= 61200   AXIS2_DRIVER_ A planetary A worm/wheel    
      MICROSTEPS gear-box for for example.   Stepper Motor shaft speeds
AXIS1_STEPS_PER_WORMROT 16000     example.   Axis1 (RA/Azm)
            2393.3 RPM
            39.9 RPS
         Tracking resolution (in arc-sec)   8.0 kHz (full step)
      Calculated Estimate   Axis2 (Dec/Alt)
SLEW_RATE_BASE_DESIRED 2.00 °/s          Axis1 0.23 0.25 <= 1.25 2393.3 RPM
    Axis2  0.23 0.25 <= 1.25 39.9 RPS
    (servo, etc.) (stepper drive)   8.0 kHz (full step)
               
Slowest rate w/run-time adjustment  62.7 µs/step →  1°/s slew rate        
Fastest rate w/run-time adjustment  15.7 µs/step →  4°/s slew rate        
               



I have modified the spreadsheet as shown above, and the CONFIG.H as follows.
// AXIS1 RA/AZM
// see https://onstep.groups.io/g/main/wiki/Configuration-Mount#AXIS1
#define AXIS1_STEPS_PER_DEGREE 15955.55556    //  12800, n. Number of steps per degree: 2393    
                                              //         n = (stepper_steps * micro_steps * overall_gear_reduction)/359.0
#define AXIS1_STEPS_PER_WORMROT       16000   //      0, n. Number steps per worm rotation (PEC Eq mode only, 0 disables PEC.)   <-Req'd
                                              //         n = (AXIS1_STEPS_PER_DEGREE*360)/reduction_final_stage

#define AXIS1_DRIVER_MODEL  TMC5160_QUIET     //    OFF, (See above.) Stepper driver model.                                  <-Often
#define AXIS1_DRIVER_MICROSTEPS       4       //    OFF, n. Microstep mode when tracking.                                        <-Often
#define AXIS1_DRIVER_MICROSTEPS_GOTO  OFF     //    OFF, n. Microstep mode used during gotos.                                     Option
#define AXIS1_DRIVER_IHOLD            OFF     //    OFF, n, (mA.) Current during standstill. OFF uses IRUN/2.0                    Option
#define AXIS1_DRIVER_IRUN             OFF     //    OFF, n, (mA.) Current during tracking, appropriate for stepper/driver/etc.    Option
#define AXIS1_DRIVER_IGOTO            OFF     //    OFF, n, (mA.) Current during slews. OFF uses same as IRUN.                    Option
#define AXIS1_DRIVER_REVERSE          OFF     //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.   <-Often
#define AXIS1_DRIVER_STATUS           TMC_SPI //    OFF, TMC_SPI, HIGH, or LOW.  Polling for driver status info/fault detection.  Option


// AXIS2 DEC/ALT
// see https://onstep.groups.io/g/main/wiki/Configuration-Mount#AXIS2
#define AXIS2_STEPS_PER_DEGREE    15955.55556//  12800, n. Number of steps per degree:                                          <-Req'd
                                             //         n = (stepper_steps * micro_steps * overall_gear_reduction)/360.0

#define AXIS2_DRIVER_MODEL  TMC5160_QUIET   //    OFF, (See above.) Stepper driver model.                                      <-Often
#define AXIS2_DRIVER_MICROSTEPS       4     //    OFF, n. Microstep mode when tracking.                                        <-Often
#define AXIS2_DRIVER_MICROSTEPS_GOTO  OFF     //    OFF, n. Microstep mode used during gotos.                                     Option
#define AXIS2_DRIVER_IHOLD            OFF   //    OFF, n, (mA.) Current during standstill. OFF uses IRUN/2.0                    Option
#define AXIS2_DRIVER_IRUN             OFF   //    OFF, n, (mA.) Current during tracking, appropriate for stepper/driver/etc.    Option
#define AXIS2_DRIVER_IGOTO            OFF  //    OFF, n, (mA.) Current during slews. OFF uses same as IRUN.                    Option
#define AXIS2_DRIVER_POWER_DOWN       OFF   //    OFF, ON Powers off 10sec after movement stops or 10min after last<=1x guide.  Option
#define AXIS2_DRIVER_REVERSE          OFF   //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.   <-Often
#define AXIS2_DRIVER_STATUS           OFF   //    OFF, TMC_SPI, HIGH, or LOW.  Polling for driver status info/fault detection.  Option
#define AXIS2_TANGENT_ARM             OFF   //    OFF, ON +limit range below. Set cntr w/[Reset Home] Return cntr w/[Find Home] Infreq

#define AXIS2_LIMIT_MIN               -90   //    -90, n. Where n=-90..0 (degrees.) Minimum allowed declination.                Infreq
#define AXIS2_LIMIT_MAX                90   //     90, n. Where n=0..90 (degrees.) Maximum allowed declination.                 Infreq


 


Khalid Baheyeldin
 

What you are seeing is called "stalling".
Which is no movement with a high pitch sound.

The reason is that you are using 1/4 microstep, which is too coarse.
As I said earlier, you need to use 1/16, 1/32, or 1/64 only.
Lower than that you get stalling, higher than that you get torque and accuracy issues.

I also note that you change GR1 from 10:1 to 20:1.
Why did you do that? Based on what?

And it looks from the motors that you are directly coupled to the worm drive, and there
are no gear reduction pulleys.

If that is the case, you need GR1 to be 1:1.

So your spreadsheet should be:

12,764.44444    = 200,    64,    1,    359
12,764.44444    = 200,    64,    1,    359

Try again with that, and let us see if they still stall.
If they still do, then you can lower the max speed and try again.
And the stalling may be different on the bench where there is no load on the
motors, from when there is actually something to move.


Prasad
 

Khalid

GR1  is really 20:1. 10 was wrong. I was there at Hopewell with Guy and Alan when we measured the ratio by counting the teeth. 

Guy, please try changing the microsteps to 32 or 64 and let us see how it works. 

-Prasad

On Saturday, December 18, 2021, 01:59:07 PM EST, Khalid Baheyeldin <kbahey@...> wrote:


What you are seeing is called "stalling".
Which is no movement with a high pitch sound.

The reason is that you are using 1/4 microstep, which is too coarse.
As I said earlier, you need to use 1/16, 1/32, or 1/64 only.
Lower than that you get stalling, higher than that you get torque and accuracy issues.

I also note that you change GR1 from 10:1 to 20:1.
Why did you do that? Based on what?

And it looks from the motors that you are directly coupled to the worm drive, and there
are no gear reduction pulleys.

If that is the case, you need GR1 to be 1:1.

So your spreadsheet should be:

12,764.44444    = 200,    64,    1,    359
12,764.44444    = 200,    64,    1,    359

Try again with that, and let us see if they still stall.
If they still do, then you can lower the max speed and try again.
And the stalling may be different on the bench where there is no load on the
motors, from when there is actually something to move.


Khalid Baheyeldin
 

On Sat, Dec 18, 2021 at 02:24 PM, Prasad wrote:
GR1  is really 20:1. 10 was wrong. I was there at Hopewell with Guy and Alan when we measured the ratio by counting the teeth. 
The video shows the motor coupled to a worm gear.
Is that worm gear coupled to first stage of reduction?

If so, then try these first:

31,911.11111    = 200,    8,    20,    359
31,911.11111    = 200,    8,    20,    359

And if that does not work, then try this. It is beyond the upper limit of OnStep,
but may still work. Worth a try.

63,822.22222    = 200,    16,    20,    359
63,822.22222    = 200,    16,    20,    359

And as I said, maybe the motors when actually coupled to the first stage
and second stage will not stall.

Unfortunately, this is all with trial and error, and cannot be predicted upfront on paper.


Apollo Grandad (Paul)
 

Two questions:

What is the motor inductance? If high that can affect the slew moves in a negative way.

What voltage are you driving the motors with?

Try the highest voltage your drivers will allow (24V is the limit). At higher voltage torque-speed improves, that might cure the stalling.

Paul


Prasad
 

Paul

I don't know the motor inductance but I do know the driving voltage as 18 Vdc. However, the microstep setting as suggested by Khalid should be tried.  

-Prasad

On Saturday, December 18, 2021, 03:52:41 PM EST, paulh_boats via groups.io <paul3507@...> wrote:


Two questions:

What is the motor inductance? If high that can affect the slew moves in a negative way.

What voltage are you driving the motors with?

Try the highest voltage your drivers will allow (24V is the limit). At higher voltage torque-speed improves, that might cure the stalling.

Paul


Guy Brandenburg
 

I have tried all of the following settings, and with each of them, slewing fails. The pitch of the noises emitted seem to go **down** with each power of two of increase in this table. 

However, the steppers consistently don't move as they should.

Tracking seems OK. 

Axis 1 steps per wormrot; Axis Steps per degree; and Axis Driver Microsteps
16000                                 15955.555                                   4
32000                                  31911.111                                  8
64000                                  63822.222                                 16
128000                               127644.444                                 32
256000                               255288.888                                 64

More suggestions?

Guy Brandenburg,


Howard Dutton
 

At 7180:1 overall reduction ratio the NEMA23 motors may very well not be capable of reaching "useful" slew speeds.

More info. about the motors would be helpful.


kevin
 

I havn't used TMC5160s so i don't know how the currents are set, but  there doesn't seem to be any mention of what current you are driving the motors at in the later config listing . in the first one you had  driver irun and goto currents set but in the later listing they OFF ?

 


Howard Dutton
 

On Sat, Dec 18, 2021 at 02:34 PM, <kevin_kevin_kevin@...> wrote:
I havn't used TMC5160s so i don't know how the currents are set, but  there doesn't seem to be any mention of what current you are driving the motors at in the later config listing . in the first one you had  driver irun and goto currents set but in the later listing they OFF ?
And when it was set it was as ~1A or so.  I'd expect a higher setting to match up with a NEMA23 motor that is designed for running fairly fast (like a 2.8A one.)

Either way, best to look over the specs of the exact motor to see what kind slew speeds it might be good for then go from there.


Howard Dutton
 

On Sat, Dec 18, 2021 at 02:34 PM, <kevin_kevin_kevin@...> wrote:
I havn't used TMC5160s so i don't know how the currents are set,
Always must be specified in Config.h, they don't have a pot to set the current manually.


kevin
 

Maybe see what happens if you set a slower desired slew rate or i think you can reduce it at runtime if you have the app or smart hand controller.
Also are the TMC5160 drivers capable of being set to use less microstepping on a goto, no idea if that helps?


Guy Brandenburg
 

I set the first gear ratio to 1:1 instead of the prior 20:1, and set the axis driver microsteps to 64. That gave steps per degree as 12764.444 and the steps per worm rotation as 12800.

The horrible screaming is gone, and the gears (on my workbench) do appear to slew somewhere, but the tracking rate is now extremely slow - exactly 20 times slower than it should be, by my measurements.

Maybe I will try mixing and matching AXIS1_STEPS_PER_DEGREE and AXIS1_STEPS_PER_WORMROT. I guess there are only 25 such possibilities?

Guy Brandenburg, Washington, DC  http://gfbrandenburg.wordpress.com/ http://guysmathastro.wordpress.com/
============================


On Saturday, December 18, 2021, 05:05:10 PM EST, Guy Brandenburg <gfbrandenburg@...> wrote:


I have tried all of the following settings, and with each of them, slewing fails. The pitch of the noises emitted seem to go **down** with each power of two of increase in this table. 

However, the steppers consistently don't move as they should.

Tracking seems OK. 

Axis 1 steps per wormrot; Axis Steps per degree; and Axis Driver Microsteps
16000                                 15955.555                                   4
32000                                  31911.111                                  8
64000                                  63822.222                                 16
128000                               127644.444                                 32
256000                               255288.888                                 64

More suggestions?

Guy Brandenburg,


Khalid Baheyeldin
 

On Sat, Dec 18, 2021 at 07:02 PM, Guy Brandenburg wrote:
I set the first gear ratio to 1:1 instead of the prior 20:1, and set the axis driver microsteps to 64. That gave steps per degree as 12764.444 and the steps per worm rotation as 12800.
 
The horrible screaming is gone, and the gears (on my workbench) do appear to slew somewhere, but the tracking rate is now extremely slow - exactly 20 times slower than it should be, by my measurements.
That 1:1 was based on me seeing a worm gear coupled directly to the motor, and assuming that there is no second stage reduction.
But Prasad says there is indeed a 20:1 reduction, so 1:1 will not work, and that also explains why it is 20 times slower.

Maybe I will try mixing and matching AXIS1_STEPS_PER_DEGREE and AXIS1_STEPS_PER_WORMROT. I guess there are only 25 such possibilities?
No.
Don't do that.

Read Howard's replies about the motor specs, and let us know what they are.


kevin
 

Have you actually set the current to something now, what is it?
as usual i may well be wrong but isn't AXIS1_STEPS_PER_WORMROT only used for PEC? os justtry turning it off untill you get everything else sorted.
can you please attach a photo or scetch of the full setup with geartrain, i am still confused what you actually have.
early on you said the old motor was about 5 RPM, i presume that wasn't actually the tracking speed directly to the 359 tooth worm, it is abot 20 times too fast so presumably there was another gearbox in there somewhere?


Khalid Baheyeldin
 

On Sat, Dec 18, 2021 at 07:41 PM, <kevin_kevin_kevin@...> wrote:
as usual i may well be wrong but isn't AXIS1_STEPS_PER_WORMROT only used for PEC? os justtry turning it off untill you get everything else sorted.
You are right.

If someone does not have a PEC sensor, then AXIS1_STEPS_PER_WORMROT should be set to 0.


Guy Brandenburg
 

Thanks to everybody for their suggestions.

FWIW, the stepper is from StepperOnline, and appears to be their model 23HE30-2804S.

No mention of voltage on the spec sheet, which says that:

It takes 2.8 Amperes.
Resistance (no units, presumably Ohms) 1.13 +/- 10%
Inductance 5.40 +/- 20%
Holding Torque 1.85 Newton-meters or 16.38 foot-inches
Step angle 1.80
Step accuracy +/- 5%
Rotor inertia 440.00 gram-centimeters
Weight 1.10 kg (2.43 lbs)
Temperature rise Max 80C
Ambient temperature -10C to +50C
Insulation resistance 100 mega ohms
Dielectric strencgth is 500 VAC for 1 minutes
Max ambient humidity is 85%

Does it sound reasonable to add a toothed belt and gear system to partly counteract the 20:1 reduction that this scope drive has in front of the 359-tooth Byers gear?


Guy Brandenburg, Washington, DC  http://gfbrandenburg.wordpress.com/ http://guysmathastro.wordpress.com/
============================


Khalid Baheyeldin
 

On Sat, Dec 18, 2021 at 09:02 PM, Guy Brandenburg wrote:
Does it sound reasonable to add a toothed belt and gear system to partly counteract the 20:1 reduction that this scope drive has in front of the 359-tooth Byers gear?
No, adding another set of gears to compensate for the 20:1 reduction
will only result in tracking inaccuracies.

It is better to check if the 20:1 can be replaced by a more reasonable
4:1 or so easily, or it is complicated. Pictures of the actual gear
reductions would help to assess if this is feasible or not.

But for the time being, try the following:

63,822.22222    = 200,    16,    20,    359
63,822.22222    = 200,    16,    20,    359

Then set these:

#define AXIS1_DRIVER_IRUN  1400
#define AXIS1_DRIVER_IGOTO 1800

#define AXIS2_DRIVER_IRUN  1400
#define AXIS2_DRIVER_IGOTO 1800

Check if this is any better.