Repetier firmware configuration

Repetier firmware configuration DEFAULT

Repetier-Firmware - the fast and user friendly firmware

Notes for developers/pull requests

This software is open source licensed under the GPL V3. As any free project we like contributions from other sources, especially since the firmware is very hardware related and many things can only be implemented/tested with the right hardware. To allow easy integration of new features you should follow some simple principals.

  1. Only send pull requests against development version. This is where we add and test new features and bug fixes. From time to time we push these to master as a new version.
  2. Do not include your personal configuration files. If you need new configuration options, add them to the official configuration.h file.
  3. We have two folders for different processor architectures. So for most changes modifications need to be in both folders. The general files are identical. In fact we develop on avr and just copy them to due. Only pins.h/fastio.h/hal.* and configuration.h are architecture dependent, so changes there need to be made twice and not copied.
  4. Document what your pull request will change/fix/introduce. Please also mention new configurations since we need to add them also to our online tool, so users can set them correctly.

.0 will be the last 1 version. Fixes for this will be done in the dev branch and moved to stable after a while as 1.0.x patch updates. With the release of the official 1.0 version we will start developing version 2.0 in the branch dev2 where all the new features will be added.

Version 2.0 information

Version 2 will be a incompatible refactoring of version 1.0. We will try to keep commands and communication identical to 1.0, but for the configuration we see a much more flexible way that makes it much easier to adjust the firmware to nowadays needs. But that requires a different configuration at several parts.

Planned stages:

  1. Merge AVR and Due into one fileset.
  2. Split long files like boards, displays, languages in several files into a subfolder. That way it gets much faster to search the right place.
  3. Update used libraries.
  4. Change configuration.
  5. Change motion planner.
  6. Create a config tool.
  7. Public testing with more users. We assume until a config tool is available the configuration will get several changes and only users with programming skills will do it manually to benefit already from improvements achieved.

Until 6. the version should be considered alpha stage. We do expect errors from all the changes and there may be bigger mods with an update. Of course we will try to keep every release workable, but as work in progress there is no guarantee.

Installation

Please use your configuration tool at http://www.repetier.com/firmware/v100 or for latest 1.0.x development version at http://www.repetier.com/firmware/dev for easy and fast configuration. You get the complete sources you need to compile from the online configurator. This system also allows it to upload configurations created with this tool and modify the configuration. This is handy for updates as you get all newly introduced parameter just by uploading the old version and downloading the latest version. New parameter are initalized with default values.

Version 1.0.0

  • Fixed many autoleveling bugs.
  • More supported boards and displays.
  • Added CNC/Laser modes.
  • Improved event system to extend firmware without modification of files.
  • Dual X axis support (2 separate x axis)
  • New gcode handler for more flexible support of different inputs.
  • Improved menu.
  • Jam detection.
  • More stable temperature control with PID.
  • Per axis homing flag.
  • Keep alive signals for hosts.
  • Support capabilities protocol.
  • Many bug fixes.

Version 0.92.8

  • Cleaner code base.
  • Pulse dense modulation for heater and fans.
  • Bed bump correction for delta printer.
  • Correction of parallelogram distortions.
  • Decoupling test for heater and sensor for more safety.
  • Mixing extruder support.
  • Test for watchdog.
  • Allow cold extrusion.
  • Fixed pause sd print issues.
  • Commands on sd stop.
  • Disable heaters/extruders on sd stop.
  • Safety question for sd stop.
  • Many minor corrections and improvements.
  • Extra motor drivers.
  • Event system for lights etc.
  • New homing sequence with preheat for nozzle based z sensors.
  • Language selectable on runtime.
  • Fix structure for Arduino 1.6.7
  • New bed leveling.
  • Fatal error handling added.

Version 0.91 released 2013-12-30

WARNING: This version only compiles with older Arduino IDE 1.0.x, for compilation with newest version use 0.92

Improvements over old code:

  • Better readable code.
  • Long filename support (from Glenn Kreisel).
  • Animated menu changes.
  • Separation of logic and hardware access to allow different processor architectures by changing the hardware related files.
  • z-leveling support.
  • Mirroring of x,y and z motor.
  • Ditto printing.
  • Faster and better delta printing.
  • New heat manager (dead time control).
  • Removed OPS handling.
  • Full graphic display support.
  • Many bug fixes.
  • many other changes.

Documentation

For documentation please visit http://www.repetier.com/documentation/repetier-firmware/

Developer

The sources are managed by the Hot-World GmbH & Co. KG It was initially based on the Sprinter firmware from Kliment, but the code has run through many changes since them. Other developers:

  • Glenn Kreisel (long filename support)
  • Martin Croome (first delta implementation)
  • John Silvia (Arduino Due port)
  • sdavi (first u8glib code implementation)
  • plus several small contributions from other users.

Introduction

Repetier-Firmware is a firmware for RepRap like 3d-printer powered with an arduino compatible controller. This firmware is a nearly complete rewrite of the sprinter firmware by kliment which based on Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware. Some ideas were also taken from Teacup, Grbl and Marlin.

Features

  • Supports cartesian, delta and core xy/yz printers.
  • RAMP acceleration support.
  • Path planning for higher print speeds.
  • Trajectory smoothing for smoother lines.
  • Nozzle pressure control for improved print quality with RAMPS.
  • Fast - 40000 Hz and more stepper frequency is possible with a 16 MHz AVR.
  • Support for Arduino Due based boards allowing much faster speeds.
  • Multiple extruder supported (max. 6 extruder).
  • Standard ASCII and improved binary (Repetier protocol) communication.
  • Autodetect the command protocol, so it will work with any host software.
  • Important parameters are stored in EEPROM and can easily be modified without recompilation of the firmware.
  • Automatic bed leveling.
  • Mixed extruder.
  • Detection of heater/thermistor decoupling.
  • 2 fans plus thermistor controlled fan.
  • Multi-Language support, switchable at runtime.
  • Stepper control is handled in an interrupt routine, leaving time for filling caches for next move.
  • PID control for extruder/heated bed temperature.
  • Interrupt based sending buffer (Arduino library normally waits for the recipient to receive written data)
  • Small RAM memory print, resulting in large caches.
  • Supports SD-cards.
  • mm and inches can be used for G0/G1
  • Arc support
  • Dry run : Execute yout GCode without using the extruder. This way you can test for non-extruder related failures without actually printing.

Controlling firmware

Also you can control the firmware with any reprap compatible host, you will only get the full benefits with the following products, which have special code for this firmware:

Installation

For documentation and installation please visit http://www.repetier.com/documentation/repetier-firmware/.

Changelog

See changelog.txt

Sours: https://github.com/repetier/Repetier-Firmware

Installation

Arduino-IDE

Arduino IDE

First you need to get and install the development software. Don’t worry, it is easy and you won’t need special programming skills. Get your version of the Arduino IDE from https://www.arduino.cc/en/Main/Software. The software is available for WIndows, Linux and Mac. Follow the instruction on the Arduino site. You will need Arduino 1.8.5 or higher.

The IDE contains only the officially supported board driver. If your board is not included, you need to install the missing device files. Not included are files for Gen 6, Sanguinololu, Gen7, Teensylu and Printrboard.

The next step is driver installation. The boards all use a serial protocol. Which is fine if your printer had a serial port. The designer of the Arduino knew this problem and have added a usb->serial converter on board. That is the reason, you need to install the usb driver used on the board. Some board/OS combinations don‘t need a special driver. If you are a Windows user – I didn‘t mean you.

To understand the IDE, you should now download the latest version of Repetier-Firmware.

It is not necessary to clone the repository. All you need is to download the contents as a ZIP file. Download the file and unpack the contents. Start the IDE and go to File->Open and select the file „Repetier.ino“ in the repetier subdirectory.

Before you can compile and upload the firmware, you need to select the board and port. You do this in the Tools menu. Start with your board. The port can only be selected, if your printer is online and connected.

For a first successful upload, follow the next steps:

  • Open the register tab named „Configuration.h“
  • Search the line „#define MOTHERBOARD“ and change the number behind to match your board.
  • Near the bottom you see a line „#define BAUDRATE 250000“. Change the baud rate to match your preferences or leave it.
  • Make sure the printer is connected and port and board type are set correctly.
  • Press the upload button. That is the button with the arrow to the right.
  • After a while you see the length of the compiled firmware file and the upload starts. On most boards you will see a led starting to flicker. After it stops flickering, the upload is verified and then you see the message „Upload done“ in the IDE.

Congratulations! You just compiled and uploaded your first firmware. You can start your host software and connect to the board with the set baud rate. Don‘t try to print now. You haven‘t set up everything needed. But you can already ask firmware name with „M115“ or move the printer head a bit (no long distance before you set up the correct steps per mm for your axis).

Common errors

  • If the MOTHERBOARD setting does not match your board settings, you will get a corresponding error message.
  • If your host is still connected to the board, you can not update a new firmware.
  • Sometimes the uploader fails to reset the board to start the bootloader. If you see the firmware is compiled and the led doesn‘t start flashing within 5 seconds, press the reset button on the board. Often this helps.
  • Sometimes you will get a fsync error message from the uploader. Unplug the printer and reconnect it. If it doesn‘t go away reboot your computer.

General configuration

In general you will only need to update two configuration files. The main configuration is „Configuration.h“ which is handled in this chapter. If you have a LCD display and optionally some keys, you also need to change the „uiconfig.h“ file if it is not supported by the firmware directly, which is handled in the next Chapter. The default is no LCD and no keys. If you have an unknown board or changed the usage of some pins, you need to update pins.h.

When you open the „Configuration.h“ file, you see a lot of comments and some values to change. These configurations are all done with preprocessor commands.

Short introduction into preprocessor directives

If you don‘t know what a preprocessor is or does, you should read this section carefully. I will explain everything you need to know for your configuration. Experienced programmer can skip this section. 

The target of your configuration is to write a firmware that works perfectly with your printer. Viewing the RepRap webpage, you see man different kinds of printer using different boards and different sensors and setups. To create one firmware that works with all variations, it needs to be very flexible and to use data defining your special setup. To do this the preprocessor is used. It is a simple parser, that runs over the code before the real compilation starts. With the help of the preprocessor you can enable or disable parts of the code, replace contents by values defined in the preprocessor and do some error checking.

All preprocessor commands can be recognized by the # char at the beginning of the command. The most important commands is #define. It defines a symbol, which is replaced by it‘s content everywhere it is found later on in the code.

Example:

#define MY_NUMBER 8 #define SQUARED(a) (a)*(a) print(SQUARED(MY_NUMBER);

