Skip to content
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

Add delta_tower_angle_trim #5984

Merged
merged 3 commits into from
Mar 8, 2017

Conversation

thinkyhead
Copy link
Member

@thinkyhead thinkyhead commented Mar 7, 2017

Rebase, squash, and patch of #5976


See issue #5914
Added a parameter to correct for tower angle error on delta printers.
Tuning is done with the M665-code.


Additionally, this PR converts the delta live parameters to arrays.

@Roxy-3D
Copy link
Member

Roxy-3D commented Mar 8, 2017

@thinkyhead Scott, I've setup a Marlin fork at https://github.com/Roxy-3D and have a local clone on my machine. I want to pull these changes into my fork and sync them to my development machine. I'm using Git-Desktop. Can you offer any advice on what I need to do to accomplish this? (I don't want to mangle the other changes I've been making, but I'm going to try to keep my fork and RCBugFix synchronized.)

@thinkyhead thinkyhead force-pushed the rc_delta_angles branch 2 times, most recently from 34a0fca to 21555a2 Compare March 8, 2017 00:18
@thinkyhead
Copy link
Member Author

You can't do anything across forks from Github Desktop, apart from sending pull requests. It doesn't provide the facilities for merging things. There are more feature-ful Git clients that might offer more of the power you want. To do what you want to do, with full control, you should use the option in Github Desktop to open the command-line, then work from there.

One way you might be able to merge this into your branch (or, make a copy first to test) is to use the Github web interface. Go to my branch at https://github.com/thinkyhead/Marlin/tree/rc_delta_angles and then do a "New Pull Request" from that page (assuming the button appears). It will initially open a page comparing the branch to Marlin/RCBugFix, but you can edit the link so it compares to your branch instead.

So, for example, if I wanted to submit this as a PR to your RCBugFix branch, I would use…

https://github.com/Roxy-3D/Marlin/compare/RCBugFix...thinkyhead:rc_delta_angles?expand=1

So… maybe it will let you do a PR against your own repository…?

You should of course begin with a branch which is a copy of the most current RCBugFix so you'll have all of today's commits.

If you want to know how to do it from the Git command-line, I can post you the commands shortly…

@Roxy-3D
Copy link
Member

Roxy-3D commented Mar 8, 2017

OK! I'll explore the things you suggested! I'm sure it won't go smoothly. But I'll see how far I can get.

You should of course begin with a branch which is a copy of the most current RCBugFix so you'll have all of today's commits.

I did start with a fresh copy of RCBugFix this morning. The whole reason I need to find a way to do this is because that branch is evolving so quickly. I need to be able to stay synchronized. This is just the first thing I need to move over.

@thinkyhead
Copy link
Member Author

thinkyhead commented Mar 8, 2017

To make a copy of my rc_delta_angles branch in your repository:

# add the remote, if needed
git remote add thinkyhead git@github.com:thinkyhead/Marlin.git
# fetch latest data from github
git fetch thinkyhead
# copy my branch to your pc
git checkout thinkyhead/rc_delta_angles -b copy_of_delta_angles
# push to your fork, tracking changes
git push --set-upstream origin copy_of_delta_angles

To merge its commits into your own branch:

git checkout my_branch
git merge copy_of_delta_angles

If starting from a branch relatively close to RCBugFix then the merge should have no conflicts.

To keep your fork's RCBugFix up to date with MarlinFirmware

git checkout RCBugFix ;# your working copy
git remote add upstream git@github.com:MarlinFirmware/Marlin.git ;# if not already done
git fetch upstream ;# get the latest from github
git reset --hard upstream/RCBugFix ;# point this branch at the latest commit
git push -f origin ;# push to your fork ('origin' is optional)

@thinkyhead
Copy link
Member Author

I need to be able to stay synchronized. This is just the first thing I need to move over.

Once you have a good set of commits on top of a recent RCBugFix it will tend to be easier to use rebase rather than merge. Rebase tries to redo your commits onto the end, while merge applies new commits after yours, making the result less suitable for a PR. The situation can be cleaned up for a PR, but it's easier just to rebase to the latest RCBugFix every so often. There can still be conflicts, but they tend to be easier to resolve.

I've been thinking of making some short videos on doing a rebase of Marlin, resolving some conflicts, and pushing changes to update a PR. Could be instructive.

@thinkyhead thinkyhead merged commit deb9d0d into MarlinFirmware:RCBugFix Mar 8, 2017
@thinkyhead thinkyhead deleted the rc_delta_angles branch March 8, 2017 01:41
@Roxy-3D
Copy link
Member

Roxy-3D commented Mar 8, 2017

Please do make a video... But try to make it so somebody can just do exactly what you are showing and the right thing happens. I did your commands up above:

git checkout RCBugFix ;# your working copy
git remote add upstream git@github.com:MarlinFirmware/Marlin.git ;# if not already done
git fetch upstream ;# get the latest from github
git reset --hard upstream/RCBugFix ;# point this branch at the latest commit
git push -f origin ;# push to your fork ('origin' is optional)

The checkout failed because my working copy was already active. But I think I've acquired all of the changes you have made in the last day or so:

Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

WARNING: posh-git support for PowerShell 2.0 is deprecated; you have version 2.0.
To download version 5.0, please visit https://www.microsoft.com/en-us/download/details.aspx?id=50395
For more information and to discuss this, please visit https://github.com/dahlbyk/posh-git/issues/163
To suppress this warning, change your profile to include 'Import-Module posh-git -Args $true'.
C:\Downloads\3D-Printers\Roxy-Firmware\RC-8-RCBugFix-with-UBL-Coexist\Marlin [RCBugFix ≡ +0 ~1 -0 !]> git fetch upstream
fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
C:\Downloads\3D-Printers\Roxy-Firmware\RC-8-RCBugFix-with-UBL-Coexist\Marlin [RCBugFix ≡ +0 ~1 -0 !]> git checkout RCBugFix
M       Marlin/Configuration.h
Your branch is up-to-date with 'origin/RCBugFix'.
Already on 'RCBugFix'
C:\Downloads\3D-Printers\Roxy-Firmware\RC-8-RCBugFix-with-UBL-Coexist\Marlin [RCBugFix ≡ +0 ~1 -0 !]> git remote add upstream git@github.com:MarlinFirmware/Marlin.git
C:\Downloads\3D-Printers\Roxy-Firmware\RC-8-RCBugFix-with-UBL-Coexist\Marlin [RCBugFix ≡ +0 ~1 -0 !]> git fetch upstream
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
From github.com:MarlinFirmware/Marlin
 * [new branch]        1.0.x               -> upstream/1.0.x
 * [new branch]        32-Bit-RCBugFix-new -> upstream/32-Bit-RCBugFix-new
 * [new branch]        32-Bit-RcBugFix     -> upstream/32-Bit-RcBugFix
 * [new branch]        RC                  -> upstream/RC
 * [new branch]        RCBugFix            -> upstream/RCBugFix
 * [new branch]        arch_samd_support   -> upstream/arch_samd_support
 * [new branch]        breakup-marlin-idea -> upstream/breakup-marlin-idea
 * [new branch]        devel-ubl           -> upstream/devel-ubl
 * [new branch]        revert-5259-Allow_UART-ISR_inside_Stepper -> upstream/revert-5259-Allow_UART-ISR_inside_Stepper
C:\Downloads\3D-Printers\Roxy-Firmware\RC-8-RCBugFix-with-UBL-Coexist\Marlin [RCBugFix ≡ +0 ~1 -0 !]> git reset --hard upstream/RCBugFix
HEAD is now at 6caf0830 Merge pull request #5985 from thinkyhead/rc_better_endstops_init
C:\Downloads\3D-Printers\Roxy-Firmware\RC-8-RCBugFix-with-UBL-Coexist\Marlin [RCBugFix ↓29]> git push -f origin
Counting objects: 77, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (76/76), done.
Writing objects: 100% (77/77), 30.20 KiB | 0 bytes/s, done.
Total 77 (delta 60), reused 0 (delta 0)
remote: Resolving deltas: 100% (60/60), completed with 27 local objects.
To https://github.com/Roxy-3D/Marlin.git
 + 7acec0e2...6caf0830 RCBugFix -> RCBugFix (forced update)
C:\Downloads\3D-Printers\Roxy-Firmware\RC-8-RCBugFix-with-UBL-Coexist\Marlin [RCBugFix ≡]>

I presume I can do this periodically to get add any changes that happen to RCBugFix? But will it tell me if there is a conflict? How do conflicts get resolved? I think I'm OK with doing a rebase instead of a merge. Because eventually, when I generate a Pull Request to send to MarlinFirmware, we want just the Pull Request to have just the changes needed to get the current version to what I have, right?

And one more question: I pretty much did things the way you said to do it. But could I have done it this way: https://help.github.com/articles/syncing-a-fork/ ??? I think I now have 'upstream' defined so that does not need to be done any more?

@Roxy-3D
Copy link
Member

Roxy-3D commented Mar 8, 2017

I give up... All of my changes are gone. I just have a current copy of what is RCBugFix. My changes were in both github.com/Roxy-3D/MarlinFirmware/Marlin and on my laptop. Now both just have the current RCBugFix

Git is not God's gift to software developers. It is a pile of complex crap.

Rather than try to make one large PR that has everything to add UBL to RCBugFix, it makes sense to go a different route. I can add one small section in Configuration.h that has:

/**
 * Select one form of Auto Bed Leveling below.
 *
 *  If you're also using the Probe for Z Homing, it's
 *  highly recommended to enable Z_SAFE_HOMING also!
 *
 * - 3POINT
 *   Probe 3 arbitrary points on the bed (that aren't collinear)
 *   You specify the XY coordinates of all 3 points.
 *   The result is a single tilted plane. Best for a flat bed.
 *
 * - LINEAR
 *   Probe several points in a grid.
 *   You specify the rectangle and the density of sample points.
 *   The result is a single tilted plane. Best for a flat bed.
 *
 * - BILINEAR
 *   Probe several points in a grid.
 *   You specify the rectangle and the density of sample points.
 *   The result is a mesh, best for large or uneven beds.
 *
 * - UBL Unified Bed Leveling
 *   A comprehensive bed leveling system that combines features and benefits from previous
 *   bed leveling system.  The UBL Bed Leveling System also includes an integrated and easy to use
 *   Mesh Generation, Mesh Validation and Mesh Editing system.
 */
//#define AUTO_BED_LEVELING_3POINT
//#define AUTO_BED_LEVELING_LINEAR
//#define AUTO_BED_LEVELING_BILINEAR
//#define AUTO_BED_LEVELING_UBL

And then I can do smaller Pull Requests that bring in more of the system, one piece at a time. Most of the code can simply be turned off until I get it all there by wrapping it with:

#ifdef AUTO_BED_LEVELING_UBL

@thinkyhead
Copy link
Member Author

Video is still on the agenda. Just busy going through the ~300 issues that piled up while I was busy with other things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants