Sunday, March 2, 2014

New printer, do as I say, not as I do.

New printer

I just finished building a new mini Kossel. This one I designed using my visual calculator Excel spreadsheet and decided to use 10" or 254mm horizontal pieces instead of 240mm. This was because I wanted a slightly larger build area of 125mm square. I also wanted to use printed sliders instead of rail guides. If you follow my Youtube channel you'll know that I was experimenting with these. Well here is the proof that they work for a printer too. Here is the Thingiverse thing for the sliders.

The endstops are not mounted on a plastic piece. I found some #4 screws and matching nuts in my bin. The 2mm nut has enough width to span the extrusion, so the endstops are mounted directly to the extrusion. The wires are routed down the inner "track" of the extrusion which is the only side of the slider that I left open. The other three sides have a "rail" that rides in the "tracks".
Otherwise, the printer uses all of the same parts as my other mini. Well, that's not true. I bought the screw kit from tridprinting.com for my first mini. Since then, I've been buying extra screws via Amazon from Small Parts. I have purchased 6mm, 8mm, 10mm, 12mm, 16mm, and 20mm stainless M3 screws in boxes of 100 (anywhere from $3.50 to $6.75). Since I had so many 20mm, I decided to use those wherever I could in place of the 35mm ones. I still needed 3 35mm screws for the top bearings, and fortunately I had 3. I did have to redesign the effector to make the net traps deeper to use the 20mm there, but the carriages worked as is.  I'm also using the 40mm silent fan I like so much like my other printer.

I don't have an extruder for it just yet, so I'm using the one from my Prusa. I'm running a 3mm setup for this printer. So far, it oozes a bit more at idle, but the print quality is excellent, and no strings anywhere.

The short of it

I have spent the last two days finishing my new mini Kossel and running through the First Calibration and testing. I wanted to video the process so others could see what I was doing. I did video the process, but man did I screw it up royally on my configuration settings. Keep reading to find out how it unfolded.

The long of it

I started out using the calculated values from my mini Kossel calculator/visual calculator. My delta diagonal rods were built using a jig and set to be 220mm pivot to pivot. The calculator gave me 112.6mm for the Horizontal radius (Delta radius for Marlin), and I see all 3 tower offsets to 0. I went through 3 rounds and finally got the 3 positions in front of the towers to Z=0 and the center. However, when I tried the other 3 positions they were off (one was low, another high). I scratched my head, and proceeded. WHAT? Yep without having a valid explanation I plowed on.

I started with a simple calibration object, 20mm ID, 22mm OD, 1mm solid, and 1mm hollow for a total hight of 2mm. The measurements were too big, 22.75 ID, 24.8 OD, and 2.54 tall. The voice in my head was screaming TOO BIG, THE DIAGONAL IS 220, IT CAN'T BE ANYTHING ELSE ... but I ignored it, and proceeded to modify both the diagonal rod length, and the horizontal length. INSANE! Yes I know. After another 6 rounds of calibration (no I didn't film these), I got all 4 spots dialed in. The other 3 were still off, but I plowed ahead. This time the print was closer in X and Y, but the Z was still 2.54mm. The only thing that controls Z is the steps per mm. It's set to 200. 1/32nd stepping, 200 steps per, GT2 belts and 16....OH @#$%$#$ ... NOT 16 TOOTH PULLEYS, 20 TOOTH. So not 200, 160.

Oh yeah, I had copied my other mini Kossel Repetier firmware over and neglected to change the settings. Not only that, but I never bothered to check/confirm my print surface radius, or look to see if 10mm was moving 10mm with my steel rule. UNBELIEVABLE ... or not. I was in such a rush to get to the good stuff, that I neglected my own advice.

Back to Square 1

I reset everything, diagonal rod to 220, horizontal radius to 112.6, and all 3 tower offsets to 0. I then measures the Z max with my steel rule and could estimate 242mm build height. After several rounds I ended up with a horizontal radius of 113.5 and a Z_Max of 245mm. And all 7 spots on the build surface wer dead on. So I fired up the hotend and printed another test square. This one was accurate, so I decided to print a mini Kossel top vertex as a real test. It came out dimensionally accurate (15mm tall, the holes were 3mm, etc...) but the infill was too low. Yep I admit it, I had not calibrated my extruder :/

After finishing the extruder calibration, this is what the print came out like.

The one on the left is showing that the 1515 extrusion fits like a glove (15.01mm) as well as the top infill. The second is showing the bottom and how perfect the 3mm nut is captured. I would say this calibration is 100% and I can start printing new sets to distribute.


Wednesday, February 26, 2014

First tests and Calibration - Repetier Firmware

I originally wrote this post, and geared it toward the firmware I was using at the time, Marlin. I then tried to edit the post and added Repetier firmware (FW will be use for firmware for the rest of the post) notes. User feedback says it would be better to have one for Marlin, and one for Repetier FW.

Update: I have uploaded a YouTube video of the testing process http://www.youtube.com/watch?v=BX8UoTgS50M

First tests and calibration

  1. Power connected and turned on (cooling fan for stepper drivers going), and USB cable connected
  2. Arduino software - you need this to compile and upload your firmware. Go back The Basics and read/re-read what I already typed out Arduino installation, no point in copy and paste.
  3. Host software - you'll need Repetier, Pronterface, or Cura software next. I use Repetier host