The above code will be converted into the following:

print((8)*(8));

Things to notice:

  • The define name is written in capital letters. This is not needed, but a helpful convention. Throughout the complete code, you will recognize the preprocessor macros at the capital characters.
  • Defines can have parameters.
  • Defines don‘t need a replacement values – they can be empty.
  • Macros can be passed as parameter to other macros.
  • If you have a long macro and you want to split it over several lines, you have to end the line with a backslash „\“ character. No more spaces after that backslash are allowed.

The firmware uses two different methods to compile code on special conditions. For one method you need to define a special value, say 0 for don‘t compile and 1 for compile. The other method is the pure existence of the define. In the configuration you see sometimes an commented define. If you remove the comment marks // the define is active and it‘s code is used or not. See the following example, how this works:

#define PRINTTYPE 1 #define DOIT //#define DOITTOO #if PRINTTYPE==1 print("Type is 1"); #endif #if PRINTTYPE==2 print("Type is 2"); // Not called, because PRINTTYPE is 1 #endif #ifdef DOIT print("Doit defined"); #else print("Doit not defined"); // Not called #endif #ifndef DOITTOO print("I'm also called."); #endif

The EEPROM trap

I already explained how handy it is to use the EEPROM feature. It is important, that you understand how it works, so you get what you think you said. In your „Configuration.h“ you have the following line:

#define EEPROM_MODE 1

A value of 0 would disable the EEPROM usage. Any other value from 1 to 255 enables it and determents if the values from the configuration file are copied to the EEPROM at the first start, or if the old values are kept. The trick is quite simple. The first byte in EEPROM is compared with the EEPROM_MODE value. If it has a different value, the values in your „Configuration.h“ are copied to EEPROM and byte 0 is set to the mode. After the next startup, the firmware sees the value is the same and will use the values already stored in EEPROM,

A correct initialization is important for a good function. If you have used an other software, that also writes to the EEPROM, your data gets corrupted and you should make sure, the values are reinitialized. From version 0.80 onwards the firmware stores a checksum, so most corruptions are detected automatically.

If you have followed the first installation example, you have already written values to your EEPROM. It is a good idea to change the EEPROM_MODE to 2 now, so you overwrite it with the configuration you will now define.

From version 0.80 onwards you can overwrite the EEPROM values with the values from Configuration.h using M502.

Modifying EEPROM values

The easiest way to change the EEPROM values it with Repetier-Host. It has a form for editing the stored values, so you don‘t need to bother with the correct commands.

For a manual change send “M205” to your board and you will get a list with all parameters with position, type and value. The output will look like this:

EPR:2 75 76800 Baudrate EPR:2 79 0 Max. inactive time [ms,0=off] EPR:2 83 60000 Stop stepper afer inactivity [ms,0=off] EPR:3 3 40.00 X-axis steps per mm EPR:3 7 40.00 Y-axis steps per mm EPR:3 11 3333.59 Z-axis steps per mm EPR:3 15 20000.00 X-axis max. feedrate [mm/min] EPR:3 19 20000.00 Y-axis max. feedrate [mm/min] EPR:3 23 2.00 Z-axis max. feedrate [mm/min] EPR:3 27 1500.00 X-axis homing feedrate [mm/min] EPR:3 31 1500.00 Y-axis homing feedrate [mm/min] EPR:3 35 100.00 Z-axis homing feedrate [mm/min] EPR:3 39 20.00 X-axis start speed [mm/s] EPR:3 43 20.00 Y-axis start speed [mm/s] EPR:3 47 1.00 Z-axis start speed [mm/s] EPR:3 51 750.00 X-axis acceleration [mm/s^2] EPR:3 55 750.00 Y-axis acceleration [mm/s^2] EPR:3 59 50.00 Z-axis acceleration [mm/s^2] EPR:3 63 750.00 X-axis travel acceleration [mm/s^2] EPR:3 67 750.00 Y-axis travel acceleration [mm/s^2] EPR:3 71 50.00 Z-axis travel acceleration [mm/s^2] EPR:3 150 373.00 Extr. steps per mm EPR:3 154 1200.00 Extr. max. feedrate [mm/min] EPR:3 158 10.00 Extr. start feedrate [mm/s] EPR:3 162 10000.00 Extr. acceleration [mm/s^2] EPR:0 166 1 Heat manager [0-1] EPR:0 167 130 PID drive max EPR:2 168 300 PID P-gain [*0.01] EPR:2 172 2 PID I-gain [*0.01] EPR:2 176 2000 PID D-gain [*0.01] EPR:0 180 200 PID max value [0-255] EPR:2 181 0 X-offset [steps] EPR:2 185 0 Y-offset [steps] EPR:2 189 40 Temp. stabilize time [s]

The first value is the data type (0=byte, 1=16 bit int,2=32 bit int,3 = float). The second parameter is the position in EEPROM, the value is stored. The third parameter is the current value. The rest of the line is a short description of the parameter.

To change one of these parameters, send

M206 T<type> P<position> S<new_value>

for types 0-2 and for type 3 use

M206 T<type> P<position> X<new_value>

Type and position must match the values returned by M205, otherwise you will overwrite some other data with undeterminable results.

Your initial configuration

Now you should start to work yourself through the „Configuration.h“ and change the settings to match your setup. There are many comments in that file explaining what value are allowed and what is meant. I will not go into every detail. The following sections will give some useful help and background information.

Steps per mm

Your printer uses stepper motors to move the extruder and for the extrusion it self. Depending on your configuration, you need x steps to move or extrude 1 mm. That is the value you need to enter. With some math you can get the values very easy. Do the example computations with your hardware settings and you are done.

StepsPerTurn = 200 // Most stepper motors have 1.8 Degree per step (some 0.9) BeltDistance = 5mm // Distance between repeating grooves. T5 belt = 5mm GroovesInPulley = 8 // 8-10 are common values Substepping = 16 // 16 Substeps for a full step needed StepsPerMM = StepsPerTurn*Substepping/(BeltDistance**GroovesInPulley)            = 200*16/(5*8) = 80

Temperature measurement

Before you can control the temperature, you need to measure it. The most common method used in the RepRap community is to use a NTC thermistor. With the help of the circuit shown below, the AVR can measure a voltage, which depends on the used resistors and the temperature at the thermistor.

