Showing posts with label Marlin Firmware. Show all posts
Showing posts with label Marlin Firmware. Show all posts

Wednesday, 24 September 2014

More Mini Kossel Updates

After nearly 4 months of supplying Mini Kossel kits we have had a lot of fantastic feedback from all the makers who have put the kits together. This is the third post on additions, changes and improvements (the first one is here, and the heated bed one here).


Simple second extruder fan mount


We have had a number of requests for a solution to allow a second, PWM controlled fan to blow on the part being printed, so I designed this modified J_head extruder mount:



This mounts on the end effector plate in the same way as the original one, with the exception that it is rotated by 60 degrees (one hole) to allow the z-probe to clear the second fan:



To minimise the air blowing on the heated bed from the existing, always-on, fan cooling the thermal break on the J-head, I added a strip of aluminium tape to the bottom of the always-on fan mount. The tape can withstand the hot-end temperature so I sealed all the way to the hot-end heater block insulation.



As the fan mount has to be rotated 60 degrees to allow the probe to clear the fan, one of the probe mount screws needs a nut adding:



The second fan is prepared with a male connector pin so it can be plugged and unplugged at the same point as the rest of the end effector wiring loom. In the long run the end effector wiring loom may move to a 2x5 pin plug.



The screws self tap into the plastic of the mount.



The fan wiring follows the same route as the remainder of the end effector/hotend wiring loom, with a plug lined up with the existing plug:



It connects to the RAMPS via screw terminal D9, between the extruder and heated bed (not connected in the picture below), allowing for PWM control when Motherboard number 33 is selected within Marlin configuration.h.




No firmware changes should be required from the standard setup and the cooling settings within Slic3r and Cura will turn the fan on after a specified number of layers.

The source files for the updated hot-end fan mount are on Github. and its also a "thing" on Youmagine!

New PSU for Heated Bed


After an issue with sourcing reliable and economical high current laptop power supplies, James Clutterbuck suggested the Dell DA-2; a 12V 18A power supply:




This beast is capable of providing enough power for the whole printer and heated bed so from now on complete printer kits ordered with heated beds will be supplied with just this power supply. Unfortunately although the DA2 is supplied with what appears to be a 2x4-way Molex Minifit plug, the housing doesn't mate correctly with the standard Molex 2x4 Minifit socket, and so needs to be changed (part numbers below).


Roland designed a new face plate that accommodates the Molex socket along with a power switch and the USB plug.



The power supply cable is wired to both sides of the RAMPS plug:



The assembled faceplate installed:



The documentation will be updated shortly. The source files are available on our Kossel Mini Repository on Github (USB-power-8way-V2). If you want to source the parts for the upgrade, along with the printed plate, you need:

Dell DA-2 Power supply (12V 18A)
8 way connectors: Molex 39-01-2080 and 39-01-2081
16AWG crimp pins for molex 39-00-0078 and 39-00-0082.
Standard case rocker switch such as this one.


Marlin improvements


The Think3dPrint3d Kossel fork of the Marlin firmware is available on github and comes pre-configured as a good starting point for Marlin on a Mini Kossel. I have recently implemented a couple of improvements. Firstly David Lapeš pointed out this feature request/ bug fix for the main version of Marlin which allows for negative position numbers to be correctly displayed on the PanelOne screen:



The second change is to add 4 menu items for filament management. Within the "Prepare" menu you can now choose to prime or retract the filament by a small amount (default 3mm) as well as either load or unload the filament completely (default 560mm).



The default values can be changed within configuration.h, line 399 onwards:

#define EASY_LOAD
#define BOWDEN_LENGTH 560
#define LCD_PURGE_LENGTH 3
#define LCD_RETRACT_LENGTH 3
#define LCD_PURGE_FEEDRATE 200
#define LCD_RETRACT_FEEDRATE 600
#define LCD_LOAD_FEEDRATE 500

#define LCD_UNLOAD_FEEDRATE 500

You can also set the feed rate for each action (in mm/minute)

This based on Lajos's changes to Marlin for the Tantilus printer, I changed his implementation to make it work with the delta firmware and simplify the options a bit.

You can upgrade to these changes by downloading the Think3dPrint3d version of Marlin and uploading it. Make sure you copy across any changes you have made to configuration.h such as the Z height and delta radius after calibration.

Sleeker cable management


Mark Burton has added "Go Faster" stripes to his Kossel mini in the form of these extrusion insets, which nicely hide away the endstop cables.




