Slew problem


wa1vta01452
 

I have posted about this before. The DEC is running much slower than RA in slew mode using my laptop with ascom. I had changed EVERYTHING in the hardware twice now with no success. This morning I set up for bluetooth with the Android app and lo and behold, the DEC slewed just fine this time. I wonder if someone can take a look at my config.h to see where there may be an issue. I left off all below axis 2 since I am not using anything below that. The mount is a G11 and I am set up with TMC2130s with the 4 soldered jumpers.
Thanks,
Tom

// This configuration was automatically generated using the Online Configuration Generator
// Authored by: Khalid Baheyeldin
// Slewing Speed: 2.17 degrees/second (estimated)
// Generated on: 2021-03-04 13:41
// ---------------------------------------------------------------------------------------------------------------------------------
// Configuration for OnStep
 
/*
 *          For more information on setting OnStep up see http://www.stellarjourney.com/index.php?r=site/equipment_onstep 
 *                      and join the OnStep Groups.io at https://groups.io/g/onstep
 * 
 *           *** Read the compiler warnings and errors, they are there to help guard against invalid configurations ***
*/
 
// ---------------------------------------------------------------------------------------------------------------------------------
// ADJUST THE FOLLOWING TO CONFIGURE YOUR CONTROLLER FEATURES ----------------------------------------------------------------------
// <-Req'd = always must set, <-Often = usually must set, Option = optional, Adjust = adjust as req'd, Infreq = infrequently changed
 
// PINMAP ---------------------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#PINMAP
//   *** See the matching Pins.xxx.h file for your setup (found by looking in src/pinmaps/Models.h) with detailed information ***
//   *** to be sure it matches your wiring.            *** USE AT YOUR OWN RISK ***                                           ***
 
//      Parameter Name              Value   Default  Notes                                                                      Hint
#define PINMAP                        CNC3 //    OFF, Choose from: MiniPCB, MiniPCB2, MaxPCB, MaxPCB2, STM32Blue,             <-Req'd
                                          //         Ramps14, MaxESP2, MaxESP3.  Check Constants.h for more info.
 
// SERIAL PORT COMMAND CHANNELS ------------------------------------ see https://onstep.groups.io/g/main/wiki/6-Configuration#SERIAL
#define SERIAL_A_BAUD_DEFAULT        9600 //   9600, n. Where n=9600,19200,57600,115200 (common baud rates.)                  Infreq
#define SERIAL_B_BAUD_DEFAULT        9600 //   9600, n. See (src/HAL/) for your MCU Serial port # etc.                        Option
#define SERIAL_B_ESP_FLASHING         OFF //    OFF, ON Upload ESP8266 WiFi firmware through SERIAL_B with :ESPFLASH# cmd.    Option
#define SERIAL_C_BAUD_DEFAULT         ON //    OFF, n, ON for ESP32 Bluetooth.                                               Option
#define SERIAL_C_BLUETOOTH_NAME  "OnStep" // "On..", Bluetooth device name for ESP32.                                         Option
 
// MOUNT TYPE -------------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#MOUNT_TYPE
#define MOUNT_TYPE                    GEM //    GEM, GEM for German Equatorial, FORK for Equatorial Fork, or ALTAZM          <-Req'd
                                          //         Dobsonian etc. mounts. GEM Eq mounts perform meridian flips.
 
// USER FEEDBACK -------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#USER_FEEDBACK
#define LED_STATUS                     OFF //     ON, Blinks w/sidereal tracking otherwise steady on indicates activity.       Option
#define LED_STATUS2                   OFF //    OFF, ON Blinks 1s interval w/PPS sync, steady for gotos, off if in standby.   Option
#define LED_RETICLE                   OFF //    OFF, n. Where n=0..255 (0..100%) activates feature sets default brightness.   Option
#define BUZZER                        OFF //    OFF, ON, n. Where n=100..6000 (Hz freq.) for piezo speaker. ON for buzzer.    Option
#define BUZZER_STATE_DEFAULT          OFF  //    OFF, ON Start with piezo buzzer/speaker enabled.                              Option
 
