# ===MicroDelta Rework===
#
#   \  | _)                    __ \         |  |                _ \                                |    
#  |\/ |  |   __|   __|  _ \   |   |   _ \  |  __|   _` |      |   |   _ \ \ \  \   /  _ \    __|  |  / 
#  |   |  |  (     |    (   |  |   |   __/  |  |    (   |      __ <    __/  \ \  \ /  (   |  |       <  
# _|  _| _| \___| _|   \___/  ____/  \___| _| \__| \__,_|     _| \_\ \___|   \_/\_/  \___/  _|    _|\_\ 
#
# Fichier de configuration des entrees sorties de la carte eMotronic
# Pour toutes questions supplementaires, vous pouvez nous contacter 
# a l'adresse email ci-dessous.
# 
# ATTENTION: Il est extremement deconseille de modifier ce fichier !!!
# Ne modifiez ce fichier que si vous savez exactement ce que vous faites.
# A partir du moment ou vous modifiez ce fichier vous sortez de 
# l'utilisation usuelle de votre MicroDelta Rework. Le support client ne 
# sera plus en mesure de vous guider plus a partir ce cette modification.
#
# Re-telechargez le fichier sur notre section support si vous avez un doute
# sur l'integrite du fichier.
#
# =======================
# This is the configuration file dedicated to the eMotronic board.
# Feel free to ask or give us any feedback to the email below:
#
# WARNING: Please do not modify this file except if you know exactly what you are doing.
# Please understand that our support will not accompagny you to thoses modifications.
# 
# =======================
# Email : contact [at] eMotion-tech [point] com
# =======================

version_name             V1.7d

# NOTE Lines must not exceed 132 characters

## Robot module configurations : general handling of movement G-codes and slicing into moves
default_feed_rate                            4000             # Default rate ( mm/minute ) for G1/G2/G3 moves
default_seek_rate                            4000             # Default rate ( mm/minute ) for G0 moves
mm_per_arc_segment                           0.0              # Arcs are cut into segments ( lines ), this is the length for
mm_max_arc_error                             0.01             # The maximum error for line segments that divide arcs 0 to 
                                                              # disable these segments.  Smaller values mean more resolution,
                                                              # higher values mean faster computation
#mm_per_line_segment                         5                # Lines can be cut into segments ( not usefull with cartesian
 
 
delta_segments_per_second                    100              # for deltas only same as in Marlin/Delta, set to 0 to disable
                                                              # coordinates robots ).

play_led_disable	true

alpha_steps_per_mm                           80               # Steps per mm for alpha stepper
beta_steps_per_mm                            80               # Steps per mm for beta stepper
gamma_steps_per_mm                           80			          # Steps per mm for gamma stepper

arm_solution                                 linear_delta
arm_length                                   170              # this is the length of an arm from hinge to hinge
arm_radius                                   80  

# Planner module configuration : Look-ahead and acceleration configuration
planner_queue_size                           32               # DO NOT CHANGE THIS UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING
acceleration                                 3000             # Acceleration in mm/second/second.
junction_deviation                           0.05             # Similar to the old "max_jerk", in millimeters,
                                                              # see https://github.com/grbl/grbl/blob/master/planner.c
                                                              # and https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.8
                                                              # Lower values mean being more careful, higher values means being
                                                              # faster and have more jerk
#z_junction_deviation                        0.0              # for Z only moves, -1 uses junction_deviation, zero disables 
                                                              # junction_deviation on z moves DO NOT SET ON A DELTA
#minimum_planner_speed                       0.0              # sets the minimum planner speed in mm/sec

# Stepper module configuration
microseconds_per_step_pulse                  1                # Duration of step pulses to stepper drivers, in microseconds
base_stepping_frequency                      100000           # Base frequency for stepping

# Cartesian axis speed limits
x_axis_max_speed                             24000		        # mm/min
y_axis_max_speed                             24000            # mm/min
z_axis_max_speed                             24000            # mm/min

# Stepper module pins ( ports, and pin numbers, appending "!" to the number will invert a pin )
# ATTENTION : ALPHA ET GAMMA SONT INVERSES POUR LA MICRODELTA REWORK, pour une utilisation normale inversez le step/dir/en/max
alpha_step_pin                               2.2              # Pin for alpha stepper step signal
alpha_dir_pin                                4.28!            # Pin for alpha stepper direction
alpha_en_pin                                 4.29             # Pin for alpha enable
alpha_max_rate                               24000.0          # mm/min

beta_step_pin                                2.1              # Pin for beta stepper step signal
beta_dir_pin                                 0.22!            # Pin for beta stepper direction
beta_en_pin                                  0.21             # Pin for beta enable pin
beta_max_rate                                24000.0          # mm/min

