Laser turned on on all moves.

edited February 2017 in Questions & Answers
Hi all,

Hope someone can help me. I'm doing some testing in laser mode but i don't get it. After selecting laser mode and during g0/g1/g28 moves the laser pin is always going high. Tested it on D44 and D4 both with the same result. Did also try a test script with the same result. Running version 1.0.0dev. Also in printer mode the pin stays low during moves.

g28
m452
g0 z400
g0 z300
m3 s0
g0 z400
g0 z300
g0 z400
g0 z300
m3 s255
g0 z400
g0 z300
g28

Some results on manual commands:
21:42:09.810 : N152 M452*38
21:42:09.810 : PrinterMode:Laser
21:43:20.052 : N153 M3 S0*100
21:43:20.052 : LaserOn:0
21:43:35.747 : N154 M3 S255*97
21:43:35.747 : LaserOn:255

Thank you,
Arjan

Comments

  • edited February 2017
    why do you move Z in laser operation? (Laser gets not activated in z-move and also not in g28 and G0 moves)


    (if laser on/off is swapped change  from #define LASER_ON_HIGH 1 to #define LASER_ON_HIGH 0 in configuration.h)

    try as follows:

    M452

    G28

    M3

    G1 X100 F200

    G0 X0

    M5

    from configuration.h :

    /*
    If the firmware is in laser mode, it can control a laser output to cut or engrave materials.
    Please use this feature only if you know about safety and required protection. Lasers are
    dangerous and can hurt or make you blind!!!

    The default laser driver only supports laser on and off. Here you control the intensity with
    your feedrate. For exchangeable diode lasers this is normally enough. If you need more control
    you can set the intensity in a range 0-255 with a custom extension to the driver. See driver.h
    and comments on how to extend the functions non invasive with our event system.

    If you have a laser - powder system you will like your E override. If moves contain a
    increasing extruder position it will laser that move. With this trick you can
    use existing FDM slicers to laser the output. Laser width is extrusion width.

    Other tools may use M3 and M5 to enable/disable laser. Here G1/G2/G3 moves have laser enabled
    and G0 moves have it disables.

    In any case, laser only enables while moving. At the end of a move it gets
    automatically disabled.
    */
  • Turning on laser mode and doing z moves is not strange in my opinion. I have a delta printer and i can image that you change the height to burn the next layer (change the focus point).

    Also in my case m3 s0 or m3 s255 and m5 gives all the same result for all moves! Laser is turned on.

    Also laser is turned on during the whole time in this script no change at all!:
    m452
    g28

    g0 z400
    m3 s0
    g1 x100 f1000
    m3 s255
    g1 x-100
    m5
    g1 x100
    m3 s255
    g1 x-100

    m3 s0
    g0 x100 f1000
    m3 s255
    g0 x-100
    m5
    g0 x100
    m3 s255
    g0 x-100

    g28

  • so as nothing changes at all... seems your wiring is the problem.
    i have laser working  without any problem. refer text from configuration.h
  • Wiring? I just measure the state of my D4 pin. So it must be a software thing.
  • edited February 2017
    some more informations of your setup would be useful.....
    which controller do you use (f.e. ramps or something else)
    check pinlist for double use etc.

    software(dev version) is for shure not the problem as i use it .
  • No problem, i use a ramps board 1.4. Good to know that you are using the same version. Tonight i would also try the light pin because that one is working for the light and re-assign the light to another pin in the config. Also i have chosen D4 because of the PWM support.

    This is my current configuration.h:

    /*
    This file is part of Repetier-Firmware.

    Repetier-Firmware is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Repetier-Firmware is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Repetier-Firmware. If not, see .

    */

    #ifndef CONFIGURATION_H
    #define CONFIGURATION_H

    /**************** READ FIRST ************************

    This configuration file was created with the configuration tool. For that
    reason, it does not contain the same informations as the original Configuration.h file.
    It misses the comments and unused parts. Open this file file in the config tool
    to see and change the data. You can also upload it to newer/older versions. The system
    will silently add new options, so compilation continues to work.

    This file is optimized for version 1.0.0dev
    generator: http://www.repetier.com/firmware/dev/

    If you are in doubt which named functions use which pins on your board, please check the
    pins.h for the used name->pin assignments and your board documentation to verify it is
    as you expect.

    */

    #define NUM_EXTRUDER 2
    #define MOTHERBOARD 33
    #include "pins.h"

    // ################## EDIT THESE SETTINGS MANUALLY ################
    // ################ END MANUAL SETTINGS ##########################

    #undef FAN_PIN
    #define FAN_PIN 9
    #undef FAN2_PIN
    #define FAN2_PIN 10
    #undef FAN_BOARD_PIN
    #define FAN_BOARD_PIN -1
    #define BOARD_FAN_SPEED 255
    #define BOARD_FAN_MIN_SPEED 0
    #define FAN_THERMO_PIN -1
    #define FAN_THERMO_MIN_PWM 128
    #define FAN_THERMO_MAX_PWM 255
    #define FAN_THERMO_MIN_TEMP 45
    #define FAN_THERMO_MAX_TEMP 60
    #define FAN_THERMO_THERMISTOR_PIN -1
    #define FAN_THERMO_THERMISTOR_TYPE 1

    //#define EXTERNALSERIAL use Arduino serial library instead of build in. Requires more ram, has only 63 byte input buffer.
    // Uncomment the following line if you are using Arduino compatible firmware made for Arduino version earlier then 1.0
    // If it is incompatible you will get compiler errors about write functions not being compatible!
    //#define COMPAT_PRE1
    #define BLUETOOTH_SERIAL -1
    #define BLUETOOTH_BAUD 115200
    #define MIXING_EXTRUDER 0

    #define DRIVE_SYSTEM 3
    #define XAXIS_STEPS_PER_MM 40.06
    #define YAXIS_STEPS_PER_MM 40.1
    #define ZAXIS_STEPS_PER_MM 40.05
    #define EXTRUDER_FAN_COOL_TEMP 50
    #define PDM_FOR_EXTRUDER 0
    #define PDM_FOR_COOLER 0
    #define DECOUPLING_TEST_MAX_HOLD_VARIANCE 20
    #define DECOUPLING_TEST_MIN_TEMP_RISE 1
    #define KILL_IF_SENSOR_DEFECT 0
    #define RETRACT_ON_PAUSE 2
    #define PAUSE_START_COMMANDS ""
    #define PAUSE_END_COMMANDS ""
    #define SHARED_EXTRUDER_HEATER 0
    #define EXT0_X_OFFSET 0
    #define EXT0_Y_OFFSET 0
    #define EXT0_Z_OFFSET 0
    #define EXT0_STEPS_PER_MM 50
    #define EXT0_TEMPSENSOR_TYPE 97
    #define EXT0_TEMPSENSOR_PIN TEMP_0_PIN
    #define EXT0_HEATER_PIN 42
    #define EXT0_STEP_PIN ORIG_E0_STEP_PIN
    #define EXT0_DIR_PIN ORIG_E0_DIR_PIN
    #define EXT0_INVERSE 0
    #define EXT0_ENABLE_PIN ORIG_E0_ENABLE_PIN
    #define EXT0_ENABLE_ON 0
    #define EXT0_MIRROR_STEPPER 0
    #define EXT0_STEP2_PIN ORIG_E0_STEP_PIN
    #define EXT0_DIR2_PIN ORIG_E0_DIR_PIN
    #define EXT0_INVERSE2 0
    #define EXT0_ENABLE2_PIN ORIG_E0_ENABLE_PIN
    #define EXT0_MAX_FEEDRATE 50
    #define EXT0_MAX_START_FEEDRATE 20
    #define EXT0_MAX_ACCELERATION 5000
    #define EXT0_HEAT_MANAGER 3
    #define EXT0_PREHEAT_TEMP 190
    #define EXT0_WATCHPERIOD 1
    #define EXT0_PID_INTEGRAL_DRIVE_MAX 230
    #define EXT0_PID_INTEGRAL_DRIVE_MIN 40
    #define EXT0_PID_PGAIN_OR_DEAD_TIME 7
    #define EXT0_PID_I 2
    #define EXT0_PID_D 40
    #define EXT0_PID_MAX 255
    #define EXT0_ADVANCE_K 0
    #define EXT0_ADVANCE_L 0
    #define EXT0_ADVANCE_BACKLASH_STEPS 0
    #define EXT0_WAIT_RETRACT_TEMP 150
    #define EXT0_WAIT_RETRACT_UNITS 0
    #define EXT0_SELECT_COMMANDS ""
    #define EXT0_DESELECT_COMMANDS ""
    #define EXT0_EXTRUDER_COOLER_PIN -1
    #define EXT0_EXTRUDER_COOLER_SPEED 255
    #define EXT0_DECOUPLE_TEST_PERIOD 12000
    #define EXT0_JAM_PIN -1
    #define EXT0_JAM_PULLUP 0
    #define EXT1_X_OFFSET 0
    #define EXT1_Y_OFFSET 0
    #define EXT1_Z_OFFSET 0
    #define EXT1_STEPS_PER_MM 50
    #define EXT1_TEMPSENSOR_TYPE 1
    #define EXT1_TEMPSENSOR_PIN TEMP_2_PIN
    #define EXT1_HEATER_PIN 8
    #define EXT1_STEP_PIN ORIG_E1_STEP_PIN
    #define EXT1_DIR_PIN ORIG_E1_DIR_PIN
    #define EXT1_INVERSE 0
    #define EXT1_ENABLE_PIN ORIG_E1_ENABLE_PIN
    #define EXT1_ENABLE_ON 0
    #define EXT1_MIRROR_STEPPER 0
    #define EXT1_STEP2_PIN ORIG_E1_STEP_PIN
    #define EXT1_DIR2_PIN ORIG_E1_DIR_PIN
    #define EXT1_INVERSE2 0
    #define EXT1_ENABLE2_PIN ORIG_E1_ENABLE_PIN
    #define EXT1_MAX_FEEDRATE 50
    #define EXT1_MAX_START_FEEDRATE 20
    #define EXT1_MAX_ACCELERATION 5000
    #define EXT1_HEAT_MANAGER 3
    #define EXT1_PREHEAT_TEMP 190
    #define EXT1_WATCHPERIOD 1
    #define EXT1_PID_INTEGRAL_DRIVE_MAX 230
    #define EXT1_PID_INTEGRAL_DRIVE_MIN 40
    #define EXT1_PID_PGAIN_OR_DEAD_TIME 7
    #define EXT1_PID_I 2
    #define EXT1_PID_D 40
    #define EXT1_PID_MAX 255
    #define EXT1_ADVANCE_K 0
    #define EXT1_ADVANCE_L 0
    #define EXT1_ADVANCE_BACKLASH_STEPS 0
    #define EXT1_WAIT_RETRACT_TEMP 150
    #define EXT1_WAIT_RETRACT_UNITS 0
    #define EXT1_SELECT_COMMANDS ""
    #define EXT1_DESELECT_COMMANDS ""
    #define EXT1_EXTRUDER_COOLER_PIN -1
    #define EXT1_EXTRUDER_COOLER_SPEED 255
    #define EXT1_DECOUPLE_TEST_PERIOD 12000
    #define EXT1_JAM_PIN -1
    #define EXT1_JAM_PULLUP 0

    #define FEATURE_RETRACTION 1
    #define AUTORETRACT_ENABLED 0
    #define RETRACTION_LENGTH 3
    #define RETRACTION_LONG_LENGTH 13
    #define RETRACTION_SPEED 40
    #define RETRACTION_Z_LIFT 0
    #define RETRACTION_UNDO_EXTRA_LENGTH 0
    #define RETRACTION_UNDO_EXTRA_LONG_LENGTH 0
    #define RETRACTION_UNDO_SPEED 20
    #define FILAMENTCHANGE_X_POS 0
    #define FILAMENTCHANGE_Y_POS 0
    #define FILAMENTCHANGE_Z_ADD 2
    #define FILAMENTCHANGE_REHOME 1
    #define FILAMENTCHANGE_SHORTRETRACT 5
    #define FILAMENTCHANGE_LONGRETRACT 50
    #define JAM_METHOD 1
    #define JAM_STEPS 220
    #define JAM_SLOWDOWN_STEPS 320
    #define JAM_SLOWDOWN_TO 70
    #define JAM_ERROR_STEPS 500
    #define JAM_MIN_STEPS 10
    #define JAM_ACTION 1

    #define RETRACT_DURING_HEATUP true
    #define PID_CONTROL_RANGE 20
    #define SKIP_M109_IF_WITHIN 2
    #define SCALE_PID_TO_MAX 0
    #define TEMP_HYSTERESIS 0
    #define EXTRUDE_MAXLENGTH 160
    #define NUM_TEMPS_USERTHERMISTOR0 0
    #define USER_THERMISTORTABLE0 {}
    #define NUM_TEMPS_USERTHERMISTOR1 0
    #define USER_THERMISTORTABLE1 {}
    #define NUM_TEMPS_USERTHERMISTOR2 0
    #define USER_THERMISTORTABLE2 {}
    #define USE_GENERIC_THERMISTORTABLE_1
    #define GENERIC_THERM1_T0 25
    #define GENERIC_THERM1_R0 100000
    #define GENERIC_THERM1_BETA 4036
    #define GENERIC_THERM1_MIN_TEMP -20
    #define GENERIC_THERM1_MAX_TEMP 300
    #define GENERIC_THERM1_R1 0
    #define GENERIC_THERM1_R2 4700
    #define GENERIC_THERM_VREF 5
    #define GENERIC_THERM_NUM_ENTRIES 33
    #define HEATER_PWM_SPEED 0

    // ############# Heated bed configuration ########################

    #define HAVE_HEATED_BED 1
    #define HEATED_BED_PREHEAT_TEMP 55
    #define HEATED_BED_MAX_TEMP 120
    #define SKIP_M190_IF_WITHIN 3
    #define HEATED_BED_SENSOR_TYPE 1
    #define HEATED_BED_SENSOR_PIN TEMP_1_PIN
    #define HEATED_BED_HEATER_PIN 57
    #define HEATED_BED_SET_INTERVAL 5000
    #define HEATED_BED_HEAT_MANAGER 0
    #define HEATED_BED_PID_INTEGRAL_DRIVE_MAX 255
    #define HEATED_BED_PID_INTEGRAL_DRIVE_MIN 80
    #define HEATED_BED_PID_PGAIN_OR_DEAD_TIME 196
    #define HEATED_BED_PID_IGAIN 33
    #define HEATED_BED_PID_DGAIN 290
    #define HEATED_BED_PID_MAX 255
    #define HEATED_BED_DECOUPLE_TEST_PERIOD 300000
    #define MIN_EXTRUDER_TEMP 150
    #define MAXTEMP 275
    #define MIN_DEFECT_TEMPERATURE -10
    #define MAX_DEFECT_TEMPERATURE 290
    #define MILLISECONDS_PREHEAT_TIME 30000

    // ##########################################################################################
    // ## Laser configuration ##
    // ##########################################################################################

    /*
    If the firmware is in laser mode, it can control a laser output to cut or engrave materials.
    Please use this feature only if you know about safety and required protection. Lasers are
    dangerous and can hurt or make you blind!!!

    The default laser driver only supports laser on and off. Here you control the intensity with
    your feedrate. For exchangeable diode lasers this is normally enough. If you need more control
    you can set the intensity in a range 0-255 with a custom extension to the driver. See driver.h
    and comments on how to extend the functions non invasive with our event system.

    If you have a laser - powder system you will like your E override. If moves contain a
    increasing extruder position it will laser that move. With this trick you can
    use existing fdm slicers to laser the output. Laser width is extrusion width.

    Other tools may use M3 and M5 to enable/disable laser. Here G1/G2/G3 moves have laser enabled
    and G0 moves have it disables.

    In any case, laser only enables while moving. At the end of a move it gets
    automatically disabled.
    */

    #define SUPPORT_LASER 1
    #define LASER_PIN 4
    #define LASER_ON_HIGH 1
    #define LASER_WARMUP_TIME 0

    // ## CNC configuration ##

    /*
    If the firmware is in CNC mode, it can control a mill with M3/M4/M5. It works
    similar to laser mode, but mill keeps enabled during G0 moves and it allows
    setting rpm (only with event extension that supports this) and milling direction.
    It also can add a delay to wait for spindle to run on full speed.
    */

    #define SUPPORT_CNC 0
    #define CNC_WAIT_ON_ENABLE 300
    #define CNC_WAIT_ON_DISABLE 0
    #define CNC_ENABLE_PIN -1
    #define CNC_ENABLE_WITH 1
    #define CNC_DIRECTION_PIN -1
    #define CNC_DIRECTION_CW 1


    #define DEFAULT_PRINTER_MODE 0

    // ################ Endstop configuration #####################

    #define MULTI_ZENDSTOP_HOMING 0
    #define ENDSTOP_PULLUP_X_MIN true
    #define ENDSTOP_X_MIN_INVERTING false
    #define MIN_HARDWARE_ENDSTOP_X false
    #define ENDSTOP_PULLUP_Y_MIN true
    #define ENDSTOP_Y_MIN_INVERTING false
    #define MIN_HARDWARE_ENDSTOP_Y false
    #define ENDSTOP_PULLUP_Z_MIN true
    #define ENDSTOP_Z_MIN_INVERTING false
    #define MIN_HARDWARE_ENDSTOP_Z false
    #define ENDSTOP_PULLUP_Z2_MINMAX true
    #define ENDSTOP_Z2_MINMAX_INVERTING false
    #define MINMAX_HARDWARE_ENDSTOP_Z2 false
    #define ENDSTOP_PULLUP_X_MAX false
    #define ENDSTOP_X_MAX_INVERTING false
    #define MAX_HARDWARE_ENDSTOP_X true
    #define ENDSTOP_PULLUP_Y_MAX false
    #define ENDSTOP_Y_MAX_INVERTING false
    #define MAX_HARDWARE_ENDSTOP_Y true
    #define ENDSTOP_PULLUP_Z_MAX false
    #define ENDSTOP_Z_MAX_INVERTING false
    #define MAX_HARDWARE_ENDSTOP_Z true
    #define max_software_endstop_r true

    #define min_software_endstop_x true
    #define min_software_endstop_y true
    #define min_software_endstop_z true
    #define max_software_endstop_x false
    #define max_software_endstop_y false
    #define max_software_endstop_z false
    #define DOOR_PIN -1
    #define DOOR_PULLUP 1
    #define DOOR_INVERTING 1
    #define ENDSTOP_X_BACK_MOVE 5
    #define ENDSTOP_Y_BACK_MOVE 5
    #define ENDSTOP_Z_BACK_MOVE 5
    #define ENDSTOP_X_RETEST_REDUCTION_FACTOR 3
    #define ENDSTOP_Y_RETEST_REDUCTION_FACTOR 3
    #define ENDSTOP_Z_RETEST_REDUCTION_FACTOR 3
    #define ENDSTOP_X_BACK_ON_HOME 0
    #define ENDSTOP_Y_BACK_ON_HOME 0
    #define ENDSTOP_Z_BACK_ON_HOME 0
    #define ALWAYS_CHECK_ENDSTOPS 0
    #define MOVE_X_WHEN_HOMED 0
    #define MOVE_Y_WHEN_HOMED 0
    #define MOVE_Z_WHEN_HOMED 0

    // ################# XYZ movements ###################

    #define X_ENABLE_ON 0
    #define Y_ENABLE_ON 0
    #define Z_ENABLE_ON 0
    #define DISABLE_X 0
    #define DISABLE_Y 0
    #define DISABLE_Z 0
    #define DISABLE_E 0
    #define INVERT_X_DIR 1
    #define INVERT_Y_DIR 0
    #define INVERT_Z_DIR 1
    #define X_HOME_DIR -1
    #define Y_HOME_DIR -1
    #define Z_HOME_DIR 1
    #define X_MAX_LENGTH 408
    #define Y_MAX_LENGTH 408
    #define Z_MAX_LENGTH 408
    #define X_MIN_POS 0
    #define Y_MIN_POS 0
    #define Z_MIN_POS 0
    #define Z2_MINMAX_PIN -1

    #define DISTORTION_CORRECTION 0
    #define DISTORTION_CORRECTION_POINTS 5
    #define DISTORTION_CORRECTION_R 100
    #define DISTORTION_PERMANENT 0
    #define DISTORTION_UPDATE_FREQUENCY 15
    #define DISTORTION_START_DEGRADE 0.5
    #define DISTORTION_END_HEIGHT 1
    #define DISTORTION_EXTRAPOLATE_CORNERS 0
    #define DISTORTION_XMIN 10
    #define DISTORTION_YMIN 10
    #define DISTORTION_XMAX 190
    #define DISTORTION_YMAX 190

    // ##########################################################################################
    // ## Movement settings ##
    // ##########################################################################################

    #define FEATURE_BABYSTEPPING 1
    #define BABYSTEP_MULTIPLICATOR 1

    #define DELTA_SEGMENTS_PER_SECOND_PRINT 99 // Move accurate setting for print moves
    #define DELTA_SEGMENTS_PER_SECOND_MOVE 70 // Less accurate setting for other moves
    #define EXACT_DELTA_MOVES 1

    // Delta settings
    #define DELTA_DIAGONAL_ROD 332.05 // mm
    #define DELTA_ALPHA_A 209.99
    #define DELTA_ALPHA_B 330.05
    #define DELTA_ALPHA_C 90
    #define DELTA_RADIUS_CORRECTION_A 0
    #define DELTA_RADIUS_CORRECTION_B 0
    #define DELTA_RADIUS_CORRECTION_C 0
    #define DELTA_DIAGONAL_CORRECTION_A 0
    #define DELTA_DIAGONAL_CORRECTION_B 0
    #define DELTA_DIAGONAL_CORRECTION_C 0
    #define END_EFFECTOR_HORIZONTAL_OFFSET 34.1
    #define CARRIAGE_HORIZONTAL_OFFSET 31.2
    #define DELTA_MAX_RADIUS 135
    #define ROD_RADIUS 183.47
    #define PRINTER_RADIUS 248.77
    #define DELTA_HOME_ON_POWER 0
    #define STEP_COUNTER
    #define DELTA_X_ENDSTOP_OFFSET_STEPS 12
    #define DELTA_Y_ENDSTOP_OFFSET_STEPS 6
    #define DELTA_Z_ENDSTOP_OFFSET_STEPS 0
    #define DELTA_FLOOR_SAFETY_MARGIN_MM 15
    //#define SOFTWARE_LEVELING

    #define DELTASEGMENTS_PER_PRINTLINE 20
    #define STEPPER_INACTIVE_TIME 360L
    #define MAX_INACTIVE_TIME 0L
    #define MAX_FEEDRATE_X 500
    #define MAX_FEEDRATE_Y 500
    #define MAX_FEEDRATE_Z 500
    #define HOMING_FEEDRATE_X 100
    #define HOMING_FEEDRATE_Y 100
    #define HOMING_FEEDRATE_Z 100
    #define HOMING_ORDER HOME_ORDER_ZXY
    #define ZHOME_PRE_RAISE 0
    #define ZHOME_PRE_RAISE_DISTANCE 10
    #define ZHOME_MIN_TEMPERATURE 0
    #define ZHOME_HEAT_ALL 1
    #define ZHOME_HEAT_HEIGHT 20
    #define ZHOME_X_POS 999999
    #define ZHOME_Y_POS 999999
    #define ENABLE_BACKLASH_COMPENSATION 0
    #define X_BACKLASH 0
    #define Y_BACKLASH 0
    #define Z_BACKLASH 0
    #define RAMP_ACCELERATION 1
    #define STEPPER_HIGH_DELAY 0
    #define DIRECTION_DELAY 0
    #define STEP_DOUBLER_FREQUENCY 12000
    #define ALLOW_QUADSTEPPING 1
    #define DOUBLE_STEP_DELAY 0 // time in microseconds
    #define MAX_ACCELERATION_UNITS_PER_SQ_SECOND_X 60
    #define MAX_ACCELERATION_UNITS_PER_SQ_SECOND_Y 60
    #define MAX_ACCELERATION_UNITS_PER_SQ_SECOND_Z 60
    #define MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND_X 60
    #define MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND_Y 60
    #define MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND_Z 60
    #define INTERPOLATE_ACCELERATION_WITH_Z 0
    #define ACCELERATION_FACTOR_TOP 100
    #define MAX_JERK 50
    #define MAX_ZJERK 0.3
    #define PRINTLINE_CACHE_SIZE 16
    #define MOVE_CACHE_LOW 10
    #define LOW_TICKS_PER_MOVE 250000
    #define EXTRUDER_SWITCH_XY_SPEED 100
    #define DUAL_X_AXIS 0
    #define FEATURE_TWO_XSTEPPER 0
    #define X2_STEP_PIN ORIG_E1_STEP_PIN
    #define X2_DIR_PIN ORIG_E1_DIR_PIN
    #define X2_ENABLE_PIN ORIG_E1_ENABLE_PIN
    #define FEATURE_TWO_YSTEPPER 0
    #define Y2_STEP_PIN ORIG_E1_STEP_PIN
    #define Y2_DIR_PIN ORIG_E1_DIR_PIN
    #define Y2_ENABLE_PIN ORIG_E1_ENABLE_PIN
    #define FEATURE_TWO_ZSTEPPER 0
    #define Z2_STEP_PIN ORIG_E1_STEP_PIN
    #define Z2_DIR_PIN ORIG_E1_DIR_PIN
    #define Z2_ENABLE_PIN ORIG_E1_ENABLE_PIN
    #define FEATURE_THREE_ZSTEPPER 0
    #define Z3_STEP_PIN ORIG_E2_STEP_PIN
    #define Z3_DIR_PIN ORIG_E2_DIR_PIN
    #define Z3_ENABLE_PIN ORIG_E2_ENABLE_PIN
    #define FEATURE_FOUR_ZSTEPPER 0
    #define Z4_STEP_PIN ORIG_E3_STEP_PIN
    #define Z4_DIR_PIN ORIG_E3_DIR_PIN
    #define Z4_ENABLE_PIN ORIG_E3_ENABLE_PIN
    #define FEATURE_DITTO_PRINTING 0
    #define USE_ADVANCE 0
    #define ENABLE_QUADRATIC_ADVANCE 0


    // ################# Misc. settings ##################

    #define BAUDRATE 115200
    #define ENABLE_POWER_ON_STARTUP 1
    #define POWER_INVERTING 0
    #define KILL_METHOD 1
    #define ACK_WITH_LINENUMBER 1
    #define KEEP_ALIVE_INTERVAL 2000
    #define WAITING_IDENTIFIER "wait"
    #define ECHO_ON_EXECUTE 1
    #define EEPROM_MODE 2
    #undef PS_ON_PIN
    #define PS_ON_PIN ORIG_PS_ON_PIN
    #define JSON_OUTPUT 0

    /* ======== Servos =======
    Control the servos with
    M340 P S / ServoID = 0..3 pulseInUs = 500..2500
    Servos are controlled by a pulse width normally between 500 and 2500 with 1500ms in center position. 0 turns servo off.
    WARNING: Servos can draw a considerable amount of current. Make sure your system can handle this or you may risk your hardware!
    */
    #define FEATURE_SERVO 0
    #define SERVO0_PIN 11
    #define SERVO1_PIN -1
    #define SERVO2_PIN -1
    #define SERVO3_PIN -1
    #define SERVO0_NEUTRAL_POS -1
    #define SERVO1_NEUTRAL_POS -1
    #define SERVO2_NEUTRAL_POS -1
    #define SERVO3_NEUTRAL_POS -1
    #define UI_SERVO_CONTROL 0
    #define FAN_KICKSTART_TIME 200

    #define FEATURE_WATCHDOG 0

    // #################### Z-Probing #####################

    #define Z_PROBE_Z_OFFSET 0
    #define Z_PROBE_Z_OFFSET_MODE 0
    #define UI_BED_COATING 0
    #define FEATURE_Z_PROBE 1
    #define EXTRUDER_IS_Z_PROBE 0
    #define Z_PROBE_BED_DISTANCE 10
    #define Z_PROBE_PIN ORIG_Z_MIN_PIN
    #define Z_PROBE_PULLUP 0
    #define Z_PROBE_ON_HIGH 1
    #define Z_PROBE_X_OFFSET 0
    #define Z_PROBE_Y_OFFSET 0
    #define Z_PROBE_WAIT_BEFORE_TEST 0
    #define Z_PROBE_SPEED 5
    #define Z_PROBE_XY_SPEED 1000
    #define Z_PROBE_SWITCHING_DISTANCE 1
    #define Z_PROBE_REPETITIONS 1
    #define Z_PROBE_HEIGHT 10
    #define Z_PROBE_START_SCRIPT ""
    #define Z_PROBE_FINISHED_SCRIPT ""
    #define Z_PROBE_RUN_AFTER_EVERY_PROBE ""
    #define Z_PROBE_REQUIRES_HEATING 0
    #define Z_PROBE_MIN_TEMPERATURE 150
    #define FEATURE_AUTOLEVEL 0
    #define FEATURE_SOFTWARE_LEVELING 0
    #define Z_PROBE_X1 -110
    #define Z_PROBE_Y1 -60
    #define Z_PROBE_X2 110
    #define Z_PROBE_Y2 -60
    #define Z_PROBE_X3 0
    #define Z_PROBE_Y3 130
    #define BED_LEVELING_METHOD 0
    #define BED_CORRECTION_METHOD 0
    #define BED_LEVELING_GRID_SIZE 5
    #define BED_LEVELING_REPETITIONS 5
    #define BED_MOTOR_1_X 0
    #define BED_MOTOR_1_Y 0
    #define BED_MOTOR_2_X 200
    #define BED_MOTOR_2_Y 0
    #define BED_MOTOR_3_X 100
    #define BED_MOTOR_3_Y 200
    #define BENDING_CORRECTION_A 0
    #define BENDING_CORRECTION_B 0
    #define BENDING_CORRECTION_C 0
    #define FEATURE_AXISCOMP 0
    #define AXISCOMP_TANXY 0
    #define AXISCOMP_TANYZ 0
    #define AXISCOMP_TANXZ 0

    #ifndef SDSUPPORT // Some boards have sd support on board. These define the values already in pins.h
    #define SDSUPPORT 0
    #undef SDCARDDETECT
    #define SDCARDDETECT -1
    #define SDCARDDETECTINVERTED 0
    #endif
    #define SD_EXTENDED_DIR 1 /** Show extended directory including file length. Don't use this with Pronterface! */
    #define SD_RUN_ON_STOP ""
    #define SD_STOP_HEATER_AND_MOTORS_ON_STOP 1
    #define ARC_SUPPORT 1
    #define FEATURE_MEMORY_POSITION 1
    #define FEATURE_CHECKSUM_FORCED 0
    #define FEATURE_FAN_CONTROL 1
    #define FEATURE_FAN2_CONTROL 1
    #define FEATURE_CONTROLLER 11
    #define ADC_KEYPAD_PIN -1
    #define LANGUAGE_EN_ACTIVE 1
    #define LANGUAGE_DE_ACTIVE 0
    #define LANGUAGE_NL_ACTIVE 0
    #define LANGUAGE_PT_ACTIVE 0
    #define LANGUAGE_IT_ACTIVE 0
    #define LANGUAGE_ES_ACTIVE 0
    #define LANGUAGE_FI_ACTIVE 0
    #define LANGUAGE_SE_ACTIVE 0
    #define LANGUAGE_FR_ACTIVE 0
    #define LANGUAGE_CZ_ACTIVE 0
    #define LANGUAGE_PL_ACTIVE 0
    #define LANGUAGE_TR_ACTIVE 0
    #define UI_PRINTER_NAME "Freez"
    #define UI_PRINTER_COMPANY "Home made"
    #define UI_PAGES_DURATION 2000
    #define UI_SPEEDDEPENDENT_POSITIONING 1
    #define UI_DISABLE_AUTO_PAGESWITCH 1
    #define UI_AUTORETURN_TO_MENU_AFTER 120000
    #define FEATURE_UI_KEYS 0
    #define UI_ENCODER_SPEED 2
    #define UI_REVERSE_ENCODER 1
    #define UI_KEY_BOUNCETIME 10
    #define UI_KEY_FIRST_REPEAT 500
    #define UI_KEY_REDUCE_REPEAT 50
    #define UI_KEY_MIN_REPEAT 50
    #define FEATURE_BEEPER 0
    #define CASE_LIGHTS_PIN 58
    #define CASE_LIGHT_DEFAULT_ON 1
    #define UI_START_SCREEN_DELAY 1000
    #define UI_DYNAMIC_ENCODER_SPEED 1
    /**
    Beeper sound definitions for short beeps during key actions
    and longer beeps for important actions.
    Parameter is delay in microseconds and the secons is the number of repetitions.
    Values must be in range 1..255
    */
    #define BEEPER_SHORT_SEQUENCE 2,2
    #define BEEPER_LONG_SEQUENCE 8,8
    #define UI_SET_MIN_HEATED_BED_TEMP 30
    #define UI_SET_MAX_HEATED_BED_TEMP 120
    #define UI_SET_MIN_EXTRUDER_TEMP 170
    #define UI_SET_MAX_EXTRUDER_TEMP 260
    #define UI_SET_EXTRUDER_FEEDRATE 2
    #define UI_SET_EXTRUDER_RETRACT_DISTANCE 3


    #define NUM_MOTOR_DRIVERS 0



    #endif
  • ok, as i work with Due i can´t check directly, but ihave a ramps board free so i´ll try to set it up tomorrow to check your setup.
    (even i don´t have the controller but that shouldn´t matter)

  • edited February 2017
    so i´ve set it up , just downloaded fresh dev. version and copied your configuration.h in it.

    i just connected a led with series resistor to d4  for simulating laser

    as expected , it works. are you shure your mega is ok?

    only thing i see problematic is the memory warning in compiler and for me it looks like not running reliable depending on memory.
    But as i´m not familiar with deltas i have no idea what and how to optimize

  • edited February 2017
    Thanks for your effort. I have the same memory warning for more then one year.  But I 3d printed a lot of stuff without problems. So i expect that is not my problem. My mega could be wrong, but on the other hand my dual extruder works, heated bed, lights,  end stops, lcd... and i tried d4 and d44. But i will also tryout some other pins just to make sure. But it's also strange that the pin is going high only during movement and only during laser mode. And in all other situations just low. I will do some more testing. 

    Ty.
  • edited February 2017
    you wrote :

    But it's also strange that the pin is going high only during movement and only during laser mode.


    thats exactly what it shall do.....!!!
    if it stops and laser would be on you would just make things burning.
    it´s wanted that laser is on only during moves
  • but also during the g0 moves
  • edited February 2017
    And in my case i cannot do a move without laser turned on. A possible workaround would probably be switch from printer mode  to laser mode all the time :-)
  • edited February 2017
    i rechecked and also saw that now ,also no reaction on m5. but in this case i cannot help so gcode is same for all drive systems.
    when i set drive system to 0 everything is ok.but not useable for you

    may be you start a bug report for delta system for this case.

    btw, if you set m3 s0 before go move and m3 s255 before g1 move it should work, but thats not the way it should



    so found the time for short crosstest.
    switched my due testsetup over to drive system 3 and that works like a charm...
    g0 switches off , g1 on  m5 also switches off correct.

    so if not memory related there might be a bug in avr-version, i´m not shure
  • In my script above i tried everything. m3 s0 and also m3 s255  both in combinations with g0 and g1 all with the same result.
  • seems to be memory problem.
    i checked the code which is identical for due and avr and as it works perfect on my due also in delta mode i think it´s
    memory problem on the avr.
    but maybe you start bug report as the not correct working behavior is reproducable
  • Will try to analyse the source code first. Maybe i can find a clue there.
  • already merged avr version vs due version. no difference
  • edited February 2017
    This seems a bit unlogical:

       #if defined(SUPPORT_LASER) && SUPPORT_LASER
       else if(Printer::mode == PRINTER_MODE_LASER)
       {
       p->secondSpeed = ((p->delta[X_AXIS] != 0 || p->delta[Y_AXIS] != 0) && (LaserDriver::laserOn || p->delta[E_AXIS] != 0) ? LaserDriver::intensity : 0);
       p->delta[E_AXIS] = 0;
       }
       #endif



    In combination with this:
            case 452:
    #if defined(SUPPORT_LASER) && SUPPORT_LASER
    waitUntilEndOfAllMoves();
                Printer::mode = PRINTER_MODE_LASER;

  • What is here unlogical?
  • edited February 2017
    the else if statement. Now c is not my native programming language, so i could be mistaken ofcourse. :-)

    Looking longer at this code i think this is not the problem. Sometimes a bit hard to read c code. I thought that the else if was a part of the if statement but it is not. Still no solution :-(

    Luckily weekend is coming up :-)

  • #if is a preprocessor if and decides which code parts get compiled at all. The following else is part of c++ logic. SO watch out for # signs indicating non c++ but preprocessor statements.
  • Thank you for the answer, i understand now why. Just to make the final code shorter.
  • I really don't get it. Switched the pin number of the laser and the case light to see what happens. This is also very pleasant because now i can see easy when the laser is on (case light). But the problem is the same, during all moves it stays on.

    What happens with this code:

    g28
    m452
    m3 s0
    g0 z300
    m3 s255
    g0 z400

    The light turns on, homing starts and flickers during the multiple end stops hits, moves to z300 and z400 with lights on and then the lights go off.

    Added also comment output to all changeIntensity calls. And almost during all moves the repetier.h calls the changeIntensity(255). I think i'm going to use the fan pin. Because this is not working at all for me. My added comment in the repetier.h file:

    if defined(SUPPORT_LASER) && SUPPORT_LASER
            else if(Printer::mode == PRINTER_MODE_LASER)
            {
                Com::printFLN(PSTR("Added for testing, change intensity to 255 (2)"));
                LaserDriver::changeIntensity(255);
            }

    :((
  • I don't understand it. G0 has laser off so it should not be on. So you are using wrong pins or pins are used for other functions as well so they get enabled. Something like that.
  • Still strange that RAYwB was able to reproduce the not functioning m5 command. Running my delta on ramps 1.4.
  • Haven't seen that comment. I see M5 sets laserOn to false and adding moves uses this condition:
                    p->secondSpeed = ((p->delta[X_AXIS] != 0 || p->delta[Y_AXIS] != 0) && (LaserDriver::laserOn || p->delta[E_AXIS] != 0) ? LaserDriver::intensity : 0);

    so essentially setting intensity 0 if laser is off. And G0/Z moves also have always laser disabled. And from your description nothing of this is happening in your case.
  • Thanks to a hint from RAyWB I found something. Just fixed dev version. For deltas laser was always set to 255 and not secondSpeed which is what we set in M3/M5. Should now work much better I think (please test if possible).
  • edited February 2017
    I was just starting to migrate my firmware to the m106 setup. But i will give it another go, will keep you updated.
  • edited February 2017
    Working now as designed! Thanks for your effort! So no wrong pins etc ;-) the problem was exactly in the code i pasted above only i was mistaking the file it was in (was a bit hard to see what file was open due to the many tabs).

    But after all this testing i'm wondering why would i not go for a fan pin so i have pwm and the ability for greyscale? Less code in memory. Are there any drawbacks?

    Regards and thanks again!
    Arjan

  • Fan does not change between G0/G1 and is always on while G1 will enable laser and disable at end for safety etc. So the laser solution is the one you want. It is easy to mod it a bit in driver.cpp where you set intensity. There you can also call analogWrite(pin,intensity) if it is a hardware pwm or set the fan speed there. Fans get a 16Hz signal so it is more like a dotted line maybe, depending how much frequency the driver needs to set power. I somehow assume you need a high frequency to do grayscale.
Sign In or Register to comment.