Topics

Esp32 in Mount CG4


Jorge Oliveira
 


I  finished  my onstep project with esp32 for my CG4 mount.
I used the     Configuration for OnStep  3,16
I did a test yesterday, the tracking was perfect, I got 40"   without the guidance.
 
But the goto was a little strange, the speed is very fast, and falling out.
and I also didn’t get guidance.
 
Material  used:
Esp32
wemos d1 mini
2x nema 17
Ra pulley 60x20, belt 180 teeth
DEC pulley 40x16, belt 150 teeth
 
Follows part of my config.h and the calculator



My config.h


//      Parameter Name              Value   Default  Notes                                                                      Hint
#define PINMAP                        MaxESP2 //    OFF, Choose from: MiniPCB, MiniPCB2, MaxPCB, MaxPCB2, STM32Blue,             <-Req'd
                                          //         Ramps14, MaxESP2, MaxESP3.  Check Constants.h for more info.


// SERIAL PORTS ---------------------------------------------------- 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 //    ON, ON Upload ESP8266 WiFi firmware through SERIAL_B with :ESPFLASH# cmd.    Option
#define SERIAL_C_BAUD_DEFAULT         ON //    ON, n, ON for ESP32 Bluetooth.                                               Option
#define SERIAL_C_BLUETOOTH_NAME  "OnStep" // "On..", Bluetooth device name for ESP32.                                         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



//RA
#define AXIS1_STEPS_PER_DEGREE    6933.33333 //  12800, n. Number of steps per degree:                                          <-Req'd
                                          //         n = (stepper_steps * micro_steps * overall_gear_reduction)/360.0
#define AXIS1_STEPS_PER_WORMROT     19200 //  12800, n. Number of steps per worm rotation (PEC Eq mode only:)                <-Req'd
                                          //         n = (AXIS1_STEPS_PER_DEGREE*360)/reduction_final_stage
 
#define AXIS1_DRIVER_MODEL            DRV8825 //    OFF, (See above.) Stepper driver model.                                      <-Often
#define AXIS1_DRIVER_MICROSTEPS       16 //    OFF, n. Microstep mode when tracking.                                        <-Often
#define AXIS1_DRIVER_MICROSTEPS_GOTO  OFF //    OFF, n. Microstep mode used during gotos.                                     Option

#define AXIS1_LIMIT_UNDER_POLE        180 //    180, n. Where n=150..180 (degrees.) Max HA hour angle + or - for Eq modes.    Adjust
#define AXIS1_LIMIT_MAXAZM                 360 //    360, n. Where n=180..360 (degrees.) Max Azimuth + or - for AltAzm mode only.  Adjust
 


//DEC
#define AXIS2_STEPS_PER_DEGREE    2888.88889 //  12800, n. Number of steps per degree:                                          <-Req'd
                                          //         n = (stepper_steps * micro_steps * overall_gear_reduction)/360.0
 
#define AXIS2_DRIVER_MODEL            DRV8825//    OFF, (See above.) Stepper driver model.                                      <-Often
#define AXIS2_DRIVER_MICROSTEPS       16 //    OFF, n. Microstep mode when tracking.                                        <-Often
#define AXIS2_DRIVER_MICROSTEPS_GOTO  OFF //    OFF, n. Microstep mode used during gotos.                                     Option

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