4 of the strips fit in each extrusion tower. The scad and stl files are on github.




 Thanks to everyone who has sent feedback and design improvements!

Thursday, 16 May 2013

Basic Marlin Configuration.h modification

In order to set up Marlin firmware to work with your 3D printer the Configuration.h file needs to be modified to match your hardware. This post will describe the basics of modifying Configuration.h.

The version of Marlin this is based on is the current (as at 15/05/13) Marlin_v1 version, modified slightly to incorporate the Think3dPrint3d Panelolu2. There are various different Marlin versions:

EricZalm master version
Think3DPrint3D version
RepRapPro version
Nophead version

This post is aimed at helping users of RepRapPro Marlin and Nophead's Marlin migrate their configurations to T3P3 Marlin in order to use the Panelolu2; however it may be helpful to others who are setting up their configuration.h for the first time.

Refer to the working/default Configuration.h from your current setup if you have one and use that as a guide to what settings to put at each stage - if in doubt use the default setting from your printer manufacturer as a start point.

Note: I do not cover every setting, just the main ones to get up and printing.

Environment

The T3P3 version of Marlin is only tested on Arduino-0023 and on the following electronics boards:

Sanguinololu 1.2, and 1.3a
Melzi
RAMPS 1.3 and 1.4
Printrboard

First open Configuration.h in your favourite text editor or the Arduino IDE (it is located in <Marlin Folder>\Marlin\Configuration.h)


(from this point on I am not going to use screen shots for each Configuration.h line)

I will refer to the line number in the version of the T3P3 firmware available today. This will change over time and get out of date but it will be a good start and it should be fairly obvious which line I am referring to. You can see the line number on the bottom left of the Arduino IDE screen - in the shot above the cursor is on line 12.

Add an Author/Version


Line 12
#define STRING_CONFIG_H_AUTHOR "(<something useful here>)" //Who made the changes.

This is helpful to confirm with a glance which version of your configuration.h is loaded on your hardware:



Baudrate


Line 20
// This determines the communication speed of the printer
#define BAUDRATE 250000
//#define BAUDRATE 115200


Keep this on the faster setting unless you have a need to use a slower setting. Make sure you select the same baudrate in Pronterface (or your control software) as you have set here when you connect.

Motherboard


Line 51
#define MOTHERBOARD 7

As the comment above this line shows there are many supported electronics motherboards. Make sure you chose the right version for your electronics (for example 63 for Melzi, 33 for RAMPS 1.3/1.4 with 1 extruder, 34 for RAMPS 1.3/1.4 with 2 extruders etc).

Temperature Measurement


Line 90
#define TEMP_SENSOR_0 1
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
#define TEMP_SENSOR_BED 1

Most printers will use a thermistor, and a common choice is the "EPCOS B57560G104F". The standard table number "1" works fine for this thermistor. I have copied two tables from Nophead's version of Marlin into the T3P3 version - numbers 11 and 12. If you have a Mendel90 kit from Nophead then these will probably be the best choice for you (although they were numbered 8 and 9 in Nophead's version, I had to change the numbering as 8 and 9 were already taken in the master version).

If you have a RepRapPro printer, their custom version of Marlin does not use a pre-calculated thermistor lookup table but computes the values directly. I have incorporated this into the latest T3P3 version on Marlin as described in my previous blog postMy copy is rather untested so use with caution. Even though on-the-fly calculation is now available, I recommend using tables. Nophead's blog describes the theory behind the table calculations and the "createTemperatureLookupMarlin.py" script in the Marlin folder allows for the calculation of an accurate table for your thermistor and temperature range of interest.

If you want to use the calculated thermistor values then:

Line 97
//use RepRapPro Algebraic Temperature calculation rather than
//the tables - still experimental in this version of Marlin.
#define ALGEBRA_TEMP 

Line 104 onwards
Choose the serial resistor for your electronics (4700 is standard)

#define SERIAL_R 4700
//#define SERIAL_R 10000

Choose your thermistor Beta values (from the data sheet, ask your supplier) and value at 25C (100K thermistor is 100000, 10K is 10000)

// EPCOS B57560G104F (the standard 100K one)
#define E_BETA 4036.0
#define E_NTC 100000.0
#define BED_BETA 4036.0
#define BED_NTC 100000.0

Other standard thermistor types that RepRapPro uses are already in configuration.h, commented out. If you change to these types then comment out the lines referring to the EPCOS and uncomment the lines for the thermistor values that match yours. For example to use the latest RepRapPro thermistor values comment out:


