How to Set Up Repetier Firmware for Wanhao Duplicator I3 V2

How to Set Up Repetier Firmware for Wanhao Duplicator I3 V2

Installation

Arduino-IDE

Arduino IDE

First you need to get and install the development software. Don’t worry, it is like shooting fish in a barrel and yous 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 lot will need Arduino 1.viii.five or higher.

The IDE contains just the officially supported board commuter. 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 side by side stride is commuter installation. The boards all use a series protocol. Which is fine if your printer had a series 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 lath. Some board/Bone combinations don‘t need a special driver. If you are a Windows user – I didn‘t hateful 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 lot demand is to download the contents every bit a Aught file. Download the file and unpack the contents. Showtime 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 lot need to select the lath and port. You practice this in the Tools menu. Start with your lath. The port can only be selected, if your printer is online and connected.

For a first successful upload, follow the side by side steps:

  • Open the register tab named „Configuration.h“
  • Search the line „#define MOTHERBOARD“ and modify the number behind to match your lath.
  • Well-nigh the bottom you see a line „#ascertain BAUDRATE 250000“. Change the baud charge per unit to match your preferences or exit it.
  • Make sure the printer is connected and port and board type are prepare correctly.
  • Press the upload push. 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. Afterwards it stops flickering, the upload is verified and then yous come across the bulletin „Upload done“ in the IDE.

Congratulations! You lot simply compiled and uploaded your first firmware. Yous can showtime your host software and connect to the lath with the set up baud charge per unit. Don‘t try to print now. You lot haven‘t prepare upward everything needed. Simply you can already ask firmware proper noun with „M115“ or move the printer head a bit (no long altitude earlier you gear up upward the correct steps per mm for your axis).

Common errors

  • If the MOTHERBOARD setting does non match your board settings, you will get a respective 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 yous see the firmware is compiled and the led doesn‘t showtime flashing within 5 seconds, press the reset button on the board. Oft this helps.
  • Sometimes you lot volition get a fsync mistake message from the uploader. Unplug the printer and reconnect it. If it doesn‘t go abroad reboot your computer.

General configuration

In general you volition only need to update ii configuration files. The principal configuration is „Configuration.h“ which is handled in this chapter. If you have a LCD display and optionally some keys, you also demand to alter the „uiconfig.h“ file if information technology is not supported by the firmware directly, which is handled in the adjacent Chapter. The default is no LCD and no keys. If yous accept an unknown board or inverse the usage of some pins, you demand 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, yous should read this section advisedly. I will explain everything you need to know for your configuration. Experienced programmer tin 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 ane firmware that works with all variations, it needs to be very flexible and to apply information defining your special setup. To do this the preprocessor is used. It is a simple parser, that runs over the lawmaking before the real compilation starts. With the aid of the preprocessor you can enable or disable parts of the lawmaking, replace contents past values defined in the preprocessor and do some error checking.

All preprocessor commands tin exist recognized by the # char at the beginning of the command. The well-nigh important commands is #define. It defines a symbol, which is replaced by information technology‘due south content everywhere it is found afterward on in the code.

Example:

#define MY_NUMBER viii #ascertain SQUARED(a) (a)*(a) print(SQUARED(MY_NUMBER);

The in a higher place code will be converted into the post-obit:

print((viii)*(eight));

Things to notice:

  • The define name is written in capital letters. This is non needed, simply a helpful convention. Throughout the complete lawmaking, you volition recognize the preprocessor macros at the upper-case letter characters.
  • Defines tin can have parameters.
  • Defines don‘t need a replacement values – they can be empty.
  • Macros tin can be passed every bit parameter to other macros.
  • If y’all have a long macro and y’all desire to separate it over several lines, you have to terminate the line with a backslash „\“ character. No more spaces afterward that backslash are allowed.

The firmware uses two dissimilar methods to compile code on special atmospheric condition. For i method yous demand 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 encounter sometimes an commented define. If yous remove the comment marks // the define is active and information technology‘s code is used or not. Run across the post-obit instance, how this works:

#ascertain PRINTTYPE ane #define DOIT //#define DOITTOO #if PRINTTYPE==1 impress("Type is i"); #endif #if PRINTTYPE==2 print("Type is 2"); // Not called, considering PRINTTYPE is 1 #endif #ifdef DOIT impress("Doit divers"); #else print("Doit not defined"); // Not called #endif #ifndef DOITTOO print("I'm too chosen."); #endif

The EEPROM trap

I already explained how handy it is to employ the EEPROM characteristic. It is of import, that you understand how it works, and so you become what you retrieve you said. In your „Configuration.h“ you have the following line:

#define EEPROM_MODE ane

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 play tricks is quite elementary. The first byte in EEPROM is compared with the EEPROM_MODE value. If information technology has a different value, the values in your „Configuration.h“ are copied to EEPROM and byte 0 is fix to the manner. 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 practiced office. If you accept used an other software, that also writes to the EEPROM, your information gets corrupted and y’all should make certain, the values are reinitialized. From version 0.80 onwards the firmware stores a checksum, so most corruptions are detected automatically.