gamma_step_pin                               2.0              # Pin for gamma stepper step signal
gamma_dir_pin                                3.26!            # Pin for gamma stepper direction
gamma_en_pin                                 3.25             # Pin for gamma enable
gamma_max_rate                               24000.0          # mm/min


## System configuration
# Serial communications configuration ( baud rate defaults to 9600 if undefined )
uart0.baud_rate                              115200           # Baud rate for the default hardware serial port
second_usb_serial_enable                     false            # This enables a second usb serial port (to have both pronterface

## Extruder module configuration
extruder.hotend.enable                       false             # Whether to activate the extruder module at all. All configuration is ignored if false
extruder.hotend.steps_per_mm                 350              # Steps per mm for extruder stepper
extruder.hotend.default_feed_rate            600              # Default rate ( mm/minute ) for moves where only the extruder moves
extruder.hotend.acceleration                 500              # Acceleration for the stepper motor mm/sec
extruder.hotend.max_speed                    40               # mm/s

extruder.hotend.step_pin                     2.3              # Pin for extruder step signal
extruder.hotend.dir_pin                      0.4              # Pin for extruder dir signal
extruder.hotend.en_pin                       0.5              # Pin for extruder enable signal

extruder.hotend2.enable                      true             # Whether to activate the extruder module at all. All configuration is ignored if false
extruder.hotend2.steps_per_mm                350              # Steps per mm for extruder stepper
extruder.hotend2.default_feed_rate           600              # Default rate ( mm/minute ) for moves where only the extruder moves
extruder.hotend2.acceleration                500              # Acceleration for the stepper motor mm/sec
extruder.hotend2.max_speed                   40               # mm/s

extruder.hotend2.step_pin                    2.8              # Pin for extruder step signal
extruder.hotend2.dir_pin                     0.20             # Pin for extruder dir signal
extruder.hotend2.en_pin                      0.19             # Pin for extruder enable signal

extruder.hotend2.x_offset                    0                # x offset from origin in mm
extruder.hotend2.y_offset                    0                # y offset from origin in mm
extruder.hotend2.z_offset 		               0

## Temperature control configuration
# First hotend configuration
temperature_control.hotend.enable            true             # Whether to activate this ( "hotend" ) module at all.
                                                              # All configuration is ignored if false.
temperature_control.hotend.thermistor_pin    0.24             # Pin for the thermistor to read
temperature_control.hotend.heater_pin        2.6              # Pin that controls the heater, set to nc if a readonly thermistor is being defined
temperature_control.hotend.thermistor        EPCOS100K         # see http://smoothieware.org/temperaturecontrol#toc5
temperature_control.hotend.set_m_code        104              #
temperature_control.hotend.set_and_wait_m_code 109            #
temperature_control.hotend.designator        T                #
temperature_control.hotend.p_factor          41.2             # permanently set the PID values after an auto pid
temperature_control.hotend.i_factor          2.903            #
temperature_control.hotend.d_factor          146              #
#temperature_control.hotend.runaway_range     5               # Safety temperature gap between target and result
temperature_control.hotend.runaway_heating_timeout 0

temperature_control.bed.enable               true             # Enable heatBedActiver le lit chauffant
temperature_control.bed.thermistor_pin       0.25             #
temperature_control.bed.heater_pin           2.5              #
temperature_control.bed.thermistor           RRRF100K         # see http://smoothieware.org/temperaturecontrol#toc5
temperature_control.bed.set_m_code           140              #
temperature_control.bed.set_and_wait_m_code  190              #
temperature_control.bed.designator           B                #
temperature_control.bed.p_factor             300              # permanently set the PID values after an auto pid
temperature_control.bed.i_factor             14.4             #
temperature_control.bed.d_factor             300              #
#temperature_control.bed.runaway_range       10               # Safety temperature gap between target and result
temperature_control.bed.runaway_heating_timeout 0

## Switch module for fan control
switch.fan.enable                            true             #
switch.fan.input_on_command                  M106             #
switch.fan.input_off_command                 M107             #
switch.fan.output_pin                        2.11             #
switch.fan.output_type                       pwm              # pwm output settable with S parameter in the input_on_comand
#switch.fan.max_pwm                          128              # && set max pwm for the pin default is 255

switch.fan_extruder.enable                   true             #
switch.fan_extruder.output_pin               2.13             #
switch.fan_extruder.output_type              pwm              # just an on or off pin
#switch.fan_extruder.max_pwm                 180              #
switch.fan_extruder.startup_value	           255              #
switch.fan_extruder.startup_state	           true             #
switch.fan_extruder.ignore_on_halt           true             #


## Endstops
endstops_enable                              true             # the endstop module is enabled by default and can be disabled here
delta_homing 				                         true

