Topics

Problem with BME280 SPI / TMC2130 SPI on MKS Gen L V2.1


jiripansky@...
 

HI,
I'm currently working on a conversion of the old LX200 classics to Onstep. The control-unit (including WIFI GW, silent sticks, steppers, ..)  works very well (thanks to Howard and Khalid), only the communication to RTC (DS3234) and/or Temp / Pressure / ... (BME280) cause problems. If I set the WEATHER parameter from OFF to BME280_SPI in config.g (to activate the BME280), the steppers no longer work (they no longer rotate), the BME280 can be queried (: GX9A # ..: GX9E # are working) with the WEATHER OFF parameter the stepper works perfectly again. My configuration:

Board: MKS Gen L V2.1
Driver: TMC2130 SPI
Firmware: OnStep 4.16k, WiFi Server 1.14e
Libraries: Adafruit_BME280_Library-156a0537d6b21aaab1d1f104a7001a38ca1ffce3 and Adafruit_Sensor-1.0.3 (for BME280 SPI)

For me it looks like the SPI communication to the stepper driver (if the Lib Adafruit_BME280_Library ... and / or Adafruit_Sensor-1.0.3 are included) is not working correctly.
HW wrong connection can be ruled out, since the individual components work stand-alone.
the problems with DS3234 behave accordingly - TIME_LOCATION_SOURCE OFF -> the steppers work, TIME_LOCATION_SOURCE DS3234 -> the steppers no longer work.
Does anyone have such a configuration to run? Does someone have an idea?


Brian Davis
 

I have the same problem, same board, same chips, posted here many days ago without answer.  Same symptoms.  It's interesting that the DS3234 doesn't work either.  

Virus-free. www.avast.com


On Wed, Oct 14, 2020 at 9:47 AM <jiripansky@...> wrote:
HI,
I'm currently working on a conversion of the old LX200 classics to Onstep. The control-unit (including WIFI GW, silent sticks, steppers, ..)  works very well (thanks to Howard and Khalid), only the communication to RTC (DS3234) and/or Temp / Pressure / ... (BME280) cause problems. If I set the WEATHER parameter from OFF to BME280_SPI in config.g (to activate the BME280), the steppers no longer work (they no longer rotate), the BME280 can be queried (: GX9A # ..: GX9E # are working) with the WEATHER OFF parameter the stepper works perfectly again. My configuration:

Board: MKS Gen L V2.1
Driver: TMC2130 SPI
Firmware: OnStep 4.16k, WiFi Server 1.14e
Libraries: Adafruit_BME280_Library-156a0537d6b21aaab1d1f104a7001a38ca1ffce3 and Adafruit_Sensor-1.0.3 (for BME280 SPI)

For me it looks like the SPI communication to the stepper driver (if the Lib Adafruit_BME280_Library ... and / or Adafruit_Sensor-1.0.3 are included) is not working correctly.
HW wrong connection can be ruled out, since the individual components work stand-alone.
the problems with DS3234 behave accordingly - TIME_LOCATION_SOURCE OFF -> the steppers work, TIME_LOCATION_SOURCE DS3234 -> the steppers no longer work.
Does anyone have such a configuration to run? Does someone have an idea?


jiripansky@...
 
Edited