Repetier-Host Printer Shape
Open your host software and configure your port. Arduino creates a com (communications) port and that's what you'll want to use. You can leave the port and the baud at auto and let the software auto-detect these. Now we need to configure the printer setting in the host software. This should match your firmware. Repetier-host lets you specify your printer is a Delta and will change the display to show a cylindrical print volume with the origin point at (0,0,0), other hosts may or may not doe this. Follow the configuration guide and use -85 and 85 (or whatever the radius of your print surface is) for the X and Y minimums and the same MANUAL_Z_HOME_POS value you used in firmware.

In addition, you need to tell Repetier-host to home to X=0, Y=0, and Z=MAX (click the Printer Shape photo to zoom in).


Click the Connect button and it should turn green. Click the Manual control tab and if you don't see the Log window click the Toggle Log button. there should be a simple message about the version of Repetier FW in the log.

Log output in Repetier-host at start

Check end stops
Before you click home(the 12V power should be off or you can click the "Turn Motors Off button or send M84 gcode commandmanually move your effector down until all three max end stops are not touching. Now lets check a few things otherwise you may get an unpleasant surprise. In the G-Code: text box type M119 and click Send (or press enter).
You should see something like: (L = logic low = connected to ground)
  18:34:03.532 : N63 M119 *63
  18:34:03.551 : x_max:L y_max:L z_max:L

If not, then something is miswired or misconfigured. Confirm that you connected to NC (normally closed) and C (common) on the switch, and you connected the two wires to the X+Y+, and Z+ pins on the RAMPS, and those two wires connect to the S (signal) and - (ground) pins, not the (5V). Another reason would be you did not update and upload the configuration.h changes I discussed in The Basics.  NoteIf you connected to the normally open NO instead, then you will need to invert the logic in the configuration.h (#define ENDSTOP_X_MAX_INVERTING true // instead of false)

Now one at a time push and hold an end stop switch and rerun the M119 command (hint, you can press the up arrow key on your keyboard to cycle through the history of G-Code commands you have issued via the G-Code entry field). You should see L changed to for the matching endstop. If not, then there is a wiring issue (make sure you plug max X(alpha) endstop into X+ not Y+ or Z+ :) Do not continue until you get this right. Test all 3 endstops.
Note: If you have a probe (and I don't think you need one) then make sure it shows when retracted and when deployed.

Check motor direction (Note: deltas use a blend of all 3 motors to move the effector)
If everything checks out so far, then we need to confirm the motors are moving in the right direction. Again, disable the motors and manually move the effector down so it's around 100mm away from your surface. On the Manual Control tab, use the X and Y arrows to manually move the end effector. The arrows are divided into segments. The segment closest to the center will move the effector in that direction 0.1mm. The next segment 1mm, then 10mm then 50mm. Z only has the 0.1mm, 1, and 10 segments. Mac users, the author decided to give you a row of buttons from -100 to 100 for each axis. Remember we home to the Max and so all movements toward the bed are negative.
Notice the Mac manual controls are not a
graphic like Windows.

Let's start with Y. Click the 1mm in the Y+ direction, the effector should move to the rear toward the Z(gamma) tower. If not, take notice of which way each carriage moved, X(alpha) should have moved down, Y(beta) moved down, and the Z(gamma) carriage up. If any of these moved opposite, STOP (never unplug a stepper motor while it's powered, you will destroy the stepper driver)unplug 
 the 12V power, and flip the stepper connector on the ramps for that motor. Then you can reapply the 12V power. Repeat until they move as they should. Now same for X, click the 1mm in the +X direction and make sure the effector travels to the right. If that looks good then Try the Z+ 1 mm and all 3 should move up. If all these work, then it's time to home.


Home (Note: make sure in your EEPROM setting you set the Homing feedrate [mm/s] to something reasonable like 90 to start)
Keep one hand on the power cord (emergency disconnect), the reset on the RAMPS, or better yet the power switch if you wired on in, for the first time and go ahead and remove your build plate or put something to protect it ;) Ok, now click any of the home buttons, there are 4, (keep in mind host software was designed for Cartesians. For delta all axis will home at the same time). All carriages should move up at the same speed (the homing speed) until they hit their end stops. Then the X(alpha), followed by Y(beta) and finally Z(gamma) will home and back off the switch. Congratulations! If not, then you skipped a step and hopefully nothing was damaged. Go back to the basics or wiring and confirm you got it right.

Calibration (Note: This link to Calibrating a 3D Printer is the de facto set of instructions for this, i only disagree with where he says you need to disable EEPROM.)
Now comes the arduous task of calibrating your actual MANUAL_Z_HOME_POS as well as your Tower X/Y/Z endstop offset. Before we begin, I think it's worth understanding what we are trying to do and what endstop offsets do for us.

In order to print thin layers and have successful first layer adhesion we need to make sure the effector (and the hotend it carries) moves parallel to our build surface and is calibrated such that Z=0 means the tip of our hotend is touching the build surface at any point. We also need to make sure our build surface is "flat" from one point on its surface to any other point. I put flat in quotes because depending on your layer thickness, 0.1mm maybe flat enough. The design of the delta with the 3 sets of parallel arms is such that it should constrain the movement effector to remain flat and not tilt or rotate around the X or Y axis. If you notice any tilting in your effector (or nozzle tip) then your arms are not parallel, not fixed to the pivot points (magnets?), or not the same length and this is a physical issue, not software.

The firmware has to convert a set of coordinates into the number of steps for each axis motor. This is some Pythagorean math (A^2 + B^2 = C^2) and is calculated for each tower, for each move, and moves are subdivied by segments per line so there is a lot of computations. In order to move where we want, the machine needs to have a reference point to start from. We call it Home, and on most deltas it's chosen to be at the maximum (max) or top of the machine. The trick is, how to you ensure that each axis endstop is in the exact same location, such that when you are homed ( X0 Y0 ZMAX_Z), the effector is in the center of the machine, and when you are at X0 Y0, Z0 the effector is still in the center and each axis has moved Z_MAX in distance and the tip of your hotend is just touching the build surface? On some designs the endstop is fixed (3DR, Lisa) and thus is guaranteed to be at the same height. Other designs have a mechanical adjustment to allow one to tweak the end stops.


The mini Kossel does not have physical adjusters and they are implemented in the firmware. In Repetier FW, you use the Tower X/Y/Z endstop offset variables to specify the number of steps to move away from the endstop after homing. The Tower X/Y/Z endstop offsets are positive integers since the logic already knows you are moving away from the endstop toward the build surface.

You should test your MAX_Z before you send a command to go to Z0. I would advise you sneak up on the distance to the build surface as you move the nozzle down to Z0. If you reach the surface before Z = 0.0 then you need to subtract the value Z displays from your MANUAL_Z_HOME_POS, just change the value in the EEPROM configuration window. The Max Z height will change in the next steps so don't worry about getting it perfect, we are just trying to get close on the first round.

Step 1, we need to make sure that each axis carriage is at the same height after homing. To do this, we need to home the machine (send a G28 G-Code command or click any home button). Then send a G-code command to get the nozzle at a point on the surface directly in front of each axis (X, Y, Z in that order). The nozzle should be touching such that if pinches a piece of paper, but that paper can be pulled out from between the nozzle and surface without tearing. So let's look at the three outcomes for each trial. Here are our starting conditions (my comments in red)
  • steps per mm are 80
  • Tower X/Y/Z endstop offset are all 0    (start with no endstop offsets)
  • MANUAL_Z_HOME_POS 225.0 (determined from step 1)
  • Build radius = X_MAX = Y_MAX = 85 (for a build diameter of 170mm)
  • Horizontal radius = 105 (use visual calculator to get this)
    • Or use the rough assumption that the diagonal rod will be at 60 degrees when homed and so the formula cos(60) = Horizontal radius/Diagonal rod -> Diagonal rod/2
  • The coordinates for the point in front of the X/Alpha tower are 
    • X=(Build radius)COS(210) Y=(Build radius)SIN(210) Z0
    • X=-73 Y =-45
  • G1 X-73 Y-42 Z5 F6000  (start at 5mm above the surface and step down to Z0 in 1mm then 0.1mm increments and move there at 100mm/s)
  • Pay attention to the axis readouts on the Manual Control tab, especially the Z value 
Here are the potential outcomes as we step to Z=0:
  1. The nozzle pinches the paper and it can just be pulled out when Z=0. This is the ideal state and means you can move to the next axis (Y/Beta). If you get this on the first try you got lucky :)
  2. The nozzle is above the surface (let's say by 2mm) when Z=0. This means we need to increase the offset for this axis by at least 2mm and I usually go 1mm more (Hint: Richard Turnrock has suggested to use a pad of Post-it notes as a variable feeler gauge. ) so I can get a more accurate sub-millimeter value. We need to multiply the distance by the steps per mm (3 * 80 = 240) and set the Tower X offset [steps] to 240. Send a G28 (home), then send G1 X-73 Y-42 Z2 F6000 which should put you roughly 1mm above the surface. Use the Z -0.1 button to step down while testing with a sheet of paper as your feeler gauge. If you reach a point where there is sufficient drag of the nozzle on the paper and Z value showssomething other than 0, then subtract that amount from the X offset value in EEPROM. Let's say Z = 0.4, then subtract 0.4*80 = 32 from 240 and update to 208 in the EEPROM configuration. Once again send G28, then G1 X-73 Y-42 Z0 F6000 and confirm the paper test works.
  3. The nozzle reaches the surface before Z=0. In this case, you will need to physically move the plastic piece that holds the end stop up. or you can reduce your MANUAL_Z_HOME_POS then re-home (G28) and retest. 
Once you finish X/Alpha, then move on to Y/Beta. Once you finish Y/Beta, Check X/Alpha and adjust if needed. If you adjust X/Alpha, then recheck Y/Beta. If X/Alpha and Y/Beta are good, go on to Z/Gamma. And you guessed it, once you finish Z/Gamma, check and adjust the other two as needed.

Step 2, ok now all 3 carriages are at the same height and pass the paper test. Now we need to set the center. If Horizontal radius is not accurate then your nozzle may be above or hitting the surface (trying to move through it) at Z0. Again to preserve your machine, use a G1 X0 Y0 Z5 F6000 to sneak up on Z0.
  1. If the nozzle passes the paper test at Z=0 then you are done. 
  2. If the nozzle is above the surface and Z=0 then you need to increase Horizontal radius. As soon as you do, you'll need to go back through step 2 (The difference this time is you should have to add the same amount of offset to all three. ). How much you change it depends on how far off it was. You can try 1mm at a time and increase by more or less depending on the observed change.
  3. If the nozzle touches the plate before Z=0, then you'll need to decrease Horizontal radius and go back through step 1 and step 2.
Step 3, you should have very parallel movement now, and any point you chose on the surface should pass the paper test at Z=0. Don't forget to update your host software's Printable Height in the Printer Settings. Now you need to calibrate your extruder steps. The de facto on that is Triffid Hunter's Calibration Guide. I was recently given the tip to use 1/8th microstepping instead of 1/16th as a way to increase my retract speeds. I have a 5.2:1 geared stepper and this allowed me to go from 35mm/s to 70mm/s which makes a difference. However, that resulted in a little more vibration which meant more noise so I'm looking for more sound isolation opportunities.

Sunday, February 9, 2014

Repetier Firmware

I am a strong believer in KISS and if it isn't broken don't fix it. However, I also want to squeeze as much performance out of my machine (not bleeding edge speed mind you) as I can with what I've already got. Also, the Google Group Delta robot 3D printers seems to be split on Marlin and Repetier. To that end, this is my experience in changing from Marlin to Repetier firmware.

The newest Repetier firmware has you use a web wizard of sorts to generate an appropriate configuration.h file. I applaud this effort, but it has some bugs with respect to the values it sets for deltas so it still requires some manual editing. Also, the naming of the variables conflicts with what they are. A good example of this is X_MIN_POS and Y_MIN_POS. In a delta, the build is centered at 0,0. The minimum would, to my way of thinking, be -X_MAX_LENGTH/2. Nope, it's the position of the at the center of the build platform at Z=0 or 0. I'm getting a little ahead of myself, let's walk through the wizard


Repetier-Firmware configuration tool for version 0.91 Rev 4

Step one General Settings - allow you to upload a prior configuration.h file. Somewhat helpful as it pre-loads all of the generated values. However, if you have manually edited those, and unless you also edited the configuration string at the bottom too, I don't think it pulls in your changes. Let's start fresh:


  • I selected Expert for configuration, but you can leave it to "Hide internal only values". I wanted to see everything at least for the first go around. Once you start manually editing things, the variable names aren't always clear (see my example above - click the image to see a bigger version)
  • I use RAMPS 1.4
  • Delta
  • I enable EEPROM (not sure difference between Set 1,2 so I left it at 1)
  • Baud at 250000 
  • Kill is set to  reset the controller, but I prefer to just disable the heaters instead. Note: when I set mine to Disable the heaters I got a compile error so I went back to reset.
Scrolling down, you get tot he Delta configuration items

  • X and Y length should be the diameter of your build plate. You can go bigger of course, and you may want to. This is an EEPROM configurable value so don't think too hard on it :)
  • The Z length I have from my calibration using Marlin. Yours will be different. This is also in EEPROM.
  • Diagonal Rod length is the pivot to pivot distance and same as DELTA_DIAGONAL_ROD in Marlin
  • Horizonal radius is DELTA_RADIUS in marlin which is the same as DELTA_SMOOTH_ROD_OFFSET-DELTA_EFFECTOR_OFFSET-DELTA_CARRIAGE_OFFSET. For my mini this is 105.15 and this is a EEPROM configuration too. Should make calibration a much easier task.
  • If you have a mini or any of the recent Deltas, then match my angles.
  • No idea the radius error so I left 0.

Step 2 Mechanics

  • Since I chose to use Expert settings the next tab  is full of stuff I didn't touch. I did play with the subsegments (DELTA_SEGMENTS_PER_SECOND in Marlin) since I am using 1/32 microstepping I lowered 180 to 100 and 70 to 50. My prints have not shown any signs of degradation.
  • I left the XY jerk at 20
  • In a delta all 3 axis should be the same configuration. For mine I have 1/32nd microstepping, 16 tooth pulleys and GT2 belts so my Resolution is 200 steps per mm. If you are 1/16th microstepping then set to 100, and if you use 20 tooth belts then set to 80% of the 16 tooth version (160 or 80)
  • I like a brisk homing speed. 80mm/s is a good start and you can increase to your liking.
  • I set the Travel acceleration to match my Marlin. This controls how fast you get to your top speed. When printing, using a lower value is something you may want to experiment with.
  • Uncheck the mirror motor signals.
  • Make Y and Z match X
Endstops
  • Deltas usually home to the top (max) so X and Y min are not assigned and disabled. You know my opinion of probing so you know why I disabled it too.
  • Mechanical switches (and this was not obvious to me when the other type is electronic) are Switch and if you followed the wiring on the mini Kossel they are NC and will switch on GND. This sets them to inverting in configuration.h and enables the pull-ups. Click the image to see a bigger version.
  • The next array of values is verbally confusing. Go back after first hit is how far the carriage should move away from the end stop before re-homing using the Reduction factor speed. Thus if you have homing at 80mm/s, then the re-home speed would be 80/5 or 16mm/s. The Endstop distance after homing should be 0 for all three. I set it to 1 originally, and it meant that my Z max was reduced by 1 since all 3 axis though they were at 228.2 - 1 when homed. Not what you or I want.

Step 3 Temperature
  • I left the defaults for most of these. I would recommend you use what you had in Marlin as a starting point.
  • Make sure you use the same steps per mm and max feedrate as in Marlin for your extruder.
Step 4 Features
  • I left the defaults. I did not set up a  fan pin for board cooling, I leave a 80mm fan on all the time.
  • I left the SD card detect pin disabled. My Reprap Smart LCD seems to work fine without it. In fact, I'll list some likes and dislikes at the bottom but the SD operations work flawlessly.
  • I used the PID values I had in Marlin from M303. These are EEPROM configurations too.
Step 5 User Interface

  • I have the RepRapDiscount Smart LCD 
  • I left most everything default except I named my printer mini Kossel.
Step 6 Download
  • You'll want to click the Complete button
  • Unzip your Firmware (I like to create a directory under Arduino called reprap firmwares so I can keep old (working) copies

Arduino - Configuration editing

  1. Start Arduino  and open Repetier.ino. 
  2. Find the configuration.h tab and confirm the following:
#define ENDSTOP_PULLUP_X_MAX true
#define ENDSTOP_X_MAX_INVERTING false   // don't need to invert if you connected to NC
#define MAX_HARDWARE_ENDSTOP_X true
#define ENDSTOP_PULLUP_Y_MAX true
#define ENDSTOP_Y_MAX_INVERTING false  // don't need to invert if you connected to NC
#define MAX_HARDWARE_ENDSTOP_Y true
#define ENDSTOP_PULLUP_Z_MAX true
#define ENDSTOP_Z_MAX_INVERTING false  // don't need to invert if you connected to NC
#define MAX_HARDWARE_ENDSTOP_Z true

#define min_software_endstop_x true
#define min_software_endstop_y true
#define min_software_endstop_z true
#define max_software_endstop_x true
#define max_software_endstop_y true
#define max_software_endstop_z true

#define X_HOME_DIR 1   // note mine had -1 which is the min direction. In Delta they all should be the same and all in the Max direction)
#define Y_HOME_DIR 1
#define Z_HOME_DIR 1

#define X_MIN_POS 0    // Note thes should all be 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0

#define MAX_JERK 20
#define MAX_ZJERK 20    /// mine had 0.3 and I could not find a place to set it in the Wizard.

Repetier Host

Since you are using Repetier FW, one can assume you will use the host. In playing with Repetier FW on my Prusa i2, I discovered an issue with trying to use 250000 baud and Autodetect for the Transfer protocol (Printer Settings -> Connection tab). The issue was that commands queued up. At first I dropped my baud to 115200, but the issue still persisted. I had to hit Ok to flush the buffer. When I changed the Transfer Protocol to Repetier Protocol things worked as they should (meaning I did not have commands queuing up).

Closing Thoughts

That should get you up and running. Here are my closing thoughts. In a nutshell I've used Marlin since it first release, I'm a convert.
  1. I love the Configuration Wizard concept, there are a few bugs and some unfamiliar nomenclature (maybe a French to English translation?) but it gets you 90% there.
  2. I love the LCD features. It far surpasses the Marlin implementation with animated menus and being able to switch to different displays rather than cram it all on one.
  3. The SD feature works flawlessly. I had all manner of issues with Marlin on the same hardware. I even had to purchase an SD card reader for my PC to write files reliably.
  4. Having the greater number of firmware settings makes needing to re-compile and upload the firmware much less likely. I had to do it 3 times since I had some confusion about some of the meanings liek I discussed before.
  5. I haven't tested pushing the speeds yet, but at the setting I use for my slicer (40mm/s perimeters 50mm/s infill) my prints look great. Travels seem a bit slow, I htink I need to bump the acceleration from 1000 to 3000 or higher.

Hope this helps, if you have any feedback or corrections please let me know.

Tuesday, February 4, 2014

First tests and calibration - Marlin

Update: After working with a few guys who use Mac, I have learned that Repetier host Mac has some notable differences. I have added some Mac specific screenshots and explanation for these readers. Furthermore, even after reading this blog posting some were still confused so I have added more clarification in bold blue. If you use Repetier firmware go here.

Update: I have uploaded a YouTube video of the testing process http://www.youtube.com/watch?v=BX8UoTgS50M

First tests and calibration

  1. Power connected and turned on (cooling fan for stepper drivers going), and USB cable connected
  2. Arduino software - you need this to compile and upload your firmware. Go back The Basics and read/re-read what I already typed out Arduino installation, no point in copy and paste.
  3. Host software - you'll need Repetier, Pronterface, or Cura software next. I use Repetier host
Repetier-Host Printer Shape
Open your host software and configure your port. Arduino creates a com (communications) port and that's what you'll want to use. You can leave the port and the baud at auto and let the software auto-detect these. Now we need to configure the printer setting in the host software. This should match your firmware. Repetier-host lets you specify your printer is a Delta and will change the display to show a cylindrical print volume with the origin point at (0,0,0), other hosts may or may not doe this. Follow the configuration guide and use -85 and 85 (or whatever the radius of your print surface is) for the X and Y minimums and the same MANUAL_Z_HOME_POS value you used in firmware.

In addition, you need to tell Repetier-host to home to X=0, Y=0, and Z=MAX (click the Printer Shape photo to zoom in).


Click the Connect button and it should turn green. Click the Manual control tab and if you don't see the Log window click the Toggle Log button. there should be a simple message about the version of Marlin in the log.

Sample log output in Repetier-host

Check end stops
Before you click home, (the 12V power should be off or you can click the "Turn Motors Off buttonmanually move your effector down until all three max end stops are not touching. Now lets check a few things otherwise you may get an unpleasant surprise. In the G-Code: text box type M119 and click Send (or press enter).
You should see something like:
   < 8:42:05 PM: Reporting endstop status
   < 8:42:05 PM: x_max: OPEN
   < 8:42:05 PM: y_max: OPEN
   < 8:42:05 PM: z_max: OPEN

If not, then something is miswired or misconfigured. Confirm that you connected to NC (normally closed) and C (common) on the switch, and you connected the two wires to the X+, Y+, and Z+ pins on the RAMPS, and those two wires connect to the S (signal) and - (ground) pins, not the (5V). Another reason would be you did not update and upload the configuration.h changes I discussed in The Basics. Now one at a time push and hold an end stop switch and rerun the M119 command (hint, you can press the up arrow key on your keyboard to cycle through the history of G-Code commands you have issued via the G-Code entry field). You should see OPEN changed to TRIGGERED for the matching endstop. If not, then there is a wiring issue (make sure you plug max X(alpha) endstop into X+ not Y+ or Z+ :) Do not continue until you get this right.
Note: If you have a probe (and I don't think you need one) then make sure it shows TRIGGERED when retracted and OPEN when deployed.

Check motor direction (Note: deltas use a blend of all 3 motors to move the effector)
If everything checks out so far, then we need to confirm the motors are moving in the right direction. Again, disable the motors and manually move the effector down so it's around 100mm away from your surface. On the Manual Control tab, use the X and Y arrows to manually move the end effector. The arrows are divided into segments. The segment closest to the center will move the effector in that direction 0.1mm. The next segment 1mm, then 10mm then 50mm. Z only has the 0.1mm, 1, and 10 segments. Mac users, the author decided to give you a row of buttons from -100 to 100 for each axis. Remember we home to the Max and so all movements toward the bed are negative.
Notice the Mac manual controls are not a
graphic like Windows.

Let's start with Y. Click the 1mm in the Y+ direction, the effector should move to the rear toward the Z(gamma) tower. If not, take notice of which way each carriage moved, X(alpha) should have moved down, Y(beta) moved down, and the Z(gamma) carriage up. If any of these moved opposite, STOP (never unplug a stepper motor while it's powered, you will destroy the stepper driver)unplug 
 the 12V power, and flip the stepper connector on the ramps for that motor. Then you can reapply the 12V power. Repeat until they move as they should. Now same for X, click the 1mm in the +X direction and make sure the effector travels to the right. If that looks good then Try the Z+ 1 mm and all 3 should move up. If all these work, then it's time to home.


Home (Note: make sure in your configuration.h you set the homing speed to something less than 200*60. I recommend 90*60 to start)
Keep one hand on the power cord (emergency disconnect), the reset on the RAMPS, or better yet the power switch if you wired one in, for the first time and go ahead and remove your build plate or put something to protect it ;) Ok, now click any of the home buttons, there are 4, (keep in mind host software was designed for Cartesians. For delta all axis must home at the same time). All carriages should move up at the same speed (the homing speed) until they hit their end stops. Then the X(alpha), followed by Y(beta) and finally Z(gamma) will home and back off the switch. Congratulations! If not, then you skipped a step and hopefully nothing was damaged. Go back to the basics or wiring and confirm you got it right.

Calibration (Note: This link to Calibrating a 3D Printer is the de facto set of instructions for this, I only disagree with where he says you need to disable EEPROM.)
Now comes the arduous task of calibrating your actual MANUAL_Z_HOME_POS as well as your end stop offsets (M666 in Marlin). Before we begin, I think it's worth understanding what we are trying to do and what endstop offsets do for us.

In order to print thin layers and have successful first layer adhesion we need to make sure the effector (and the hotend it carries) moves parallel to our build surface and is calibrated such that Z=0 means the tip of our hotend is touching the build surface at any point. We also need to make sure our build surface is "flat" from one point on its surface to any other point. I put flat in quotes because depending on your layer thickness, 0.1mm maybe flat enough. The design of the delta with the 3 sets of parallel arms is such that it should constrain the movement effector to remain flat and not tilt or rotate around the X or Y axis. If you notice any tilting in your effector (or nozzle tip) then your arms are not parallel, not fixed to the pivot points (magnets?), or not the same length and this is a physical issue, not software.

The firmware has to convert a set of coordinates into the number of steps for each axis motor. This is some Pythagorean math (A^2 + B^2 = C^2) and is calculated for each tower, for each move, and moves are subdivied by segments per line so there is a lot of computations. In order to move where we want, the machine needs to have a reference point to start from. We call it Home, and on most deltas it's chosen to be at the maximum (max) or top of the machine. The trick is, how to you ensure that each axis endstop is in the exact same location, such that when you are homed ( X0 Y0 ZMAX_Z), the effector is in the center of the machine, and when you are at X0 Y0, Z0 the effector is still in the center and each axis has moved Z_MAX in distance and the tip of your hotend is just touching the build surface? On some designs the endstop is fixed (3DR, Lisa) and thus is guaranteed to be at the same height. Other designs have a mechanical adjustment to allow one to tweak the end stops.

The mini Kossel does not have this, so Peter Hercek wrote a new M code for to allow users to specify an offset for each axis so that when homed the carriages would all be at the same height. This M code is M666 and how it's used is M666 X-n.n Y-n.n Z-n.n, where n.n is some floating point number representing a distance in millimeters. The numbers are always negative (meaning they move away from the end stop toward the surface) and always have a decimal since we need them as floating point values.

You should test your MAX_Z before you send a command to go to Z0. I would advise you sneak up on the distance to the build surface as you move the nozzle down to Z0. If you reach the surface before Z = 0.0 then you need to subtract the value Z displays from your MANUAL_Z_HOME_POS. For Marlin, disconnect from the printer, save the change in configuration.h, upload the firmware, reconnect, and verify. The Max Z height will change in the next steps so don't worry about getting it perfect, we are just trying to get close on the first round.

Step 1, we need to make sure that each axis carriage is at the same height after homing. To do this, we need to home the machine (send a G28 G-Code command or click any home button). Then send a G-code command to get the nozzle at a point on the surface directly in front of each axis (X, Y, Z in that order). The nozzle should be touching such that it pinches a piece of paper and that paper can be pulled out from between the nozzle and surface without tearing. So let's look at the three outcomes for each trial. Here are our starting conditions (my comments in red)
  • steps per mm are 80
  • M666 X-0.0 Y-0.0 Z-0.0    (start with no endstop offsets)
  • MANUAL_Z_HOME_POS 225.0 (determined from step 1)
  • DELTA_PRINTABLE_RADIUS  = X_MAX = Y_MAX = 85 (for a build diameter of 170mm)
  • DELTA_SMOOTH_ROD_OFFSET 144.5
  • DELTA_EFFECTOR_OFFSET 20    (from the effector.scad file)
  • DELTA_CARRIAGE_OFFSET 19.5 (from the carriage.scad file)
  • DELTA_RADIUS 105.0 (from the original Johann configuration.h #define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET-DELTA_EFFECTOR_OFFSET -DELTA_CARRIAGE_OFFSET)
  • The coordinates for the point in front of the X/Alpha tower are 
    • X=(DELTA_PRINTABLE_RADIUS) * COS(210) Y=(DELTA_PRINTABLE_RADIUS ) * SIN(210)
    • X=-73 Y =-45 
  • G1 X-73 Y-42 Z5 F6000  (start at 5mm above the surface. We will step down toward Z0 in 1mm then 0.1mm increments)
  • Pay attention to the axis readouts on the Manual Control tab, especially the Z value 
Here are the potential outcomes as we step to Z=0:
  1. The nozzle pinches the paper and it can be pulled out when Z=0. This is the ideal state and means you can move to the next axis (Y/Beta). If you get this on the first try you got lucky :)
  2. The nozzle is above the surface (let's say by 2mm) when Z=0. This means we need to increase the offset for this axis. Using the M666 command, send M666 X-3.0 G-Code. We want to go a bit further so as we use -0.1mm steps, we find the most accurate offset value. Send a G28 (home), then send G1 X-73 Y-42 Z2 F6000 which should put you roughly 1mm above the surface. Use the Z -0.1 button to step down while testing with a sheet of paper as your feeler gauge. If you reach a point where there is sufficient drag of the nozzle on the paper and Z reads something other than 0, then subtract that amount from the X value in M666. Let's say Z = 0.4. Then send M666 X-2.6. Then G28, then G1 X-73 Y-42 Z0 F6000 and confirm the paper test works.
  3. The nozzle reaches the surface before Z=0. In this case, you will need to move the plastic piece that holds the end stop up, or you can reduce your MANUAL_Z_HOME_POS (including reflashng the firmware) and increase M666 value by the same amount. Then re-home (G28) and retest.
Once you finish X/Alpha, then move on to Y/Beta. Once you finish Y/Beta, Check X/Alpha and adjust if needed. If you adjust X/Alpha, then recheck Y/Beta. If X/Alpha and Y/Beta are good, go on to Z/Gamma. And you guessed it, once you finish Z/Gamma, check and adjust the other two as needed.

Step 2, ok now all 3 carriages are at the same height and pass the paper test. Now we need to set the center. If DELTA_SMOOTH_ROD_OFFSET, and by association DELTA_RADIUS, is not accurate then your nozzle may be above or hitting the surface (trying to move through it). Again to preserve your machine, use a G1 X0 Y0 Z5 F6000 to sneak up on Z0.
  1. If the nozzle passes the paper test at Z=0 then you are done. Save the M666 values. I use EEPROM so I would use M500 to save them. If you are not using EEPROM and don't plan to, then add the M666 to your start.gcode in your slicer.
  2. If the nozzle is above the surface and Z=0 then you need to increase DELTA_SMOOTH_ROD_OFFSET. As soon as you do, you'll need to go back through step 1 (The difference this time is you should have to add the same amount of offset to all three. ). How much you change DELTA_SMOOTH_ROD_OFFSET depends on how far off. You can try 1mm at a time and increase by more depending on the observed change.
  3. If the nozzle touches the plate before Z=0, then you'll need to decrease DELTA_SMOOTH_ROD_OFFSET and go back through step 1.
Step 3, you should have very parallel movement now, and any point you chose on the surface should pass the paper test at Z=0. Don't forget to update your host software's Printable Height in the Printer Settings. Now you need to calibrate your extruder steps. The de facto on that is Triffid Hunter's Calibration Guide. I was recently given the tip to use 1/8th microstepping instead of 1/16th as a way to increase my retract speeds. I have a 5.2:1 geared stepper and this allowed me to go from 35mm/s to 70mm/s which makes a difference. However, that was a little more vibration which meant more noise so I'm looking for more sound isolation opportunities.

Friday, January 10, 2014

Wiring

Wiring

We are almost there, we still need to connect the stepper motors, the cooling fan (definitely for the stepper drivers, and most likely for your hot end), connect the 12V power, and connect the end stops.

Power
If you bought the LCD 12V 5A (A means Amp, a measure of current) switching power supply per the BOM, then you'll need to cut off the barrel connector to get  to the wires. Or you could buy an appropriate barrel socket and wire to it. I cut mine. Using your meter, connect the black and red leads to the two wires (careful to keep
them separated to avoid shorting the power supply) and measure the voltage. If you see 12V, then label the wire connected to the black lead as - (negative, common, or ground) and the other as +12. Then remove the green power block with the 4 screw terminals (see image). With the openings of the block facing to your left, insert the - wire (the black wire in the photo to your left) into the bottom opening and the +12 (the yellow wire in the photo to your left) right above it. The two connectors above these are for a heated bed power supply. Verify the voltage 1 more time before you plug this block into it's connector on the RAMPS to ensure the right polarity (- to black meter lead, +12 to red lead and your meters shows ~12V DC).

Stepper motors
If your motor comes with a 4-pin connector, odds are it's wired to be compatible with the Pololu stepper connector too. If not, then you will want to confirm via a vendor spec sheet or wiring diagram which wire is paired with the other (coil A and coil B refer to the image below). If you get it wrong, the worse case is your motor is going to act very strange, squeal at you, or just sit there. Pololu stepper boards expect a bipolar stepper motor with 4 wires and 2 coils. If you have a motor with more wires, it might could be used, and you will need to identify the 4 wires that connect to the start and end of the coils. The 0.1" pin connectors on the RAMPS are designed for matching headers. I like to buy the pre-terminated wires from Pololu and matching housings to make my own wiring, you can also salvage these from old PC's (all the front panel connectors for example). Whatever you use/find you want it to be a solid and reliable connection. The quickest way to kill a stepper driver is to unplug it while the power is on. The inductive spike with vaporize the traces inside the driver chip, thankfully with RAMPS, you can just buy and replace that driver board...not so with all-in-one boards.

Current limit
DRV4988 - test point circled
We want to set the current limit on the stepper driver. You will need a multimeter with the ability to measure a DC voltage, having a continuity check capability will come in handy too. Look at the Pololu product page for the driver you are using to see where the test point is and what the multiplier is. As an example let's assume you are using the DRV4988. Per the documentation the test point is a tiny via (a via is a metal plated hold that connects two or more copper layer on a printed circuit board) between the driver chip and the adjustment pot (short for potentiometer, AKA variable resistor or pot for short). The test point also connects to the metal center of the pot. You will need to connect the black lead of your meter to ground (aka negative, -, or common) and the tip of the red  lead touching the test point (aka Vref). With the power on, take a reading. Let's say you measured 0.34V. Per the product page Current Limit = VREF × 2.5, so our current limit is .34 * 2.5 or 0.85 amps. We want 1 amp (any higher and you just waste power as heat. If you need more current, then replace the motors with higher toque ones, you bought the wrong ones) so we need to set the voltage to 0.4V. The potentiometer on these boards are not that good, are fragile and are tiny so don't go nuts with the force you use to turn it. Now using a small slotted screw driver, slowly turn the pot clockwise (CW) while holding the red lead on the test point until you read as close to 0.4V as you care to (0.42 isn't a big deal). repeat for all 4 drivers (yes the extruder too).

Fan
If you need a fan on your hot end (like my E3D requires), then you will need to connect it to the 12V power. There is also a 12V header next to D2 that connects to this 12V too. For my printer, I bought a terminal strip so I could have multiple screw downs for 12V and ground.

End stops
End Stop header on RAMPS. S is on top.
I mentioned these before, but to keep things organized I'll add it here too. The end stop wiring 3 home switches connect to the X+, Y+, Z+ connectors (which are to the right of the X-, Y-, and Z- connectors respectively) with the wires going to the top and middle pins labeled S and - retrospectively.
Note: when I say labeled I'm referring to silkscreen legend printed on the RAMPS circuit board. There are multiple suppliers of RAMPS boards, they have all the same components but they may not have the same color shown.


If you've made it this far, we are ready to connect to the Arduino and send some Gcode. 

I'm working on the next post and hope to have it out this weekend. it'll cover first test and calibration.