At the time when I started working on the phase detection signal generation, I used an AD9833 for generating a sine wave that drives the piezo and an LM393 Schmitt trigger circuit that converts it to a square wave, which drives the strobe LED that makes the droplet formation visible to the naked eye.
Unfortunately, this setup was not suitable for generating the phase detection signal, so I had to find another solution.
Commercial CIJ printers use FPGAs for their signal processing and generation, so I started by buying a beginner FPGA board - the BASYS 3.
After trying out some tutorials and examples, I quickly realized that using an FPGA is not the best choice for a "low-cost, easy-to-build" open-source project, because of its cost and complexity.
So, another solution was needed.
After the FPGA, I tried out multiple other microcontroller boards until I tried out the ESP32, which was able to generate pulse sequences like the phase detection signal with its RMT feature.
Unfortunately, I couldn't start different output channels at the same time with it. Even if there seems to be a synchronization manager feature for RMT, I couldn't find out how to get it working.
While searching on the web for infos about the ESP32's RMT feature, I read about the Raspberry Pi Pico's PIO (Programmable IO) feature, which turned out to be a better solution for signal generation than the ESP32's RMT feature.
The PIO feature of the Pico is intended to be used for coding your own communication interfaces to add functionalities to the Pi that it doesn't have out of the box.
The Pico features 8 so-called "state machines" with each of them being able to perform simple operations independently from the main CPU and other state machines.
They run a custom instruction set (no C++ or micropython) of which each instruction takes one clock cycle to be performed, which makes them ideal for time-critical tasks like communication or signal generation for this printer project.
They also can be synchronized, so that all signals needed for the printer's operation can have the same clock source and starting time.
With the PIO feature, I generated the following 4 signals:
- Piezo Drive Signal 50kHz 20us
- Strobe LED Signal 50kHz 20us
- Phase Detection Signal 1.47kHz 680us
- Oscilloscope Trigger Signal 1.47kHz 680us
Because the output of the Raspberry Pi Pico is a digital signal with either around 0V or around 3.3V it was needed to filter the piezo drive signal with an RC filter to get a "close-to-sine-wave-shaped" signal.
At the current state of the project, the piezo signal gets fed into a 24V 100W audio amplifier, which amplifies it and sends it to the piezo ring at the nozzle.
Maybe I will replace the audio amplifier with a dedicated piezo driver, later in the project to get a better drive signal. The square-to-sine wave RC filter is also not optimal and could later be replaced by something else.
Something like a circuit where you can feed in a 0V to 3.3V square wave and get a 100+V sine wave out would be perfect...Maybe later...
For the strobe LED I'm currently using a dedicated pin, which isn't really needed, because I could also just use the piezo signal. Both signals are the same when they exit the Raspberry Pi.
However, at the moment the output is not needed for something else and so it's possible to connect the strobe LED directly to the pin without additional wiring.
The phase detection signal is passed to an inverting amplifier circuit that amplifies and inverts it from 0V to 3.3V to around 0V to -12V.
I added the trigger signal because my oscilloscope can not trigger the phase detection signal right - it keeps jumping back and forth.
The trigger signal is just a simple square wave with the same period as the phase detection signal of 680us, which is suitable for triggering the oscilloscope without any jumping.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.