// TIME AND LOCATION -------------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#TLS
#define TIME_LOCATION_SOURCE          OFF //    OFF, DS3231 (I2c,) DS3234 (Spi,) TEENSY (T3.2 internal,) or GPS source.       Option
                                          //         Provides Date/Time, and if available, PPS & Lat/Long also.
#define SerialGPS                     Serial3
#define SerialGPSBaud                 9600
 
// SENSORS -------------------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#SENSORS
// * = also supports ON_PULLUP or ON_PULLDOWN to activate MCU internal resistors if present.
#define WEATHER                       OFF //    OFF, BME280 (I2C 0x77,) BME280_0x76, BME280_SPI (see pinmap for CS.)          Option
                                          //         BMP280 (I2C 0x77,) BMP280_0x76, BMP280_SPI (see pinmap for CS.)
                                          //         BME280 or BMP280 for temperature, pressure.  BME280 for humidity also.
                                          
#define TELESCOPE_TEMPERATURE         OFF //    OFF, DS1820, n. Where n is the DS1820 s/n for focuser temperature.            Adjust
 
#define HOME_SENSE                    OFF //    OFF, ON*. Automatically detect and use home switches. For GEM mode only.      Option
#define HOME_SENSE_STATE_AXIS1       HIGH //   HIGH, State when clockwise of home position, as seen from front. Rev. w/LOW.   Adjust
#define HOME_SENSE_STATE_AXIS2       HIGH //   HIGH, State when clockwise of home position, as seen from above. Rev. w/LOW.   Adjust
                                          //         Signal state reverses when travel moves ccw past the home position.
 
#define LIMIT_SENSE                   OFF //    OFF, ON* limit sense switch close to Gnd stops gotos and/or tracking.         Option
#define LIMIT_SENSE_STATE             LOW //    LOW, For NO (normally open) switches, HIGH for NC (normally closed.)          Adjust
 
#define PEC_SENSE                     OFF //    OFF, ON*, n, sense digital OR n=0 to 1023 (0 to 3.3V or 5V) analog threshold. Option
#define PEC_SENSE_STATE              HIGH //   HIGH, Senses the PEC signal rising edge or use LOW for falling edge.           Adjust
                                          //         Ignored in ALTAZM mode.
 
#define PPS_SENSE                     OFF //    OFF, ON* enables PPS (pulse per second,) senses signal rising edge.           Option
                                          //         Better tracking accuracy especially for Mega2560's w/ceramic resonator.
 
// ST4 INTERFACE ------------------------------------------------------ see https://onstep.groups.io/g/main/wiki/6-Configuration#ST4
// *** It is up to you to verify the interface meets the electrical specifications of any connected device, use at your own risk ***
#define ST4_INTERFACE                 OFF //    OFF, ON, ON_PULLUP enables interface. <= 1X guides unless hand control mode.  Option
                                          //         During goto btn press: aborts slew or continue meridian flip pause home
#define ST4_HAND_CONTROL              OFF //    OFF, ON for hand controller special features and SHC support.                 Option
                                          //         Hold [E]+[W] btns >2s: Guide rate   [E]-  [W]+  [N] trk on/off [S] sync
                                          //         Hold [N]+[S] btns >2s: Usr cat item [E]-  [W]+  [N] goto [S] snd on/off
#define ST4_HAND_CONTROL_FOCUSER      OFF //    OFF, ON alternate to above: Focuser move [E]f1 [W]f2 [N]-     [S]+            Option
 
// GUIDING BEHAVIOUR ---------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#GUIDING
#define GUIDE_TIME_LIMIT                0 //      0, No guide time limit. Or n. Where n=1..120 second time limit guard.       Adjust
#define GUIDE_DISABLE_BACKLASH        OFF //    OFF, Disable backlash takeup during guiding at <= 1X                          Option
 
