repetier / Repetier-Firmware

Firmware for Arduino based RepRap 3D printer.
812 stars 734 forks source link

Delta position calculation bug #227

Closed mrbi11 closed 10 years ago

mrbi11 commented 10 years ago

Hi, I am the guy who recently offered software changes, so have some familiarity with internals.

ISSUE, short version, I think there is a calculation error in delta split, and would like to communicate with the author of that extension to the code if possible.

Issue, long version: The printer of interest is the rostock max, a delta printer. It has 3 vertical calibrations and a radius calibration, from which it calculates position. With the 3 towers and center calibrated to within 0.1 mm, other points are calculated at the wrong height. Not a lot, but enough to cause poor first layer of large prints, so the print fails.

It is said the delta can print 140 mm radius, but experiments show hardware limitations that can (actually do) damage motors due to collisions with floor. This is the main reason I made software changes. I think it can handle 139mm but as margin of safety installed a limit (eeprom setting) that is defaulted to 138mm.

THIS Issue is a new one, as the calculations appear incorrect. If the delta towers are placed at 12, 4 and 8 on a clock face, and calibrations done immediately in front of each tower, and radius set such that center matches... The clock positions 2, 6 and 10 are about 0.5 to 0.6mm too high. this varies slightly with arm radius, but setting arm radius both too low and too high always leave the clock position in between towers too high.

These measurements are taken at 138mm radius. Typical radius for say 6" object would be 70mm max, and as error is zero at center, worst case would be worst about 0.2 to 0.3 mm high at 70mm, which is close enough for most print objects to get started, and those errors at clock points 2 6 and 10.

So this problem mainly affects prints in the outer 3 inches of print area.

I note the radial arm is not vertical at 140mm or 138. It is negative several degrees at 138mm. I estimate the vertical position is at radius about 132mm, so think it may be the source of error if the software is assuming the maximum radius is the point it is vertical, which is slightly off. This is not a function of radius but of the location of the pivot point.

I know where the split is calculated, but before I investigate further I would appreciate talking to the author so I understand the theory. It may already be calculated correctly, and some subtle hardware issue is at work, but as this is consistent between towers, my current thinking is the calculation is off. Perhaps it need only correct a constant, perhaps the algorithm.

I got the rostock to print some large objects, which it is not currently able to do. This issue report is after about 3 months of tuning the hardware to get stable and accurate results. So I am reasonably sure the hardware is at the limits of its design and materials in accuracy.

mrbi11 commented 10 years ago

errata ...worst case would be about 0.2 to 0.3 mm high at 70mm...

repetier commented 10 years ago

Not sure what you are meaning with radius all the time. Please open http://www.repetier.com/firmware/v091/ and select delta printer. Then you see a graphic with measurements and names. Please use these to describe your problem, so I know we are talking about the same part. Maybe you are mixing horizontal radius when centered with printer radius, which is never used?

kyrreaa commented 10 years ago

Sounds to me like the position of the towers are off. This is the first thing to check, and as I learned the hard way, the best way to make a printer very hard to calibrate.

mrbi11 commented 10 years ago

Thanks for comments.

I have investigated the software. It uses delta rod length, and printer radius to calculate tower heights. The calculation is correct, although it assumes all measurements are identical, which as kyrreaa points out is only approximate. With rostock max in particular, the rods are plastic. Mine were drilled 0.5mm shorter than the value listed in configuration.h.

My suggestion is that both delta rod length and printer radius be added to the eeprom area, as they have to be adjusted for precise calibration.

Also, the calculation adds head offset and rod pivot offset to the mix, only to subtract them. The calculations are considerably simplified to delete those two constants.

printer radius used in the calculations is the print location at which the Z axis rod is vertical, while Cartesian X is 0, and Cartesian Y is printer radius. For rostock max, it is about 130mm. This is try for any delta printer, all offsets are irrelevant. The radius can be set to the Y value when the Z tower

rod is exactly vertical.

The print envelope radius is a separate value, and is important not to exceed or the tower carriage is driven through the printer floor, depending on where one exceeds it of course. This ruins nema stepper motors. An alternative would be to calculate the point at which carriage is just above the floor, but since this interacts with calibrations, not sure how wise that would be. Checking the cartesian coordinates is much simpler.