// EPCOS B57560G104F (the standard 100K one)
//#define E_BETA 4036.0
//#define E_NTC 100000.0
//#define BED_BETA 4036.0
//#define BED_NTC 100000.0

and uncomment

// RS 198-961
#define E_BETA 3960.0
#define E_NTC 100000.0
// Rapid 61-0446 ; Semitec 103GT-2 All RepRapPRo Mendels and Thermistors shipped after 1/4/13
#define BED_BETA 4126.0
#define BED_NTC 10000.0

Temperature at Print Start

Line 137
#define TEMP_RESIDENCY_TIME 10 // (seconds)
#define TEMP_HYSTERESIS 3       // (degC) range of +/- temperatures considered "close" to the target one
#define TEMP_WINDOW     1 // (degC) Window around target to start the residency timer x degC early.

These allow you to control how close to the exact set temperature the thermistor reading needs to be to begin extruding. The defaults work OK, however to get a quicker start, I change my TEMP_RESIDENCY_TIME to "5" and TEMP_WINDOW to "2".

Max and Min Temperatures


The printer will give an error if the temperatures are outside of these values. I find that in a cold garage in winter the MIN_TEMPs need to be "1" rather than "5". Don't comment out or set to 0 or else the hotend could overheat if the thermistor is disconnected or breaks.

Line 144-155
#define HEATER_0_MINTEMP 1
....
#define HEATER_0_MAXTEMP 275
....

PID Temperature control


In order to get more stable extruder temperature control the use of PID control is recommended. To enable it ensure PIDTEMP is uncommented.

Line 164
#define PIDTEMP

You need to set the PID constants specific to your hotend. See Wikipedia theory on PID control if interested (not required to make this work):-

Line 178 onwards
    #define  DEFAULT_Kp 22.2
    #define  DEFAULT_Ki 1.08  
    #define  DEFAULT_Kd 114 

By far the easiest way to calculate these is to use PID autotune once your firmware is uploaded to your printer. This function experiments with the reaction of your hotend and calculates the best PID values. For more detail of PID autotune check this wiki entry. Once you have the values you can save them to EEPROM (see the section later in this guide about enabling EEPROM) or you can replace the values in the firmware (at line 178 as shown above) and re-upload your firmware.

You can use PID on the heated bed in a similar manner but I don't find it necessary. To do so uncomment PID_TEMP_BED:

Line 203
#define PIDTEMPBED

and define the constants for your bed. It is best to use PID autotune for this as well, choosing a different target temperature, as suggested in the Marlin comment:

"FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles."

Line 216
    #define  DEFAULT_bedKp 10.00
    #define  DEFAULT_bedKi .023
    #define  DEFAULT_bedKd 305.4

Extruder protection

The following lines prevent extrusion when conditions are not right.

Line 233
#define PREVENT_DANGEROUS_EXTRUDE
#define PREVENT_LENGTHY_EXTRUDE

Only comment them out to override the effect they have if you have a specific reason for doing so.


Endstops

For Sanguinololu, RAMPS, Melzi and most other common electronics all the endstop pullups should be on - ensure line 248 is uncommented:

Line 248
#define ENDSTOPPULLUPS

Generally you want the endstops to trigger when open: this is controlled with the following lines:

Line 270
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. 

For more information on endstops and why it is generally better to have Normally Closed Endstops have a look at this part of the Reprap wiki and the linked forum post.

Axis direction is controlled by the motor wiring and by these lines:

Line 287
#define INVERT_X_DIR false    // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR false    // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR true     // for Mendel set to false, for Orca set to true

Many printers only have 3 endstops, one per axis, so you have to tell the firmware which end to home towards:

Line 296
// Sets direction of endstops when homing; 1=MAX, -1=MIN
#define X_HOME_DIR -1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1

This combined with the length of the axis sets the dimensions of the printer. It is worth using software endstops to keep the print head within the print area during normal operation:

These need to be set to the correct values for your printer or else you can command the printer to move outside of the area it can cover and potentially cause damage.

Line 300
#define min_software_endstops true //If true, axis won't move to coordinates less than HOME_POS.
#define max_software_endstops true  //If true, axis won't move to coordinates greater than the defined lengths below.
// Travel limits after homing
#define X_MAX_POS 205
#define X_MIN_POS 0
#define Y_MAX_POS 205
#define Y_MIN_POS 0
#define Z_MAX_POS 200
#define Z_MIN_POS 0

