Monthly Archives: December 2012

LCD and Encoder controls (Panelolu) – – – – – – – Part 1, Software

I’d like to first thank the people over at think3dprint3d.com for all the hard work they’ve done in providing most of the work in connecting an LCD and encoder to the PrintrBoard. I’m re-posting this information using the code that works for my PrintrBoard I use on my MendelMax. If this helps you with your machine then please leave a comment.

This code should work with any PrintrBoard connected to either a MendelMax, Printrbot or any 3D printer where you’re using Marlin firmware.

This post has 2 parts, this, the Software part and part 2, the Hardware part which will show the wiring diagrams for the LCD and controls.

The examples given will be using the latest version (at the time of writing) of the Marlin firmware.  Download it HERE

You must first prepare the files Configuration.h and pins.h within the firmware to access the LCD and encoder.

Configuration.h

line 48-50

#ifndef MOTHERBOARD
  #define MOTHERBOARD 81
#endif

line 78-81

#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 -1
#define TEMP_SENSOR_2 -1
#define TEMP_SENSOR_BED 1

line 216-218

const bool X_ENDSTOPS_INVERTING = false; //set to true to invert the logic of the endstops
const bool Y_ENDSTOPS_INVERTING = false; //set to true to invert the logic of the endstops
const bool Z_ENDSTOPS_INVERTING = false; //set to true to invert the logic of the endstops

line 275 – Obviously change these values to your own printers configuration.

#define DEFAULT_AXIS_STEPS_PER_UNIT   {78.7402,78.7402,200*8/3,760*1.1}

line 279-283 – Not necessary but I like to slow down the acceleration for less ringing when changing direction.

#define DEFAULT_ACCELERATION 1500 //X, Y, Z and E max acceleration in mm/s^2 for printing moves
#define DEFAULT_RETRACT_ACCELERATION 3000 //X, Y, Z and E max acceleration in mm/s^2 for r retracts
#define DEFAULT_XYJERK 12.0

line 302-307

//LCD and SD support
//#define ULTRA_LCD //general lcd support, also 16x2
#define SDSUPPORT // Enable SD Card Support in Hardware Console
#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
//#define ULTIPANEL //the ultipanel as on thingiverse
pins.h

line 961

#define FAN_PIN            22  // Fan

line 973 – To enable SD card support you must move the Y-endstop to the E-endstop pins (see previous post)

#define Y_STOP_PIN         37

line 989-994

#ifndef SDSUPPORT
  // these pins are defined in the SD library if building with SD support
    #define SCK_PIN          21  // 9
    #define MISO_PIN         22  //11
    #define MOSI_PIN         23  //10
  #endif

line 995 add the following

#ifdef ULTRA_LCD
 #ifdef NEWPANEL
  //we have no buzzer installed
  #define BEEPER -1
  //LCD Pins
  #define LCD_PINS_RS        41
  #define LCD_PINS_ENABLE    1
  #define LCD_PINS_D4        11
  #define LCD_PINS_D5        9
  #define LCD_PINS_D6        6
  #define LCD_PINS_D7        4

  //The encoder and click button
  #define BTN_EN1 2  //must be a hardware interrupt pin
  #define BTN_EN2 3  //must be hardware interrupt pin
  #define BTN_ENC 0  //the click

  //not connected to a pin currently
  #define SDCARDDETECT -1

  //from the same bit in the RAMPS Newpanel define
  //encoder rotation values
  #define encrot0 0
  #define encrot1 2
  #define encrot2 3
  #define encrot3 1

  #define BLEN_C 2
  #define BLEN_B 1
  #define BLEN_A 0
 #endif //Newpanel
#endif //ULTRA_LCD

Upload this firmware to your PrintrBoard (how-to).

Once updated restart your PrintrBoard. If you have the LCD connected then it should display data about your printer. If you haven’t connected the LCD to your PrintrBoard yet then it’s worth attempting to connect your computer to the PrintrBoard to make sure everything is still working correctly.

Advertisements
Tagged , , , ,

Latest Marlin firmware for PrintrBoard

Recently I had noticed that the version of Marlin I was using on my 3D printer (using a PrintrBoard as the control board) was Marlin v1.0.0 RC2 and looking on GitHub there had been quite a few changes since this version was released.

Although a lot of work making it compatible with a PrintrBoard had already been included I needed to make a few alterations to get it working fully.

Code alterations I’ve made include:

  • change motherboard, temp sensors, endstops not inverting, included SD and LCD support to Configuration.h
  • swapped Y endstop pin to E endstop pin, added LCD, encoder and SD card pins to pins.h

Obvious updates include:

  • X & Y location on LCD home screen
  • Long filenames on SD card support
  • Move Axis by 10mm, 1mm or 0.1mm increments

You can download the version of Marlin I’m using here.  Don’t forget to adjust the calibration figures to your printers requirements.

Tagged , , ,