So how does it work? For a long and good description read nopheads excellent article (http://hydraraptor.blogspot.de/2007/10/measuring-temperature-easy-way.html). The short version is, the NTC changes its resistance. Using a NTC means, with increasing temperature the resistance drops. This causes the measured voltage to change. With the full circuit, we end with the formula:

VMeasured = VRef*RS / (RS+R2)

If you have no resistor R1, RS = R. If you have, then

RS = R * R1 / (R+R1)

After knowing how to convert a temperature into a voltage, how do we get this into the firmware? The current Arduino generation uses AVR controller with a resolution of 10 bit. The voltage is converted into a number between 0 for ground and 1023 for VRef, which is normally 5V. The new XMega AVR controller have a resolution of 12 bit, resulting in values from 0 to 4095. To be ready for the future, the firmware adds 4 readings for a temperature calculation, resulting in a range from 0 to 4092. From this value, the firmware must compute the temperature at the thermistor. So far, so good. Unfortunately, the voltage-temperature-curve is nonlinear and differs for every thermistor type. Even different 100K thermistors have different curves. As a solution, the firmware uses a lookup table from which it interpolates temperatures between given values.

For a better understanding, lets have a look at one of these tables:

#define USER_THERMISTORTABLE0 {\ {1*4,864*8},{21*4,300*8},{25*4,290*8},{29*4,280*8},{33*4,270*8},{39*4,260*8},{46*4,250*8},{54*4,240*8},{64*4,230*8},{75*4,220*8},\ {90*4,210*8},{107*4,200*8},{128*4,190*8},{154*4,180*8},{184*4,170*8},{221*4,160*8},{265*4,150*8},{316*4,140*8},{375*4,130*8},\ {441*4,120*8},{513*4,110*8},{588*4,100*8},{734*4,80*8},{856*4,60*8},{938*4,40*8},{986*4,20*8},{1008*4,0*8},{1018*4,-20*8} }

For those with little C experience: The define must be in one line, which isn’t very readable. So to break it into different lines, append a backslash at the end of the line, to indicate that the line continues in the following line.

This lookup table has 28 reference values. Make sure the correct number is set in you configuration. For this table, I set

#define NUM_TEMPS_USERTHERMISTOR0 28

The table here contains 28 pairs of {adc, temperature*8} with the adc reading in range 0-4093 and temperature values multiplied with 8 as integer. The pairs must be ordered with increasing adc values!

What you see is the lookup table for an EPCOS G550 thermistor. The table consists of two columns. The first is the voltage reading and the second is the temperature. In the table, you see that the readings are multiplied with 4 and the temperatures with 8. I’ve taken this format, because most firmwares use a reading range from 0-1023 and full integer values for temperatures. Repetier-Firmware uses a higher resolution for input and temperature and these factors convert old tables you may have into the needed value range for Repetier-Firmware. If you don’t have a matching table, you have to compute one.

Looking into the datasheet gives characteristic curve 8404 for this thermistor. A look into the table shows temperatures and a factor RT/R25. Knowing R25 is 100K, we can compute the resistance for every temperature. Lets look at 100°C. We get a factor 0.063688, so R100 = 100000*0.063688 = 6368.8. In this example I take R1 not present and R2 = 4,7K. U100 = 4093*6368.8/(6368.8+4700) = 2355 = 4*588.76

Compute the values and enter them into one of the user definable thermistor lookup tables in Configuration.h. The order matters – start with the highest temperature. You can leave the first value for safety.

Controlling temperature

Knowing the temperature, we can start controlling the heater. The firmware currently supports two methods.

Bang-Bang control

This is the method used for a heated bed and for the extruder, if you set heat manager to 0. The principle is very simple. If the measured temperature is below the target temperature, the heater is set at full power. If the temperature rises above the target temperature, the heater is turned off.

Pros: Simple Cons: Temperature oscillates around the target temperature. For the heated bed, this is no real problem. If you are using PLA this is no big issue. With ABS you may want a more precise control.

PID control

For a better controlled temperature, the firmware uses a PID controller. This requires an output with PWM using a unused timer. Currently only RAMPS 1.0 doesn’t have a free timer for PID control. PID control is only implemented for extruder. For a better overview, lets have a look at the parameter used:

/** \brief The maximum value, I-gain can contribute to the output.A good value is slightly higher then the output needed for your temperature. Values for starts: 130 => PLA for temperatures from 170-180°C 180 => ABS for temperatures around 240°CThe precise values may differ for different nozzle/resistor combination. Overridden if EEPROM activated. */ #define EXT0_PID_INTEGRAL_DRIVE_MAX 150 /** \brief lower value for integral partThe I state should converge to the exact heater output needed for the target temperature. To prevent a long deviation from the target zone, this value limits the lower value. A good start is 30 lower then the optimal value. You need to leave room for cooling. Overridden if EEPROM activated. */ #define EXT0_PID_INTEGRAL_DRIVE_MIN 60 /** P-gain. Overridden if EEPROM activated. */ #define EXT0_PID_P 24 /** I-gain. Overridden if EEPROM activated. */ #define EXT0_PID_I 0.88 /** Dgain. Overridden if EEPROM activated.*/ #define EXT0_PID_D 80 // maximum time the heater is can be switched on. Max = 255. Overridden if EEPROM activated. #define EXT0_PID_MAX 255

I know, quite a number of factors, but don’t worry. It’s not that complicated if you understand, what the parameter are used for.

The first one you should look at is PID_MAX. It’s the maximum PWM setting for your output. Normally, the heating resistor is selected, that a maximum value of 255 is allowed, meaning the full voltage (normally 12V) is send to the resistor. The lost energy at the resistor is U2/R. If you increase your voltage above the designed voltage, you may blow it with full settings. Reduce it in this case.

At the start, the controller behaves like the Bang-Bang controller, except that it uses PID_MAX instead of full power. Only if the current temperature is in a range of +/-10°C from the target temperature the real PID control starts. For the output, three terms P, I and D are computed and added to get the output value. The result is clipped to the range 0..PID_MAX

P-Term

The P-Term adds a value proportional to the temperature error.

P = (TTarget-TCurrent)*P_GAIN

The closer the target temperature is reached, the lower the term gets. It will always oscillate around a value some degrees below the target temperature if left alone.

I-Term

The I-Term is the most important one. The I-Term tries to find the perfect output for your temperature. It does this by incrementing/decrementing the output slowly. The speed is defined by the I_GAIN parameter. You can help a lot, if you limit the range of possible values to a known range INTEGRAL_DRIVE_MIN .. INTEGRAL_DRIVE_MAX. The min value should be at least 0 and the max not exceed 255. If you don’t know what works for you, use these extreme values and watch the output with the command M203 S0. When you that the temperature stabilizes, take the mean value and add/sub 20. If you like to change temperatures, set the limits, so all possible ranges are enclosed with a safety factor.

If your I_GAIN is set to a good value, you will see that the oscillation gets smaller with time. Disturbances like different printing speed or blowing at the nozzle may increase the error again.

D-Term

The D-Term is the damping factor. With a good damping factor, your oscillations will slow down much faster and you get a much more stable system. Don’t by show using more then 100%. The default is already 500%.

Finding proper PID values is difficult for the unexperienced. To overcome this, the firmware has a autotune function to find good values. Disable the extruder and wait until it is more or less cold. Then start autotune with M303 P0 S180 This assumes you want to find the PID values for your first extruder and your typical target temperature will be 180°C. For your second extruder you would use P1 and for the heated bed use the number of extruders as P-value.

SCALE_PID_TO_MAX

This option only tells, when and how to scale down to DRIVE_MAX. If set to 0, the addition of the PID-Terms is clamped to 0..DRIVE_MAX. If you set this to 1, the PID Term gets clamped to 0..255 and is then scaled to 0..DRIVE_MAX.

What’s the difference? If you have DRIVE_MAX=255 there is no difference. If you have found your perfect values for 12V and DRIV_MAX=255 and now want’s to use 18V, you have to reduce DRIVE_MAX to DRIVE_MAX_OLD*(12^2/18^2)=113 to protected your resistor. If you want to keep your found factors, set DRIVE_MAX to 133 and SCALE_PID_TO_MAX 1. If you leave it 0, the found terms are to high and don’t work any more.

Jerk

Jerk is what makes your printer shake. It is a speed difference between two moves, which can be reached without acceleration. So why do you want jerk and what does it influence? The first thing it influences is the starting speed. It is 50% of the allowed jerk. So if you have a jerk of 20, the first move will start with 10mm/s. The other thing jerk controls is the join speed for consecutive segments. In the figure above you see two examples. The jerk is the difference of the two speeds. Example 1 shows a jerk, that is higher then allowed. In this case, the path planner will reduce the speed to match exactly the maximum allowed speed. Example 2 has a lower directional change, so the jerk is within allowed limits and the planner allows a full speed move through the edge. The jerk is set these two values:

#define MAX_JERK 20.0 #define MAX_ZJERK 0.3

MAX_JERK is for x/y axis moves and MAX_ZJERK for moves in Z direction.

You want high jerk values, because

  • printing time is reduced.
  • print shows less blobs.

You want low jerk values, because

  • it causes less mechanical stress to your printer.
  • moves are smoother.
  • filament has better adhesion at directional changes.
  • reduces printer noise.
  • you loose steps with higher values.

You see, it is balance between your personal priorities. The only simple thing is z-jerk, which has nearly no influence. It only reduces the time for z-moves, but has no effect on quality.

Path planning

Path planning makes your printer moves more smooth. Have a look at the above picture. It shows a print of three lines. Without path planning, the printer needs to follow the blue path. For each segment it will accelerate to the commanded feed rate and back to the maximum end speed allowed. The path planner looks for previous moves, which aren‘t executed now and tries to remove the deceleration/acceleration between line joints, resulting in the much smoother red line. For each line joint, the maximum allowed jerk is computed and speed is reduced if needed to reduce the jerk. In most cases this is still much faster then the start/stop speed you would have otherwise. In circles you will most likely have no speed reduction at all. The only bad thing about path planning is, that it needs computation time. For each new line segment the algorithm needs to update older entries. For normal moves, this is no big deal and is very fast. Only if you have many very short moves, the update time becomes dominant and the firmware has to slow down the print. The behavior is influenced by the following configuration parameter:

MOVE_CACHE_SIZE (default 16)

That is the size of the buffer for currently processed segment and following moves. If you have 8kb RAM you can increase this to 24 if you want. It could make print smoother if they have many small lines.

MOVE_CACHE_LOW (default 10)

The path planner has some tricks to prevent empty buffers. One is to make a minimum move time per segment. If the buffer has only MOVE_CACHE_LOW or less segments, each segment is slowed down if would be shorter otherwise. For typical prints the buffer always has MOVE_CACHE_SIZE or MOVE_CACHE_SIZE-1 moves stored and normal moves are long enough, that no speed reduction is needed anyway. This is only effective for very short moves. Higher values can increase computation cost in extreme situations.

LOW_TICKS_PER_MOVE (default 250000)

The minimum time in processor ticks, each segment must need if the cache is low. The default value means, there will be still 40 segments printed per second.

 

Trajectory smoothing

The firmware uses the bresenham algorithm for the computations of the x, y, z and e axis. It takes the axis with the most steps needed and moves over the steps of this axis. At these steps it looks if other axis need also a step. What happens is, that the timing of the primary axis is perfect, while the dependent axises are only updated at the discrete points, not at the best time. This gives a little jitter to the dependent axis. To reduce this effect, the firmware can do half steps on the primary axis. The price you pay is double computation cost for the stepper update computation. For safety, this behavior is only enabled, if the shortest time between two full steps is larger then MAX_HALFSTEP_INTERVAL ticks (default1999). This allows smoothing with a frequency of 8000 hertz. If you have 80steps/mm you can print with up to 100mm/s and still benefit from the smoothing effect.

Speed settings

Always look at the unit of measurement. Feed rates are always in mm/s!

First you should think about your maximum speed your printer can handle.  Most printer will be able to handle 100mm/s (except z axis which is much slower for most printer types). 200mm/s is a solid speed most printer can handle. Fast printers go up to 500mm/s.  You should test these values when you installed the firmware. Find the speed where no stepper stalls and reduce this by 10-20% for safety. The last thing you want are lost steps during print, because your limit was too high. Your motor current has influence on your speed, too. Be aware that high currents heat up the motors and drivers which can also lead to lost steps!

#define MAX_FEEDRATE_X 200 #define MAX_FEEDRATE_Y 200 #define MAX_FEEDRATE_Z 40Next comes the homing feed rate. This should be much lower then your maximum. The printer needs to stop immediately, when the end stop is triggered. So take values, which allow a stop without deceleration.

#define HOMING_FEEDRATE_X 40
#define HOMING_FEEDRATE_Y 40
#define HOMING_FEEDRATE_Z 2

Now we come to the acceleration. The firmware distinguishes between travel and printing moves. Travel moves have no influence on print quality, so you can use higher values here. For x- and y-axis 500 mm/s2 is slow, 1000mm/s2 a moderate value for smooth prints and 3000 mm/s2 is good for quick prints.#define MAX_ACCELERATION_UNITS_PER_SQ_SECOND_X 1500 #define MAX_ACCELERATION_UNITS_PER_SQ_SECOND_Y 1500 #define MAX_ACCELERATION_UNITS_PER_SQ_SECOND_Z 100#define MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND_X 3000 #define MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND_Y 3000 #define MAX_TRAVEL_ACCELERATION_UNITS_PER_SQ_SECOND_Z 100 

Stepper timings

The default values for stepper timings work perfectly with the Allegro stepper driver chips used on most RepRaps. So only change them if you think you have a different driver which needs slower timings.

The step signal is normally kept high for around 2µs, depending on the situation a bit longer. You can increase this time with

#define STEPPER_HIGH_DELAY 0

The unit is µs.

Now we come to the tricky part allowing high step rates of 40000 hertz with this little AVR microcontroller. The real limit for precise positioned stepper pulses lies around 16000 Hz. With this speed over 80% of the computation time is spend in the stepper routine and leaves not much room for other tasks. The trick is to double or quadruple the number of step signals in one computation. The frequency, where this starts is

#define STEP_DOUBLER_FREQUENCY 10000

If the frequency is higher, then this value the firmware will double the steps for frequencies of 10000-20000 Hz and quadruple steps above 20000 Hz. If your printer is no real CNC, it will have no problems with this. Think of it as reducing 1/16th micro stepping to 1/8th or 1/4th micro stepping.

If double/quadruple stepping is active, the consecutive steps are delayed by

#define DOUBLE_STEP_DELAY 1 // time in us

Extruder configuration

Most parts of the extruder configuration are already explained. In this chapter you will learn all about the other parameter not mentioned yet. Lets go through the basic per extruder settings first.

#define NUM_EXTRUDER 1

Most of you will only have and use one extruder. The firmware is designed to support 2 or 3 extruder. This feature is not tested at all, so no one can tell if it would work. I‘m working on a printer with double extruder to check the functionality. If you have one, try it and I will help you with possible problems.

If you have a second extruder, you need to copy the EXT0_  definitions and rename them to EXT1_ for the configuration of the second extruder.

#define EXT0_X_OFFSET 0 #define EXT0_Y_OFFSET 0

Printing commands are based on one position for all tools. Switching the extruder needs to move the head, so the second extruder is exactly at the position of the first extruder. These coordinates are the difference to the position of the first extruder.

#define EXT0_STEPS_PER_MM 373

How many steps does the motor need to move the filament 1 mm. This is the number for the filament going in, not out!

#define EXT0_TEMPSENSOR_TYPE 5

What temperature sensor are you using in the extruder. The configuration file lists possible values and meanings.

#define EXT0_TEMPSENSOR_PIN 0

This parameter is tricky and often causes wrong configurations. For historical reasons it is named PIN but it IS NOT A PIN NUMBER. It is the position in an array of analog input sources. In this array, the real pin number is stored. In 99.9% 0 is the correct answer here.

#define EXT0_HEATER_PIN HEATER_0_PIN

Which pin enables the heater block. It works with any pin. PWM capability is not required to use PID on an output.

#define EXT0_STEP_PIN E_STEP_PIN

Which pin moves the Stepper one step further.

#define EXT0_DIR_PIN E_DIR_PIN

Which pin determines the turning direction of the extruder.

#define EXT0_INVERSE false

If your extruder turns in the wrong direction, change the value into true.

#define EXT0_ENABLE_PIN E_ENABLE_PIN

Pin to activate/deactivate your extruder stepper motor.

// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 #define EXT0_ENABLE_ON false

For inverting stepper enable pins (active low) use false, non Inverting (Active High) use true.

#define EXT0_MAX_FEEDRATE 1500

Maximum feed rate of your extruder in mm/min.

#define EXT0_MAX_START_FEEDRATE 18

Starting feed rate in mm/s of your extruder. Normal feed rates are 12-20mm/s depending on motor strength, friction and extruder type. If your extruder stalls on retractions from the start, reduce this value.

#define EXT0_MAX_ACCELERATION 6000

Acceleration of your extruder in mm/s2.

#define EXT0_HEAT_MANAGER 1

Type of heat manager for this extruder.

  • 0 = Simply switch on/off if temperature is reached. Works always.
  • 1 = PID Temperature control. This method gives more stable results with a good PID parameter setting.
#define EXT0_WATCHPERIOD 20

Wait x seconds, after reaching target temperature. Only used for M109.

#define EXT0_PID_INTEGRAL_DRIVE_MAX 130

The maximum value, I-gain can contribute to the output.

A good value is slightly higher then the output needed for your temperature.

Values for starters:

130 => PLA for temperatures from 170-180°C
180 => ABS for temperatures around 240°C

Depending in your heater these values can vary. If your printer can not hold the target temperature or does not reach it, increase this value!

#define EXT0_PID_INTEGRAL_DRIVE_MIN 50

Lower value for integral part. The I state should converge to the exact heater output needed for the target temperature. To prevent a long deviation from the target zone, this value limits the lower value. A good start is 30 lower then the optimal value. You need to leave room for cooling.

#define EXT0_PID_PGAIN   500

P-gain in 0.01 units.

#define EXT0_PID_IGAIN   1

I-gain in 0.001 units.

#define EXT0_PID_DGAIN 3000

D-gain in 0.01 units.

#define EXT0_PID_MAX 255

Maximum time the heater can be switched on. Max = 255. This works only with PID. The power dissipated by the heating resistor is U2/R. If you increase the voltage your resistor may get damaged if you still use full power.

#define EXT0_ADVANCE_K 0.0f #define EXT0_ADVANCE_L 0.0f

Values to influence the advance algorithm. Check the advance algorithm chapter for more information. 0 disables the function.

Jam and out of filament detection

From 0.92.3 onwards the firmware supports jam and out of filament sensors. These sensors work quite simple. Filament goes through
the sensor and turns a wheel. The turning wheel turns a switch on/off. This might be a mechanical switch, but contact less switches
like light barrier or hal sensor are better. One on/off cycle should always need nearly the same amount of extruder steps (JAM_STEPS).
Between changes the sensor might flip back to old signal, so we require JAM_MIN_STEPS since the last change before we assume the signal as
changed again completing the cycle.
If the extruder starts
to slip it will take more and more steps for a full cycle. Based on the steps we can follow, that we have a problem. If we have only a mild increase (> JAM_SLOWDOWN_STEPS)
extrusion gets heavier due to partial clogging or reduced grip. In that case we reduce speed by setting speed multiplier to JAM_SLOWDOWN_TO.

If we need more then JAM_ERROR_STEPS steps, we assume a more serious problem that even reduced speed could not solve and take the action defined with JAM_ACTION, preferably something that pauses the running print.

Action 0 does simply print a warning on the LCD and lets the printer beep. Action 1 is my preferred solution, but requires a LCD screen. It will block
any host communication preventing further print, moves extruder to filament change position and disables temperature and all motors, which would home
after filament change. Then it waits for the user to react. First click on LCD will reheat extruders. Then you have to wait until all extruders are back on
temperature. After that you can move extruder with your click encoder to remove filament, test if extrusion works, etc. During this period jam detection is disabled! Action 2 will request a pause from the host or pause a sd print.

To handle the new feature, there are some new commands:

M513 resets the jam signal, so the printer stops complaining about jam and also disables the beeper.
M601 S1 pauses extruder temperatures while M601 S0 restores the temperatures before the pause.
M602 S<1/0> P<1/0> is for debugging jam (S value) or disabling jam control (P value). If you enable jam debug, the firmware will not execute jam
actions. Instead it will write the signal switch steps and percent values into the host log. That way you can calibrate your 100% value.
This is also useful to find out at which extrusion speed the forces get too high, so that extruder starts to slip.

 User interface configuration

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 4×4 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. A rotary encoder over I2C works only with slow turns!

Hardware connection

Display

The current firmware supports LCD display usinga HD44780 or compatible driver. This is a industrial standard that is found in nearly all alpha-numeric LCD displays. If you buy one, be careful about the voltage requirements. Some LCDs need negative voltage for contrast. If you don’t know how to get negative voltages avoid them. There are plenty of displays using only positive voltages. It’s best to put a 10k poti between 0 and 5V and connect the middle pin to V0. That way you can adjust the contrast any time. For the backlight a resistor is normally required. Read the specs for the required value. Some LCD have the resistor build in, so they can be powered with 5V directly. Now connect VSS, DB0, DB1, DB2, DB3 and LED- with GND and VDD with 5V. Connect RS, R/W, E, DB4, DB5, DB6 and DB7 to io pins of your Arduino or to the signal pins of your PCF8574 chip, if you are connecting the display over I2C. Then you are done! Make sure you know which pin is connected to which function for later configuration.

Keys

The easiest way is, to connected the keys via gnd to the io pin of your Arduino/PCF8574. It is always a good idea to add a 1K resistor in line, just in case the pin becomes an output to prevent a short. The internal pull-up will rise the signal to high, until a button is pushed and draws the line to ground.

You can also connect the keys via 5V, but you need a pull-down resistor on the io side for a defined signal.

If you have a key matrix you need up to 4 io pins for the driving rows and 1-4 pins for the receiving columns. The voltage on the rows gets changed between 0 and 5V to detect the active key. If you press 2 keys in the same column at the same time, a short will happen. To protect your cpu, you should add 1K resistors to each line.

Piezo Buzzer

If you want acoustic feedback, you can add a piezo buzzer. Get one that draw less then 20mA current. If you connect it directly to your AVR, connect GND – Buzzer – IO pin. If you use PCF8574 you have to connect it this way: 5V – buzzer – PCF8574 pin. Piezo elements have a plus and a minus contact, don’t run them the wrong way around!

Configuration

All configurations of the user interface are done in uiconfig.h.

Concept

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_X_UP : Move x axis 1 mm right
  • UI_ACTION_X_DOWN : Move X axis 1 mm left
  • UI_ACTION_Y_UP : Move Y axis 1 mm to front
  • UI_ACTION_Y_DOWN  : Move Y axis 1 mm back
  • UI_ACTION_Z_UP : Move Z axis 1 mm up
  • UI_ACTION_Z_DOWN : Move Z axis 1 mm down
  • UI_ACTION_EXTRUDER_UP : Extrude filament 1 mm
  • UI_ACTION_EXTRUDER_DOWN : Retract filament 1 mm
  • UI_ACTION_EXTRUDER_TEMP_UP : Increase extruder temperature 1 degree
  • UI_ACTION_EXTRUDER_TEMP_DOWN : Decrease extruder temperature 1 degree
  • UI_ACTION_HEATED_BED_UP : Increase bed temperature 1 degree
  • UI_ACTION_HEATED_BED_DOWN : Decrease bed temperature 1 degree
  • UI_ACTION_FAN_UP  : Increase fan speed 12.5%
  • UI_ACTION_FAN_DOWN  : Slow fan 12.5% down
  • 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

Display

First you need to define, how your LCD is connected:

#define UI_DISPLAY_TYPE 1

Possible values: 0 = No display
1 = LCD Display with 4 bit data bus
2 = LCD Display with 8 bit data bus (is mapped to 1) 3 = LCD Display with I2C connection, 4 bit mode

Then you can define the second line of the greeting message.

#define UI_VERSION_STRING2 "Orig. Mendel"

Now define the number of columns (16, 20 or 24) and number of rows (2 or 4)

#define UI_COLS 16   #define UI_ROWS 4

Now comes the hard part. You need to identify the pins used to control the display and set them accordingly. The first definition block is for a display connected over I2C. Here you need to set the mask value, not the pin number. That’s why you see _BV(3) for pin 3 (if you start counting at 0). In addition you need to set the PCF8574 address.

If you use a direct connection you could set the RW pin to -1. If you do this, the firmware will wait UI_DELAYPERCHAR microseconds after each byte send. The faster method is to have a RW pin, so the firmware can ask the display if it is ready for the next command.

#if UI_DISPLAY_TYPE==3 // I2C Pin configuration #define UI_DISPLAY_RS_PIN _BV(4) #define UI_DISPLAY_RW_PIN _BV(5) #define UI_DISPLAY_ENABLE_PIN _BV(6) #define UI_DISPLAY_D0_PIN _BV(0) #define UI_DISPLAY_D1_PIN _BV(1) #define UI_DISPLAY_D2_PIN _BV(2) #define UI_DISPLAY_D3_PIN _BV(3) #define UI_DISPLAY_D4_PIN _BV(0) #define UI_DISPLAY_D5_PIN _BV(1) #define UI_DISPLAY_D6_PIN _BV(2) #define UI_DISPLAY_D7_PIN _BV(3) // 0x40 till 0x4e for PCF8574 #define UI_DISPLAY_I2C_ADDRESS 0x4e #else // Direct display connections #define UI_DISPLAY_RS_PIN 16 #define UI_DISPLAY_RW_PIN 17 #define UI_DISPLAY_ENABLE_PIN 31 #define UI_DISPLAY_D0_PIN 23 #define UI_DISPLAY_D1_PIN 29 #define UI_DISPLAY_D2_PIN 25 #define UI_DISPLAY_D3_PIN 27 #define UI_DISPLAY_D4_PIN 23 #define UI_DISPLAY_D5_PIN 29 #define UI_DISPLAY_D6_PIN 25 #define UI_DISPLAY_D7_PIN 27 #define UI_DELAYPERCHAR 320 #endif

Keys

The firmware gives you complete freedom over the number and functions of your keys. The price you pay is, you have to write the key polling code yourself. Don’t worry, the firmware has predefined macros for the most common types of keys. You have to put the code into the matching 4 functions used by the firmware. All functions are already defined in the keys section of uiconfig.h with some commented samples. But before we start with the function, you should define some key related definitions.

First, tell the firmware if you have any keys at all.

/** Are some keys connected? 0 = No keys attached - disables also menu 1 = Some keys attached */ #define UI_HAS_KEYS 0

If you set it to 0 you can skip the rest of this section.

Most keys bounce the signal when closed/opened. After a short time the signal stabilizes. There is no need to add debounce electronics, all needed is to tell the firmware how long your keys bounce. After that, you can define key repetition behaviour. The default values should give a good starting point.

/** \brief bounce time of keys in milliseconds */ #define UI_KEY_BOUNCETIME 10 /** \brief First time in ms until repeat of action. */ #define UI_KEY_FIRST_REPEAT 500 /** \brief Reduction of repeat time until next execution. */ #define UI_KEY_REDUCE_REPEAT 50 /** \brief Lowest repeat time. */ #define UI_KEY_MIN_REPEAT 100

Next you define, if you will set the action of one of the keys to UI_ACTION_BACK. If you do, set the value to 0, so the back menü function at the top is removed. This way you can navigate faster through the menus. If you want the back menu entry, set it to 0 even if you have a back key.

#define UI_HAS_BACK_KEY 1

If you have keys attached over I2C, you need to uncomment the define and set the PCF8574 address.

/** Uncomment this, if you have keys connected via i2c to a PCF8574 chip. */ //#define UI_HAS_I2C_KEYS

 

// Under which address can the key status requested. This is the address of your PCF8574 where the keys are connected-

#define UI_I2C_KEY_ADDRESS 0x40

Ok, now the hard part. We start with the keyboard initialization. This functions is called only once, before the key polling starts. Here we define the pins as input and enable the pull up resistor if required. I2C keys need no code here. Possible macros are listed in the uiconfig file with their description.

void ui_init_keys() { //  UI_KEYS_INIT_CLICKENCODER_LOW(47,45); // click encoder on pins 47 and 45. Phase is connected with gnd for signals. //  UI_KEYS_INIT_BUTTON_LOW(43); // push button, connects gnd to pin // UI_KEYS_INIT_MATRIX(32,47,45,43,41,39,37,35); }

The macros for the next three functions are all the same. They are only caused from different points and with different frequencies. The first function is ui_check_keys. This is called from an interrupt and should finish as fast as possible. The only thing you should add here is a directly connected encoder. All I2C key methods are strictly forbidden. They take to much time to be run inside the interrupt. You can add 1-2 directly connected push buttons here if you want.

The second function is ui_check_slow_encoder, which is intended for rotary encodes connected over I2C. This is the only key macro you should add there. As you see, there is already one included, but you may need to change the type or pins or disable it, if you use I2C keys without encoder.

The last function is ui_check_slow_keys. Here you add the same key macro as in ui_check_slow_encoder, if you have anything there plus all keys not defined until now. This function is called from the main thread and can be interrupted any time, so no big things happen if it takes some ticks longer.

void ui_check_keys(int &action) { //  UI_KEYS_CLICKENCODER_LOW_REV(47,45); // click encoder on pins 47 and 45. Phase is connected with gnd for signals. //  UI_KEYS_BUTTON_LOW(43,UI_ACTION_OK); // push button, connects gnd to pin } inline void ui_check_slow_encoder() { #ifdef UI_HAS_I2C_KEYS i2c_start_wait(UI_I2C_KEY_ADDRESS+I2C_READ); byte keymask = i2c_readNak(); // Read current key mask   i2c_stop();   // Add I2C click encoder tests here, all other i2c tests and a copy of the encoder test belog in ui_check_slow_keys   UI_KEYS_I2C_CLICKENCODER_LOW_REV(_BV(2),_BV(0)); // click encoder on pins 0 and 2. Phase is connected with gnd for signals. #endif } void ui_check_slow_keys(int &action) { #ifdef UI_HAS_I2C_KEYS     i2c_start_wait(UI_I2C_KEY_ADDRESS+I2C_READ);  // Read keymask from i2c for the following tests     byte keymask = i2c_readNak(); // Read current key mask     i2c_stop();     // Add I2C key tests here     UI_KEYS_I2C_CLICKENCODER_LOW_REV(_BV(2),_BV(0)); // click encoder on pins 0 and 2. Phase is connected with gnd for signals.     UI_KEYS_I2C_BUTTON_LOW(_BV(1),UI_ACTION_OK); // push button, connects gnd to pin       UI_KEYS_I2C_BUTTON_LOW(_BV(3),UI_ACTION_BACK); // push button, connects gnd to pin       UI_KEYS_I2C_BUTTON_LOW(_BV(4),UI_ACTION_MENU_QUICKSETTINGS); // push button, connects gnd to pin       UI_KEYS_I2C_BUTTON_LOW(_BV(5),UI_ACTION_MENU_EXTRUDER); // push button, connects gnd to pin       UI_KEYS_I2C_BUTTON_LOW(_BV(6),UI_ACTION_MENU_POSITIONS); // push button, connects gnd to pin   #endif  // UI_KEYS_MATRIX(32,47,45,43,41,39,37,35); }

Buzzer

You find the buzzer configuration near the start of the file. The comments should be enough, to understand the configuration.

/** Select type of beeper 0 = none 1 = Piezo connected to pin 2 = Piezo connected to a pin over I2C */ #define BEEPER_TYPE 0  #if BEEPER_TYPE==1 #define BEEPER_PIN 42 #endif #if BEEPER_TYPE==2 #define BEEPER_ADDRESS 0x40 // I2C address of the chip with the beeper pin #define BEEPER_PIN _BV(7)  // Bit value for pin 8 #define COMPILE_I2C_DRIVER  // We need the I2C driver as we are using i2c #endif /** Beeper sound definitions for short beeps during key actions and longer beeps for important actions. Parameter is is delay in microseconds and the secons is the number of repetitions. Values must be in range 1..255 */ #define BEEPER_SHORT_SEQUENCE 1,1 #define BEEPER_LONG_SEQUENCE 5,5

Menu definition

At the start of the file you can select the language for your menu. #define UI_LANGUAGE 0

0 is english, 1 is german and 2 is dutch. With some luck nice users of the firmware will contribute additional languages. To define your own language go into uilang.h At the end you will find this, where you can write your own translations:

// ************************************************************************************* //                             User defined language // // If you need a language not mentioned above, you can translate this dummy entry. // If you want it added permanently to the distribution, spend it to the community under // GPL V3. Only new and complete translations are put into the official distribution! // ************************************************************************************* #if UI_LANGUAGE==1000

To use it, select 1000 as language.

Thats all needed to get the complete menu and info pages. If you want more information pages or additional menu entries, other ordering etc. search for

/* ============ MENU definition ================

and make your changes. Read the comments and look at the definitions and you should gasp, how to modify it. Be careful to update the menu entry counters to match the number of entries!

Continue with “First Tests”

Sours: https://www.repetier.com/documentation/repetier-firmware/rf-installation/
  1. Sas sata compatibility
  2. 2018 ford f150 recall list
  3. May astrological sign
  4. German poppy seed cake recipes
/* 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 <http://www.gnu.org/licenses/>.*/#ifndef CONFIGURATION_H#defineCONFIGURATION_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.3dev 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.*/#defineNUM_EXTRUDER4#defineMOTHERBOARD35#include"pins.h"// ################## EDIT THESE SETTINGS MANUALLY ################// ################ END MANUAL SETTINGS ###########################defineHOST_RESCUE1#undef FAN_BOARD_PIN#defineFAN_BOARD_PIN ORIG_FAN_PIN#defineBOARD_FAN_SPEED255#defineBOARD_FAN_MIN_SPEED0#defineFAN_THERMO_PIN -1#defineFAN_THERMO_MIN_PWM128#defineFAN_THERMO_MAX_PWM255#defineFAN_THERMO_MIN_TEMP45#defineFAN_THERMO_MAX_TEMP60#defineFAN_THERMO_THERMISTOR_PIN -1#defineFAN_THERMO_THERMISTOR_TYPE1//#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#defineBLUETOOTH_SERIAL -1#defineBLUETOOTH_BAUD115200#defineMIXING_EXTRUDER0#defineDRIVE_SYSTEM0#defineXAXIS_STEPS_PER_MM72.72#defineYAXIS_STEPS_PER_MM72.72#defineZAXIS_STEPS_PER_MM520#defineEXTRUDER_FAN_COOL_TEMP50#definePDM_FOR_EXTRUDER0#definePDM_FOR_COOLER0#defineDECOUPLING_TEST_MAX_HOLD_VARIANCE20#defineDECOUPLING_TEST_MIN_TEMP_RISE1#defineKILL_IF_SENSOR_DEFECT1#defineRETRACT_ON_PAUSE4#definePAUSE_START_COMMANDS""#definePAUSE_END_COMMANDS""#defineSHARED_EXTRUDER_HEATER0#defineEXT0_X_OFFSET0#defineEXT0_Y_OFFSET0#defineEXT0_Z_OFFSET0#defineEXT0_STEPS_PER_MM255#defineEXT0_TEMPSENSOR_TYPE5#defineEXT0_TEMPSENSOR_PIN TEMP_0_PIN#defineEXT0_HEATER_PIN HEATER_0_PIN#defineEXT0_STEP_PIN ORIG_E0_STEP_PIN#defineEXT0_DIR_PIN ORIG_E0_DIR_PIN#defineEXT0_INVERSE1#defineEXT0_ENABLE_PIN ORIG_E0_ENABLE_PIN#defineEXT0_ENABLE_ON1#defineEXT0_MIRROR_STEPPER0#defineEXT0_STEP2_PIN ORIG_E0_STEP_PIN#defineEXT0_DIR2_PIN ORIG_E0_DIR_PIN#defineEXT0_INVERSE20#defineEXT0_ENABLE2_PIN ORIG_E0_ENABLE_PIN#defineEXT0_MAX_FEEDRATE50#defineEXT0_MAX_START_FEEDRATE20#defineEXT0_MAX_ACCELERATION5000#defineEXT0_HEAT_MANAGER1#defineEXT0_PREHEAT_TEMP190#defineEXT0_WATCHPERIOD1#defineEXT0_PID_INTEGRAL_DRIVE_MAX255#defineEXT0_PID_INTEGRAL_DRIVE_MIN40#defineEXT0_PID_PGAIN_OR_DEAD_TIME8.94#defineEXT0_PID_I0.51#defineEXT0_PID_D20#defineEXT0_PID_MAX255#defineEXT0_ADVANCE_K0#defineEXT0_ADVANCE_L0#defineEXT0_ADVANCE_BACKLASH_STEPS0#defineEXT0_WAIT_RETRACT_TEMP150#defineEXT0_WAIT_RETRACT_UNITS0#defineEXT0_SELECT_COMMANDS""#defineEXT0_DESELECT_COMMANDS""#defineEXT0_EXTRUDER_COOLER_PIN -1#defineEXT0_EXTRUDER_COOLER_SPEED255#defineEXT0_DECOUPLE_TEST_PERIOD30000#defineEXT0_JAM_PIN -1#defineEXT0_JAM_PULLUP0#defineEXT1_X_OFFSET0#defineEXT1_Y_OFFSET0#defineEXT1_Z_OFFSET0#defineEXT1_STEPS_PER_MM257#defineEXT1_TEMPSENSOR_TYPE5#defineEXT1_TEMPSENSOR_PIN TEMP_2_PIN#defineEXT1_HEATER_PIN HEATER_2_PIN#defineEXT1_STEP_PIN ORIG_E1_STEP_PIN#defineEXT1_DIR_PIN ORIG_E1_DIR_PIN#defineEXT1_INVERSE1#defineEXT1_ENABLE_PIN ORIG_E1_ENABLE_PIN#defineEXT1_ENABLE_ON1#defineEXT1_MIRROR_STEPPER0#defineEXT1_STEP2_PIN ORIG_E1_STEP_PIN#defineEXT1_DIR2_PIN ORIG_E1_DIR_PIN#defineEXT1_INVERSE20#defineEXT1_ENABLE2_PIN ORIG_E1_ENABLE_PIN#defineEXT1_MAX_FEEDRATE100#defineEXT1_MAX_START_FEEDRATE40#defineEXT1_MAX_ACCELERATION5000#defineEXT1_HEAT_MANAGER1#defineEXT1_PREHEAT_TEMP190#defineEXT1_WATCHPERIOD1#defineEXT1_PID_INTEGRAL_DRIVE_MAX255#defineEXT1_PID_INTEGRAL_DRIVE_MIN40#defineEXT1_PID_PGAIN_OR_DEAD_TIME8.94#defineEXT1_PID_I0.51#defineEXT1_PID_D20#defineEXT1_PID_MAX255#defineEXT1_ADVANCE_K0#defineEXT1_ADVANCE_L0#defineEXT1_ADVANCE_BACKLASH_STEPS0#defineEXT1_WAIT_RETRACT_TEMP150#defineEXT1_WAIT_RETRACT_UNITS0#defineEXT1_SELECT_COMMANDS""#defineEXT1_DESELECT_COMMANDS""#defineEXT1_EXTRUDER_COOLER_PIN -1#defineEXT1_EXTRUDER_COOLER_SPEED255#defineEXT1_DECOUPLE_TEST_PERIOD30000#defineEXT1_JAM_PIN -1#defineEXT1_JAM_PULLUP0#defineEXT2_X_OFFSET0#defineEXT2_Y_OFFSET0#defineEXT2_Z_OFFSET0#defineEXT2_STEPS_PER_MM257#defineEXT2_TEMPSENSOR_TYPE5#defineEXT2_TEMPSENSOR_PIN TEMP_3_PIN#defineEXT2_HEATER_PIN HEATER_3_PIN#defineEXT2_STEP_PIN ORIG_E2_STEP_PIN#defineEXT2_DIR_PIN ORIG_E2_DIR_PIN#defineEXT2_INVERSE1#defineEXT2_ENABLE_PIN ORIG_E2_ENABLE_PIN#defineEXT2_ENABLE_ON1#defineEXT2_MIRROR_STEPPER0#defineEXT2_STEP2_PIN ORIG_E2_STEP_PIN#defineEXT2_DIR2_PIN ORIG_E2_DIR_PIN#defineEXT2_INVERSE20#defineEXT2_ENABLE2_PIN ORIG_E2_ENABLE_PIN#defineEXT2_MAX_FEEDRATE100#defineEXT2_MAX_START_FEEDRATE40#defineEXT2_MAX_ACCELERATION5000#defineEXT2_HEAT_MANAGER1#defineEXT2_PREHEAT_TEMP190#defineEXT2_WATCHPERIOD1#defineEXT2_PID_INTEGRAL_DRIVE_MAX255#defineEXT2_PID_INTEGRAL_DRIVE_MIN40#defineEXT2_PID_PGAIN_OR_DEAD_TIME8.94#defineEXT2_PID_I0.51#defineEXT2_PID_D20#defineEXT2_PID_MAX255#defineEXT2_ADVANCE_K0#defineEXT2_ADVANCE_L0#defineEXT2_ADVANCE_BACKLASH_STEPS0#defineEXT2_WAIT_RETRACT_TEMP150#defineEXT2_WAIT_RETRACT_UNITS0#defineEXT2_SELECT_COMMANDS""#defineEXT2_DESELECT_COMMANDS""#defineEXT2_EXTRUDER_COOLER_PIN -1#defineEXT2_EXTRUDER_COOLER_SPEED255#defineEXT2_DECOUPLE_TEST_PERIOD30000#defineEXT2_JAM_PIN -1#defineEXT2_JAM_PULLUP0#defineEXT3_X_OFFSET0#defineEXT3_Y_OFFSET0#defineEXT3_Z_OFFSET0#defineEXT3_STEPS_PER_MM257#defineEXT3_TEMPSENSOR_TYPE5#defineEXT3_TEMPSENSOR_PIN TEMP_4_PIN#defineEXT3_HEATER_PIN HEATER_4_PIN#defineEXT3_STEP_PIN ORIG_E3_STEP_PIN#defineEXT3_DIR_PIN ORIG_E3_DIR_PIN#defineEXT3_INVERSE1#defineEXT3_ENABLE_PIN ORIG_E3_ENABLE_PIN#defineEXT3_ENABLE_ON1#defineEXT3_MIRROR_STEPPER0#defineEXT3_STEP2_PIN ORIG_E3_STEP_PIN#defineEXT3_DIR2_PIN ORIG_E3_DIR_PIN#defineEXT3_INVERSE20#defineEXT3_ENABLE2_PIN ORIG_E3_ENABLE_PIN#defineEXT3_MAX_FEEDRATE100#defineEXT3_MAX_START_FEEDRATE40#defineEXT3_MAX_ACCELERATION5000#defineEXT3_HEAT_MANAGER1#defineEXT3_PREHEAT_TEMP190#defineEXT3_WATCHPERIOD1#defineEXT3_PID_INTEGRAL_DRIVE_MAX255#defineEXT3_PID_INTEGRAL_DRIVE_MIN40#defineEXT3_PID_PGAIN_OR_DEAD_TIME8.94#defineEXT3_PID_I0.51#defineEXT3_PID_D20#defineEXT3_PID_MAX255#defineEXT3_ADVANCE_K0#defineEXT3_ADVANCE_L0#defineEXT3_ADVANCE_BACKLASH_STEPS0#defineEXT3_WAIT_RETRACT_TEMP150#defineEXT3_WAIT_RETRACT_UNITS0#defineEXT3_SELECT_COMMANDS""#defineEXT3_DESELECT_COMMANDS""#defineEXT3_EXTRUDER_COOLER_PIN -1#defineEXT3_EXTRUDER_COOLER_SPEED255#defineEXT3_DECOUPLE_TEST_PERIOD30000#defineEXT3_JAM_PIN -1#defineEXT3_JAM_PULLUP0#defineFEATURE_RETRACTION1#defineAUTORETRACT_ENABLED0#defineRETRACTION_LENGTH2.5#defineRETRACTION_LONG_LENGTH2.5#defineRETRACTION_SPEED50#defineRETRACTION_Z_LIFT0#defineRETRACTION_UNDO_EXTRA_LENGTH0#defineRETRACTION_UNDO_EXTRA_LONG_LENGTH0#defineRETRACTION_UNDO_SPEED40#defineFILAMENTCHANGE_X_POS0#defineFILAMENTCHANGE_Y_POS0#defineFILAMENTCHANGE_Z_ADD2#defineFILAMENTCHANGE_REHOME1#defineFILAMENTCHANGE_SHORTRETRACT5#defineFILAMENTCHANGE_LONGRETRACT50#defineJAM_METHOD1#defineJAM_STEPS220#defineJAM_SLOWDOWN_STEPS320#defineJAM_SLOWDOWN_TO70#defineJAM_ERROR_STEPS500#defineJAM_MIN_STEPS10#defineJAM_ACTION1#defineRETRACT_DURING_HEATUPtrue#definePID_CONTROL_RANGE20#defineSKIP_M109_IF_WITHIN2#defineSCALE_PID_TO_MAX0#defineTEMP_HYSTERESIS0#defineEXTRUDE_MAXLENGTH160#defineNUM_TEMPS_USERTHERMISTOR029#defineUSER_THERMISTORTABLE0 {{0,8000},{69,2280},{79,2200},{92,2120},{107,2040},{125,1960},{146,1886},{172,1810},{204,1736},{243,1661},{291,1586},{350,1511},{422,1437},{512,1362},{622,1287},{756,1212},{919,1138},{1345,988},{3139,539},{3388,464},{3591,390},{3749,314},{3866,240},{3949,160},{4005,80},{4041,0},{4064,-80},{4086,-240},{4093,-400}}#defineNUM_TEMPS_USERTHERMISTOR10#defineUSER_THERMISTORTABLE1 {}#defineNUM_TEMPS_USERTHERMISTOR20#defineUSER_THERMISTORTABLE2 {}#defineGENERIC_THERM_VREF5#defineGENERIC_THERM_NUM_ENTRIES33#defineTEMP_GAIN1#defineHEATER_PWM_SPEED0#defineCOOLER_PWM_SPEED0// ############# Heated bed configuration #########################defineHAVE_HEATED_BED1#defineHEATED_BED_PREHEAT_TEMP55#defineHEATED_BED_MAX_TEMP120#defineSKIP_M190_IF_WITHIN3#defineHEATED_BED_SENSOR_TYPE8#defineHEATED_BED_SENSOR_PIN TEMP_1_PIN#defineHEATED_BED_HEATER_PIN HEATER_1_PIN#defineHEATED_BED_SET_INTERVAL5000#defineHEATED_BED_HEAT_MANAGER1#defineHEATED_BED_PID_INTEGRAL_DRIVE_MAX255#defineHEATED_BED_PID_INTEGRAL_DRIVE_MIN80#defineHEATED_BED_PID_PGAIN_OR_DEAD_TIME196#defineHEATED_BED_PID_IGAIN33#defineHEATED_BED_PID_DGAIN290#defineHEATED_BED_PID_MAX255#defineHEATED_BED_DECOUPLE_TEST_PERIOD300000#defineMIN_EXTRUDER_TEMP150#defineMAXTEMP280#defineMIN_DEFECT_TEMPERATURE -10#defineMAX_DEFECT_TEMPERATURE300#defineMILLISECONDS_PREHEAT_TIME30000// ##########################################################################################// ## 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 aredangerous and can hurt or make you blind!!!The default laser driver only supports laser on and off. Here you control the intensity withyour feedrate. For exchangeable diode lasers this is normally enough. If you need more controlyou can set the intensity in a range 0-255 with a custom extension to the driver. See driver.hand 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 aincreasing extruder position it will laser that move. With this trick you canuse 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 enabledand G0 moves have it disables.In any case, laser only enables while moving. At the end of a move it getsautomatically disabled.*/#defineSUPPORT_LASER0#defineLASER_PIN -1#defineLASER_ON_HIGH1#defineLASER_WARMUP_TIME0#defineLASER_PWM_MAX255#defineLASER_WATT2// ## CNC configuration ##/*If the firmware is in CNC mode, it can control a mill with M3/M4/M5. It workssimilar to laser mode, but mill keeps enabled during G0 moves and it allowssetting 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.*/#defineSUPPORT_CNC0#defineCNC_WAIT_ON_ENABLE300#defineCNC_WAIT_ON_DISABLE0#defineCNC_ENABLE_PIN -1#defineCNC_ENABLE_WITH1#defineCNC_DIRECTION_PIN -1#defineCNC_DIRECTION_CW1#defineCNC_PWM_MAX255#defineCNC_RPM_MAX8000#defineCNC_SAFE_Z150#defineDEFAULT_PRINTER_MODE0// ################ Endstop configuration ######################defineMULTI_ZENDSTOP_HOMING0#defineENDSTOP_PULLUP_X_MINtrue#defineENDSTOP_X_MIN_INVERTINGtrue#defineMIN_HARDWARE_ENDSTOP_Xtrue#defineENDSTOP_PULLUP_Y_MINtrue#defineENDSTOP_Y_MIN_INVERTINGtrue#defineMIN_HARDWARE_ENDSTOP_Ytrue#defineENDSTOP_PULLUP_Z_MINtrue#defineENDSTOP_Z_MIN_INVERTINGtrue#defineMIN_HARDWARE_ENDSTOP_Ztrue#defineENDSTOP_PULLUP_Z2_MINMAXtrue#defineENDSTOP_Z2_MINMAX_INVERTINGfalse#defineMINMAX_HARDWARE_ENDSTOP_Z2false#defineENDSTOP_PULLUP_X_MAXtrue#defineENDSTOP_X_MAX_INVERTINGtrue#defineMAX_HARDWARE_ENDSTOP_Xtrue#defineENDSTOP_PULLUP_Y_MAXtrue#defineENDSTOP_Y_MAX_INVERTINGtrue#defineMAX_HARDWARE_ENDSTOP_Ytrue#defineENDSTOP_PULLUP_Z_MAXtrue#defineENDSTOP_Z_MAX_INVERTINGtrue#defineMAX_HARDWARE_ENDSTOP_Ztrue#defineENDSTOP_PULLUP_X2_MINtrue#defineENDSTOP_PULLUP_Y2_MINtrue#defineENDSTOP_PULLUP_Z2_MINMAXtrue#defineENDSTOP_PULLUP_X2_MAXtrue#defineENDSTOP_PULLUP_Y2_MAXtrue#defineENDSTOP_X2_MIN_INVERTINGfalse#defineENDSTOP_Y2_MIN_INVERTINGfalse#defineENDSTOP_X2_MAX_INVERTINGfalse#defineENDSTOP_Y2_MAX_INVERTINGfalse#defineMIN_HARDWARE_ENDSTOP_X2false#defineMIN_HARDWARE_ENDSTOP_Y2false#defineMAX_HARDWARE_ENDSTOP_X2false#defineMAX_HARDWARE_ENDSTOP_Y2false#defineX2_MIN_PIN -1#defineX2_MAX_PIN -1#defineY2_MIN_PIN -1#defineY2_MAX_PIN -1#defineZ2_MINMAX_PIN -1#definemax_software_endstop_rtrue#definemin_software_endstop_xfalse#definemin_software_endstop_yfalse#definemin_software_endstop_zfalse#definemax_software_endstop_xfalse#definemax_software_endstop_yfalse#definemax_software_endstop_zfalse#defineDOOR_PIN -1#defineDOOR_PULLUP1#defineDOOR_INVERTING1#defineENDSTOP_X_BACK_MOVE6#defineENDSTOP_Y_BACK_MOVE6#defineENDSTOP_Z_BACK_MOVE6#defineENDSTOP_X_RETEST_REDUCTION_FACTOR3#defineENDSTOP_Y_RETEST_REDUCTION_FACTOR3#defineENDSTOP_Z_RETEST_REDUCTION_FACTOR6#defineENDSTOP_X_BACK_ON_HOME1#defineENDSTOP_Y_BACK_ON_HOME1#defineENDSTOP_Z_BACK_ON_HOME0#defineALWAYS_CHECK_ENDSTOPS1#defineMOVE_X_WHEN_HOMED0#defineMOVE_Y_WHEN_HOMED0#defineMOVE_Z_WHEN_HOMED0// ################# XYZ movements ####################defineX_ENABLE_ON1#defineY_ENABLE_ON0#defineZ_ENABLE_ON1#defineDISABLE_X0#defineDISABLE_Y0#defineDISABLE_Z0#defineDISABLE_E0
Sours: https://github.com/repetier/Repetier-Firmware/blob/master/src/ArduinoAVR/Repetier/Configuration.h
Marlin vs. Repetier Firmware on a Delta 3D Printer

Introduction

So, you build your 3d printer and want to get it going? Then you came to the right place. With Repetier-Firmware you have chosen a high end firmware that works with nearly all Arduino powered printer boards. In this manual you‘ll learn how to configure, compile and upload the firmware to your printer board. Then I show you how to connect your printer and how to use it correctly. A special chapter handles common problems and how to solve them.
Repetier-Firmware

Required hardware

The firmware works with all Arduino based RepRap boards with at least 64kB flash memory. If you plan to use all possible features you need a board with at least 256kB flash like the Arduino Mega 2560. If you have no board yet, get an Arduino Mega 2560 with RAMPS 1.4 shield. It is very flexible and has enough free pins for later extensions. For delta style printers you should use a Arduino Due compatible boards like RADDS board. The nonlinear computations require much memory and cpu time so a due based board, which is around 10 times faster is a good option. This is also required if you need high stepper frequencies from high micro stepping. With AVR based boards the maximum frequency is 30-40kHz with quad stepping. A due based board can do 100kHz without double stepping enabled and with quad stepping you can reach around 300kHz (for deltas a bit less).

When I said it works with all boards with at least 64kB flash memory, I meant you can get it running. The only real difference between the several  boards is the pin to function assignment. When you set the correct values, it works. For easy configuration the most common boards are already included with their correct pin assignments. The currently supported boards are:

  • Arduino Mega/RAMPS combination
  • Gen 6
  • Sanguinololu
  • /Gen7 1.1 and above with 16 or 20MHz
  • Teensylu
  • Printrboard
  • Foltyn 3D Master
  • MegaTronics
  • RUMBA
  • Rambo
  • RADDS Shield for Arduino Due
  • And many more…

Provided functions

Fast and reliable communication

The best printer and firmware does not help, if the communication breaks or commands are misinterpreted, because a character was lost or changed during transmission. For that reason, the firmware uses checksums to verify the data integrity. This requires a host software that sends the commands including a checksum and line number. This is true for all RepRap compatible host software I have seen. The checksum is build as simple 8-bit xor value over the command. This offers some room for errors, which can not be detected by the firmware, like adding an additional char twice, which has no influence on the checksum.

To overcome this disadvantage a new binary data protocol was added into the firmware. This new Repetier-Protocol uses binary data transmission and a 16 bit checksum. The binary data speeds up the analysis of commands and reduces the needed data to rawly 50% of the standard ascii transfer. The 16 bit Fletcher checksum makes the communication very reliable. Currently only Repetier-Host supports sending data in this format. You can still use other host software, like Pronterface. The firmware automatically detects, if a command is in ascii or binary format.

For a fast communication a wide range of baud rates can be used. For the most common 16MHz boards a speed of 250000 baud is recommended, if the used os/host software supports this setting.

Fast and smooth print

Depending on your hardware, the firmware gets your printer moving fast. Normally it can move the printer faster then the extruder is able to print cleanly. It uses linear ramps to accelerate and decelerate your extruder. The firmware stores several moves in a buffer, so it doesn‘t need to stop on short communication pauses. The buffer is also used to optimize the movement path. That way less acceleration/deceleration is needed and your print gets smoother and printing time is reduced.

Storage of configuration parameter in EEPROM

The AVR microcontroller used on the board have a small EEPROM which can store data permanently. This data is not lost after a restart or after uploading a new firmware version. If you want, the most important parameter are stored in this memory area. That way, you can change these parameter while the printer is running. The alternative would be to change the configuration file and upload a new version of the firmware.

Graphical user interface

You can add a LCD display or optionally some keys or a rotary click encoder to control printer functions independent of any host. With a connected sd card reader you can even print completely without a host. The LCD will show the most important parameter (which you can configure) in one or more info screens.

Some boards like Gen 6/Sanguino have not enough free pins for a direct connection of the interface hardware. For this reason the interface also supports hardware connected via I2C bus. More on this in the user interface chapter.

SD card reader support

You don‘t want your computer running all the time you print? Your computer adds pauses when you do some fancy things while printing? Add a sd card reader to your board and copy the file to your card. Then print from card and your printer will continue, even if you computer crashes or is turned off.

Continue with “Installation”

Sours: https://www.repetier.com/documentation/repetier-firmware/repetier-firmware-introduction/

Configuration repetier firmware

Introduction

The configurator is the solution to the typical configuration hell, when it comes to creating or updating a new firmware for your 3d printer. While the wanted values are quite simple, many users get lost in the different options and when they need to be set. In this configurator we try to hide all information and settings, that are not relevant for your printer, based on previous answers. For that reason work yourself through the top menus from left to right and answer the questions from top to bottom.

This is the latest stable version. It will get no more updates or fixes since version 0.92 is in a good shape and is already usable. In fact users with Arduino due based boards should upgrade to 0.92 and enable watchdog in that version. All other users can safely continue to use this version until 0.92 is declared stable or if you like to live with the latest features and improvements you can already switch to 0.92.
Switch to 0.92

If you have already made a configuration - including older versions - you can upload the Configuration.h or config.json file to set all options to that settings. If you choose the Configuration.h, the settings are taken from the embedded json string. All changes in the normal part are lost. New parameter are highlighted like this:

Attention! Only config files generated by this configuration tool can be uploaded!

Please notice the warnings below, which normally indicate a wrong or bad choice of configuration combination.

There are three options to continue your work:

  1. Download complete firmware incl. these settings
    This returns a zip file with the complete firmware including your settings in Configuration.h. You can upload the contained Configuration.h later to continue configuration or use it for future versions. The README.txt contains all instuctions needed for compilation.
  2. Download Configuration.h
    This returns only the modified Configuration.h file. Use it to update an existing firmware.
  3. Download config.json
    This file only contains your configuration settings. It is not needed for compilation and contains only the settings part of the Configuration.h. Useful for printer vendors who want to offer a pre configured and testen configuration to allow future firmware updates.
Sours: https://www.repetier.com/firmware/v091/
Marlin vs. Repetier Firmware on a Delta 3D Printer

Introduction

The configurator is the solution to the typical configuration hell when it comes to creating or updating a new firmware for your 3d printer. While the wanted values are quite simple, many users get lost in the different options and when they need to be set. In this configurator we try to hide all information and settings that are not relevant for your printer, based on previous answers. For that reason work yourself through the top menus from left to right and answer the questions from top to bottom.

This is the latest stable version. You can also use the older version 0.91 or the development version with all fixes and improvements for the next major release.
Switch to 0.91

Switch to 1.0.x

If you have already made a configuration - including older versions - you can upload the Configuration.h or config.json file to set all options to that settings. If you choose the Configuration.h, the settings are taken from the embedded json string. All changes in the normal part are lost. New parameter are highlighted like this:

Attention! Only config files generated by this configuration tool can be uploaded!

Sours: https://www.repetier.com/firmware/v092/

You will also like:

Installation

Prerequisites

Before you start with the installation, you should check if your computer meets the requirements. Currently available computers should have no problems at all. If you have an old computer running Windows XP you may have difficulties. The Host works on Windows XP and later and on Linux. If you have a Macintosh computer, check for the Repetier-Host Mac on this site. All you need is .NET framework 4.0 or a recent Mono installation, if you are running Linux. The only other requirement is a graphic card with OpenGL. For a good rendering performance OpenGL 1.5 or higher is needed. With lower versions you may have speed issues with live preview.

Getting the software

Go to the download page and fetch the latest version for your os.

Windows installation

The windows version comes with a installer. After downloading run the installer and you are done. The installer already contains Slic3r and Skeinforge for slicing and python and pypy, which are needed to run Skeinforge.

Linux installation

The linux version comes as gzipped tar file. Move it to where you want your files and unpack its contents and run the post installation script:

tar -xzf repetierHostLinux_1_03.tgz cd RepetierHost sh configureFirst.sh

After that you have a link in /usr/bin to the installation, so you can start it with repetierHost. Make sure you have all required Mono libraries installed. If you are in doubt, install Mono develop, which has all needed libraries as dependency.

One problem that most linux distributions have is, that the normal users are not allowed to connect to a serial console. You need to put your user into the right group. On Debian you can call:

usermod -a -G dialout yourUserName

to add your user to the group dialout.

First start

After the first start a dialog may pop up asking you, where your work directory should be. The latest windows versions skip this step, because the installer already created a work directory for you. You can select any directory, where you have write privileges, but it is advised to use a separate directory for this purpose.

The work directory is, where the host will put temporary stl files, sliced results and if enabled the log file.

Configuring your printer

The next step should be, to configure your printer so you can connect your computer with the host. Make sure your printer is connected and enabled. Some printer need special driver to access the device, so make sure the drivers are also installed. If you have uploaded the firmware to your printer, the driver is already installed.

Go to the menu “Config”->”Printer Settings” or klick the button Printer Settings. You will see a window like this:

At the top you see a drop down box, with the currently selected printer. At the start you have only the default printer. To create a new printer you only need to change the printer name and press “Apply”. The new printer will start with the same settings as the last selected printer.

Below the drop down box you see four tabs with most off the data stored with the printer configuration. In addition to this, for each configuration a start/end/pause/kill and five user defines scripts are stored with configuration. These can be changed in the g-code editor, which is described in a different chapter.

In this first tab, you set how to connect with your printer. In “Port” you select the port, where your printer is connected. At the opening of the window, all available ports were scanned and added to the list. If you connect your printer when this menue is already open, klick “Refresh Ports” to detect the new port. Select the right one. Then select the baud rate entered into the firmware. Stop bits and parity are correct for 99,9% of the printer, so leave them untouched.

The transfer protocol determines, how the host will communicate with the printer. All supported firmwares work in ASCII mode. The Repetier-Firmware also supports a binary format. The advantages of the binary format are:

  • Reduced data size. Normal data is reduced to 50%.
  • Better error correction.
  • Less computation time needed for the firmware to parse the data.

You can leave this on “Auto detect”, which will automatically switch to binary format if Repetier-Firmware is detected. For all other firmwares, the ASCII communication is used.

The next decision is, how to send data to the firmware. The method that was planned with the first firmwares works like ping-pong. The host send a command and waits for the firmware to return an ok. This causes latencies, which can result in empty buffers if you have many small moves. To improve speed, you can allow the host to send more then one command at once. Your printer has a input buffer. As long as you are sending not more then the size of the buffer, you can send more then one command if they fit into the buffer. So if you disable the ping-pong mode, the host will send up to “Receive cache size” bytes, before it waits for the ok, telling him that the command is processed. If you are unsure on the printer buffer size select 63, which works on all printers. Firmware compiled with Arduino versions before 1.0 even allow 127 bytes.

The second tab defines important behavior you want. The Travel feed rate and Z-axis feed rate are used, when you move the extruder with the manual controls. The temperatures are set in the manual controls as start values. You can change them there any time.

When you turn the extruder on, you surely want to know the temperature of it. This is done by sending the M105 command to the printer. If you don’t plan to do this yourself every x seconds leave the option checked. You can also select how often you want the host to check the temperature. The default 3 seconds are a good start. With every request you get 2 entries in your log. The host will show the read temperature at the bottom in the status bar, so removing these messages from the log makes it much more readable.

Park position is where you like your extruder head the most. In the manual control you have a button to move the head to the park position. You can also tell the host to go to this position, after a print is finished.

The next check boxes define, what the printer should do, when a print is finished and if a SD card is available. If no SD card is available, the corresponding tab will not be displayed.

With “Add to comp. printing time” you define, how the host should correct the computed printing time. When the host computes the time from g-code, it assumes all moves are executed at the feed rate requested. If you do a slow print, this will be quite correct, except that it doesn’t take the time to heat the extruder/bed into account. With fast prints, the firmware needs to accelerate/decelerate a log, which increases the print time. After some prints, where you compared the computed and real printing time, you should be able to figure out how much percent you need to add to the computed time. Don’t expect to match every print. Depending on the geometry, the time will still differ a bit.

At the end you can change the moving direction in manual control for each axis.

In the “Extruder” tab you can define the numbers of extruders, the max. temperatures, that are shown in the manual control. The max volume per second defines the maximum amount of filament in mm³, the extruder can melt per second.

For each extruder you can define a name, a nozzle diameter (the diameter is only used for CuraEngine), a temperature offset, which is added to the filament temperature, if this extruder is selected (this also works only with CuraEngine), a color, which is used for preview, and x and y offset, which adjusts the extruder position for multi extruder prints. Some firmwares like Repetier-Firmware correct the offset themself, so in this case offset should stay 0.

The “Printer Shape” tab defines your printer shape, or to be more exact the shape of your build area. The host will use this to limit your moves and to check, if your models fit onto the print bed. You can also define the position of the x and y end stop.

The dump area is a rectangular hole in your print bed, where you can drop filament. Mostly the original Mendel had this. If you don’t have a dump area, leave the option unchecked.

If you like to add a visualization of your printer, you can design it with a 3d editor. Important points:

  • You can have up to 3 stl files and assign each a different color.
  • You need to export it, so that it fits bed position. The imported files do not get translated after loading.
  • Sometimes it is useful to view the model from below. You can either decide to hide the printer if viewed from bottom or design you printer that you can view the model from bottom.

The last tab is for advanced configurations, you most probably will never need. Currently it only contains a post process filter. After the slicer is done with slicing, you can start an external program with the g-code. This program must save the resulting g-code in the file named by the #out parameter.

Units Settings

Unit Settings
The host uses internally only millimeters. Unfortunately STL and OBJ format do not contain a scaling hint. Therefore you need to select the units used for the creation. That way the host will convert the units correctly into millimeters.

Continue with “Object Placement”

Sours: https://www.repetier.com/documentation/repetier-host/rh-installation-and-configuration/


25 26 27 28 29