I find that it is safest with a new printer to set the MAX_POS values to less than the maximum theoretical sizes, then physically check how much more travel is possible and adjust the values upwards if appropriate.

Movement Settings

These settings define how fast your printer's axis move and set the accuracy of moves. In most cases there will be a direct copy from the configuration.h file of your printer supplier. First is the speed the axes move during homing; this is in mm/s and the format X,Y,Z,E. E is 0 because the extruder is not homed.

Line 325
#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)


The next line defines how many steps of the stepper motor are required to move an axis by 1mm. Getting this wrong means the printer axis will not move the right distance. You MUST change the settings from the defaults (unless you actually have an Ultimaker!). Once again the format is  X, Y, Z, E. Prusa's calculator is very helpful for calculating the appropriate X, Y and Z values for your stepper motors, belt pitch and pulley teeth. For E, because hobbed bolts all vary slightly, the only way to get the correct value is to start with a reasonable value (e.g. 700 for a Wade's) and calibrate your extruder: RichRap's Slic3r blog provides detailed instructions for doing this.

Line 329
#define DEFAULT_AXIS_STEPS_PER_UNIT   {78.7402,78.7402,200.0*8/3,760*1.1}  // default steps per unit for ultimaker


The following lines set the speed and acceleration of your printer. Often the quality of prints can be improved by using slower acceleration values and smaller XYJERK values. They definitely need setting down for less-rigid machines with threaded-rod frames. Check the default values in the Marlin as supplied with your machine and use these to start with.

Line 330 Onwards
#define DEFAULT_MAX_FEEDRATE          {500, 500, 5, 25}    // (mm/sec)
#define DEFAULT_MAX_ACCELERATION      {9000,9000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.

#define DEFAULT_ACCELERATION          3000    // 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

// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
#define DEFAULT_XYJERK                20.0    // (mm/sec)
#define DEFAULT_ZJERK                 0.4     // (mm/sec)
#define DEFAULT_EJERK                 5.0    // (mm/sec)

EEPROM - Saving Settings without recompiling firmware

When EEPROM is enabled there are three locations where versions of the printer settings are stored.
  1. Hard-coded in Firmware in Configuration.h.
  2. In the running RAM of the microcontroller - not saved on power down or reset.
  3. In EEPROM
If EEPROM is enabled the settings are loaded from EEPROM, not from the hard-coded values in Configuration.h. EEPROM settings can be updated using a series of "M" commands. See the G-Code page on the RepRap wiki for a description of all the G and M codes including those for saving and reading from EEPROM.

I recommend enabling EEPROM_SETTINGS and EEPROM_CHITCHAT
Line 356

//define this to enable eeprom support
#define EEPROM_SETTINGS
//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
// please keep turned on if you can.
#define EEPROM_CHITCHAT

Display Screens - Panelolu2

There are an increasing number of LCD screens supported by Marlin, but this post only covers the Panelolu2. To enable the Panelolu2 uncomment the following line:

Line 381

#define PANELOLU2

If you don't like the buzzer making a beep sound then comment out the PAN_BEEP

Line 386
 #define PAN_BEEP //comment out to disable buzzer

I recommend that you get your printer working without enabling the Panelolu2 first and then uncomment the #define PANELOLU2 line afterwards. Note that Marlin will hang if the PANELOLU2 is enabled but not connected.

Thats it!

Please feel free to leave useful links to further information in the comments to this blog post.

Wednesday, 15 May 2013

Algebraic Thermistor readings

As part of a larger piece of work to make it easier for users of RepRapPro Marlin to use a Panelolu2 I have implemented RepRapPro's use of maths to convert the raw ADC values from the thermistor inputs into temperature readings.

The maths in question is the B parameter equation which uses the Beta value specified for NTC thermistor to approximate the curve.

I added the following code to temperature.cpp:-


float analog2tempi(int raw, const float& beta, const float& rs, const float& r_inf)
{
   return = ABS_ZERO + beta/log( (raw*rs/(AD_RANGE - raw))/r_inf );
}

along with some #ifdef ALGEBRA_TEMP to compile the computational functions and information only if required.

In order to use this, download the latest version of the T3P3 branch of Marlin and make the following changes to Configuration.h


//use RepRapPro Algebraic Temperature calculation rather than
//the tables - still experimental in this version of Marlin.
#define ALGEBRA_TEMP 