small update: with this config.h (see below). BME280_SPI and stepper now work in parallel, but the rotation speed of the stepper is significantly reduced (question to Howard - is it plausible? -> OnStep will limit slew rates automatically if they exceed your platform's capabilities - but the platform has not changed, just exists there one (or two) SPI device (s) more. BTW: DS3234 with the HW and with a test program also works). Version 3.16 behaves the same way ... Maybe Howard can comment on it ...

// ---------------------------------------------------------------------------------------------------------------------------------
// 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                  MksGenL21 //    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       19200 //   9600, n. Where n=9600,19200,57600,115200 (common baud rates.)                  Infreq
#define SERIAL_B_BAUD_DEFAULT         OFF //   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       19200 //    OFF, n, ON for ESP32 Bluetooth.                                               Option
#define SERIAL_C_BLUETOOTH_NAME "LX200-8" // "On..", Bluetooth device name for ESP32.                                         Option

// MOUNT TYPE -------------------------------------------------- see https://onstep.groups.io/g/main/wiki/6-Configuration#MOUNT_TYPE
#define MOUNT_TYPE                   FORK //    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                     ON //     ON, Blinks w/sidereal tracking otherwise steady on indicates activity.       Option
#define LED_STATUS2                    ON //    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                         ON //    OFF, ON, n. Where n=100..6000 (Hz freq.) for piezo speaker. ON for buzzer.    Option
#define BUZZER_STATE_DEFAULT           ON //    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.

// 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               BME280_SPI  //    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           ON_PULLUP //    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               ON //    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                ON //    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        9.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        5.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       OFF //    OFF, ON Remember meridian flip pause at home setting across power cycles.     Option
#define MFLIP_AUTOMATIC_MEMORY        OFF //    OFF, ON Remember automatic meridian flip setting across power cycles.         Option

#define PIER_SIDE_SYNC_CHANGE_SIDES   OFF //    OFF, ON Allows sync to change pier side, for GEM mounts.                      Option
#define PIER_SIDE_PREFERRED_DEFAULT  BEST //   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              PULSE // 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 8290.90909

#define AXIS1_STEPS_PER_WORMROT     66327 //      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   TMC2130_QUIET//    OFF, (See above.) Stepper driver model.                                      <-Often
#define AXIS1_DRIVER_MICROSTEPS        16 //    OFF, n. Microstep mode when tracking.                                        <-Often
#define AXIS1_DRIVER_MICROSTEPS_GOTO    2 //    OFF, n. Microstep mode used during gotos.                                     Option
#define AXIS1_DRIVER_IHOLD            100 //    OFF, n, (mA.) Current during standstill. OFF uses IRUN/2.0                    Option
#define AXIS1_DRIVER_IRUN             500 //    OFF, n, (mA.) Current during tracking, appropriate for stepper/driver/etc.    Option
#define AXIS1_DRIVER_IGOTO            500 //    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.

// AXIS2 DEC/ALT
// see https://onstep.groups.io/g/main/wiki/6-Configuration#AXIS2
#define AXIS2_STEPS_PER_DEGREE    8290.90909

#define AXIS2_DRIVER_MODEL  TMC2130_QUIET //    OFF, (See above.) Stepper driver model.                                      <-Often
#define AXIS2_DRIVER_MICROSTEPS        16 //    OFF, n. Microstep mode when tracking.                                        <-Often
#define AXIS2_DRIVER_MICROSTEPS_GOTO    2 //    OFF, n. Microstep mode used during gotos.                                     Option
#define AXIS2_DRIVER_IHOLD            100 //    OFF, n, (mA.) Current during standstill. OFF uses IRUN/2.0                    Option
#define AXIS2_DRIVER_IRUN             500 //    OFF, n, (mA.) Current during tracking, appropriate for stepper/driver/etc.    Option
#define AXIS2_DRIVER_IGOTO            500 //    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       TMC_SPI //    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

// AXIS3 ROTATOR
// see https://onstep.groups.io/g/main/wiki/6-Configuration#AXIS3
#define ROTATOR                       OFF //    OFF, ON to enable the rotator (or de-rotator for ALTAZM mounts.)              Option
#define AXIS3_STEPS_PER_DEGREE       64.0 //   64.0, n. Number of steps per degree for rotator/de-rotator.                    Adjust
                                          //         Alt/Az de-rotation: n = (num_circumference_pixels * 2)/360, minimum
#define AXIS3_SLEW_RATE_DESIRED       1.0 //    1.0, n, (degrees/second) Maximum speed depends on processor.                  Adjust

#define AXIS3_DRIVER_MODEL            OFF //    OFF, TMC2130, TMC5160. Leave OFF for all drivers models except these.         Option
#define AXIS3_DRIVER_MICROSTEPS       OFF //    OFF, n. Microstep mode when tracking.                   For TMC2130, TMC5160. Option
#define AXIS3_DRIVER_IHOLD            OFF //    OFF, n, (mA.) Current standstill. OFF uses IRUN/2.0.                  "       Option
#define AXIS3_DRIVER_IRUN             OFF //    OFF, n, (mA.) Current tracking, appropriate for stepper/driver/etc.   "       Option
#define AXIS3_DRIVER_POWER_DOWN       OFF //    OFF, ON Powers off the motor at stand-still.                                  Option
#define AXIS3_DRIVER_REVERSE          OFF //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.    Option

#define AXIS3_LIMIT_MIN              -180 //   -180, n. Where n=-360..0 (degrees.) Minimum allowed rotator angle.             Infreq
#define AXIS3_LIMIT_MAX               180 //    180, n. Where n=0..360 (degrees.) Maximum allowed rotator angle.              Infreq

// AXIS4 FOCUSER 1
// see https://onstep.groups.io/g/main/wiki/6-Configuration#AXIS4
#define FOCUSER1                      OFF //    OFF, ON to enable this focuser.                                               Option
#define AXIS4_STEPS_PER_MICRON        0.5 //    0.5, n. Steps per micrometer. Figure this out by testing or other means.      Adjust
#define AXIS4_SLEW_RATE_DESIRED       500 //    500, n, Where n=200..5000 (um/s.) Max microns/second. In DC mode, max pwr %   Adjust

#define AXIS4_DRIVER_MODEL            OFF //    OFF, TMC2130, TMC5160. Leave OFF for all drivers models except these.         Option
#define AXIS4_DRIVER_MICROSTEPS       OFF //    OFF, n. Microstep mode when tracking.                   For TMC2130, TMC5160. Option
#define AXIS4_DRIVER_IHOLD            OFF //    OFF, n, (mA.) Current standstill. OFF uses IRUN/2.0.                  "       Option
#define AXIS4_DRIVER_IRUN             OFF //    OFF, n, (mA.) Current tracking, appropriate for stepper/driver/etc.   "       Option
#define AXIS4_DRIVER_POWER_DOWN       OFF //    OFF, ON Powers off the motor at stand-still.                                  Option
#define AXIS4_DRIVER_REVERSE          OFF //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.    Option
#define AXIS4_DRIVER_DC_MODE          OFF //    OFF, DRV8825 for pwm dc motor control on stepper driver outputs.              Option

#define AXIS4_LIMIT_MIN_RATE           50 //     50, n. Where n=1..1000 (um/s.) Minimum microns/second. In DC mode, min pwr.  Adjust
#define AXIS4_LIMIT_MIN                 0 //      0, n. Where n=0..500 (millimeters.) Minimum allowed position.               Adjust
#define AXIS4_LIMIT_MAX                50 //     50, n. Where n=0..500 (millimeters.) Maximum allowed position.               Adjust

// AXIS5 FOCUSER 2
// see https://onstep.groups.io/g/main/wiki/6-Configuration#AXIS5
#define FOCUSER2                      OFF //    OFF, ON to enable this focuser.                                               Option
#define AXIS5_STEPS_PER_MICRON        0.5 //    0.5, n. Steps per micrometer. Figure this out by testing or other means.      Adjust
#define AXIS5_SLEW_RATE_DESIRED       500 //    500, n, Where n=200..5000 (um/s.) Max microns/second. In DC mode, max pwr %   Adjust

#define AXIS5_DRIVER_MODEL            OFF //    OFF, TMC2130, TMC5160. Leave OFF for all drivers models except these.         Option
#define AXIS5_DRIVER_MICROSTEPS       OFF //    OFF, n. Microstep mode when tracking.                   For TMC2130, TMC5160. Option
#define AXIS5_DRIVER_IHOLD            OFF //    OFF, n, (mA.) Current standstill. OFF uses IRUN/2.0.                  "       Option
#define AXIS5_DRIVER_IRUN             OFF //    OFF, n, (mA.) Current tracking, appropriate for stepper/driver/etc.   "       Option
#define AXIS5_DRIVER_POWER_DOWN       OFF //    OFF, ON Powers off the motor at stand-still.                                  Option
#define AXIS5_DRIVER_REVERSE          OFF //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.    Option
#define AXIS5_DRIVER_DC_MODE          OFF //    OFF, DRV8825 for pwm dc motor control on stepper driver outputs.              Option

#define AXIS5_LIMIT_MIN_RATE           50 //     50, n. Where n=1..1000 (um/s.) Minimum microns/second. In DC mode, min pwr.  Adjust
#define AXIS5_LIMIT_MIN                 0 //      0, n. Where n=0..500 (millimeters.) Minimum allowed position.               Adjust
#define AXIS5_LIMIT_MAX                50 //     50, n. Where n=0..500 (millimeters.) Maximum allowed position.               Adjust

// AUXILIARY FEATURE CONTROL ------------------------------ see https://onstep.groups.io/g/main/wiki/6-ConfigurationMaster#AUXILIARY
#define FEATURE_LIST_DS               OFF //    OFF, temporarily set ON to list ds18b20 and ds2413 device serial numbers.     Adjust
#define FEATURE1_NAME          "FEATURE1" // "FE..", Name of feature being controlled.                                        Adjust
#define FEATURE1_PURPOSE              OFF //    OFF, SWITCH, ANALOG, DEW_HEATER, INTERVALOMETER.                              Adjust
#define FEATURE1_TEMP                 OFF //    OFF, DS1820, n. Where n is the ds18b20 s/n for DEW_HEATER temperature.        Adjust
#define FEATURE1_PIN                  OFF //    OFF, AUX, DS2413, n. Where n is ds2413 s/n (gpio0) or n=0 to 255 (pin#.)      Adjust
#define FEATURE2_NAME          "FEATURE2" // "FE..", Name of feature being controlled.                                        Adjust
#define FEATURE2_PURPOSE              OFF //    OFF, SWITCH, ANALOG, DEW_HEATER, INTERVALOMETER.                              Adjust
#define FEATURE2_TEMP                 OFF //    OFF, DS1820, n. Where n is the ds18b20 s/n for DEW_HEATER temperature.        Adjust
#define FEATURE2_PIN                  OFF //    OFF, AUX, CHAIN (ds2413 gpio1,) n. Where n=0 to 255 (pin#.)                   Adjust
#define FEATURE3_NAME          "FEATURE3" // "FE..", Name of feature being controlled.                                        Adjust
#define FEATURE3_PURPOSE              OFF //    OFF, SWITCH, ANALOG, DEW_HEATER, INTERVALOMETER.                              Adjust
#define FEATURE3_TEMP                 OFF //    OFF, DS1820, n. Where n is the ds18b20 s/n for DEW_HEATER temperature.        Adjust
#define FEATURE3_PIN                  OFF //    OFF, AUX, DS2413, n. Where n is ds2413 s/n (gpio0) or n=0 to 255 (pin#.)      Adjust
#define FEATURE4_NAME          "FEATURE4" // "FE..", Name of feature being controlled.                                        Adjust
#define FEATURE4_PURPOSE              OFF //    OFF, SWITCH, ANALOG, DEW_HEATER, INTERVALOMETER.                              Adjust
#define FEATURE4_TEMP                 OFF //    OFF, DS1820, n. Where n is the ds18b20 s/n for DEW_HEATER temperature.        Adjust
#define FEATURE4_PIN                  OFF //    OFF, AUX, CHAIN (ds2413 gpio1,) n. Where n=0 to 255 (pin#.)                   Adjust
#define FEATURE5_NAME          "FEATURE5" // "FE..", Name of feature being controlled.                                        Adjust
#define FEATURE5_PURPOSE              OFF //    OFF, SWITCH, ANALOG, DEW_HEATER, INTERVALOMETER.                              Adjust
#define FEATURE5_TEMP                 OFF //    OFF, DS1820, n. Where n is the ds18b20 s/n for DEW_HEATER temperature.        Adjust
#define FEATURE5_PIN                  OFF //    OFF, AUX, DS2413, n. Where n is ds2413 s/n (gpio0) or n=0 to 255 (pin#.)      Adjust
#define FEATURE6_NAME          "FEATURE6" // "FE..", Name of feature being controlled.                                        Adjust
#define FEATURE6_PURPOSE              OFF //    OFF, SWITCH, ANALOG, DEW_HEATER, INTERVALOMETER.                              Adjust
#define FEATURE6_TEMP                 OFF //    OFF, DS1820, n. Where n is the ds18b20 s/n for DEW_HEATER temperature.        Adjust
#define FEATURE6_PIN                  OFF //    OFF, AUX, CHAIN (ds2413 gpio1,) n. Where n=0 to 255 (pin#.)                   Adjust
#define FEATURE7_NAME          "FEATURE7" // "FE..", Name of feature being controlled.                                        Adjust
#define FEATURE7_PURPOSE              OFF //    OFF, SWITCH, ANALOG, DEW_HEATER, INTERVALOMETER.                              Adjust
#define FEATURE7_TEMP                 OFF //    OFF, DS1820, n. Where n is the ds18b20 s/n for DEW_HEATER temperature.        Adjust
#define FEATURE7_PIN                  OFF //    OFF, AUX, DS2413, n. Where n is ds2413 s/n (gpio0) or n=0 to 255 (pin#.)      Adjust
#define FEATURE8_NAME          "FEATURE8" // "FE..", Name of feature being controlled.                                        Adjust
#define FEATURE8_PURPOSE              OFF //    OFF, SWITCH, ANALOG, DEW_HEATER, INTERVALOMETER.                              Adjust
#define FEATURE8_TEMP                 OFF //    OFF, DS1820, n. Where n is the ds18b20 s/n for DEW_HEATER temperature.        Adjust
#define FEATURE8_PIN                  OFF //    OFF, AUX, CHAIN (ds2413 gpio1,) n. Where n=0 to 255 (pin#.)                   Adjust

// THAT'S IT FOR USER CONFIGURATION!

// -------------------------------------------------------------------------------------------------------------------------
#define FileVersionConfig 3


Howard Dutton
 
Edited

I made note that the SPI DS3234 and BME280_SPI don't work in the MKS Gen-L 2 Wiki.

If a clear cause becomes apparent I will patch the code.

The obvious question is:
What did you change that made it kind of start to work.


Howard Dutton
 

Also, you could try the following in Config.h

#define MODE_SWITCH_BEFORE_SLEW ON


Howard Dutton
 

On Thu, Oct 15, 2020 at 06:41 AM, Howard Dutton wrote:
lso, you could try the following in Config.h

#define MODE_SWITCH_BEFORE_SLEW ON
Shouldn't help though... given that 3.16 doesn't work (since it uses this same method.)


jiripansky@...
 

thanks Howard for the answers:

#define MODE_SWITCH_BEFORE_SLEW ON - no effect

the changes were only for #define AXISx_DRIVER_IGOTO 500 (where x = <1,2>

the problems lie (I think) in the order of the upload of the firmware:

firmware    WEATHER     STEPPER    M
ODE_SWITCH_BEFORE_SLEW
========================================================
OnStep       OFF               FAST           not used.
OnStep       BME280_SPI  SLOW         not used
test prog     -                      -                 -
OnStep      BME280_SPI   not working  ON
OnStep      BME280_SPI   not working  OFF
OnStep      OFF                FAST            ?
OnStep      BME280_SPI   SLOW          ON


these are the tests that I did ... the SPI is correctly initialized (HW SPI) ... the problems with not working can perhaps be explained with eeprom init? But why then does toggle WEATHER OFF / BME280_SPI help? strange...


Brian Davis
 

What versions of the ADAFruit libraries are you using?  I am unable to duplicate your result with your config changes.

Virus-free. www.avast.com


On Thu, Oct 15, 2020 at 8:43 AM Howard Dutton <hjd1964@...> wrote:
On Thu, Oct 15, 2020 at 06:41 AM, Howard Dutton wrote:
lso, you could try the following in Config.h

#define MODE_SWITCH_BEFORE_SLEW ON
Shouldn't help though... given that 3.16 doesn't work (since it uses this same method.)


Howard Dutton
 
Edited

Try the latest master.  I added code to specifically disable CS pins (HIGH) since hardware without correct pullups can cause problems.

Another long-shot but rules out a possibility.


jiripansky@...
 

1st:Adafruit_BME280_Library-156a0537d6b21aaab1d1f104a7001a38ca1ffce3
2nd: Adafruit_BME280_Library-master

Both with the same result...


Brian Davis
 

How about the adafruit sensor library?   In May, Howard posted here: https://onstep.groups.io/g/main/topic/73378905#20123 that there was a  problem " Mega2560 OnStep doesn't allow the standard Arduino Serial library to be brought in (which the latest Adafruit library does I beilive) so compile fails." 

I had to roll the sensor library back to 1.0.3 to get it to compile without error.

On Thu, Oct 15, 2020 at 10:19 AM <jiripansky@...> wrote:
1st:Adafruit_BME280_Library-156a0537d6b21aaab1d1f104a7001a38ca1ffce3
2nd: Adafruit_BME280_Library-master

Both with the same result...


jiripansky@...
 

@Howard - the path seems to be working. The stepper makes different noises with the WEATHER BME280_SPI (it reacts quickly, but it sounds different compared to the WEATHER OFF). Stepping params different??? (I'm not a stepper motor expert).

The path for the temperature adjustment does not seem to work

12.7 # 13.3 # 13.8 # 14.4 # 14.4 # 14.4 # 14.9 #
...
22.0 # 22.1 # 24.1 # 24.1 #


jiripansky@...
 

@ tapperbld: yes I also use that
Adafruit_Sensor-1.0.3 in addition to Adafruit_BME280_Library-156a0537d6b21aaab1d1f104a7001a38ca1ffce3 or  Adafruit_BME280_Library-master. Otherwise I got compile error (I think)


Howard Dutton
 
Edited

On Thu, Oct 15, 2020 at 08:48 AM, <jiripansky@...> wrote:
@Howard - the path seems to be working. The stepper makes different noises with the WEATHER BME280_SPI (it reacts quickly, but it sounds different compared to the WEATHER OFF). Stepping params different??? (I'm not a stepper motor expert).
That shouldn't be happening.  The BME (and DS3231 DS3234) comms are corrupting the TMC comms somehow.

The path for the temperature adjustment does not seem to work

12.7 # 13.3 # 13.8 # 14.4 # 14.4 # 14.4 # 14.9 #
...
22.0 # 22.1 # 24.1 # 24.1 #
I patched this again.


jiripansky@...
 

@ Howard: after a few more tests I can add more information. the testsquence was:

WEATHER STEPPER
OFF          running
<power off>
OFF          running
CHANGE CONFIG TO WEATHER BME280_SPI ; COMPILE AND UPLOAD WITHOUT POWER OFF
BME280_SPI running (sounds different)
<power off>
BME280_SPI is not running
CHANGE CONFIG TO WEATHER OFF; COMPILE AND UPLOAD
OFF          running
CHANGE CONFIG TO WEATHER BME280_SPI ; COMPILE AND UPLOAD WITHOUT POWER OFF
BME280_SPI running (sounds different)

For me it seems that the TMC2130 drivers are only correctly initialized / configured in the WEATHER OFF mode, if the other configuration is then loaded without power off, they will continue to run, but not properly ... after power off they will lose TMC2130 the configuration and stepper do nothing


Brian Davis
 

Confirm Jiri's results.

One note - The MKS wiki shows the bottom two pins on EXP2 as GND and NC.  The same pin position is marked 5V on EXP1, and meters 5V on EXP2, so I used it to power the BME280.  Jiri - how did you power the chip?

Virus-free. www.avast.com


On Thu, Oct 15, 2020 at 11:53 AM <jiripansky@...> wrote:
@ Howard: after a few more tests I can add more information. the testsquence was:

WEATHER STEPPER
OFF          running
<power off>
OFF          running
CHANGE CONFIG TO WEATHER BME280_SPI ; COMPILE AND UPLOAD WITHOUT POWER OFF
BME280_SPI running (sounds different)
<power off>
BME280_SPI is not running
CHANGE CONFIG TO WEATHER OFF; COMPILE AND UPLOAD
OFF          running
CHANGE CONFIG TO WEATHER BME280_SPI ; COMPILE AND UPLOAD WITHOUT POWER OFF
BME280_SPI running (sounds different)

For me it seems that the TMC2130 drivers are only correctly initialized / configured in the WEATHER OFF mode, if the other configuration is then loaded without power off, they will continue to run, but not properly ... after power off they will lose TMC2130 the configuration and stepper do nothing


jiripansky@...
 

@tapperbld: I use Z + connector 5v / GND in the direct vicinity of EXP2


Howard Dutton
 

It might be more useful (for debugging purposes) to attempt to get the DS3234 working rather than the BME280.  It DS3234 is touched only at boot to get the date/time and potentially never again (if the date/time is not set by an application.)  The BME280 is accessed on a regular basis though never while a slew is happening.

I'd also turn off the AXIS1_DRIVER_STATUS and AXIS2_DRIVER_STATUS options and _GOTO mode switching for now.  That stops other continuous SPI polling and so other opportunities for things going wrong.


jiripansky@...
 

@ Howard: I switched the circuit to DS3234. Tested for functionality with a test program (OK), then with OnStep TIME_LOCATION_SOURCE DS3234 (steppers do not work), then TIME_LOCATION_SOURCE OFF, recompiled, upload, without power off (stepper OK), then TIME_LOCATION_SOURCE DS3234, recompiled, upload without power off (steppers work ) ... So we behave absolutely the same with BME280 ...


Dave Schwartz
 

Forget about testing without cycling the power after uploading - it tells you nothing about how it will perform in the field where everything is always cold-started. In fact, you should always cycle the power before each test so all modules start from the same state of initialization.


On October 15, 2020 2:12:57 p.m. EDT, jiripansky@... wrote:
@ Howard: I switched the circuit to DS3234. Tested for functionality with a test program (OK), then with OnStep TIME_LOCATION_SOURCE DS3234 (steppers do not work), then TIME_LOCATION_SOURCE OFF, recompiled, upload, without power off (stepper OK), then TIME_LOCATION_SOURCE DS3234, recompiled, upload without power off (steppers work ) ... So we behave absolutely the same with BME280 ...

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.