I thought the software might be using it as the implied edge for calculations, which was my mistake.

I am closing my issue, but as above recommend both rod length and printer radius be in eeprom as they are variable depending on hardware dimensions, and recommend removing print head offset and rod pivot offset from calculations. A reasonable default value for print radius for rostock max is then 129 or 130mm for the given rod length.

kyrreaa commented 10 years ago

These are already in eeprom in 0.91

From: mrbi11 Sent: Friday, January 17, 2014 8:48 PM To: repetier/Repetier-Firmware Cc: kyrreaa Subject: Re: [Repetier-Firmware] Delta position calculation bug (#227)

Thanks for comments.

I have investigated the software. It uses delta rod length, and printer radius to calculate tower heights. The calculation is correct, although it assumes all measurements are identical, which as kyrreaa points out is only approximate. With rostock max in particular, the rods are plastic. Mine were drilled 0.5mm shorter than the value listed in configuration.h.

My suggestion is that both delta rod length and printer radius be added to the eeprom area, as they have to be adjusted for precise calibration.

Also, the calculation adds head offset and rod pivot offset to the mix, only to subtract them. The calculations are considerably simplified to delete those two constants.

printer radius used in the calculations is the print location at which the Z axis rod is vertical, while Cartesian X is 0, and Cartesian Y is printer radius. For rostock max, it is about 130mm. This is try for any delta printer, all offsets are irrelevant. The radius can be set to the Y value when the Z tower

rod is exactly vertical. The print envelope radius is a separate value, and is important not to exceed or the tower carriage is driven through the printer floor, depending on where one exceeds it of course. This ruins nema stepper motors. An alternative would be to calculate the point at which carriage is just above the floor, but since this interacts with calibrations, not sure how wise that would be. Checking the cartesian coordinates is much simpler.

I thought the software might be using it as the implied edge for calculations, which was my mistake.

I am closing my issue, but as above recommend both rod length and printer radius be in eeprom as they are variable depending on hardware dimensions, and recommend removing print head offset and rod pivot offset from calculations. A reasonable default value for print radius for rostock max is then 129 or 130mm for the given rod length.

— Reply to this email directly or view it on GitHub.

mrbi11 commented 10 years ago

Actually, everything is a bit off. Tower location, rod lengths do not match each other.

It isn't hard to calibrate, it is fixed (impossible). A triangle thing. The only way to calibrate it is to set each tower individually for both tower position and rod length. The towers have a variation of more than a millimeter relative to each other. So any calibration with just radius and rod length is doomed to be up to a millimeter or 2 off, depending where in 3d space it is.

One could make a compensation grid for height, which is probably good enough for most people even with large prints, because it will always get the first layer down. But the nature of the beast is that 0.2mm error in a rod length has minimal errors in some location, and magnified errors in others, easily over a millimeter on horizontal errors when rod is near vertical.

I'm fixing mine, because I need parts that are printed to scale in every axis as they must fit and work together with tight tolerance. The calibration is painstaking on the rostock max, because there is no real zero for the z axis, and compensating with the one adjustment cannot compensate for both height mismatches and rod mismatches. I doubt anyone else cares enough to go thru the full calibration, and I have not found a simple method. Even if a proper zero for z axis was available, it requires considerable time and computation. Calipers measuring plastic parts that have large variations from piece to piece. Calibrate it, get closer, calibrate it again. Not fun.

I appreciate your response, it helped get me on the right track.

peace, *Bill Kelley

On 1/16/2014 9:59 AM, kyrreaa wrote:

Sounds to me like the position of the towers are off. This is the first thing to check, and as I learned the hard way, the best way to make a printer very hard to calibrate.

— Reply to this email directly or view it on GitHub https://github.com/repetier/Repetier-Firmware/issues/227#issuecomment-32481889.

kyrreaa commented 10 years ago

If you have to measure width of printed objects to calibrate you are approaching this all wrong. The nice thing about these printers is there is only one setting that can affect your actual scale errors and that is the step/mm for the towers. As long as it uses belts and proper pulleys it is extremely easy to get this absolutely right.

Your issue with the rods however is something the current calibration can not do. My suggestion to that is to adjust the rods using a proper jig. I am using magnetic rods so I made mine on a magnetic jig. Control-measuring them finds em all within 0.01mm of eachother. You could probably split this up but I wonder if some of the calculations will not work if the rods are not identical.

The bit that really annoys me is the adjustments one does in the tower delta radius and how it affects the z heights calibrations. These should self-compensate if possible so one can keep X,Y,Z calibration identical while adjusting radius offsets.

Installing a z probe is a lot easier btw. You only need a 7-point reading (X,Y,Z,C,L,R,F) and then adjust and rehome. I got mine very well calibrated this way even though it's off in the axis radius by over 2mm.

mrbi11 commented 10 years ago

<...current calibration can not do....> Yes, I know. I am putting in separate tower position and rod lengths for each tower. Good idea on your accurate rods.

Not sure what you mean about the probe. Where would I find more out about the z probe? Is that just probing multiple points on the print surface to get correction factors? I was going to do that until I realized I'd be as wavy in the horizontal planes as the vertical planes, and my parts wont fit each other.

peace, *Bill Kelley

On 1/19/2014 3:58 PM, kyrreaa wrote:

If you have to measure width of printed objects to calibrate you are approaching this all wrong. The nice thing about these printers is there is only one setting that can affect your actual scale errors and that is the step/mm for the towers. As long as it uses belts and proper pulleys it is extremely easy to get this absolutely right.

Your issue with the rods however is something the current calibration can not do. My suggestion to that is to adjust the rods using a proper jig. I am using magnetic rods so I made mine on a magnetic jig. Control-measuring them finds em all within 0.01mm of eachother. You could probably split this up but I wonder if some of the calculations will not work if the rods are not identical.

The bit that really annoys me is the adjustments one does in the tower delta radius and how it affects the z heights calibrations. These should self-compensate if possible so one can keep X,Y,Z calibration identical while adjusting radius offsets.

Installing a z probe is a lot easier btw. You only need a 7-point reading (X,Y,Z,C,L,R,F) and then adjust and rehome. I got mine very well calibrated this way even though it's off in the axis radius by over 2mm.

— Reply to this email directly or view it on GitHub https://github.com/repetier/Repetier-Firmware/issues/227#issuecomment-32722002.

mrbi11 commented 10 years ago

Oh, I meant measuring the plastic rods and rod mounts, not the prints. I should learn to be more clear.

peace, *Bill Kelley

On 1/19/2014 3:58 PM, kyrreaa wrote:

If you have to measure width of printed objects to calibrate you are approaching this all wrong. The nice thing about these printers is there is only one setting that can affect your actual scale errors and that is the step/mm for the towers. As long as it uses belts and proper pulleys it is extremely easy to get this absolutely right.

Your issue with the rods however is something the current calibration can not do. My suggestion to that is to adjust the rods using a proper jig. I am using magnetic rods so I made mine on a magnetic jig. Control-measuring them finds em all within 0.01mm of eachother. You could probably split this up but I wonder if some of the calculations will not work if the rods are not identical.

The bit that really annoys me is the adjustments one does in the tower delta radius and how it affects the z heights calibrations. These should self-compensate if possible so one can keep X,Y,Z calibration identical while adjusting radius offsets.

Installing a z probe is a lot easier btw. You only need a 7-point reading (X,Y,Z,C,L,R,F) and then adjust and rehome. I got mine very well calibrated this way even though it's off in the axis radius by over 2mm.

— Reply to this email directly or view it on GitHub https://github.com/repetier/Repetier-Firmware/issues/227#issuecomment-32722002.

kyrreaa commented 10 years ago

A z probe can be just a bracket you attach to your head with a button to presss as it bumps against the bed being lowered onto it. Any free digital IO will do.

With it you can take a few key readings and see if they are level. Then adjust, rehome and repeat. Much faster than any other method. I am not saying to use any automatic levelling or such as it does not help calibrate, only level. Without a calibrated printer your printbed movements are like a molten vinyl record, weavy and uneven. Once calibrated your system moves in a flat plane, then any bed slanting can be dealth with. (I prefer to simply adjust bed.)