-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Homing Phase for TMC drivers #17299
Homing Phase for TMC drivers #17299
Conversation
This feature would be also nice also for not Delta 3D-Printer |
@Fabi0San Why is this a delta-only feature? Would you be able to apply it to all types of printers? |
Deltas use the endstops and endstop trim to get all 3 carriages almost perfectly leveled. So homing repeatability is a huge deal for deltas. For cartesians it is not such a big deal, so much so that printers have now been using sensorless homing using TMC's StallGuard feature, and is by far the least repeatable homing method I can think of. @Maeyanie made a good point though, one could benefit from it on a cartesian, by setting the first layer height and the layer height just so it is a multiple of a full step and therefore the z axis would have the highest possible holding torque on every layer. But I'm not sure if holding torque is a big deal, especially given all the Z axis with lead screws and somewhat of a good reduction on them. All that said, yes anything is possible, we could in theory factor out my code into a method WalkToPhase(axis, phase, direction) and use it on both delta and cartesian. What do you think @thinkyhead ? Any point on doing it? |
While I agree it's more useful for deltas, it does have uses for cartesians. Holding torque (more specifically, positioning accuracy) can become a problem when printing extremely thin layers, near the edge of what FDM systems can achieve. X and Y positioning do tend to be less important, but it would still improve things like power-loss resume accuracy. |
@Maeyanie , @extesy , @Strahler85 |
Much appreciated. :) |
Thank you very much. I'm compiling at the moment. One thing. How to setup this values right? #define TMC_HOME_PHASE { 896, 896, 896 } One thing maybe a good improvement (for normal users) that we have a option that home to the next full step and not to select the phase. |
Yes, un-comment that line and also #define DEBUG_LEVELING_FEATURE on config.h so it can warn you if the phases you picked are too close to the endstops, if so pick other ones.
The suggested values are the full step positions, from trinamic datasheet:
The phase is tunable for the case where your end stop is too close to the chosen phase and its noise may trigger sometimes before sometimes after the target phase which would make it have a repeatably of 4 full steps. |
Okay this mean I uncomment this command, Debug Command and home the printer and if there is no warning it works. If I get a warning I have to change the position and compile the firmware again. |
Okay :-) First the good thing. It runs :-). But I'm not sure if it is working at the Z-Axis, because there is no Z- Endstop Hit Debug Log Output
|
Sorry my fault... I replaced the TMC2208 with a LV87XX driver. This is why there is no information at the Z-Axis. I switched back to TMC2208 and compiling marlin again. |
That is a good test too, I just added the check that doesn't assume all drivers are TMC, it should do just that not look for phase if one of the axis has no TMC on. Tested! Thank you. |
Changed to TMC2208 Home phase too close to endstop trigger. Pick a different phase for Z I will change the Phase Z to value 128 But what I found out is:
Z moves to 0.04? |
You see that Y varied 0.02mm, which is very typical for mechanical ES, which type is it? Note that Z home will be further from the bed now, if you use offset you may have to re-calibrate that or your first layer will get thicker and may run lean. |
TMC2660 uses another name. |
Thank you, |
Looks like progress has been made and testing is going well. I have been attending to other issues, but I will give this a re-review now and get it into final shape for merge. |
@Fabi0San tested multiple runs of
If I understand this correctly, there is quite a bit of spread in the activation distance of my Z-endstop relative to the configured phase? However, i see a huge spread in the trigger phase. 8, 280, 452, 872. How should I evaluate this, or is it time for a better endstop? |
ok discard any previous post from me....I just understood now what you mean (and data you posted) |
@GMagician basically I'm double checking if this indeed means that my Z-homing varies between 0.06 (I've also seen 0.01) and 0.14 mm relative to the selected phase, indicating a trigger position variation of 0.08 (0.13) mm. Which would be horrible and tells me I need to replace this thing asap. |
Yes you got it right, your trigger points are all over the place, given phase is between 0-1023 there is no safe place to pick. Ideally you want your endstop to be repeatable within 2 full steps, or 512 uSteps(1/256) which in your case should be about 0.08mm but your trigger seems to have an error at of at least 0.16mm possibly more. It is hard to say what is adding such noise though, endstop surely is the first suspect but it can be being caused by chassis noise such as from bearings, belts, steppers(current), or electronic noise such as filtering capacitors on endstop pins or FW artifacts such as endstops not using interrupts and the uC missing the edge change by a few steps. On my machine I have hit all of those and some more, I'm now at about 0.0012mm repeatability which likely is beyond the limit of what I can measure with the tools I can afford. If you would like some wild guesses tell me about your machine and I can suggest where to look first. |
Not quite. You will always get better repeatability even between full steps, the main difference with that approach is how much torque the motor will have at the homing position. |
Thank you for the verification. I'm relatively sure this is a component quality issue, the endstop is a no-name brand microswitch - the lever also appears to bend during actuation. I'll replace it with a decent omron unit and see if this improves things. I'll also hook up a scope to the endstop and see how noisy the signal is. Tinker time, perhaps it's even time to install a hall effect sensor on Z. |
Delta of 0 is not good so there will always be some distance, say pick samples:
These are all good, within 0.01mm from each other this would be very typical and workable, all within the fullstep 2(384-640) But then:
Ugh, got to .03 and into the full step1(128-384), still workable
Now these samples screwed all up, with these we hit full step 3(640-896) and full step 0(896-128).
Sounds like fun :) Quality is important, but name brands also have their quality issues. In my experimentation, the lever on the endstops were a huge source of noise, take it off if you can. The most repeatable sensors I could find were inductive and optical, likely because they have no mechanical contact, but both suffered minor drift between machine reboots and changing room conditions. On my delta I use optical, but the best compromise is really on mechanical switch especially if you can use this homing phase feature. Also to clarify, the filter cap was adding a random delay into sinking the pin, so there is a balance there between contact noise and random delay. Good luck, and have fun. |
Optical switches can be very repeatable if you have something good, solid, and flat going into the path of the sensor, and take some steps to prevent foreign light affecting it. |
So thanks for this extensive reply with your experiences, I modified the endstop bracket on my printer to allow me to use the endstop without the lever. Just to remember, this was the result with the lever:
And this is after modifying the printer and removing the lever:
That's pretty crazy. Can I suggest that this feature is extended with a method to determine the trigger accuracy of the Z endstop (be it microswitch, optical, hall or whatever)? Something that does 5 triggers and outputs the min / max / average perhaps. |
That is fantastic! I support that idea for a feature request, M48 for any endstop, not just z_min_probe. @swilkens, feel free to create a [FR] issue and link it here so we can track it. Cheers. |
@Fabi0San would like to check, are this value look ok? i got repeatable number on every home Endstop X hit at Phase:252 Delta:900 Distance:-0.7000 |
Description
Homing phase.
Makes homing super repeatable by retracting from endstop hit back to a very specific stepper coil phase.
TMC Only. Delta Only.
The implementation changes delta homing so when the endstop is hits, the TMC phase is queried and the distance to the next target phase away from endstop is computed and added to endstop trim.
Notes:
Benefits
Related Issues
#16383