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
Feature / Global Axes and Framework for Enhanced Motion Control #1035
Conversation
…ndantly in there.
…xis package. Wrestle with WindowBuilder.
…on its own (redundant) Axis mapping.
# Conflicts resolved: * src/main/java/org/openpnp/machine/marek/MarekNozzle.java * src/main/java/org/openpnp/machine/neoden4/NeoDen4Driver.java * src/main/java/org/openpnp/machine/reference/ReferenceActuator.java * src/main/java/org/openpnp/machine/reference/ReferenceCamera.java * src/main/java/org/openpnp/machine/reference/ReferenceDriver.java * src/main/java/org/openpnp/machine/reference/ReferenceHead.java * src/main/java/org/openpnp/machine/reference/ReferenceNozzle.java * src/main/java/org/openpnp/machine/reference/driver/GcodeDriver.java * src/main/java/org/openpnp/machine/reference/driver/NullDriver.java * src/main/java/org/openpnp/spi/Movable.java * src/main/java/org/openpnp/spi/base/AbstractActuator.java * src/main/java/org/openpnp/spi/base/AbstractCamera.java * src/test/java/BasicJobTest.java * src/test/java/VisionUtilsTest.java * src/test/java/org/openpnp/machine/reference/driver/test/TestDriver.java
* Added simulated Homing Error corrected by Visual Homing * Added simulated non-squareness corrected by Linear Axis Non-Squareness Transformation * Added simulated vibration to test Camera Settle * Added simulated camera noise to test Camera Settle * Added simulated nozzle runout to test Runout Compensation No Unit yet.
…wrapping-around when going beyond the image margin.
…cting the ImageCamera view at the location.
Optionally test an imperfect machine in the SampleJobTest.
Implement analytical constant acceleration profile solving for symmetric cases. Lots of cosmetics.
Hi Mark. This looks like a great improvement. Might it be worth squashing some of those commits? Also, there's much more (good) work done in this one PR than is implied by the title. The write-up is impressive. Regards, |
Hi Ian Thanks! I guess Jason could squash it when he merges it, Github has this option. Personally, I don't believe much in (premature) squashing, because time and again it was valuable to trace one's own steps and retrieve some bits and pieces from earlier revisions (and you never know in advance). This PR has evolved quite a bit and it was thoroughly remodeled multiple times, some approaches wildly different and huge code blocks thrown out again (like a full numeric solver port from C). _Mark |
That's a handy GH feature. I tend to give my R&D branch a new name to keep it around for rework/posterity, then rebase interactive to get a cleaner version for public comment. As an occasional Linux kernel contributor and long time mailing list lurker I know they need the commits to be clean and concise for review. Anyway, whatever Jason's happy with, ofc. :-) Regards, |
Hi Ian To be honest, I'm not a GitHub expert at all. It simply never occurred to me that someone might look at individual commits in a PR while it is not yet merged. Just the diff. Technically, at that time, it is still a part of my forked repo, right? At least that's what the command-line instructions for a pull of this PR suggest:
I understand that the PR should be squashed in the end, when it is merged into Jason's repo, so it appears as one commit at one time in history, can easily be reverted and blamed etc. I thought this insulation is exactly one of the reasons, why one uses the GitHub forking pattern. But I'm open to suggestion. @vonnieda, any preferences/recipes? _Mark |
Hi Mark, Yes, your commits are absolutely your own and live in your forked repo, until the PR is merged - however Jason chooses to do that. The only reason to squash them into more manageable chunks would be to help a code reviewer. Linux is obviously super-strict about that, but maybe openPnP is a bit more laid back. Maybe just looking at the final diff would be enough, but this is a big series. Anyway, just my $0.02, and all projects and maintainers are different. CU, |
Hi @vonnieda Could we merge this into Thanks, |
Yea, will get it merged this evening. Sorry - been a busy week.
…On Wed, Aug 12, 2020 at 2:04 AM markmaker ***@***.***> wrote:
Hi @vonnieda <https://github.com/vonnieda>
Could we merge this into openpnp:test for non-developer users to be able
to test it easily?
Thanks,
_Mark
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1035 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJAU44OU2OOLORPEH7VXGLSAI5HHANCNFSM4PZNZDTA>
.
|
Merged! Thank you for all your work on this @markmaker - I'm very excited to start testing it! |
…pnp#1035) * First implementation round. GCodeDriver Axis management is still redundantly in there. * Reworked Drivers to flat list. * Machine Setup Panel Tabs per class restoring and out of bounds bugfix. * Work in progress, backup commit. * Add * Axes and Transformations' Wizards implemented. Reorganized into own axis package. Wrestle with WindowBuilder. * First time tests run successful. GcodeDriver still partially running on its own (redundant) Axis mapping. * Testing and refining migration with examples. * Resolved openpnp#998 merging issues. * Cosmetics. * Created new AxesLocation for Controller side. Reworked all Transformations. * Made tests run with AxesLocation. * Testing: First steps towards "simulated imperfection". * Tested using NullDriver. * Added simulated Homing Error corrected by Visual Homing * Added simulated non-squareness corrected by Linear Axis Non-Squareness Transformation * Added simulated vibration to test Camera Settle * Added simulated camera noise to test Camera Settle * Added simulated nozzle runout to test Runout Compensation No Unit yet. * Restrict image transfer to the area of the source image, to fix some wrapping-around when going beyond the image margin. * Backup commit. * Factored OpenCvUtils.createFootprintTemplate() out for use outside of stages. * SimulationModeMachine can now check pick and place Locations by inspecting the ImageCamera view at the location. * Sub-pixel rendering etc. * Refined the NullMotionPlanner and various stuff. * Fix the camera view rotation jog to work with and respect mapped axes. * MotionPlanner first implementation. Before MappedAxes refactoring. * Reworked: no MappedAxes. Axis limits. Rotation wrap-around. * Added solver. * Better description and simpler formula. Getting the hang of this. * More cosmetics * Backup commit. * Backup commit. * Added motion solver test. Does not work (yet). * Backup commit * Backup commit before solver remove. * Removed tnc solver. Almost completed profile solver cases. * Backup commit * Changed profile solver to rudimentary secant method. * Solver seems to work now. * Backup commit * New region solver. * Tests augmented. * Before reworking path solver. * Backup before reworking path solving/half sided profiles. * Finish without trying to implement advanced motion planning. Cleanup and better comments. * Better comments. * Removed unnecessary (whitespace) changes etc. Better comments. * Self code review bugfixes. * Constant acceleration profiles. Optionally test an imperfect machine in the SampleJobTest. * Simplify Motion and MotionOption. Implement analytical constant acceleration profile solving for symmetric cases. Lots of cosmetics. * Testing on the machine with GcodeDriver: refinements and bugfixes. * Test bugfix. (cherry picked from commit f6713b6) Fix/global axes bugfixes 1 (openpnp#1038) * Squashed commit of the following: commit a252f08 Author: markmaker <mark@makr.zone> Own Machine testing bug-fixes. Proper X, Y filtering of Visual Homing axes by the Camera that is used (mapped axes only). Also found logic inversion error in ReferenceHead.isInsideSoftLimits(HeadMountable, Location). Testing this with multiple Heads and no camera on second head required changing Park Location interpretation to any HeadMountable. commit c765eaf Author: markmaker <mark@makr.zone> Initial user group machine testing bugfixes. Thank you Duncan, Bill, Marmalade, Mike! Removed obsolete openpnp\src\main\java\org\openpnp\machine\reference\driver\wizards\AbstractTcpDriverConfigurationWizard.java commit 190b34b Author: markmaker <mark@makr.zone> Test bugfix. commit 3a94e82 Author: markmaker <mark@makr.zone> Testing on the machine with GcodeDriver: refinements and bugfixes. commit 1f52b1c Author: markmaker <mark@makr.zone> Simplify Motion and MotionOption. Implement analytical constant acceleration profile solving for symmetric cases. Lots of cosmetics. commit 38aae5d Author: markmaker <mark@makr.zone> Constant acceleration profiles. Optionally test an imperfect machine in the SampleJobTest. commit e38384a Author: markmaker <mark@makr.zone> Self code review bugfixes. commit c4f87b7 Merge: cd6b55f edbca39 Author: markmaker <mark@makr.zone> Merge branch 'develop' into feature/global-axes Conflicts resolved: * src/test/java/VisionUtilsTest.java commit cd6b55f Author: markmaker <mark@makr.zone> Removed unnecessary (whitespace) changes etc. Better comments. commit ee29ca7 Author: markmaker <mark@makr.zone> Better comments. commit c8c0e7e Merge: ef152b6 10b0095 Author: markmaker <mark@makr.zone> Merge branch 'develop' into feature/global-axes Resolved Conflicts: * src/main/java/org/openpnp/machine/reference/ReferenceMachine.java commit ef152b6 Author: markmaker <mark@makr.zone> Finish without trying to implement advanced motion planning. Cleanup and better comments. commit 2e1a0ee Author: markmaker <mark@makr.zone> Backup before reworking path solving/half sided profiles. commit fb92b4d Author: markmaker <mark@makr.zone> Before reworking path solver. commit 9443afb Merge: 9aed71f 5280aa8 Author: markmaker <mark@makr.zone> Merge branch 'develop' into feature/global-axes Conflicts resolved: * src/main/java/org/openpnp/machine/reference/ReferenceMachine.java * src/main/java/org/openpnp/machine/reference/ReferenceNozzleTipCalibration.java * src/main/java/org/openpnp/machine/reference/driver/GcodeDriver.java commit 9aed71f Author: markmaker <mark@makr.zone> Tests augmented. commit 777ed4a Author: markmaker <mark@makr.zone> New region solver. commit 2511dcf Author: markmaker <mark@makr.zone> Backup commit commit 273474c Author: markmaker <mark@makr.zone> Solver seems to work now. commit 4cd7f6d Author: markmaker <mark@makr.zone> Changed profile solver to rudimentary secant method. commit aaa832f Author: markmaker <mark@makr.zone> Backup commit commit 512ce63 Author: markmaker <mark@makr.zone> Removed tnc solver. Almost completed profile solver cases. commit 15996c6 Author: markmaker <mark@makr.zone> Backup commit before solver remove. commit 019436b Author: markmaker <mark@makr.zone> Backup commit commit 46a3be1 Author: markmaker <mark@makr.zone> Added motion solver test. Does not work (yet). commit b8a5780 Author: markmaker <mark@makr.zone> Backup commit. commit 4a5f01f Author: markmaker <mark@makr.zone> Backup commit. commit 5de4b1c Author: markmaker <mark@makr.zone> More cosmetics commit 557c005 Author: markmaker <mark@makr.zone> Better description and simpler formula. Getting the hang of this. commit 4b8f935 Author: markmaker <mark@makr.zone> Added solver. commit e3a14a2 Author: markmaker <mark@makr.zone> Reworked: no MappedAxes. Axis limits. Rotation wrap-around. commit f8301ba Author: markmaker <mark@makr.zone> MotionPlanner first implementation. Before MappedAxes refactoring. commit 71c672d Author: markmaker <mark@makr.zone> Fix the camera view rotation jog to work with and respect mapped axes. commit 0dbdf0b Author: markmaker <mark@makr.zone> Refined the NullMotionPlanner and various stuff. commit 2234e45 Author: markmaker <mark@makr.zone> Sub-pixel rendering etc. commit 7e98c23 Author: markmaker <mark@makr.zone> SimulationModeMachine can now check pick and place Locations by inspecting the ImageCamera view at the location. commit ba10f8c Author: markmaker <mark@makr.zone> Factored OpenCvUtils.createFootprintTemplate() out for use outside of stages. commit 02bcfa5 Author: markmaker <mark@makr.zone> Backup commit. commit 3d2409a Author: markmaker <mark@makr.zone> Restrict image transfer to the area of the source image, to fix some wrapping-around when going beyond the image margin. commit 0be6a0e Merge: 4b389c7 b4310b6 Author: markmaker <mark@makr.zone> Merge branch 'develop' into feature/global-axes commit 4b389c7 Author: markmaker <mark@makr.zone> Tested using NullDriver. * Added simulated Homing Error corrected by Visual Homing * Added simulated non-squareness corrected by Linear Axis Non-Squareness Transformation * Added simulated vibration to test Camera Settle * Added simulated camera noise to test Camera Settle * Added simulated nozzle runout to test Runout Compensation No Unit yet. commit c08725c Author: markmaker <mark@makr.zone> Testing: First steps towards "simulated imperfection". commit 3e72d57 Author: markmaker <mark@makr.zone> Made tests run with AxesLocation. commit 4dd295d Merge: 19f2505 b8548f9 Author: markmaker <mark@makr.zone> Merge branch 'develop' into feature/global-axes commit 19f2505 Author: markmaker <mark@makr.zone> Created new AxesLocation for Controller side. Reworked all Transformations. commit 80117eb Author: markmaker <mark@makr.zone> Cosmetics. commit b36f6e9 Author: markmaker <mark@makr.zone> Resolved openpnp#998 merging issues. commit 0139331 Merge: 8b266b2 19e2925 Author: markmaker <mark@makr.zone> Merge branch 'develop' into feature/global-axes # Conflicts resolved: * src/main/java/org/openpnp/machine/marek/MarekNozzle.java * src/main/java/org/openpnp/machine/neoden4/NeoDen4Driver.java * src/main/java/org/openpnp/machine/reference/ReferenceActuator.java * src/main/java/org/openpnp/machine/reference/ReferenceCamera.java * src/main/java/org/openpnp/machine/reference/ReferenceDriver.java * src/main/java/org/openpnp/machine/reference/ReferenceHead.java * src/main/java/org/openpnp/machine/reference/ReferenceNozzle.java * src/main/java/org/openpnp/machine/reference/driver/GcodeDriver.java * src/main/java/org/openpnp/machine/reference/driver/NullDriver.java * src/main/java/org/openpnp/spi/Movable.java * src/main/java/org/openpnp/spi/base/AbstractActuator.java * src/main/java/org/openpnp/spi/base/AbstractCamera.java * src/test/java/BasicJobTest.java * src/test/java/VisionUtilsTest.java * src/test/java/org/openpnp/machine/reference/driver/test/TestDriver.java commit 8b266b2 Author: markmaker <mark@makr.zone> Testing and refining migration with examples. commit 1dc16ec Author: markmaker <mark@makr.zone> First time tests run successful. GcodeDriver still partially running on its own (redundant) Axis mapping. commit b12c661 Author: markmaker <mark@makr.zone> Axes and Transformations' Wizards implemented. Reorganized into own axis package. Wrestle with WindowBuilder. commit daa9eee Author: markmaker <mark@makr.zone> Add commit ce3f543 Author: markmaker <mark@makr.zone> Work in progress, backup commit. commit 53e7875 Author: markmaker <mark@makr.zone> Machine Setup Panel Tabs per class restoring and out of bounds bugfix. commit e61af78 Author: markmaker <mark@makr.zone> Reworked Drivers to flat list. commit 51ea613 Author: markmaker <mark@makr.zone> First implementation round. GCodeDriver Axis management is still redundantly in there. Conflicts resolved: * src/main/java/org/openpnp/machine/reference/ReferenceHead.java * src/main/java/org/openpnp/machine/reference/axis/ReferenceControllerAxis.java * src/main/java/org/openpnp/machine/reference/axis/ReferenceMappedAxis.java * src/main/java/org/openpnp/machine/reference/axis/wizards/ReferenceControllerAxisConfigurationWizard.java * src/main/java/org/openpnp/machine/reference/driver/AbstractMotionPlanner.java * src/main/java/org/openpnp/machine/reference/driver/GcodeDriver.java * src/main/java/org/openpnp/model/AxesLocation.java * src/main/java/org/openpnp/model/Motion.java * src/main/java/org/openpnp/spi/ControllerAxis.java * src/main/java/org/openpnp/spi/base/AbstractControllerAxis.java * Initial user group machine testing bugfixes. Thank you Duncan, Bill, Marmalade, Mike! Removed obsolete openpnp\src\main\java\org\openpnp\machine\reference\driver\wizards\AbstractTcpDriverConfigurationWizard.java * Cosmetics. (cherry picked from commit d46cfb3) Fix/Global Axes Enhancements and Bug-Fixes 2 (openpnp#1042) * Integrated GcodeServer into SimulationMode. * Added MotionControlType to Driver. Implemented simplified S-Curves as in TinyG and Marlin. Bugfixes. * Tests with Null Machine. New reset button for default GcodeDriver commands. Bug-fixes. (cherry picked from commit c144c75) Feature/Better Backlash Compensation (openpnp#1047) * Removed backlash compensation from GcodeDriver and added it to the Motion Planner. * A new BacklashCompensationMethod can now be selected on the axis. * Added optimized one-sided backlash compensation that only adds an extra move, if on the wrong side. * Added directional backlash compensation that works without extra moves. (cherry picked from commit 58a54a7) Feature/Advanced Motion Control (openpnp#1061) * Make Directional Backlash Compensation one sided too for better compatibility. * Asynchronous GcodeDriver first steps. * * Implemented GcodeAsyncDriver. * Fixed some Backlash Compensation bugs for the new Directional method. * Hide deprecated Gcode commands in the Combobox, if they are not set to a value already. * * Adding the GcodeAsyncDriver class to the Machine so it can be instantiated. * Some bug-fixes. * Bugfixes, testing with controller. * First trials with interpolation. * Fixed Logger thread safety. * * New GcodeAsyncDriverSettings Wizard. * Interpolation settings moved to the GcodeAsyncDriver where they belong, getters return defaults in GcodeDriver. * timeoutMilliseconds is stretched to the inverse of the Machine Speed where it matters. So tests with very small speed factors won't timeout. * Added ModeratedConstantAcceleration motion control type. * Bug-fixes from testing with controller/stepper attached. * * MotionPlanner class can now be selected in the Machine Wizard. * ReferenceAdvancedMotionPlannerConfigurationWizard added, exposing the MotionPlanner as a Wizard page of the machine. * Refactored actuator sub-class Wizards to use base class AbstractActuatorConfigurationWizard for common stuff (in preparation to add more common stuff). * extracted public method to allow (re-) selection of current object in the Machine Setup Tree, therefore allow loading Wizards with changing set of tabs. * moved getMotionPlanner() to Machine interface. * * Actuator, machine & motion coordination * * CameraView Zoom increment clipped to >= 1.0 if best scale quality is selected * * Remodeled ReferenceDriver interface into spi Driver interface and class hierarchy similar to other machine objects. * Made interpolation a task of the MotionPlanner, drivers now only execute single moveTo commands. * * Backlash compensation more robust when settings change during session * First steps towards advanced motion planner * Support profiles with fused reversing ramps i.e. acceleration != 0 in mid segment * Test case reworked * * Path solver progress. * * Refactored overshoot control * * Good working order. * * Refactored AbstractMotionPath out of MotionProfile to separate path solving from profile solving. * Simplified "PnP class" path solver heuristics completed. * * Controller axes get Safe Zone * * Implemented Axis centric Safe (Z) Zone * Migrate Safe Z. * BasicJobTest with proper working Z below Safe Z * ReferenceAdvancedMotionPlanner performs uncoordinated moves in Safe Zone * * Machine testing. * * First steps towards better interpolation. * * Reverted Momentaries. * New interpolation method. * * More testing. * * Diagnostic Graphics * Bugfixing * * Finished graphical diagnostics. * Better uncoordinated motion synchronization, tries to approximate coordinated. * Bugfixing. * * Interpolation intervals snap to the special points in time (extremes in the profile). * Testing on machine. * * Proper diagnostics for all MotionControlType variants. * Added Test Motion. * Time measurements in diagnostics. * Interpolation failure status. * * C axis in Test motionGraph * Retiming optionFlags * Fine tuning. * More tests on Smoothie. * * extensive testing on machine * * Extensive code review, last fixes and final touches. * Redesigned ugly axis limit icons. * * Solved position reporting dilemma. * Made "infinite" timeouts into 5 minutes to (eventually) resolve hard-to-diagnose hangs. * Added after actuate machine coordination back, needed for contact probing. * Added Safe Z handling for virtual axes (takes home coordinate). (cherry picked from commit 52f2756) * Conflicts resolved: * src/main/java/org/openpnp/machine/reference/driver/GcodeDriver.java Merge pull request openpnp#1065 from markmaker/feature/advanced-motion-control--update Feature/Advanced Motion Control - Various Improvments Merging this myself, in the testing branch regime. (cherry picked from commit b5a53eb) Merge pull request openpnp#1066 from markmaker/feature/advanced-motion-control--update-2 Feature/Advanced Motion Control - Update 2 (cherry picked from commit 75bda17) Merge pull request openpnp#1071 from markmaker/feature/advanced-motion-control--3 Feature / Advanced Motion Control - Update 3 (cherry picked from commit 4a96553) Merge pull request openpnp#1072 from markmaker/feature/advanced-motion-control--4 Feature/Advanced Motion Control - Update 4 (cherry picked from commit dfba626) Merge pull request openpnp#1073 from markmaker/feature/advanced-motion-control--5 Feature / Advanced Motion Control - Update 5 (cherry picked from commit 56eae4d) Merge pull request openpnp#1074 from markmaker/feature/advanced-motion-control--6 Feature / Advanced Motion Control - Update 6 (cherry picked from commit e5b521c) Merge pull request openpnp#1082 from markmaker/feature/advanced-motion-control--7 Feature / Advanced Motion Control - Update 7 (cherry picked from commit e12b91a) * Better TinyG SET_GLOBAL_OFFSETS_COMMAND suggestion. (cherry picked from commit 2bcaff3151ba7d8516c16551d5a74202d57c9c74) * Cherry Pick artifact?
…pnp#1035) * First implementation round. GCodeDriver Axis management is still redundantly in there. * Reworked Drivers to flat list. * Machine Setup Panel Tabs per class restoring and out of bounds bugfix. * Work in progress, backup commit. * Add * Axes and Transformations' Wizards implemented. Reorganized into own axis package. Wrestle with WindowBuilder. * First time tests run successful. GcodeDriver still partially running on its own (redundant) Axis mapping. * Testing and refining migration with examples. * Resolved openpnp#998 merging issues. * Cosmetics. * Created new AxesLocation for Controller side. Reworked all Transformations. * Made tests run with AxesLocation. * Testing: First steps towards "simulated imperfection". * Tested using NullDriver. * Added simulated Homing Error corrected by Visual Homing * Added simulated non-squareness corrected by Linear Axis Non-Squareness Transformation * Added simulated vibration to test Camera Settle * Added simulated camera noise to test Camera Settle * Added simulated nozzle runout to test Runout Compensation No Unit yet. * Restrict image transfer to the area of the source image, to fix some wrapping-around when going beyond the image margin. * Backup commit. * Factored OpenCvUtils.createFootprintTemplate() out for use outside of stages. * SimulationModeMachine can now check pick and place Locations by inspecting the ImageCamera view at the location. * Sub-pixel rendering etc. * Refined the NullMotionPlanner and various stuff. * Fix the camera view rotation jog to work with and respect mapped axes. * MotionPlanner first implementation. Before MappedAxes refactoring. * Reworked: no MappedAxes. Axis limits. Rotation wrap-around. * Added solver. * Better description and simpler formula. Getting the hang of this. * More cosmetics * Backup commit. * Backup commit. * Added motion solver test. Does not work (yet). * Backup commit * Backup commit before solver remove. * Removed tnc solver. Almost completed profile solver cases. * Backup commit * Changed profile solver to rudimentary secant method. * Solver seems to work now. * Backup commit * New region solver. * Tests augmented. * Before reworking path solver. * Backup before reworking path solving/half sided profiles. * Finish without trying to implement advanced motion planning. Cleanup and better comments. * Better comments. * Removed unnecessary (whitespace) changes etc. Better comments. * Self code review bugfixes. * Constant acceleration profiles. Optionally test an imperfect machine in the SampleJobTest. * Simplify Motion and MotionOption. Implement analytical constant acceleration profile solving for symmetric cases. Lots of cosmetics. * Testing on the machine with GcodeDriver: refinements and bugfixes. * Test bugfix. (cherry picked from commit f6713b6)
* develop: Added possibility to disable ContactProbeNozzle actuator temporarily. To (#1026) ReferenceDragFeeder works with 0402 parts with vision enabled and dis… (#1088) a feeder in feeder's list is grayed out if no active placement uses it. (#1068) Closes #1005: Replace actuator text field with combobox (#1080) Feature / Global Axes and Framework for Enhanced Motion Control (#1035) Fix for issue 755 "ReferenceStripFeeder Breaks When Part Pitch > Hole to Hole Distance" (#1083) Improved loop syntax, fixed code to update the part info whenever the combo box is changed. (#1077) MjpgCaptureCamera was missing image transform support. Added the missing code so the image trasnform settings now work correctly. (#1078) set list length of combo boxes to 20 items. (#1069) Implemented part count display on the ReferenceStripFeederConfigurationWizard (#1076) Mjpg camera feature (#1075) # Conflicts: # src/main/java/org/openpnp/machine/reference/ReferenceMachine.java
Description
This PR represents an extensive rework of "all things motion" in OpenPnP. It exposes axes globally in the Machine Model and provides easy and universal setup in the GUI rather the
machine.xml
as before. It lays the groundwork for many possible Motion Control extensions.Some highlights:
SampleJobTest.imperfectMachine
is enabled).machine.xml
should be automatically migrated for all users of OpenPnP 2.0. A few minor exceptions have been discussed and dismissed in the group.Credit: Most images shown here are from the automatically migrated machine definition by Bill. Thanks, Bill!
Justification
The justification has been discussed and confirmed in the group.
https://groups.google.com/g/openpnp/c/bEVZvYoXO98/m/hl14FcspBwAJ
Instructions for Use
Full instructions for new users (Wiki) will take much additional time. I would like to call for some help with that, perhaps in the group.
For existing users with
machine.xml
experience, this should be mostly easy. After some fun with simulation, there is a rudimentary after-migration guide further down.Simulation Test
For those who just want to have a look, please use the "Imperfect machine" simulation.
machine.zip
Have a look around. Play with the Simulation settings.
Why not try ridiculous vibrations and then test Camera Settling... :-)
Load and run the
pnp-test.job.xml
as described here.Real World Test - General Note of Caution!
The motion control rework and the auto-migration has been very carefully crafted and thoroughly tested, as far as possible on my rather simple single nozzle machine. But I cannot give any guarantees whatsoever! Please be very careful when testing this on the real machine. Keep your hand on the Emergency Button. Baby steps first.
Make sure you have switched off auto-homing on the Machine, so you can enable the machine and then try some small Jogs first:
Note, the migration should create a workable machine. But in order to use some of the new features, we need to tweak some things.
Remember: When you fiddle with the Machine Setup: Always Backup, Backup, Backup!
Try get rid of Pre-Move Commands
The controller should be driven in true multi Axis mode i.e. so that all Axes can be driven directly and in any combination. If you have a Smoothieware Controller, you certainly don't need Pre-Move Commands anymore. Configure the controller for multi-axes setup.
Then switch them off in the driver:
You then need to change your
MOVE_TO_COMMAND
s as shown below.Axis Letters and Variables
Each Axis has a letter designator as used in G-code. You can now specify the proper Letter on the Axis:
Warning: The migration takes a simple guess, but if you want to use this feature, please check each axis carefully!
New universal MOVE_TO_COMMAND
Now you need to rework your
MOVE_TO_COMMAND
and use the Axis Letters instead of the generic Axis Type names (X
,Y
,Z
,Rotation
). Most users will at least have to replaceRotation
with the proper Axis Letter. While we're at it, we can insert the proper G-code to set acceleration (and possibly jerk) limits on the move command:The command must now include all your controller axes, so if you have multiple Z and/or C axes, you need to list them all with their controller letters in the Default
MOVE_TO_COMMAND
. In that case you almost certainly have otherMOVE_TO_COMMAND
on individual HeadMountables with different axes mapped trough slightly different G-code. Remember how complicated this was? Get rid of those!Congratulations! You now have one simple and universal MOVE_TO_COMMAND per driver. That's not just easier, it is also a preparation for the future! OpenPnP is now able to move all the axes at once. The MotionPlanner is not there yet, but it could pre-rotate all the nozzles at once, using the travel time to bottom vision.
New SET_GLOBAL_OFFSETS_COMMAND
After Visual Homing, OpenPnP must set the physical axis position to new global offsets. This was formerly done with the
POST_VISION_HOME_COMMAND
(this command is still working in "legacy mode" as long as noSET_GLOBAL_OFFSETS_COMMAND
is defined).The same comand should now also be used wrapping around a rotary axis. Therefore a new universal SET_GLOBAL_OFFSETS_COMMAND is introduced, that gives OpenPnP the ability to reset any axis to new coordinates.
You can move the old command over to
SET_GLOBAL_OFFSETS_COMMAND
. Then again list all the axes of your controller and use the proper controller Axis Letters as variables:You can now the delete the old
POST_VISION_HOME_COMMAND
:Switch on Letter Variables Mode
GcodeDriver can now be switched into Letter Variables mode:
Enable Rotary Axis Wrap-Around
Because we have the
SET_GLOBAL_OFFSETS_COMMAND
defined, we can switch rotary axis Wrap-Around on:Once the wrap around occurs, OpenPnP will rest the controller to the wrapped coordinate. this works similar to a Modulo operation.
Try rotating all in the same direction until it wraps around. Look at the DRO.
Tune your Axes
Now that each Axis has its own set of feed-rate, acceleration and optionally jerk limit, you can tune those from the migration guesstimate. The rotary axes will certainly need revisiting. Formerly, they were driven with the same feed-rate limits as the linear axes, i.e. degrees were handled the same as millimeters. But 180mm is quite a long move, whereas a turn of 180° should be certainly faster.
Delete the Feed-Rate Limit on the Driver
For 3D-printers, router mills, laser cutters etc. it is important that they move at the same speed, regardless whether a move is parallel to an axis such as X, Y or in a diagonal. The extrusion, the milling, the laser cutting needs to be done at the same speed to be consistent. Therefore the feed-rate limit of a CNC machine is measured along the so-called tool-path. If the tool-path is a diagonal, the X and Y axes will move slower to accomodate that. For a 45° diagonal an axis moves at 1/√2 or about 71% of the nomal speed.
For PnP we don't need consistent speeds. We want the maximum speed available from the axes. If you delete the GcodeDriver's limit, the MotionPlanner will compensate that for you:
For diagonal moves your PnP machine will now be up to √2 or ~141% faster than before!
... unless you knew how to trick OpenPnP before.
Slow Motion ... or if you tricked OpenPnP before
The way the Speed [%] work has changed. The MotionPlanner will now also shape the acceleration (and perhaps even jerk) limit. The resulting motion will act as if in slow motion, it will be smoother and take longer as before. This might mean you can now increase the speed factors a bit with no harm. One example is the nozzle tip Tool Changer, where I observe much smoother operation now:
... or if you tricked OpenPnP before...
The trick was to set the feedrate to some very high number in the GcodeDriver, so it became ineffective and the axis limits set in your controller config would apply instead. The problem: your Speed [%] didn't really work then i.e. you needed to set ridiculously small percentages for effect. If you did this (I did), you certainly need to revise your nozzle tip Tool Changer and similar settings.
Implementation Details
org.openpnp.spi
ororg.openpnp.model
packages, roughly discussed in the group thread.mvn test
before submitting the Pull Request, including the "Imperfect Machine" unit test option.You can enable the "Imperfect Machine" unit test option, by setting
SampleJobTest.imperfectMachine
totrue
. The test then takes about 2 min. on my machine. If this is acceptable, it could be permanently enabled.