// TRACKING BEHAVIOUR -------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#TRACKING
#define TRACK_AUTOSTART               OFF //    OFF, ON Start with tracking enabled.                                          Option
#define TRACK_REFRACTION_RATE_DEFAULT OFF //    OFF, ON Start w/atmospheric refract. compensation (RA axis/Eq mounts only.)   Option
#define TRACK_BACKLASH_RATE            25 //     25, n. Where n=2..50 (x sidereal rate) during backlash takeup.               Option
                                          //         Too fast motors stall/gears slam or too slow and sluggish in backlash.
 
// SLEWING BEHAVIOUR ---------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#SLEWING
#define SLEW_RATE_BASE_DESIRED        2.0 //    1.0, n. Desired slew rate in deg/sec. Adjustable at run-time from            <-Req'd
                                          //         1/2 to 2x this rate, and as MCU performace considerations require.
#define SLEW_RATE_MEMORY              ON //    OFF, ON Remembers rates set across power cycles.                              Option
#define SLEW_ACCELERATION_DIST        8.0 //    5.0, n, (degrees.) Approx. distance for acceleration (and deceleration.)      Adjust
#define SLEW_RAPID_STOP_DIST          2.5 //    2.0, n, (degrees.) Approx. distance required to stop when a slew              Adjust
                                          //         is aborted or a limit is exceeded.
 
// PIER SIDE BEHAVIOUR -------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#SYNCING
#define MFLIP_SKIP_HOME               OFF //    OFF, ON Goto directly to the destination without visiting home position.      Option
#define MFLIP_PAUSE_HOME_MEMORY       ON //    OFF, ON Remember meridian flip pause at home setting across power cycles.     Option
#define MFLIP_AUTOMATIC_MEMORY        ON //    OFF, ON Remember automatic meridian flip setting across power cycles.         Option
 
#define PIER_SIDE_SYNC_CHANGE_SIDES   ON //    OFF, ON Allows sync to change pier side, for GEM mounts.                      Option
#define PIER_SIDE_PREFERRED_DEFAULT  EAST //   BEST, Stays on current side if possible. EAST or WEST switch if possible.      Option
 
// PARKING BEHAVIOUR ---------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#PARKING
#define STRICT_PARKING                OFF //    OFF, ON Un-parking is only allowed if successfully parked.                    Option
 
// MOTION CONTROL -------------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#MOTION
#define STEP_WAVE_FORM             SQUARE // SQUARE, PULSE Step signal wave form faster rates. SQUARE best signal integrity.  Adjust
 
// Stepper driver models (also see ~/OnStep/src/sd_drivers/Models.h for additional infrequently used models and more info.): 
// A4988, DRV8825, LV8729, S109, SSS TMC2209*, TMC2130* **, and TMC5160* ***
// * = add _QUIET (stealthChop tracking) for example "TMC2130_QUIET"
// ** = SSS TMC2130 if you choose to set stepper driver current (in mA) set Vref pot. 2.5V instead of by motor current as usual.
// *** = SSS TMC5160 you must set stepper driver current (in mA) w/ #define AXISn_TMC_IRUN (IHOLD, etc.)
 
// AXIS1 RA/AZM
// see https://onstep.groups.io/g/main/wiki/6-Configuration#AXIS1
#define AXIS1_STEPS_PER_DEGREE    48000.0 //  12800, n. Number of steps per degree:                                          <-Req'd
                                          //         n = (stepper_steps * micro_steps * overall_gear_reduction)/360.0
#define AXIS1_STEPS_PER_WORMROT     48000 //  12800, n. Number of steps per worm rotation (PEC Eq mode only:)                <-Req'd
                                          //         n = (AXIS1_STEPS_PER_DEGREE*360)/reduction_final_stage
 
// Configured for G11 with 16:60 pulley gearing and 1/32 microstepping
 
#define AXIS1_DRIVER_MODEL            TMC2130  // TMC2130_QUIET //    OFF, (See above.) Stepper driver model.                                      <-Often
#define AXIS1_DRIVER_MICROSTEPS       32 //    OFF, n. Microstep mode when tracking.                                        <-Often
#define AXIS1_DRIVER_MICROSTEPS_GOTO  8 //    OFF, n. Microstep mode used during gotos.                                     Option
#define AXIS1_DRIVER_IHOLD            600 //    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            900 //    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           OFF //    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.
 
