Welcome! Log In Create A New Profile


Porting Volumetric E and FWRetract

Posted by adavidm 
Porting Volumetric E and FWRetract
July 16, 2014 07:02AM
Hi All,

I'd like a little advice if possible. I'm trying to port the Volumetric E and Firmware Retract from mainline Marlin into Rich Cattell's version that has the Delta auto-calibration. I'd like to test if the Firmware Retract, in particular, improves the unretract quality on my Delta (A 3DR) which is currently not ideal.

After a lot of diff-ing (The mainline and Rich's fork are in different repositories and I'm not familiar enough with Git to compare across repos) I *think* I'm almost there. The mainline FW has a new function in Marlin_main.cpp called retract() that handles the G10 and G11 gcodes - as well as G1 if E but no XZY movement is involved.

My fork of Rich's repo with theses changes is here:


The printer now prints the first layer pretty well, and so the Volumetric E part seems ok. I can't test further though as the effector makes a bid for freedom through the side/top of the printer on retract. I suspect this is partly because of the way Zlift is handled in the retract() function. It seems to only alter the Z_AXIS position, which would make sense for a non-delta, but not for delta. I've modified this this morning to change the X and Y positions by the same amount by doing the following in the retract part of the function:

#ifdef DELTA // move all axis equally when zlifting on Delta
      #endif //DELTA

and a similar thing in the unretract part of the same function. I've not had a chance to test this, the first opportunity will probably be tonight, but can anyone tell me if I'm barking up the wrong tree? I know that just this change won't affect how far the effector moves, I'd just like to see it move vertically. I suspect a bad conversion from mm/sec to mm/min or similar is responsible for some of the craziness but if I can get the movement in the right direction magnitude errors should be easier to spot.

The goal of all this is to create a pull request for Rich so he can get the FWretract into his code. I'm trying to learn enough to be useful, not just dangerous!

Thanks in advance for any assistance.



[Edit - typo]

Edited 1 time(s). Last edit at 07/16/2014 08:17AM by adavidm.
Re: Porting Volumetric E and FWRetract
July 17, 2014 03:58AM
A good strategy to join two repos is to add the other one an a remote repo. Starting in a clone of Marlins' main repo:

git remote add cattel <url>

"cattel" is just a name, you can choose any name you find convenient. Then fetch both:

git fetch cattel
git fetch origin

Voilá, now you have both on your local copy and can use gitk to show where they diverged. A good strategy is not to diff around, but to rebase the diverged branch commit by commit until it's based on the main repo's master:

git checkout cartell/master
git checkout -b new_cartell
git rebase master^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
git rebase master^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
git rebase master^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
git rebase master

Add enough ^^^ to initially get a "branch is up to date". If not, git rebase --abort and add more of them. Then remove one ^ each time.

That's lots of routine work, but upcoming conflicts can be solved most easily and when you're done, the new branch is ready to be committed.

Edited 1 time(s). Last edit at 07/17/2014 03:59AM by Traumflug.

Generation 7 Electronics Teacup Firmware RepRap DIY
Re: Porting Volumetric E and FWRetract
July 17, 2014 06:00AM
Wow, great advice. Thanks!

I'll have a try at this tonight. If nothing else it should show if I've missed anything vital.

I still suspect the retract() function itself is not delta aware, and I've modified it as discussed based on the delta homing code ready for testing, but using your method will help rule out less obvious problems.

I think I need to build a new printer so I can be messing with firmware on one while printing with the other but I'm not sure my wife would accept the justification!

Thanks again.

Sorry, only registered users may post in this forum.

Click here to login