and define the series resistor and Thermistors specific to your setup:


// Uncomment ONE of the next two lines - the one for the series resistors on your controller (most common is 4700)
#define SERIAL_R 4700
//#define SERIAL_R 10000

// EPCOS B57560G104F (the standard 100K one)
#define E_BETA 4036.0
#define E_NTC 100000.0
#define BED_BETA 4036.0
#define BED_NTC 100000.0


The data sheet for your thermistor will give the Beta value, the E_NTC or B_NTC is the value of the thermistor at 25C which for a "100K" thermistor is 100 000.

Warning: This is only tested with a variable resistor and an EPCOS B57560G104, and the equation used is an approximation - it is not as accurate as a well defined table.

To do: Investigate using a better equation, such as the equation that Nophead describes here which is in the new createTemperatureLookupMarlin.py script in Marlin.


Sunday, 22 July 2012

Disabling JTAG on PrintrBoard

Disabling JTAG on PrintrBoard - Get 4 more I/O pins

As I discovered while getting the Panelolu working with a Printrboard the JTAG interface is enabled by default. This uses 4 pins on one of the expansion headers:


In order to get access to these pins the JTAG interface needs to be disabled: to do this you have to change the fuses on the AT90USB1286 micro. An ISP is required (I use the Pololu AVR ISP) but others should work fine.

Warning: You can "brick" your micro if you mess up the fuse settings: handle with care and I don't recommend you mess with the clock settings!

Lincomatic describes how to set the fuses in his blog post on uploading a bootloader to the AT90USB1286. He has the following settings

LOW : 0xDE
HIGH: 0x9B
EXT: 0xF0

Using the fuse calculator at engbedded.com, start by selecting the AT90USB1286 and then put the DE,9B and F0 setting in at the bottom of the page. After applying these settings it is simple to deselect the "JTAG Interface Enabled" check box and recalculate the settings. The only one which has changed is the HIGH setting to 0xDB

Using the version of avrdude that comes with arduino 0023 change the fuse setting to disable the JTAG interface:

avrdude -c avrispv2 -p at90usb1286 -U hfuse:w:0xdb:m  -C ..\etc\avrdude.conf -P com40

You will need to change the "-c avrisp2" to match your ISP and the "-P com40" to match the com port it's on.

Now that we have read-write access to those pins the connections for the Panelolu can use 1 less plug and stay on just one expansion header:


The pin allocations are:

With pin numbering of:
TDI = 42
TDO =43
TMS = 44
TCK = 45

The only change to the firmware from that described in my previous post is:

pins.h

      #define LCD_PINS_D4        42
      #define LCD_PINS_D5        43
      #define LCD_PINS_D6        44
      #define LCD_PINS_D7        45
 
So if you have an ISP and want 4 more IO pins this is the way to go. If you are going to buy a Printrboard then ensure you get your supplier to change the fuses to disable the JTAG interface before sending it to you.

Panelolu with Printrboard

Panelolu with Printrboard

Update: The Panelolu2 has replaced the Panelolu. It is much quicker to install, has adapter boards to no messing with cables and uses less pins. The blog post with the information is here, it is available to buy in our webshop.

The Printrboard is a based on the Teensylu which is itself a derivative of the Sanguinololu; the main difference is the use of the AT90USB1286  in place of the ATmega644P or 1284P.


Thanks to the work of Lincomatic, Marlin firmware will run on the AT90USB1286. The Printrboard section of the RepRap wiki page has information on the board and an outline of how to upload the firmware - you will need Lincomatic's fork of Marlin. The Printrboard I bought was supposed to come with a bootloader but that did not work. I followed Lincomatic's instructions to install the CDC bootloader using the Pololu ISP I have used previously on ATmega644P and ATmega1284P micros. It's worth ensuring you have a working setup with the Printrboard connecting to your control software (Pronterface for me) and firmware uploading before you go any further.

Built in SD card reader or SDSL?

The Printrboard has a build in SD card reader so you do not need an SDSL. That said I prefer to have the electronics hidden away, so using the SDSL in the Panelolu is my preference. Both options will work and are described below.

Hardware and wiring the Panelolu

The wiring internal to the Panelolu is identical to that described in my previous post, with the option not to bother with wires 13,15,16,17,19,20,21,22 and the 10 pin IDC connector if you are going to use the build in SD card reader on the Printrboard.
Unfortunately the design of the expansion headers on the Printrboard does not keep to the standard 2.54mm spacing between the expansion header and the ISP header (and 4 pins on ext1 are not I/O by default) - a simple IDC connector will not fit without bending the pins . The solution is to use the same connectors that are used on the LCD and circuit board within the Panelolu.


