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

Loading nozzle speed and unloading nozzle speed behaves different #584

Closed
lilltroll77 opened this issue Jun 18, 2017 · 10 comments
Closed

Loading nozzle speed and unloading nozzle speed behaves different #584

lilltroll77 opened this issue Jun 18, 2017 · 10 comments

Comments

@lilltroll77
Copy link
Contributor

lilltroll77 commented Jun 18, 2017

I think the speed needs a fix for load unload nozzle under Machine setup.

If
l_n = location for position n
v_n = speed for ???
v_1 is during loading between l_1 -> l_2 ?
but during unloading l_2 -> l_1 gets speed v_2 !?

That need to be shifted to v_1, and so on for v_3...v_4, otherwise loading and unloading behaves different.

Maybe it instead should be 3 or 5 Speed textboxes located between the location boxes, since the speed is between 2 locations.

@vonnieda
Copy link
Member

I like the idea of making it clear that the speed is to be used between specific locations.

@lilltroll77
Copy link
Contributor Author

lilltroll77 commented Jun 29, 2017

@vonnieda
I started to play with the java code.
I'm not new to GUI programming, eclipse or git - but I'm completely new to java and swing.
What about this basic idea (testing different label-positions) - or should I change the Formlayout to a non-grid variant. In such case, any proposals which one you prefer to make the graphics scale correctly.
image
I have also added ToolTipText.

@vonnieda
Copy link
Member

vonnieda commented Jun 29, 2017 via email

@lilltroll77
Copy link
Contributor Author

I suspected that something like WindowBuilder was involved.
I will check that out and try to fix the rest of the code as well.

@lilltroll77
Copy link
Contributor Author

I have working code now, based on WindowBuilder including the speed calculations.
It loads and unloads the nozzle without spitting them out on the table due to incorrect speeds.
image
But I do not have a clue how to make the code backward compatible with the (old) machine.xml

With my current naming it looks like this

<nozzle-tip class="org.openpnp.machine.reference.ReferenceNozzleTip" id="e092921a-2eef-449b-b340-aa3f40d8d791" name="507" allow-incompatible-packages="false">
                        <compatible-package-ids class="java.util.HashSet"/>
                        <changer-start-location units="Millimeters" x="149.4" y="77.3" z="-13.8" rotation="0.0"/>
                        <changer-start-to-mid-speed>0.01</changer-start-to-mid-speed>
                        <changer-mid-location units="Millimeters" x="149.4" y="77.0" z="-17.6" rotation="0.0"/>
                        <changer-mid-to-mid-2-speed>0.025</changer-mid-to-mid-2-speed>
                        <changer-mid-location-2 units="Millimeters" x="149.4" y="25.0" z="-16.5" rotation="0.0"/>
                        <changer-mid-2-to-end-speed>0.04</changer-mid-2-to-end-speed>
                        <changer-end-location units="Millimeters" x="149.4" y="17.0" z="-16.5" rotation="0.0"/>
                        <calibration angle-increment="15.0" enabled="false">
                           <pipeline>
                     

