-
Notifications
You must be signed in to change notification settings - Fork 732
User Interface
It is possible to control all operations of the printer over a serial line. But if you want a stand alone printer or simple some additional way of input, you can use the user interface methods offered by the firmware.
The simplest addition is a single LCD, which shows some current data like extruder/bed temperature or z-level. If you want some methods of input, you can add keys. The minimum required is three signals. You can use a rotary encoder with push button function or three plain push buttons. The addition of a complete key matrix up to 4x4 buttons is also possible. For acoustic feedback, a piezo buzzer can be added.
The current implementation supports direct connection to IO pins of your Arduino or an indirect connection over I2C to a PCF8574 chip, where the display and keys/buzzer are connected. You need one chip for the display and one for the keys and buzzer. If you have the pins, use direct connection. It is much faster and less error prone.
All configurations of the user interface are done in uiconfig.h.
The firmware uses a very flexible concept for the user interface. The key behind all this is a flexible output command and assignable actions. So how does it work? Everywhere, where you can define some output you can include place holder for special values like current temperature or z-position. It doesn't really matter for which function the output was meant, you can show the temperature in the x-position menu if you like. These placeholder always consist of three chars, beginning with a %. The following two letter determine the information shown.
List of placeholder
%ec : Current extruder temperature
%eb : Current heated bed temperature
%e0..9 : Temp. of extruder 0..9
%er : Extruder relative mode
%Ec : Target temperature of current extruder
%Eb : Target temperature of heated bed
%E0-9 : Target temperature of extruder 0..9
%os : Status message
%oe : Error message
%oB : Buffer length
%oc : Connection baudrate
%o0..9 : Output level extruder 0..9 is % including %sign.
%oC : Output level current extruder
%ob : Output level heated bed
%%% : The % char
%x0 : X position
%x1 : Y position
%x2 : Z position
%x3 : Current extruder position
%sx : State of x min endstop.
%sX : State of x max endstop.
%sy : State of y min endstop.
%sY : State of y max endstop.
%sz : State of z min endstop.
%sZ : State of z max endstop.
%do : Debug echo state.
%di : Debug info state.
%de : Debug error state.
%dd : Debug dry run state.
%O0 : OPS mode = 0
%O1 : OPS mode = 1
%O2 : OPS mode = 2
%Or : OPS retract distance
%Ob : OPS backslash distance
%Od : OPS min distance
%Oa : OPS move after
%ax : X acceleration during print moves
%ay : Y acceleration during print moves
%az : Z acceleration during print moves
%aX : X acceleration during travel moves
%aY : Y acceleration during travel moves
%aZ : Z acceleration during travel moves
%aj : Max. jerk
%aJ : Max. Z-jerk
%fx : Max. feedrate x direction
%fy : Max. feedrate y direction
%fz : Max. feedrate z direction
%fe : Max. feedrate current extruder
%fX : Homing feedrate x direction
%fY : Homing feedrate y direction
%fZ : Homing feedrate z direction
%Sx : Steps per mm x direction
%Sy : Steps per mm y direction
%Sz : Steps per mm z direction
%Se : Steps per mm current extruder
%is : Stepper inactive time in seconds
%ip : Max. inactive time in seconds
%X0..9 : Extruder selected marker
%Xi : PID I gain
%Xp : PID P gain
%Xd : PID D gain
%Xm : PID drive min
%XM : PID drive max
%XD : PID max
%Xw : Extruder watch period in seconds
%Xh : Extruder heat manager (BangBang/PID)
%Xa : Advance K value
%Xx : x offset in steps
%Xy : y offset in steps
%Xf : Extruder max. start feedrate
%XF : Extruder max. feedrate
%XA : Extruder max. acceleration
Notice: Some values are only available, if the matching functions are included. E.g. the PID values are only possible if you compiled with PID support.
The second key concept are actions. An action is defined by what happens if it is executed. One possible action is home x, so if it is executed, your extruder will move to x home position. It doesn't matter what triggered that action. You can assign this to a key or it can be an action belonging to an menu entry.
Possible actions for keys and menu functions
UI_ACTION_NEXT : Next higher value/menu entry
UI_ACTION_PREVIOUS : Previous lower value/menu entry
UI_ACTION_DUMMY : Do nothing
UI_ACTION_BACK : Go one menu level higher
UI_ACTION_OK : Select entry or finish setting value
UI_ACTION_MENU_UP : Go one menu level higher
UI_ACTION_TOP_MENU : Go to the information menu
UI_ACTION_EMERGENCY_STOP : Stop printer, run endless loop
UI_ACTION_XPOSITION : Change x position with microstep resolution
UI_ACTION_YPOSITION : Change y position with microstep resolution
UI_ACTION_ZPOSITION : Change z position with microstep resolution
UI_ACTION_EPOSITION : Change extruder position with 1mm resolution
UI_ACTION_BED_TEMP : Change heated bed temperature
UI_ACTION_EXTRUDER_TEMP : Change extruder temperature
UI_ACTION_SD_DELETE : Delete file on sd card
UI_ACTION_SD_PRINT : Print file on sd card
UI_ACTION_SD_PAUSE : Pause/stop sd print
UI_ACTION_SD_CONTINUE : Continue sd print
UI_ACTION_SD_UNMOUNT : Unount sd card
UI_ACTION_SD_MOUNT : Mount sd card
UI_ACTION_XPOSITION_FAST : Change x position with 1mm steps
UI_ACTION_YPOSITION_FAST : Change x position with 1mm steps
UI_ACTION_ZPOSITION_FAST : Change x position with 1mm steps
UI_ACTION_HOME_ALL : Home all axis
UI_ACTION_HOME_X : Home x axis
UI_ACTION_HOME_Y : Home y axis
UI_ACTION_HOME_Z : Home z axis
UI_ACTION_SELECT_EXTRUDER1 : Make extruder 1 current extruder
UI_ACTION_OPS_RETRACTDISTANCE : Change OPS retractions distance
UI_ACTION_OPS_BACKSLASH : Change OPS backslash
UI_ACTION_OPS_MOVE_AFTER : Change OPS move after
UI_ACTION_OPS_MINDISTANCE : Change OPS min. distance
UI_ACTION_STORE_EEPROM : Store settings in EEPROM
UI_ACTION_LOAD_EEPROM : Load settings from EEPROM
UI_ACTION_PRINT_ACCEL_X : Change x acceleration during print
UI_ACTION_PRINT_ACCEL_Y : Change y acceleration during print
UI_ACTION_PRINT_ACCEL_Z : Change z acceleration during print
UI_ACTION_MOVE_ACCEL_X : Change x acceleration during moves
UI_ACTION_MOVE_ACCEL_Y : Change y acceleration during moves
UI_ACTION_MOVE_ACCEL_Z : Change z acceleration during moves
UI_ACTION_MAX_JERK : Change jerk value
UI_ACTION_MAX_ZJERK : Change z-jerk value
UI_ACTION_BAUDRATE : Change baudrate. Works only after storing to eeprom and reset!
UI_ACTION_HOMING_FEEDRATE_X : Change x homing feedrate
UI_ACTION_HOMING_FEEDRATE_Y : Change y homing feedrate
UI_ACTION_HOMING_FEEDRATE_Z : Change z homing feedrate
UI_ACTION_MAX_FEEDRATE_X : Change maximum x feedrate
UI_ACTION_MAX_FEEDRATE_Y : Change maximum y feedrate
UI_ACTION_MAX_FEEDRATE_Z : Change maximum z feedrate
UI_ACTION_STEPS_X : Change steps per mm in x direcion
UI_ACTION_STEPS_Y : Change steps per mm in y direcion
UI_ACTION_STEPS_Z : Change steps per mm in z direcion
UI_ACTION_FAN_OFF : Turn fan off
UI_ACTION_FAN_25 : Set fan to 25%
UI_ACTION_FAN_50 : Set fan to 50%
UI_ACTION_FAN_75 : Set fan to 75%
UI_ACTION_FAN_FULL : Set fan to 100%
UI_ACTION_FEEDRATE_MULTIPLY : Change feedrate multiplier
UI_ACTION_STEPPER_INACTIVE : Change stepper inactivity timeout
UI_ACTION_MAX_INACTIVE : Change max inactivity timeout
UI_ACTION_PID_PGAIN : Change P gain for PID of current extruder
UI_ACTION_PID_IGAIN : Change I gain for PID of current extruder
UI_ACTION_PID_DGAIN : Change D gain for PID of current extruder
UI_ACTION_DRIVE_MIN : Change drive min for PID of current extruder
UI_ACTION_DRIVE_MAX : Change drive max for PID of current extruder
UI_ACTION_X_OFFSET : Change x offset of current extruder
UI_ACTION_Y_OFFSET : Change y offset of current etxruder
UI_ACTION_EXTR_STEPS : Change steps per mm of current extruder
UI_ACTION_EXTR_ACCELERATION : Change extruder acceleration
UI_ACTION_EXTR_MAX_FEEDRATE : Change extruder maximum feedrate
UI_ACTION_EXTR_START_FEEDRATE : Change extruder start feedrate
UI_ACTION_EXTR_HEATMANAGER : Change etxruder heat manager
UI_ACTION_EXTR_WATCH_PERIOD : Change temperture stabalize time
UI_ACTION_PID_MAX : Change extruder pid max value
UI_ACTION_ADVANCE_K : Change advance K value
UI_ACTION_SET_ORIGIN : Set x,y and z origin to current position
UI_ACTION_DEBUG_ECHO : Enable/disable echo of received messages
UI_ACTION_DEBUG_INFO : Enable/disable info messages
UI_ACTION_DEBUG_ERROR : Enable/disable error reports
UI_ACTION_DEBUG_DRYRUN : Enable/disable dry run mode
UI_ACTION_PREHEAT : Pre heat extruder and heated bed
UI_ACTION_COOLDOWN : Disable extruder heater and heated bed
UI_ACTION_HEATED_BED_OFF : Turn heated bed off
UI_ACTION_EXTRUDER0_OFF : Turn extruder 0 off
UI_ACTION_EXTRUDER1_OFF : Turn extruder 1 off
UI_ACTION_HEATED_BED_TEMP : Set heated bed temperature
UI_ACTION_EXTRUDER0_TEMP : Set extruder 0 temperature
UI_ACTION_EXTRUDER1_TEMP : Set extruder 1 temperature
UI_ACTION_OPS_OFF : Turn OPS off
UI_ACTION_OPS_CLASSIC : Switch OPS to classic mode
UI_ACTION_OPS_FAST : Switch OPS to fast mode
UI_ACTION_DISABLE_STEPPER : Disable stepper motors
UI_ACTION_RESET_EXTRUDER : Set extruder position to 0
UI_ACTION_EXTRUDER_RELATIVE : Toggle extruder relative mode
UI_ACTION_SELECT_EXTRUDER0 : Make extruder 0 current extruder
UI_ACTION_MENU_XPOS : Show x position menu
UI_ACTION_MENU_YPOS : Show y position menu
UI_ACTION_MENU_ZPOS : Show z position menu
UI_ACTION_MENU_XPOSFAST : Show x fast position menu
UI_ACTION_MENU_YPOSFAST : Show y fast position menu
UI_ACTION_MENU_ZPOSFAST : Show z fast position menu
UI_ACTION_MENU_SDCARD : Show sd card menu
UI_ACTION_MENU_QUICKSETTINGS : Show quick settings menu
UI_ACTION_MENU_EXTRUDER : Show extruder menu
UI_ACTION_MENU_POSITIONS : Show positions menu