If yous have followed the starting time installation case, you have already written values to your EEPROM. Information technology is a adept idea to change the EEPROM_MODE to 2 at present, and so you overwrite information technology with the configuration you lot volition now ascertain.

From version 0.80 onwards yous tin overwrite the EEPROM values with the values from Configuration.h using M502.

Modifying EEPROM values

The easiest way to alter the EEPROM values information technology with Repetier-Host. Information technology has a grade for editing the stored values, so you don‘t need to bother with the correct commands.

For a manual change transport “M205” to your lath and yous will get a list with all parameters with position, blazon and value. The output will look similar this:

EPR:ii 75 76800 Baudrate EPR:ii 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 vii xl.00 Y-centrality steps per mm EPR:3 11 3333.59 Z-axis steps per mm EPR:3 fifteen 20000.00 10-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:three 35 100.00 Z-axis homing feedrate [mm/min] EPR:three 39 twenty.00 10-axis offset speed [mm/s] EPR:three 43 twenty.00 Y-axis showtime speed [mm/south] EPR:3 47 1.00 Z-axis beginning speed [mm/s] EPR:3 51 750.00 X-axis acceleration [mm/s^2] EPR:iii 55 750.00 Y-axis dispatch [mm/south^2] EPR:3 59 50.00 Z-axis acceleration [mm/s^two] 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 l.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 ten.00 Extr. start feedrate [mm/s] EPR:three 162 10000.00 Extr. dispatch [mm/southward^ii] EPR:0 166 1 Rut manager [0-1] EPR:0 167 130 PID drive max EPR:2 168 300 PID P-gain [*0.01] EPR:ii 172 2 PID I-gain [*0.01] EPR:two 176 2000 PID D-proceeds [*0.01] EPR:0 180 200 PID max value [0-255] EPR:2 181 0 Ten-offset [steps] EPR:2 185 0 Y-offset [steps] EPR:ii 189 40 Temp. stabilize time [s]

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

To change i 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>
        10<new_value>
      

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

Your initial configuration

Now y’all should get-go 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 particular. The following sections will give some useful aid and background information.

Steps per mm

Your printer uses stepper motors to motility the extruder and for the extrusion information technology self. Depending on your configuration, you demand x steps to motion or extrude 1 mm. That is the value you need to enter. With some math you lot tin become the values very easy. Practise the example computations with your hardware settings and you are done.

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

Temperature measurement

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