(I haven't read the google naming of variables enough yet.)

But how to handle the old way with 4 speed settings in machine.xml? Can it be controlled with compatibility package settings?

@vonnieda
Copy link
Member

@lilltroll77 First, thank you for running with this and for thinking about the issue of backwards compatibility!

The way I usually handle this kind of thing is to add the new variables, as you've done, and then add a method like this:

@Commit
public void commit() {
    // copy old variables into new and set old ones to null or 0
}

The commit method is called by the configuration serializer after it loads the config. So what will happen is that the first time a user with an old config loads their config with this new code, it will copy the variables into the new spots and zero out the old ones. Finally, I'll add a // TODO to remove the old stuff in 6 months or so.

You can also change the old variables from double to Double (primitive to object) and set them to null. This will remove them entirely from the old config once it's saved.

As for the mapping from old to new, I'll leave that to you to figure out. I think anything reasonable will be fine and we'll just let users know they should check their settings after installing the update.

lilltroll77 added a commit to lilltroll77/openpnp that referenced this issue Jun 30, 2017
"Loading nozzle speed and unloading nozzle speed behaves
different "

Changing from 4 speed settings to 3 speed settings between 4 locations.
@lilltroll77
Copy link
Contributor Author

Ok, I did changed from double to Double and added a check and convert for old variables to new ones.
Now it looks like this. It seems to work when I add old variables to my XML.
lilltroll77@f09c5c2

@vonnieda
Copy link
Member

@lilltroll77 Looks great! Only thing I see missing is failing to null changerStartSpeed, changerMidSpeed and changerStartSpeed2 after copying them into their new home.

@lilltroll77 lilltroll77 mentioned this issue Jul 2, 2017
@lilltroll77
Copy link
Contributor Author

Things went crazy here 2 days ago when I tried to handle git within eclipse and change the repo from openpnp to my fork. All changed files became empty of some reason. I think everything is in sync now on my side. I have made a pull request.

vonnieda added a commit that referenced this issue Jul 3, 2017
* lilltroll77-develop:
  Update CHANGES for the nozzle changer speed update.
  Null old variables
  Revert "Fixing missing set to null of variable changerStartSpeed,"
  Fixing missing set to null of variable changerStartSpeed, changerMidSpeed and changerStartSpeed2 after copying them into their new home.
  A fix for #584 "Loading nozzle speed and unloading nozzle speed behaves different "
@vonnieda
Copy link
Member

vonnieda commented Jul 3, 2017

Fixed in #596

@vonnieda vonnieda closed this as completed Jul 3, 2017
vonnieda added a commit that referenced this issue Jul 21, 2017
* develop: (80 commits)
  Add a default COMMAND_CONFIRM_REGEX to a sub-driver when adding a new sub-driver. This is a fix for a regression that happened when the defaults code was refactored.
  Adds additional information when a fiducial pipeline results in an exception.
  Remove various outdated settings that were scheduled for removal. Fix paste dispenser selection from machine controls. Remove outdated or unused code. Fix up all TODOs so they have meaningful instructions and remove outdated or unneeded ones.
  Removed every instance of // TODO Auto-generated method stub from the source code so it's easier to get a better picture of what TODOs are actually left in the code.
  Removes the unused Outline class and it's references. See https://groups.google.com/forum/#!searchin/openpnp/outline$20class%7Csort:relevance/openpnp/wU7QsvjRRWU/0q1n8IhqBgAJ
  Update CHANGES for the nozzle changer speed update.
  Null old variables
  Update changes for fid pipeline.
  Changes the power on, no home behavior to highlight the home button instead of the power button. The power button highlight was confusing since it might indicate you shoudl push it again.
  Woops, put my code in the wrong part of the try/catch block!
  CameraView now remembers reticles individually, instead of just one for all.
  Minor formatting and spelling fixes.
  Changed units per pixel of defaul sim camera to be smaller so the smallest parts are more visible. Added footprints for all the default packages and added a TQFP32 package. Changed resolution of the sim camera to 1280x1280 to be able to handle larger parts. Added code to catch exceptions when trying to show results from ReferenceBottomVision. Required so that it can be run in tests. Made the two result display strings from ReferenceBottomVision match. Added a basic test suite. Ready for release.
  Revert "Fixing missing set to null of variable changerStartSpeed,"
  Fixing missing set to null of variable changerStartSpeed, changerMidSpeed and changerStartSpeed2 after copying them into their new home.
  A fix for #584 "Loading nozzle speed and unloading nozzle speed behaves different "
  Added error offsets and integrated. Added to wizard as well so they can be changed on the fly.
  SimulatedUpCamera mostly finished, just need to add error offsets. Added new methods to Footprint to get just pads or body shapes. Changed Footprint reticle to use pads shape only. Looked weird once I started added body sizes. Added default body width/height to the R0805 package for testing. Deleted the unused OutlineReticle and PackageReticle.
  For to sort by distance. All good now.
  All finished and tested. Ready to go!
  ...

# Conflicts:
#	src/main/java/org/openpnp/machine/reference/ReferenceGlueDispenseJobProcessor.java
#	src/main/java/org/openpnp/machine/reference/ReferencePnpJobProcessor.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants