-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Experimental kinematics #1023
Experimental kinematics #1023
Conversation
Based on my experiments over the last few days I figured out, that it would be really handy to configure the attachment points of the winches at the toolhead separately. We discussed this in #180 and while it is working to offset the winches by the offset of the attachment points, it is error prone to change something. The anchor positions should be the exact values measured from the (arbitrarily chosen) So my suggestion would be to add three optional config parameters per winch: |
@yschroeder - that makes sense. I don't feel I'm in a good position to make those types of changes though, as I don't have the hardware to test it. If you'd like to get the code and docs into a better shape, that would be great. Let me know if you think I should hold-off on merging "winch" kinematics, or if you think merging and extending later is okay. -Kevin |
I think you can merge this as the basic functionality is there (and I believe it is working correctly apart from my setup being badly calibrated). Homing ( I will copy my above idea into an issue and might work on it myself. Can't promise it though and it would only happen after holidays are over... |
Can you elaborate on why anchor positions should be measured from the origin? What would be the end points of the offset measurements, and how does the simplified anchor calibration procedure look, step by step? When changing tools heads using Marlin and RepRapFirmware, I've just added a z-offset in Slic3r. Later, when we have tool changing, I've imagined adding a z offset, relative to a point on the holder bracket on the mover, per tool. |
Just for reference: In current Marlin and RepRapFirmware, the offsets from nozzle tip to line entry point on the mover are not mentioned in the firmware at all. Anchor positions are measured from line entry point on the mover, to the line entry point on the anchor. (You only measure along one line, even if several lines go in the same direction.) So the static offsets are subtracted at time of measurement, not firmware compilation time or run time. |
I am not sure what exactly you mean with "simplified anchor calibration". To be honest, I haven't looked yet at how anchors are calibrated for a Hangprinter, so there might be better ways to do this. Let me explain what we did until now: Remember we have this setup:
Step 4 is extremely cumbersome though. The easiest way to do this is via a total So, how would you do it @tobbelobb? I started watching the calibration part of you video with Tom, but I'd like a written document better 😃 |
Ah, ok I thought you were suggesting a simplification of the current Hangprinter calibration routine. Having the origin at the bottom left of your reachable area get you in line with Cartesian printers, but out of line with delta printers. As you say, you may define the origin to anywhere you choose. There is a practical benefit to placing your origin close to where you will actually print, and to do your calibration measurements when the nozzle is in that point. The benefit is better accuracy, because consequences (errors) due to any mis-calibration will grow (accumulate) when you move away from your well calibrated point (the origin). Some work on consequences of calibration errors here: http://vitana.se/opr3d/tbear/2018#hangprinter_project_53 I don't do manual calibration anymore, as step 4 in your description is indeed cumbersome. Manual calibration is not part of part of the HP design or intended use case, so I won't write any official documentation, but I can try to help you here. Steps to manually calibrate anchor positions of HP3:
Standard HP3 calibration is semi-automatic. The user collects data points, feeds them into a script, and the script calculates the position of the anchors. See: The semi-automatic calibration script could probably be made to work for your machine as well with some small adjustments. |
How does your inverse kinematic equations look like? I think your point 5 might be in error. You want to calculate line lengths (distance from the point where the line enters the mover to the point where the line enters the anchor), not the distance to the tip of the nozzle. Edit: Maybe you're not in error, since you're measuring from the origin and subtract your offsets. Works in principle, if your offsets are right. If you're using the Tom's videos, then this page might help you navigate them since they're so long: https://reprap.org/wiki/Links_Into_Hangprinter_v3_Build_Video#Now_going_into_an_hour_of_measuring_this |
FYI, Klipper calculates motion from a single inverse kinematics equation. For the "winch" demo kinematics, I implemented: 345b22e#diff-5407884987d0f93b6d75d59a65f94109R19 The code uses an "iterative solver" to find a precise time for each step on each stepper using this function. The anchor x/y/z values come directly from the config: 345b22e#diff-f726e7a1bb28f5dce6c9c6e7bbf4cd4cR15 The above equation may not be best - my goal was to provide a starting point. FYI, it should be possible to change just this inverse kinematics equation (and the similar forward kinematics equation in the winch.py code) to implement more advanced calculations (eg, the effect of gravity on the cable, the effect of spooled cable impacting the drum radius). -Kevin |
Looks perfectly reasonable. I like the clear, easy to read config file! |
Maybe this PR is derailling completely now, but I am not sure I understood the semi-automatic calibration. I understood is does the following: You input nozzle positions and line lengths into the script and it tries to figure out which anchor locations make sense for those values. Some questions: Or do you just need the line lengths and not the real X, Y, Z coordinates? The Mechaduinos tell Marlin the "lost" steps when they are moved by hand and You say you move to the position of data point collection. Where exactly is this? I guess the solver needs to know this? In the video with Tom you did all kinds of measurements. Am I correct, that none of these are needed when using the semi-automatic calibration? Does the solver make any assumptions on the geometry of the printer (e.g. D winch being at X=0 Y=0)? And some more info on the kinematics: |
Thanks for asking these questions. Calibration is the major bottleneck and hurdle for almost all HP users and details has been under-communicated. Yes, You input these relative line lengths into the script. The xyz-positions of data point collection may also be input into the script, but this is optional. The most common way to use the script is to drag the mover to ca 13 completely random and unknown positions of data point collection and not input any xyz-positions into the script. No, the solver does not need to know positions of data point collection. It will solve for that as well as the anchor positions. If you do know the xyz-positions of data collection, then you need fewer points of data collection (maybe 3-4?), and may have better accuracy in the output anchor point positions. Yes, you don't need measuring tape at all to build a HP3 :) Working on the Tom's videos made me realize that crawling on the floor with a measurement tape is really not the way forward. Yes, the solver currently assumes D winch being at x=0 y=0. HP3 also uses dyneema. It's awesome :) |
I had an idea for a (almost) fully automated calibration. It might not be completely thought through, so maybe this does not work at all. It requires automatic cable tensioning (as possible with the Mechaduinos and hopefully via the Stallguard of the TMC2130 as well. With the encoder output of Mechaduinos it might become even easier. The automated calibration would work like this:
After step 4 we know all 4 cable lengths that are needed for your calibration script. Repeat steps 3 and 4 until enough points are sampled, maybe choose different winches each time for the lose cable. It might also be advisable to return to the 0 location in between to check if all cables are still tensioned correctly. If you are using Mechaduinos, the fourth motor could be in torque mode and you could read out its encoder movement directly instead of auto-tension it afterwards. I'm interested in the auto-tension solution, as this would work with my TMC2130. |
I think your idea would work well if StallGuard2 gave a fine-resolution measurement of line tension. But StallGuard2 has some limitations that would make the data collection procedure you describe less good (I think maybe not work at all) in practice. After a StallGuard2 detection, you only know the motor shaft position to an accuracy of +-4 full steps. So you would need to return to the origin an re-calibrate between collected data point. StallGuard2 actually doesn't measure force, it forces back emf, which depends on many things, like motor speed. Back emf does not easily translate to cable tension. But you could record for example the line lengths at the origin, if you ram the mover into prepared landing brackets at the anchors. Before reaching for the Mechaduinos (and later SmartSteppers and ODrives, I don't recommend Mechaduinos anymore), I tried using force sensing resistors. Some details here: http://vitana.se/opr3d/tbear/2017#hangprinter_project_48 I think auto calibration based on force sensing resistors (or better; well calibrated load cells) could be made to work well. If you just want to test the script, you could use forced moves to get into 13 different valid positions (positions where all lines are tight). |
I understand that is an abuse of stallguard to do tensioning. The accuracy can be down to 1 full step, which is actually not that much I believe. For my setup one full step is 0.36mm. I don't think I can tension the cable to that accuracy by hand... (remember, my machine is not fully constrained, so overtensioning one cable results in movement of the nozzle). Further, Stallguard does not only allow stall detection but you could read I'd love to try your script, however, |
@KevinOConnor: I found a bug with this PR (back on topic): You are using
Yes, I'm still using the old version, but the bug is still valid. |
Add a dummy kinematics class for development testing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
345b22e
to
7c6d145
Compare
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
7c6d145
to
4957695
Compare
Thanks, should be fixed now. -Kevin |
Hello |
Klipper has had experimental "polar" and "cable winch" kinematics on development branches for some time. I plan to commit these experimental kinematics to the master branch - although they are not complete, I think they are sufficiently modular that they will not adversely impact the main cartesian/corexy/delta users.
-Kevin