Then how does information technology work? For a long and good description read
nopheads splendid commodity (http://hydraraptor.blogspot.de/2007/10/measuring-temperature-easy-style.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:

5Measured
= VRef*RS / (RS+R2)

If you have no resistor Ri, RDue south
= R. If you have, and then

RSouthward
= R * R1
/ (R+R1)

After knowing how to convert a temperature into a voltage, how practise we get this into the firmware? The current Arduino generation uses AVR controller with a resolution of x bit. The voltage is converted into a number betwixt 0 for ground and 1023 for 5Ref, which is normally 5V. The new XMega AVR controller have a resolution of 12 flake, resulting in values from 0 to 4095. To be set up for the hereafter, the firmware adds 4 readings for a temperature adding, resulting in a range from 0 to 4092. From this value, the firmware must compute the temperature at the thermistor. Then far, then good. Unfortunately, the voltage-temperature-curve is nonlinear and differs for every thermistor type. Fifty-fifty
different 100K thermistors have different curves. As a solution, the firmware uses a lookup table from which it interpolates temperatures betwixt given values.

For a better understanding, lets take a expect at one of these tables:

#define USER_THERMISTORTABLE0 {\  {1*4,864*8},{21*4,300*8},{25*four,290*8},{29*four,280*eight},{33*iv,270*eight},{39*four,260*viii},{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*eight},{184*4,170*8},{221*4,160*viii},{265*four,150*8},{316*4,140*8},{375*4,130*eight},\  {441*4,120*8},{513*4,110*8},{588*4,100*eight},{734*four,80*8},{856*4,60*8},{938*4,40*8},{986*4,20*viii},{1008*4,0*8},{1018*4,-20*8} }

For those with piddling C experience: The define must be in one line, which isn’t very readable. So to break information technology into different lines, append a backslash at the end of the line, to point that the line continues in the post-obit line.

This lookup table has 28 reference values. Make sure the correct number is set in you lot configuration. For this tabular array, 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 viii every bit integer. The pairs must be ordered with increasing adc values!

Read:  High Sierra Upgrade Fails With: an Error Occurred While Verifying Firmware

What y’all see is the lookup table for an EPCOS G550 thermistor. The table consists of two columns. The commencement is the voltage reading and the second is the temperature. In the tabular array, you see that the readings are multiplied with 4 and the temperatures with eight. 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 tabular array, you have to compute 1.

Looking into the datasheet gives characteristic curve 8404 for this thermistor. A expect into the table shows temperatures and a factor RT/R25. Knowing R25
is 100K, we tin compute the resistance for every temperature. Lets wait at 100°C. We become a factor 0.063688, so R100
= 100000*0.063688 = 6368.viii. In this example I have R1 not present and R2 = 4,7K. U100 = 4093*6368.eight/(6368.viii+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 – starting time with the highest temperature. Yous can get out the first value for safety.

Controlling temperature

Knowing the temperature, nosotros 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 estrus manager to 0. The principle is very uncomplicated. If the measured temperature is below the target temperature, the heater is prepare at full power. If the temperature rises above the target temperature, the heater is turned off.

Pros: Uncomplicated Cons: Temperature oscillates around the target temperature. For the heated bed, this is no existent problem. If you are using PLA this is no large effect. 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 costless timer for PID control. PID command is only implemented for extruder. For a improve overview, lets accept a await at the parameter used:

/** \brief The maximum value, I-gain can contribute to the output.
A practiced 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°C
The 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 function
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 commencement is 30 lower then the optimal value. You demand to go out 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-proceeds. 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 exist switched on. Max = 255. Overridden if EEPROM activated. #define EXT0_PID_MAX 255

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

The get-go 1 you should await at is PID_MAX. Information technology’due south 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 information technology in this case.

At the showtime, the controller behaves similar 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 existent 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 mistake.

P = (TTarget-TCurrent)*P_GAIN

The closer the target temperature is reached, the lower the term gets. It will e’er oscillate around a value some degrees beneath the target temperature if left lonely.

I-Term

The I-Term is the about of import one. The I-Term tries to observe the perfect output for your temperature. It does this by incrementing/decrementing the output slowly. The speed is divers past the I_GAIN parameter. You can assist a lot, if you limit the range of possible values to a known range INTEGRAL_DRIVE_MIN .. INTEGRAL_DRIVE_MAX. The min value should exist at to the lowest degree 0 and the max not exceed 255. If you don’t know what works for yous, utilize these extreme values and scout the output with the command M203 S0. When you lot that the temperature stabilizes, take the mean value and add/sub 20. If you like to change temperatures, set the limits, and then all possible ranges are enclosed with a safety cistron.

If your I_GAIN is fix to a practiced value, yous will see that the oscillation gets smaller with time. Disturbances like different printing speed or blowing at the nozzle may increase the mistake once more.

D-Term

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

Finding proper PID values is hard for the unexperienced. To overcome this, the firmware has a autotune part to find good values. Disable the extruder and wait until information technology is more or less cold. So start autotune with

M303 P0 S180 This assumes you lot want to notice the PID values for your first extruder and your typical target temperature will exist 180°C. For your 2d extruder y'all 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 improver of the PID-Terms is clamped to 0..DRIVE_MAX. If yous set up this to 1, the PID Term gets clamped to 0..255 and is then scaled to 0..DRIVE_MAX.

What’s the difference? If y’all accept DRIVE_MAX=255 at that place is no divergence. If yous have found your perfect values for 12V and DRIV_MAX=255 and at present want’s to utilize 18V, you have to reduce DRIVE_MAX to DRIVE_MAX_OLD*(12^ii/xviii^ii)=113 to protected your resistor. If you want to continue your establish factors, set DRIVE_MAX to 133 and SCALE_PID_TO_MAX 1. If you get out it 0, the establish terms are to high and don’t piece of work any more than.

Jerk

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

#define MAX_JERK xx.0 #ascertain MAX_ZJERK 0.3

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

You want high wiggle values, because

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

You want low jerk values, considering

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

You see, it is residual betwixt your personal priorities. The only simple thing is z-wiggle, which has nearly no influence. It only reduces the time for z-moves, just has no consequence on quality.

Path planning

Path planning makes your printer moves more smooth. Take a expect at the above pic. It shows a impress 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 terminate 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 articulation, the maximum allowed jerk is computed and speed is reduced if needed to reduce the jerk. In most cases this is all the same much faster and then the kickoff/stop speed you would have otherwise. In circles you will about likely have no speed reduction at all. The just bad thing most path planning is, that information technology needs computation time. For each new line segment the algorithm needs to update older entries. For normal moves, this is no big bargain and is very fast. Only if you accept many very short moves, the update time becomes ascendant and the firmware has to deadening down the print. The behavior is influenced past the post-obit configuration parameter:

MOVE_CACHE_SIZE (default xvi)

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

MOVE_CACHE_LOW (default ten)

The path planner has some tricks to forestall empty buffers. One is to make a minimum move fourth dimension 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 anyhow. This is merely constructive for very curt 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 depression. The default value ways, there will be still xl segments printed per second.

Trajectory smoothing

The firmware uses the bresenham algorithm for the computations of the ten, y, z and east axis. Information technology takes the axis with the nearly 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 centrality is perfect, while the dependent axises are just updated at the detached points, non at the best fourth dimension. This gives a little jitter to the dependent centrality. To reduce this result, the firmware tin do half steps on the primary axis. The price you pay is double computation price for the stepper update computation. For safety, this behavior is merely enabled, if the shortest time between 2 full steps is larger and so MAX_HALFSTEP_INTERVAL ticks (default1999). This allows smoothing with a frequency of 8000 hertz. If yous accept 80steps/mm you tin print with upwardly to 100mm/s and all the same benefit from the smoothing issue.

Speed settings

Always wait at the unit of measurement. Feed rates are always in mm/southward!

Outset you should think about your maximum speed your printer can handle.  Virtually printer volition 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 upwards to 500mm/s.  You should test these values when y’all installed the firmware. Find the speed where no stepper stalls and reduce this by 10-20% for safety. The last affair y’all desire are lost steps during print, because your limit was likewise loftier. Your motor current has influence on your speed, too. Be aware that high currents heat up the motors and drivers which can too lead to lost steps!

#ascertain MAX_FEEDRATE_X 200 #define MAX_FEEDRATE_Y 200 #define MAX_FEEDRATE_Z twoscore
        Adjacent comes the homing feed rate. This should exist much lower so your maximum. The printer needs to stop immediately, when the end terminate is triggered. So take values, which allow a stop without deceleration.
      

#ascertain HOMING_FEEDRATE_X 40
#define HOMING_FEEDRATE_Y 40
#define HOMING_FEEDRATE_Z ii

        Now we come to the acceleration. The firmware distinguishes between travel and press moves. Travel moves have no influence on print quality, then you lot can employ college values here. For x- and y-axis 500 mm/due south
        two
        
          is slow, 1000mm/southward
        two
        
        a moderate value for smooth prints and 3000 mm/s
        2
        
        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
#ascertain 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 piece of work perfectly with the Allegro stepper driver chips used on most RepRaps. So only change them if y’all think yous take a dissimilar driver which needs slower timings.

The step signal is unremarkably kept high for around 2µs, depending on the situation a scrap longer. Y’all tin increase this time with

#ascertain STEPPER_HIGH_DELAY 0

The unit is µs.

Read:  Kenapa Di Cas Malah Berkurang

At present we come up to the tricky part allowing loftier footstep rates of 40000 hertz with this niggling AVR microcontroller. The existent 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 stride signals in one ciphering. The frequency, where this starts is

#define STEP_DOUBLER_FREQUENCY 10000

If the frequency is higher, so this value the firmware volition double the steps for frequencies of 10000-20000 Hz and quadruple steps above 20000 Hz. If your printer is no real CNC, it volition take no issues with this. Call up of it as reducing 1/16th micro stepping to 1/8th or ane/quaternary micro stepping.

If double/quadruple stepping is agile, the consecutive steps are delayed past

#ascertain DOUBLE_STEP_DELAY 1 // fourth dimension in us

Extruder configuration

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

#ascertain NUM_EXTRUDER 1

Most of you will merely take and use ane 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 ane, try it and I will help you with possible problems.

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

#ascertain EXT0_X_OFFSET 0 #define EXT0_Y_OFFSET 0

Printing commands are based on ane position for all tools. Switching the extruder needs to move the head, so the second extruder is exactly at the position of the start extruder. These coordinates are the deviation to the position of the get-go 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 lot 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 Pivot simply it IS Not A Pin NUMBER. It is the position in an assortment 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 footstep farther.

#define EXT0_DIR_PIN E_DIR_PIN

Which pivot determines the turning direction of the extruder.

#define EXT0_INVERSE imitation

If your extruder turns in the incorrect management, modify the value into truthful.

#define EXT0_ENABLE_PIN E_ENABLE_PIN

Pin to activate/deactivate your extruder stepper motor.

// For Inverting Stepper Enable Pins (Active Low) use 0, Not Inverting (Active Loftier) use one #ascertain EXT0_ENABLE_ON faux

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

#ascertain EXT0_MAX_FEEDRATE 1500

Maximum feed rate of your extruder in mm/min.

#define EXT0_MAX_START_FEEDRATE 18

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

#define EXT0_MAX_ACCELERATION 6000

Acceleration of your extruder in mm/due south2.

#define EXT0_HEAT_MANAGER 1

Type of heat manager for this extruder.

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

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

#define EXT0_PID_INTEGRAL_DRIVE_MAX 130

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

A good value is slightly higher and so 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 tin vary. If your printer tin not hold the target temperature or does not reach it, increment this value!

#ascertain EXT0_PID_INTEGRAL_DRIVE_MIN fifty

Lower value for integral office. 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 lot need to get out room for cooling.

#define EXT0_PID_PGAIN   500

P-gain in 0.01 units.

#define EXT0_PID_IGAIN   ane

I-proceeds in 0.001 units.

#define EXT0_PID_DGAIN 3000

D-proceeds in 0.01 units.

#define EXT0_PID_MAX 255

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

#define EXT0_ADVANCE_K 0.0f #define EXT0_ADVANCE_L 0.0f

Values to influence the advance algorithm. Check the accelerate algorithm affiliate 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 low-cal bulwark or hal sensor are meliorate. One on/off cycle should e’er need nearly the aforementioned corporeality of extruder steps (JAM_STEPS).
Between changes the sensor might flip dorsum to old signal, so nosotros require JAM_MIN_STEPS since the last change before nosotros assume the betoken every bit
inverse once more 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 nosotros take just a mild increment (> JAM_SLOWDOWN_STEPS)
extrusion gets heavier due to fractional bottleneck or reduced grip. In that instance we reduce speed by setting speed multiplier to JAM_SLOWDOWN_TO.

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

Action 0 does simply impress a alarm on the LCD and lets the printer beep. Action i is my preferred solution, but requires a LCD screen. Information technology will block
any host advice preventing further print, moves extruder to filament change position and disables temperature and all motors, which would home
after filament change. And so it waits for the user to react. First click on LCD will reheat extruders. Then you have to await until all extruders are dorsum on
temperature. After that you lot tin move extruder with your click encoder to remove filament, examination if extrusion works, etc. During this flow jam detection is disabled! Action two will request a suspension from the host or pause a sd print.

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

M513 resets the jam signal, and so the printer stops complaining near jam and besides disables the beeper.
M601 S1 pauses extruder temperatures while M601 S0 restores the temperatures before the intermission.
M602 South<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 information technology volition write the indicate switch steps and percent values into the host log. That way you lot can calibrate your 100% value.
This is also useful to observe out at which extrusion speed the forces get also 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 y’all want a stand lone 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 lot tin can add keys. The minimum required is three signals. Yous can use a rotary encoder with push function or three evidently push buttons. The addition of a complete key matrix up to 4×4 buttons is also possible. For acoustic feedback, a piezo buzzer can exist added.

The electric current implementation supports directly connection to IO pins of your Arduino or an indirect connection over I2C to a PCF8574 flake, where the display and keys/buzzer are connected. Yous need one fleck for the display and one for the keys and buzzer. If you have the pins, use direct connection. It is much faster and less fault prone. A rotary encoder over I2C works merely with wearisome turns!

Hardware connection

Display

The current firmware supports LCD brandish usinga HD44780 or compatible driver. This is a industrial standard that is found in nearly all blastoff-numeric LCD displays. If yous buy one, be careful virtually the voltage requirements. Some LCDs demand negative voltage for dissimilarity. If y’all don’t know how to go negative voltages avoid them. There are plenty of displays using just positive voltages. It’southward best to put a 10k poti betwixt 0 and 5V and connect the heart pivot 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 exist 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 bespeak pins of your PCF8574 bit, if you are connecting the display over I2C. Then you are done! Make sure you know which pin is connected to which function for after configuration.

Keys

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

You tin 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 one-4 pins for the receiving columns. The voltage on the rows gets changed between 0 and 5V to detect the active key. If yous press 2 keys in the same column at the same time, a short volition happen. To protect your cpu, you should add 1K resistors to each line.

Piezo Buzzer

If you want acoustic feedback, y’all can add a piezo cablegram. 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 fashion: 5V – buzzer – PCF8574 pin. Piezo elements have a plus and a minus contact, don’t run them the wrong way effectually!

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 y’all can define some output you can include place holder for special values similar current temperature or z-position. It doesn’t really affair for which role the output was meant, you can testify the temperature in the x-position menu if yous similar. These placeholder ever consist of 3 chars, commencement with a %. The following two letter determine the data shown.

List of placeholder

  • %ec : Electric current extruder temperature
  • %eb : Current heated bed temperature
  • %e0..nine : 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
  • %bone : Status message
  • %oe : Error message
  • %oB : Buffer length
  • %oc : Connectedness baudrate
  • %o0..9 : Output level extruder 0..ix 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 : Land of x min endstop.
  • %sX : State of x max endstop.
  • %sy : State of y min endstop.
  • %sY : Country of y max endstop.
  • %sz : State of z min endstop.
  • %sZ : State of z max endstop.
  • %do : Debug echo country.
  • %di : Debug info country.
  • %de : Debug error state.
  • %dd : Debug dry out run land.
  • %O0 : OPS mode = 0
  • %O1 : OPS mode = 1
  • %O2 : OPS manner = 2
  • %Or : OPS retract distance
  • %Ob : OPS backslash altitude
  • %Od : OPS min distance
  • %Oa : OPS move subsequently
  • %ax : X acceleration during print moves
  • %ay : Y acceleration during impress moves
  • %az : Z acceleration during impress moves
  • %aX : Ten acceleration during travel moves
  • %aY : Y dispatch during travel moves
  • %aZ : Z dispatch during travel moves
  • %aj : Max. jerk
  • %aJ : Max. Z-jerk
  • %fx : Max. feedrate x management
  • %fy : Max. feedrate y direction
  • %fz : Max. feedrate z management
  • %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 proceeds
  • %Xp : PID P gain
  • %Xd : PID D proceeds
  • %Xm : PID drive min
  • %XM : PID drive max
  • %XD : PID max
  • %Xw : Extruder watch period in seconds
  • %Xh : Extruder oestrus managing director (BangBang/PID)
  • %Xa : Advance K value
  • %20 : x beginning in steps
  • %Xy : y offset in steps
  • %Xf : Extruder max. start feedrate
  • %XF : Extruder max. feedrate
  • %XA : Extruder max. acceleration
Read:  How to Access Psn Store N Firmware 3.63

Notice: Some values are only available, if the matching functions are included. Due east.g. the PID values are only possible if you compiled with PID support.

The second key concept are deportment. An activeness is defined by what happens if it is executed. 1 possible action is home x, so if it is executed, your extruder will move to x home position. It doesn’t affair what triggered that action. You can assign this to a primal or it can exist 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 : Motion Ten axis 1 mm left
  • UI_ACTION_Y_UP : Move Y axis 1 mm to front
  • UI_ACTION_Y_DOWN  : Move Y axis 1 mm dorsum
  • UI_ACTION_Z_UP : Movement Z axis i mm up
  • UI_ACTION_Z_DOWN : Motion Z axis 1 mm down
  • UI_ACTION_EXTRUDER_UP : Extrude filament i mm
  • UI_ACTION_EXTRUDER_DOWN : Retract filament 1 mm
  • UI_ACTION_EXTRUDER_TEMP_UP : Increase extruder temperature 1 degree
  • UI_ACTION_EXTRUDER_TEMP_DOWN : Subtract extruder temperature 1 degree
  • UI_ACTION_HEATED_BED_UP : Increment bed temperature one degree
  • UI_ACTION_HEATED_BED_DOWN : Decrease bed temperature 1 caste
  • UI_ACTION_FAN_UP  : Increase fan speed 12.v%
  • UI_ACTION_FAN_DOWN  : Slow fan 12.v% down
  • UI_ACTION_DUMMY : Do cypher
  • UI_ACTION_BACK : Become one menu level higher
  • UI_ACTION_OK : Select entry or finish setting value
  • UI_ACTION_MENU_UP : Get 1 menu level higher
  • UI_ACTION_TOP_MENU : Go to the information carte
  • UI_ACTION_EMERGENCY_STOP : Stop printer, run endless loop
  • UI_ACTION_XPOSITION : Alter 10 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 : Modify heated bed temperature
  • UI_ACTION_EXTRUDER_TEMP : Alter extruder temperature
  • UI_ACTION_SD_DELETE : Delete file on sd card
  • UI_ACTION_SD_PRINT : Print file on sd carte
  • UI_ACTION_SD_PAUSE : Break/finish sd impress
  • UI_ACTION_SD_CONTINUE : Continue sd print
  • UI_ACTION_SD_UNMOUNT : Unount sd bill of fare
  • UI_ACTION_SD_MOUNT : Mount sd card
  • UI_ACTION_XPOSITION_FAST : Change x position with 1mm steps
  • UI_ACTION_YPOSITION_FAST : Alter 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 : Domicile 10 axis
  • UI_ACTION_HOME_Y : Home y axis
  • UI_ACTION_HOME_Z : Home z centrality
  • UI_ACTION_SELECT_EXTRUDER1 : Make extruder one current extruder
  • UI_ACTION_OPS_RETRACTDISTANCE : Change OPS retractions distance
  • UI_ACTION_OPS_BACKSLASH : Alter OPS backslash
  • UI_ACTION_OPS_MOVE_AFTER : Change OPS motion 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 impress
  • UI_ACTION_PRINT_ACCEL_Y : Change y acceleration during print
  • UI_ACTION_PRINT_ACCEL_Z : Change z dispatch during print
  • UI_ACTION_MOVE_ACCEL_X : Change x acceleration during moves
  • UI_ACTION_MOVE_ACCEL_Y : Modify y acceleration during moves
  • UI_ACTION_MOVE_ACCEL_Z : Alter 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 just afterwards 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 : Modify steps per mm in ten direcion
  • UI_ACTION_STEPS_Y : Alter steps per mm in y direcion
  • UI_ACTION_STEPS_Z : Modify steps per mm in z direcion
  • UI_ACTION_FAN_OFF : Plow fan off
  • UI_ACTION_FAN_25 : Gear up 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 : Alter 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 : Modify 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 electric current extruder
  • UI_ACTION_X_OFFSET : Alter x offset of current extruder
  • UI_ACTION_Y_OFFSET : Change y offset of current etxruder
  • UI_ACTION_EXTR_STEPS : Alter steps per mm of current extruder
  • UI_ACTION_EXTR_ACCELERATION : Modify 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 : Modify extruder pid max value
  • UI_ACTION_ADVANCE_K : Change accelerate K value
  • UI_ACTION_SET_ORIGIN : Set x,y and z origin to current position
  • UI_ACTION_DEBUG_ECHO : Enable/disable repeat of received messages
  • UI_ACTION_DEBUG_INFO : Enable/disable info letters
  • UI_ACTION_DEBUG_ERROR : Enable/disable error reports
  • UI_ACTION_DEBUG_DRYRUN : Enable/disable dry run mode
  • UI_ACTION_PREHEAT : Pre estrus extruder and heated bed
  • UI_ACTION_COOLDOWN : Disable extruder heater and heated bed
  • UI_ACTION_HEATED_BED_OFF : Plough heated bed off
  • UI_ACTION_EXTRUDER0_OFF : Plow extruder 0 off
  • UI_ACTION_EXTRUDER1_OFF : Turn extruder one off
  • UI_ACTION_HEATED_BED_TEMP : Set up heated bed temperature
  • UI_ACTION_EXTRUDER0_TEMP : Fix extruder 0 temperature
  • UI_ACTION_EXTRUDER1_TEMP : Set extruder 1 temperature
  • UI_ACTION_OPS_OFF : Plow OPS off
  • UI_ACTION_OPS_CLASSIC : Switch OPS to archetype 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 style
  • UI_ACTION_SELECT_EXTRUDER0 : Make extruder 0 electric current extruder
  • UI_ACTION_MENU_XPOS : Evidence x position carte du jour
  • UI_ACTION_MENU_YPOS : Show y position bill of fare
  • UI_ACTION_MENU_ZPOS : Show z position menu
  • UI_ACTION_MENU_XPOSFAST : Show x fast position menu
  • UI_ACTION_MENU_YPOSFAST : Prove y fast position menu
  • UI_ACTION_MENU_ZPOSFAST : Show z fast position menu
  • UI_ACTION_MENU_SDCARD : Show sd carte menu
  • UI_ACTION_MENU_QUICKSETTINGS : Show quick settings carte
  • UI_ACTION_MENU_EXTRUDER : Show extruder menu
  • UI_ACTION_MENU_POSITIONS : Testify positions menu

Display

First you lot need to ascertain, how your LCD is connected:

#define UI_DISPLAY_TYPE i

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

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

#ascertain UI_VERSION_STRING2 "Orig. Mendel"

Now ascertain the number of columns (16, 20 or 24) and number of rows (2 or four)

#define UI_COLS xvi   #ascertain UI_ROWS 4

Now comes the hard function. You need to identify the pins used to control the display and set them appropriately. The first definition block is for a display connected over I2C. Here yous need to fix the mask value, not the pivot number. That’s why y’all run into _BV(3) for pin 3 (if yous start counting at 0). In improver you demand to gear up the PCF8574 address.

If you utilize a direct connection you could set the RW pivot to -1. If you do this, the firmware will wait UI_DELAYPERCHAR microseconds after each byte send. The faster method is to take a RW pin, and so the firmware tin inquire the display if it is ready for the side by side command.

#if UI_DISPLAY_TYPE==three // I2C Pin configuration #define UI_DISPLAY_RS_PIN _BV(4) #ascertain UI_DISPLAY_RW_PIN _BV(v) #define UI_DISPLAY_ENABLE_PIN _BV(6) #define UI_DISPLAY_D0_PIN _BV(0) #ascertain 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(ane) #define UI_DISPLAY_D6_PIN _BV(two) #define UI_DISPLAY_D7_PIN _BV(3) // 0x40 till 0x4e for PCF8574 #ascertain UI_DISPLAY_I2C_ADDRESS 0x4e #else // Direct brandish connections #ascertain UI_DISPLAY_RS_PIN 16 #define UI_DISPLAY_RW_PIN 17 #define UI_DISPLAY_ENABLE_PIN 31 #ascertain UI_DISPLAY_D0_PIN 23 #define UI_DISPLAY_D1_PIN 29 #ascertain UI_DISPLAY_D2_PIN 25 #define UI_DISPLAY_D3_PIN 27 #define UI_DISPLAY_D4_PIN 23 #define UI_DISPLAY_D5_PIN 29 #ascertain UI_DISPLAY_D6_PIN 25 #ascertain 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 cost you lot 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. Y’all have to put the code into the matching iv functions used by the firmware. All functions are already defined in the keys department of uiconfig.h with some commented samples. But earlier we start with the function, you lot should define some key related definitions.

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

/** Are some keys continued? 0 = No keys attached - disables likewise menu 1 = Some keys fastened */ #ascertain UI_HAS_KEYS 0

If you set it to 0 yous can skip the balance of this department.

Well-nigh keys bounciness the signal when closed/opened. Later a short fourth dimension the signal stabilizes. There is no need to add together debounce electronics, all needed is to tell the firmware how long your keys bounce. After that, you tin define key repetition behaviour. The default values should requite a skilful starting point.

/** \brief bounce fourth dimension of keys in milliseconds */ #define UI_KEY_BOUNCETIME 10 /** \cursory Outset fourth dimension in ms until repeat of action. */ #define UI_KEY_FIRST_REPEAT 500 /** \brief Reduction of repeat fourth dimension until next execution. */ #define UI_KEY_REDUCE_REPEAT fifty /** \cursory Lowest repeat fourth dimension. */ #ascertain UI_KEY_MIN_REPEAT 100

Next you define, if you volition set the action of one of the keys to UI_ACTION_BACK. If you do, ready the value to 0, so the back menü function at the top is removed. This fashion you can navigate faster through the menus. If you desire the dorsum menu entry, set information technology to 0 even if you lot have a back fundamental.

#define UI_HAS_BACK_KEY i

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

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

// Under which address can the central condition requested. This is the accost of your PCF8574 where the keys are connected-

#define UI_I2C_KEY_ADDRESS 0x40

Ok, at present the hard function. We showtime with the keyboard initialization. This functions is called only once, before the key polling starts. Hither nosotros define the pins as input and enable the pull upwards resistor if required. I2C keys need no lawmaking here. Possible macros are listed in the uiconfig file with their clarification.

void ui_init_keys() { //  UI_KEYS_INIT_CLICKENCODER_LOW(47,45); // click encoder on pins 47 and 45. Phase is continued 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 however. They are only acquired from different points and with different frequencies. The first office is ui_check_keys. This is called from an interrupt and should finish equally fast as possible. The merely thing yous should add hither is a directly connected encoder. All I2C key methods are strictly forbidden. They take to much time to be run inside the interrupt. You tin can add 1-2 directly continued push buttons here if you want.

The second function is ui_check_slow_encoder, which is intended for rotary encodes continued over I2C. This is the only fundamental macro you should add there. As you see, there is already one included, but you may need to alter the blazon or pins or disable it, if you employ I2C keys without encoder.

The last role is ui_check_slow_keys. Hither you add the aforementioned fundamental macro as in ui_check_slow_encoder, if yous have anything there plus all keys not divers until now. This function is called from the principal thread and can exist interrupted whatsoever time, then no big things happen if it takes some ticks longer.

void ui_check_keys(int &activeness) { //  UI_KEYS_CLICKENCODER_LOW_REV(47,45); // click encoder on pins 47 and 45. Stage 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 electric current fundamental 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 primal mask     i2c_stop();     // Add I2C fundamental 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(one),UI_ACTION_OK); // push button, connects gnd to pivot       UI_KEYS_I2C_BUTTON_LOW(_BV(3),UI_ACTION_BACK); // button, connects gnd to pivot       UI_KEYS_I2C_BUTTON_LOW(_BV(4),UI_ACTION_MENU_QUICKSETTINGS); // push button button, connects gnd to pin       UI_KEYS_I2C_BUTTON_LOW(_BV(v),UI_ACTION_MENU_EXTRUDER); // push, connects gnd to pin       UI_KEYS_I2C_BUTTON_LOW(_BV(6),UI_ACTION_MENU_POSITIONS); // button, connects gnd to pin   #endif   // UI_KEYS_MATRIX(32,47,45,43,41,39,37,35); }

Buzzer

You notice the buzzer configuration near the start of the file. The comments should exist plenty, to understand the configuration.

/** Select type of beeper 0 = none 1 = Piezo connected to pin two = Piezo connected to a pin over I2C */ #ascertain BEEPER_TYPE 0  #if BEEPER_TYPE==1 #define BEEPER_PIN 42 #endif #if BEEPER_TYPE==two #define BEEPER_ADDRESS 0x40 // I2C address of the fleck with the beeper pin #ascertain BEEPER_PIN _BV(seven)  // Scrap value for pin viii #define COMPILE_I2C_DRIVER  // We need the I2C driver as we are using i2c #endif  /** Beeper audio definitions for short beeps during fundamental actions and longer beeps for important actions. Parameter is is filibuster in microseconds and the secons is the number of repetitions. Values must be in range i..255 */ #define BEEPER_SHORT_SEQUENCE 1,1 #define BEEPER_LONG_SEQUENCE v,5

Menu definition

At the start of the file you can select the language for your carte du jour. #ascertain UI_LANGUAGE 0

0 is english, 1 is german language and ii is dutch. With some luck nice users of the firmware volition contribute additional languages. To define your own linguistic communication become into uilang.h At the cease yous will observe this, where you can write your own translations:

// ************************************************************************************* //                             User divers language // // If y'all need a language non mentioned above, you tin translate this dummy entry. // If you want information technology added permanently to the distribution, spend it to the community nether // GPL V3. Merely new and complete translations are put into the official distribution! // *************************************************************************************  #if UI_LANGUAGE==thousand

To use it, select 1000 equally language.

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

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

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

Continue with “First Tests”

How to Set Up Repetier Firmware for Wanhao Duplicator I3 V2

You May Also Like