-
Notifications
You must be signed in to change notification settings - Fork 106
remove z_travel from tecan resources #553
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
Conversation
i'm afraid the previous implementation was even wrong since the travel height only considered the specific resource in question but not the other resources around in the future we can write a nice and optimal algorithm that computes the minimum height required for the marginal speed benefit, hopefully on the LH level, but for now just increase it to a safe height that should work everywhere. |
updated the evo backend with f4705de note that the tests don't pass because this call changed:
to this
i'll need someone to test this on an EVO before merging to make sure it doesn't break anything. It seems to me it wouldn't because the z travel height is not important right before MDT ("Move Tip, Detect Liquid, Submerge", |
This PR will be very helpful. I have crashed my arm multiple times now since the z_travel is set for the destination resource and not anything in the way. I tried running the unittest for the tecan backend but I am not very experienced with this. Do I need to have the resources listed or should I change them to match my set up? I also removed the RoMa arm since it was getting in the way and not needed at the moment. I get this error when running the test.
|
The unit tests are actually completely independent of hardware (in fact, they even run in github ci!) the problem is we hardcode the firmware commands that we expect to see, and then see if the calls generate them. the thought is that if we generate and send the same firmware commands, the machines will do the same thing. PLR's responsibility ends at generating and sending these commands, so testing here makes sure we do what we need to do. The reason I raised it here is I never change the tests without verifying on a physical machine. And since I currently don't have an EVO, I was blocked on that for this PR. But now that you have tested (thank you!) I will update the tests to reflect this new behavior and merge it. |
Ok. I tested the changes to z_travel and found that it traveled lower than before. It still uses the resource z size to determine the travel height.
I changed it to just use the _z_traversal_height
That seemed to force the machine to traverse at the highest z. Do we need to change the "travel" height every time we perform an action? I think it is stored in the machine until we change it |
I don't understand how this works since Can you please verify the exact code that works? Ideally, could you create a PR into this branch https://github.com/PyLabRobot/pylabrobot/tree/remove-tecan-z-travel with your changes that work? Then I can merge this into main.
You are right, we do not have to send the command (SHZ) every time. In a future update, we can cache the location in the But the current issue is computing this location correctly and verifying it works. Caching should definitely not change that! Caching would just mean less commands to send but keep the behavior the same. The current behavior is wrong so we need to fix it first. |
Ahh. Sorry I copied it wrong. I will create a PR with my working code. It should be this:
|
thanks. so not dependent on tip height? |
Is z_travel the height from the deck? In the function get_z_position(), the z_range (which is 2100) - z (in this case z_travel) + z_off*10 + tip_length.
Why is z_travel subtracted from z_range? If we set z_travel to 2100 then the height becomes 0 + the resource and tip_length. Can you help me understand the values? I pulled these parameters from a tecan 96 well plate.
Why is z_travel less than the variables? Are they an offset? In the function get_z_position() they subtract from the range. Side note: In the future, will you be using z_travel to set the traverse height or manually move the arm to a specified height and then traverse? |
Those are all good questions, and I should have asked the person who wrote this backend about this in more detail when he contributed it. It is very possible these values/logic are actually incorrect, so we should just be reasoning from first principles, and what works in your setup.
with this change (that you posted here), that should no longer be the case right? to me it makes sense to "hardcode" (as an attribute of the backend) the traversal height and always use this value. As you point out, they seem to be treated as offsets but are almost certainly not offsets when you look at their values. let's fix that. The only thing that could be different is if it depends on tip height.
Possibly not parsed correctly from the resource definition? Either way, we don't care because this PR removes that attribute.
See this: https://www.tecan.com/knowledge-portal/how-to-teach-the-z-values-in-freedom-evoware for explanation We should get rid of those parameters in favor of general use parameters as explained in #552. On Hamiltons and OT, these parameters don't exist. First principles say we shouldn't need them. |
Thanks so much for the detailed response. I will work on simplifying the coordinates and getting rid of tecan specific parameters. With this PR, the arm now retracts to full height before traversing. I am working on removing the other tecan specific parameters in another branch. To stay consistent, the code should force "travel" to be an integer. Doesnt seem to affect the execution though.
|
Great! Happy to help with this.
Since it should be in PLR units (mm, uL, s, mg, etc.), I think it should be float. The firmware accepts parameters in 0.1mm level, so we should just round and send when converting to firmware commands. |
thanks @nedru004 for your help with this! |
see #552 for background