I had a longshot idea to revive the galvanometer control of a broken FormLabs Form 1+ resin laser 3D printer. It didn’t work and galvanometer remains broken. Because the printer also had a broken resin tray tilt motor and other smaller problems, I wasn’t trying to get it to print again. What I had in mind was to repurpose the optical core into a laser light show machine.
This was made possible because FormLabs opened up the Form 1/1+ for experimentation after they stopped supporting the hardware. Since they are no longer responsible if anything goes wrong, they freed the hardware for people to mess around with. This consisted of a special build of the PreForm software, which will flash a special (final?) edition of firmware. This firmware is willing to talk to a PC beyond accepting print jobs from PreForm. To make this communication easier, they released a Python library. All of these were posted on a GitHub repository under their “OpenFL” umbrella.
I really appreciate the fact FormLabs did this, exposing an API to control hardware independently of PreForm print jobs make it possible to do things completely outside the realm of printing. One of their examples turn the Z-axis stepper motor into a single-channel MIDI instrument making buzzy electromechanical music. The API also allows control of laser power and galvanometer position, which lead to my idea of turning the printer into a laser light show machine.
But first, I had to get it up and running. The first problem is that, as a seven-year-old Python library, it was written for Python 2 which is now discontinued. To create a backwards compatible Python environment, I used Miniconda to create a Python 2 environment called “openfl”
conda create --name openfl python=2
Following instructions in OpenFL repository I setup and installed Python dependencies. It allowed me to load OpenFL library but I immediately ran into an error.
Python 2.7.18 |Anaconda, Inc.| (default, Apr 23 2020, 17:26:54) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from OpenFL import Printer as P
>>> p = P.Printer()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "OpenFL\Printer.py", line 62, in __init__
self.dev = usb.core.find(idVendor=self.VID, idProduct=self.PID)
File "C:\Users\me\miniconda3\envs\openfl\lib\site-packages\usb\core.py", line 1297, in find
raise NoBackendError('No backend available')
usb.core.NoBackendError: No backend available
>>>
This “No backend available” error came from pyusb library, complaining about a missing dependency outside of Python: we need a compatible USB driver installed. Solving this error required the following chain of events:
- Read up on PyUSB at https://pyusb.github.io/pyusb/
- Which point me to LibUSB at https://libusb.info/
- Which pointed me to its Wiki for running on Windows at https://github.com/libusb/libusb/wiki/Windows#How_to_use_libusb_on_Windows
- Which recommended the Zadig utility at https://zadig.akeo.ie/
Zadig offered several options for USB drivers, I tried them in the order recommended by LibUSB.
- WinUSB (v6.1.7600.16385): nope, still got “No backend available” error
- libusb-win32 (v1.2.6.0): looks good!
Python 2.7.18 |Anaconda, Inc.| (default, Apr 23 2020, 17:26:54) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from OpenFL import Printer as P
>>> p = P.Printer()
>>> p.state()
<State.MACHINE_READY_TO_PRINT: 3>
>>>
I’m in! Now to poke around and see what I can do with the laser.
Hi , I have a Form 1 and want to use python and openfl and get it installed . I am impressed what You have done in documented the Form1 . Can I contact regarding some guidelines how you get the USB to work running Python 2.7
Best Regards
Lars Herrnsdorf
Vänersborg, Sweden
LikeLike
I’ve documented everything I learned on this site. If it’s not here, I probably don’t have an answer for you. But please feel free to ask away.
LikeLike
Hi Roger
I have been successful to follow the instructions in OpenFL repository but
I got the same problem to find the “usb.core rhat was missing initially as described In your earlier post:
You write:
This “No backend available” error came from pyusb library, complaining about a missing dependency outside of Python: we need a compatible USB driver installed. Solving this error required the following chain of events:
Read up on PyUSB at https://pyusb.github.io/pyusb/
Which point me to LibUSB at https://libusb.info/
Which pointed me to its Wiki for running on Windows at https://github.com/libusb/libusb/wiki/Windows#How_to_use_libusb_on_Windows
Which recommended the Zadig utility at https://zadig.akeo.ie/
Zadig offered several options for USB drivers, I tried them in the order recommended by LibUSB.
WinUSB (v6.1.7600.16385): nope, still got “No backend available” error
libusb-win32 (v1.2.6.0): looks good!
”
So I ask You if you can help me to describe little more in detail how you fix to use Zadiq and get the an usb driver installed (how did you do that ) so it was recognized by the OpenFl module . How did you fix that the correct driver now recognized so the
“ImportError: No module named usb.core” was not anymore valid
Best / Lars
LikeLike
What I did was:
1) Download and start Zadig utility
2) Use device selection menu to choose Form 1+ (USB ID match values in core.py)
3) Use driver selection menu to choose libusb-win32
4) Click install driver button
5) After completion, reboot computer to ensure new driver is active. (May not be necessary.)
Hope this works for you as well.
LikeLike
Hi Roger
Thanks for the reply , Today I was successfully to get the Python environment installed and could start to use different *.py files that exist to control the Form1.
The main problem for me was that I had limited knowledge of the Python 2.7.18 way of install modules since I didn’t initially had the pip working . After I successfully find the correct “get-pip.py” file for the Python 2.7.18 version and set up the path in windows for the Python environment everything start to work much easier to set up the FormFl Modules and the Python dependence for the files/modules that was needed .
I successfully run Z_Jog_052320.Py and A Grid Calibration Tool (AGCT) AGCT.Py.
Do Yo still have the the Form1+ or have you bought something newer like the Elegoo Mars 2 that may have better xy resolution and xy linearity ?
Best Regards Lars
LikeLike
I couldn’t fix the galvanometer control board on my Form 1+ so I postponed resin 3D printing until later. I have not yet tried with a different printer.
LikeLike