alpha_min_endstop                            nc               # add a ! to invert if endstop is NO connected to ground
alpha_max_endstop                            1.22!            # NOTE set to nc if this is not installed
alpha_homing_direction                       home_to_max      # or set to home_to_max and set alpha_max
alpha_max                                    0                # this gets loaded after homing when home_to_max is set
beta_min_endstop                             nc               #
beta_max_endstop                             1.23!^           #
beta_homing_direction                        home_to_max      #
beta_max                                     0                #
gamma_min_endstop                            nc               #
gamma_max_endstop                            1.24!^           #
gamma_homing_direction                       home_to_max      #
gamma_max                                    180              #
endstop_debounce_count	100



alpha_fast_homing_rate_mm_s                  50               # feedrates in mm/second
beta_fast_homing_rate_mm_s                   50               # "
gamma_fast_homing_rate_mm_s                  50               # "
alpha_slow_homing_rate_mm_s                  25               # "
beta_slow_homing_rate_mm_s                   25               # "
gamma_slow_homing_rate_mm_s                  25               # "

alpha_homing_retract_mm                      5                # distance in mm
beta_homing_retract_mm                       5                # "
gamma_homing_retract_mm                      5                # "

#endstop_debounce_count                      100              # uncomment if you get noise on your endstops, default is 100

## Z-probe
zprobe.enable                                true             # set to true to enable a zprobe
zprobe.probe_pin                             0.26!^           # pin probe is attached to if NC remove the !
zprobe.slow_feedrate                         20               # mm/sec probe feed rate
zprobe.debounce_count                        100              # set if noisy
zprobe.fast_feedrate                         100              # move feedrate mm/sec
zprobe.probe_height                          20               # how much above bed to start probe

# associated with zprobe the leveling strategy to use
leveling-strategy.delta-calibration.enable          true      # basic delta calibration
leveling-strategy.delta-calibration.radius          65        # the probe radius
leveling-strategy.delta-calibration.tolerance       0.04
leveling-strategy.delta-calibration.initial_height  10        # height above bed to stop initial move

#grid
leveling-strategy.delta-grid.enable                 true
leveling-strategy.delta-grid.radius                 65
leveling-strategy.delta-grid.size                   7
leveling-strategy.delta-grid.do_home                true
leveling-strategy.delta-grid.probe_offsets          0,0,0     # probe offsets x,y,z  (Z should always be 0)
leveling-strategy.delta-grid.save                   true
leveling-strategy.delta-grid.initial_height         30

## Panel

###########
# DISPLAY #
###########

panel.enable                true                              # set to true to enable the panel code
panel.lcd                   viki2                             # set type of panel. AZSMZ 12864 LCD is similar viki2, also set to viki2.
panel.spi_channel           0                                 # set spi channel to use P0_18,P0_15 MOSI,SCLK
panel.spi_cs_pin            0.1                               # set spi chip select
panel.encoder_a_pin         1.26!^                            # encoder pin
panel.encoder_b_pin         1.28!^                            # encoder pin
panel.click_button_pin      0.11!^                            # click button
panel.a0_pin                1.29                              # st7565 needs an a0
panel.contrast              15                                # some panels need contrast set, 38 for eMotronic LCD 19 AZSMZ 12864 LCD
panel.encoder_resolution    4                                 # number of clicks to move 1 item
panel.buzz_pin              0.10                              # pin for buzzer (use red led OR buzzer not both)
panel.menu_offset           0                                 # some panels will need 1 here
panel.reverse               1

custom_menu.prechauf.enable  true
custom_menu.prechauf.name    Prechauffage
custom_menu.prechauf.command M104_S202|M140_S61

custom_menu.eject.enable     true
custom_menu.eject.name       Ejection_Filament
custom_menu.eject.command    G28|G0_Z20_F3000|M109_S200|G91|G1_E5_F300|G1_E-500_F1200|M104_S0|G90

custom_menu.zero.enable     true
custom_menu.zero.name       Z0_Manuel
custom_menu.zero.command    G92_Z0

custom_menu.save.enable     true
custom_menu.save.name       Sauvegarde_Config
custom_menu.save.command    M500



kill_button_enable			    false	                            # Enable the "kill" button
kill_button_pin			        0.0^!	                            # Pin for the "kill" button


# setup for external sd card on the LCD board
panel.external_sd                 true                        # set to true if there is an extrernal sdcard on the panel
panel.external_sd.spi_channel     0                           # set spi channel the sdcard is on
panel.external_sd.spi_cs_pin      0.16                        # set spi chip select for the sdcard
panel.external_sd.sdcd_pin        1.31!^                      # sd detect signal (set to nc if no sdcard detect)


ws2812b_module_enable            false