// AXIS2 DEC/ALT
// see https://onstep.groups.io/g/main/wiki/6-Configuration#AXIS2
#define AXIS2_STEPS_PER_DEGREE    48000.0 //  12800, n. Number of steps per degree:                                          <-Req'd
                                          //         n = (stepper_steps * micro_steps * overall_gear_reduction)/360.0
 
#define AXIS2_DRIVER_MODEL            TMC2130  //  TMC2130_QUIET //    OFF, (See above.) Stepper driver model.                                      <-Often
#define AXIS2_DRIVER_MICROSTEPS       32 //    OFF, n. Microstep mode when tracking.                                        <-Often
#define AXIS2_DRIVER_MICROSTEPS_GOTO  8 //    OFF, n. Microstep mode used during gotos.                                     Option
#define AXIS2_DRIVER_IHOLD            600 //    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            900 //    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          ON //    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

 


 

CNCv3 in combination with SPI drivers? Disable and disconnect GPS and see what's happening


wa1vta01452
 

Hi Vladimir, I am not using GPS and I have it commented out. Still the same action...DEC is low.


 

What does mean DEC axis is slow? Is it pointing where it should, regardless of speed?


wa1vta01452
 

It does not point right and when slewing it runs about a third of the speed of the RA.


kevin
 

From your config you have
AXIS1_STEPS_PER_DEGREE       48000.0
AXIS1_STEPS_PER_WORMROT   48000
AXIS2_STEPS_PER_DEGREE      48000.0
so presumably you have a 360 tooth worm on axis1.
if you have a 200 step motor 48000/200 = 240 so you have a combination of gearbox and microstepping =240.
there is a  note // Configured for G11 with 16:60 pulley gearing and 1/32 microstepping which is still only 120 and doesn't match you settings unless you have 400 step motors.
the micro-stepping is set to 16 so have a 3.75 :1 gearbox on each axis. does that make 48000.0 wrong?

what steps per rev are the motor?
what ratio on each axis gear
what worm axis1?
What worm  axis2?






wa1vta01452
 

Axis 1 and axis 2 have identical worms and 360 tooth gears with a 400 step motor with a 3.75:1 belt drive ratio as you stated. I am not expert enough to say 48000 is a wrong value. Is it?  By the way, when I swap cables at the driver, the RA slows down and the DEC runs right.


Khalid Baheyeldin
 

On Sun, Jan 16, 2022 at 07:14 PM, wa1vta01452 wrote:
Axis 1 and axis 2 have identical worms and 360 tooth gears with a 400 step motor with a 3.75:1 belt drive ratio as you stated. I am not expert enough to say 48000 is a wrong value. Is it?
If your spreadsheet looks like this:

48,000.000    = 400,    32,    3.75,    360.00
48,000.000    = 400,    32,    3.75,    360.00

That is, 1/32 microsteps, then yes, your values are correct.

One thing to do is set AXIS1_STEPS_PER_WORMROT to 0, if you don't have a PEC sensor.

  By the way, when I swap cables at the driver, the RA slows down and the DEC runs right.
That means there is something wrong in the cables, or their connection to the motors.
What if you swap the drivers only, and keep the cables and motors the same?


wa1vta01452
 

Thanks for the calculation verification. I don't think it's the cables because The DEC and RA both rotate at maximum speed during slewing when I use the Android app and Bluetooth.


kevin
 

 n = (stepper_steps * micro_steps * overall_gear_reduction)/360.0 =400*32*3.75* *360/ 360 = 48000.0  so correct, sorry no idea where i got 16 micro-stepping from.
These are just some thoughts,
how are you measuring the "correct " speed? at X degrees a second the worm should rotate at that rate. i.e 0.5 degrees per second = 1/2 turn every second.
is the tracking rate correct, about 4 minutes per worm rev?
are the actual distances correct?
do you use Ascom Device Hub? you can select different rates and distances in that. I don't know the details of the variable rate option so try a fixed distance of at least 20 degrees ( see below). without your OTA on, don't want to bend anything.
you have SLEW_ACCELERATION_DIST   8.0 degrees, so it won't get up to full speed for a number of seconds , depending what slew rate you have set, and the same to slow down. it won't get up to full speed unless you move at least 16 degrees,  it is also set to remember the rate through power cycles. can you actually see both motors speed up and slow down.








