Should have posted this here...
I am trying to add auto bed leveling to Teacup:
I first saw this on nophead's blog(
hydraraptor), but, currently, there are several other people doing this.
I started to turn nophead's python code into C.
and
I talked to emaker(he is developing this in Marlin:
github ) on the IRC and he explained to me that it is not done in the loop of G-code that is about to be used by the machine, but before that where time is not a constraint. I'm not really sure yet how the firmware buffers commands and such, so I may be describing it incorrectly. If G-code is stored on the printer before being fed into a loop that the machine uses, then g-code can be processed before it is sent to the loop, I'm not sure if this means that a certain amount of G-code must be processed first to fill up the loop. I also do not know if this is specific to Marlin.
I just finished making the methods that will enable input of 3 points(as arrays) and then fill in the variables of the equation that would transform the G-code onto the new plane. By the end of the day I will have learned how to code with strings and I will input fake Z-probe points and a G-code file to make sure it at least appears to be working. And right now I am just using doubles, but I will replace that with uint-type variables once I see it is working in order to be consistent with the "integers only" in Teacup. The only thing I can't figure out is how to tell the motors to move from within the firmware.
I would really like any help with using the firmware to move the motors or with understanding the way in which G-code is stored and processed in the firmware.