VSpin Troubleshooting

Hello, everyone!

I am back at it again with another FTDI-related question, but this time with the Aligent VSpin centrifuge that I recently got and trying to integrate it.

So I followed the guide and installation process, verified that VSpin FTDI is there, built the script, and tried running it, but ran into an error that I am not sure how else to troubleshoot it. After some troubleshooting, something happened that I can’t fully explain, but it seems like the calibration was set wrong…?

I say this because the first error I ran into was this, even though my script had `set_bucket_1_position_to_current` method after setup:

UserWarning: No calibration found for VSpin with device id BG028CTI. Please set the bucket 1 position using `set_bucket_1_position_to_current` method after setup.
  warnings.warn(

This is my Python script to configure the VSpin:

import pylibftdi
print(pylibftdi.Driver().list_devices())

import asyncio
from pylabrobot.centrifuge import Centrifuge, VSpinBackend

async def run_vspin():

    cf = Centrifuge(name = "centrifuge", backend = VSpinBackend(device_id="BG028CTI"), size_x= 1, size_y=1, size_z=1)
    print("Will set up")
    await cf.setup()
    print("vspin was set up")

    await cf.open_door()

    input("Press Enter to continue...")

    await cf.backend.set_bucket_1_position_to_current()

    await cf.close_door()

if __name__ == "__main__":
    asyncio.run(run_vspin())

Halfway through modifying my script, I accidentally ran it, and something happened that I don’t recall, or saved it :melting_face: But when I ran the script to try again, it froze at the setup function, not finishing the setup at all. So I switched PLR to a different branch on my computer to start “fresh”, but ran into this error, which I am inclined to believe that whatever error I ran previously is propagated here, and that I would need to “reset” that calibration if I understand properly…?

    cf = Centrifuge(name = "centrifuge", backend = VSpinBackend(device_id="BG028CTI"), size_x= 1, size_y=1, size_z=1)
                                                   ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
TypeError: VSpinBackend.__init__() missing 1 required positional argument: 'calibration_offset'

Yes, I know this is a hot mess, and you may put me on the wall of shame :woman_standing:

this is a mess of my own making, I just removed this parameter a couple of days ago when working on a calibration issue with the vspin Vspin calibration by rickwierenga · Pull Request #731 · PyLabRobot/pylabrobot · GitHub. you can read the PR description for background on the problem + fix.

you are probably following the updated docs, based on your code:

what happened is you switched to another branch that does not have these changes yet (maybe the bioshake branch?). on that branch the calibration_offset is still required on init. that version also does not work correctly, the bucket 1 position will get lost over time. I fixed this, but the code you’re running there is still the old broken version. that is simply the problem. switching to the main branch (or merging the main branch into an older branch) will fix it.

also, heads up, I am working on some more changes today (some phispin improvements by rickwierenga · Pull Request #525 · PyLabRobot/pylabrobot · GitHub) to fix the acceleration parameter, which is currently not implemented correctly… this will not change the user-facing API, but it does change (fix) how the machine functions. I hope to merge this today or tomorrow, and will respond in this thread when done.

1 Like

Yes, I am following the updated docs that you provided. As for the difference in the branch, originally, I was testing on my BioShake branch, which I can confirm has the updated version of the main branch according to PR#731. The other branch I was testing, Cap Hood, was not updated, as I thought I had updated it before using it, but I did it wrong.

Anyway, I did update that branch and tested the script, but I am still running into the second problem where the setup function freezes in my terminal. I want to confirm how long the setup function takes, cause I’m running it on my terminal, and so far it’s been three minutes, and the second print statement has yet to appear to show that the setup function was done.

python3 vspin_test.py 
[('FTDI', 'FT232R USB UART', 'BG028CTI')]
Will set up

:cricket:

:eyes:

you should hear the air popping sounds pretty much instantly, and setup should finish within 1 minute. there might be another problem. we don’t have any docs for the vspin, so it’s all “figured out” from the bytes. it is reasonable to expect there to be some differences across vspins that we have never seen before and therefore not been able to write it into PLR yet.