wa1vta01452
 

Hi, I have searched for the ascom device hub for the reasons you mention but I don't see any download link for it. I have the covers removed so I can see the belts move.  I have set the slew speed to 2 degrees/sec on both the Android app and ascom on the pc. I downloaded APT so I can play with slewing. I use a copy of Guide 9.1 to reference real-time object locations. When I slew to an object, the DEC slews at less than half the 2 degree speed of the RA as viewed on  the 60 tooth sprockets. When I use the Android app and slew to an object, both sprockets spin at the same rate of 2 degrees per second. I have not verified the tracking rate as the mount is sitting next to my bench with no scope attached, just the dovetail plate.


 

So you want to say that you only have this problem when using it via ASCOM?


kevin
 

Device hub is installed as standard on my machine when i installed Ascom a couple of months ago Windows 10 , click on the start button and go down to Ascom



Are you using Ascom with the usb port? you could try with the bluetooth serial port. May be strange but i have problems with my Wemos D1 R32 board if i power it via usb AND from the barrel connector.

have you cut or removed the resistor on the CNC V3 board, that can  have strange effects.

There is a note at the bottom of the Wiki https://onstep.groups.io/g/main/wiki/7233 about power sequencing for TMC2130  drivers , they need a protection diode adding to protect in case the USB is powered before the external power  is applied.



To check tracking rate just set tracking and  the RA motor should move very slowly, put a mark on one of the pulleys and time how long for 1 revolution. the 60 tooth should take about 4 mins, the 16 tooth one a bit over a minute.

Do you have any non SPI drivers you can drop in for a basic check?


 

Try setting both GoTo microstepping settings to OFF (for the sake of testing) and see if there is any difference. Your slew rate will be slower though, but just test if DEC and RA will become equal then

#define AXIS1_DRIVER_MICROSTEPS_GOTO  OFF
#define AXIS2_DRIVER_MICROSTEPS_GOTO  OFF


wa1vta01452
 

Thanks Kevin, I am using an older Win7 laptop but I still don't see the hub. I do have the latest ASCOM platform downloaded. I'll check again.

I have removed the resistor on the cnc and I'm careful to turn on the laptop (usb port) after having applied 12V. Yesterday I let the RA run most of the afternoon and found in 6 hours the mount moved just about 1/4  of 360 degrees so I think the tracking/gear ratios are probably good.

I marked the two large sprockets and did a slew to see the speed difference. It was probably more like 10:1 rather than 2:1.

I do have some 2208s but I would have to un-solder the SPI jumpers and I'd rather not go through that exercise again if I can help it, but it may come to that.


wa1vta01452
 

Vladimir, I changed the two parameters and it made no noticeable difference. I thought is I was using the 2130 SPIs I would hear a distinct tramp-up of the RA speed on slew but there is only a smooth speedup and slowdown sound regardless of the GOTO values.


tomofreno2000
 

I don't think RA running slower when cables are swapped indicates a cable problem, simply that one driver is driving more slowly than the other for some reason.  Since it works fine with BT and the App, seems the config.h must also be ok and it must be an issue with the computer program settings.


wa1vta01452
 

I agree and that's why I included the relevant part of config.h above.


 

Which pins you connected TMC SPI bus to?


wa1vta01452
 

As specified in the CNC V3 Wiki      

  • Axis1 SDI to Axis2 SDI to the WeMos R32 GPIO32 (SPI MOSI, not present on the CNC V3.)
  • Axis1 SCK to Axis2 SCK to the WeMos R32 GPIO33 (SPI SCK, not present on the CNC V3.)
  • Axis1 CS to the WeMos R32 GPIO15 (not present on the CNC V3.)
  • Axis2 CS to the WeMos R32 GPIO 0 (not present on the CNC V3.)