The pin out is as follows:
 
Ribbon cable wire number
Printrboard Pin Label
Marlin Pin
number
Marlin Pin
name
 1
 Not used *
---
---
 2
 Not used *
---
---
 3
 GND
---
---
 4
 5V
---
---
 5
 PD4
4
LCD_PINS_D7
 6
 A3
41
LCD_PINS_RS
 7
 PD6
6
LCD_PINS_D6 
 8
 TX1
2
ENC1
 9
 PE1
9
LCD_PINS_D5
 10
 RX1
3
ENC2
 11
 PC1
11
LCD_PINS_D4
 12
 SDA
1
LCD_PINS_ENABLE
 13
 A2***
40
SDSS
 14
 SCL
0

 18
 RESET**
---
---
* Wire 1 and 2 are not connected/used but kept in for consistency with the original instructions.
** Can come either from the RESET pin on the expansion header or the ISP header.
*** Only required if a SDSL is used rather than the on board SD card reader

Update There was a mistake in the table above, thanks to Colin Bradburne for bringing the problem to my attention. It is fixed now - the lines in red have been amended.

If using the SDSL rather than the on board SD card reader then the following connections to the ISP header are used as well.

Ribbon cable wire number
Printrboard Pin Label
Marlin Pin number
Marlin Pin name
 17
 GND
---
 ---
 18
 RESET
---
 ---
 19
 MOSI
 22
MOSI_PIN
 20
 SCLK
 21
SCK_PIN
 21
 5V
---
 ---
 22
 MISO
 23
 MISO_PIN

The Printrboard I bought does not have the expansion header pins labelled, I have annotated the pins on the screen shot of the board below:
The 4 pins labelled "JTAG PINS" are set to the JTAG interface by default - I have done a separate blog post about how to change the fuse settings to gain access to these pins as I/O. This does mean that we can't fit the Panelolu connections onto just one expansion header, hence the 4 pins on the second expansion header towards the centre of the board

The ribbon cable with the connectors will look like this:

Pairing this picture with the annotated screen shot of the board should show how to plug in the cables. (note that wire 1 and 2 are not in this picture as they are not used and that a 4 pin connector is used for MISO,SCLK and RESET because I ran out of 3 pin connectors)

Firmware configuration

The following firmware changes to Marlin are required to get the Panelolu working with a Printrboard. Please note that line numbers are based on my version of Lincomatic's branch of Marlin - they may be slightly different with a different version or after additional changes are made.

Configuration.h

line 34-40:
#define MOTHERBOARD 81

#if (MOTHERBOARD == 81) //printrboard
 #define SDSUPPORT
 //comment out the following line to use onboard SD card reader

#define USESDSL
#end
if
 
line 234:
#define ULTIMAKERCONTROLLER  

Pins.h

within the Printrboard (81) section
line 953 -984  
  #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 //Ultipanel

Sd2PinMap.h

Line 224-236

// SPI port
#if MOTHERBOARD == 81 //printrboard
#ifdef USESDSL  //SDSL with Panelolu
uint8_t const SS_PIN = 40;    //F2
#else
uint8_t const SS_PIN = 26;    // B6
#endif
#else
uint8_t const SS_PIN = 20;    // B0
#endif
uint8_t const MOSI_PIN = 22;  // B2
uint8_t const MISO_PIN = 23;  // B3
uint8_t const SCK_PIN = 21;   // B1 

To explain what the firmware changes actually do:
  • Add the USESDSL define to configuration.h which allows easy toggling between the onboard SD card reader and the SDSL
  • Enable the ULTIMAKERCONTROLLER which the PanelMax and Panelolu are derivatives of.
  • Define the pins that are used for the Panelolu within the Printrboard section of the pins definition file
  • Add a check to the SdPinMap to see if SDSL on onboard card reader is selected with the USESDSL define.
Summary

To get a Panelolu working on Printrboard: 
  • Confirm you can connect to the Printrboard and upload firmware - if not follow Lincomatic's instructions for loading a bootloader.
  • Get Lincomatic's branch of Marlin and make the changes listed in the Firmware section above.
  • Get the components required for a Panelololu and wire up the Panelolu end as described in my previous post.
  • Wire up the end of the ribbon cable that is going to the Printrboard as described above.