Motorized Bed Level Correction with 4 Independent Z Screws?
I've been reading through the z-probing guide to get auto bed leveling to work. So far I've made good progress, and have successfully ran a G32 using the nxn grid method, and the software correction of rotation. However I would like to use the mechanical motorized bed leveling, because as far as I understand, the software correction will correct mid print but won't actually adjust the level of the bed outside of that mid print context. However, the guide on motorized correction says it needs a bed fixed on 3 points which 2 have a motor to change the height. The bed I'm using has 4 independent z screws, each with a motor, so I don't understand if there's a way to adapt the instructions I read to my setup or not.
Comments
4 bed motorized leveling is not supported. I never had a printer with that design and it has the problem that you can not move just one motor without the other blocking or bending the bed. The system is statically undefined so it puts extra forces on bed to bend it if you move them out of plane. Guess no problem if they are spring loaded or the bed is flexible enough to do small corrections on one edge. But problem is still that it is not implemented.
Due to bending problem this does not really work for 4 point correction. I think here it would be best to test at 4 points as close to spindle as possible, make one reference and adjust the other 3 instead. With some programming knowledge you should be able to write this:-)
So I can add this line pretty easily to create the variable for the new motor
float h4 = plane.z(BED_MOTOR_4_X,BED_MOTOR_4_Y);
But I'm somewhat unsure where to go from there. Any tips?
The problem is this assumes a flat bed and will probably not iterate correctly with 4 points since it is statically undefined. You only need 3 point to hold a plate in position. The 4th as I said might bend the plate and that causes errors in plane measurement and assigning correction values. You need a completely different approach where you measure close to the 4 plane fixtures and then correct 3 of them by using the fixed one as reference. This would result sooner or later into a perfect leveling. For faster iteration you need to add some math for better prediction, but this should already suffice.
float h4 = plane.z(BED_MOTOR_4_X,BED_MOTOR_4_Y);
h4 -= h1;
MotorDriverInterface *motor4 = getMotorDriver(2);
motor4->setCurrentAs(0);
motor4->gotoPosition(h4);
motor4->disable(); // now bed is even
https://imgur.com/a/sM014fY. Then on the features tab I read that I can define the motor drivers below https://imgur.com/e8WtPBL. Then am I right in assuming that for the system I've described above I should add 4 motors here https://imgur.com/OlB1h8D then define them as the pins, steps per mm, etc, for the z stepper and extruders 2, 3, and 4 as shown in the first picture?
BED_MOTOR_4_X and BED_MOTOR_4_Y which are not available in config tool. So add them in manual additions.
In the meantime, I was reading through the leveling code but was having a hard time pulling the math involved out of the code because all the pointers and function calls involved. Would you be able to explain using variable names how you expect the math to work?
Observing the leveling function run it seemed to measure the 9 points in the 3x3 grid I defined staring at the front left of my machine and ending in the back right. Then, while still in the back right it begins adjusting the individual z screws seemingly at the same time but maybe it's just switching very quickly. My confusion comes because for the way in which the bed is unlevel, it's adjustments are moving z screws that were out of line, further out of line rather than closer. At first I thought I may have put an invert signal in incorrectly but I'm now sure that isn't the case so I'm thinking maybe I'm pointing to the screws incorrectly for how the math is defined. For example maybe I've mistakenly told your code that my front right screw is the back left screw which I imagine would cause issues with the math. Here's the current copy of my correctAutoLevel function after adding the 4th screw definitions. Maybe you'll be able to see whatever mistake it is I'm making. I'll attach the full BedLeveling.cpp just in case but I believe I've only made changes to this one function.
And here's the Z-Probing section of my Configuration.h, I believe everything here is defined properly.
and here's the full BedLeveling.cpp
So as you can see, the first set of measurements show the bed to be pretty level with only a 0.391 max difference between z-probe values. However after it tries to correct and then measures again it becomes much less level showing a new maximum difference of 0.765. I'm unsure of why this is happening still, I believe I must have made mistake somewhere. I did also notice that it's measuring points don't match what I've set. I defined Z_PROBE_X1 and Z_PROBE_Y1 as 25 each but it's measuring the first point at X:50.00 Y:50.00 instead? I don't know why that's happening. The only changes I've made to the code I posted before we're reducing the grid size and repetitions to be as follows.
To make sure I have my screws defined properly I've drawn this diagram showing which of my physical screws correspond to the BED_MOTOR variables.
https://imgur.com/7zfWGP6and just to be clear Z1 is BED_MOTOR_1 and so on and Z2, Z3, and Z4 are the new Motor Driver 1, 2, and 3 respectively. If any of this seems weird to you please let me know as I'm really having trouble finding my mistake here.
To address your previous concern that 4 screw leveling wouldn't work because of bending the bed. Our rigid print bed is attached to a flexible elevator plate via flexible vibration dampeners, this allows z correction flexibility without issue. As shown in these pictures.
https://imgur.com/aW1188C
https://imgur.com/7tsrvbs
I also wanted to know more about the grid size, and leveling repetition values. I currently have grid size at 5 and repetitions at 10 with the thought that if it reaches level sooner than 10 repetitions it'll just break the loop. What values do you recommend for those variables. Will higher grid sizes yield better results? If I were to set grid size to 100 it would certainly take forever but would I be left with a impressively level bed? Or would be making the process longer for no real benefit? If so then at what grid size would I reach max benefit?
How about the limit value of 0.00025. What made you reach the conclusion that that value is sufficiently level? Maybe our printer is just reading out those values of a and b for the plane incorrectly.
Finally, my most recent test stopped after only 1 repetition despite those values of a and b not reaching the defined precision. Maybe this is because I've exceeded the a and b variable type precisions? Do you know what type of variable it uses for plane.a and plane.b? Is it a float or a double? Is there a minimum rotation it applies to the z motors that is set somewhere?
but replace h1-h4 with runZProbe calls which are as close possible to the 4 motor positions. You can not measure exactly there but that is ok. It will still converge after some iterations. And since you ignore the plane problem it would converge to the correct value.
Also you need to activate probe only for first and deactivate for last test.