I applied for this challenge since I've been using LabVIEW off and on for 20 years. I found out that much has changed in the past few years that I was not aware of.
The 10 Lessons on Element14 were a good refresher, Lesson 10 about using a RPi pico as an instrument being interesting. I've used GPIB instruments in the past, so the protocol is familiar.
I have several NI Daq boards around the lab used for various projects, so I just picked one and here's what I learned.
There are issues with DAQmx and LabVIEW compatibility
NI-DAQmx and LabVIEW Compatibility Table can be found here:
https://www.ni.com/en/support/documentation/compatibility/16/ni-daqmx-and-labview-compatibility.html
>>Using incompatible versions may result in errors, missing LabVIEW palettes or functions, or devices and tasks failing to show up in NI Measurement & Automation Explorer (MAX).
After 2019-2020, NI limited supporting the NIDaqMX assistant subVI.
I'm sure every .vi file I have written in the past 10 years uses the DaqMX assistant, so using a new version of LabVIEW is already a challenge.
I downloaded and installed the 2023 version of LabVIEW without too many problems.
I plugged in a NI USB-6009 DAQ board and it was recognized by the NI Device Monitor.
I opened a new .vi and tried to load the DAQmx assistant, but it would not compile and gave me a coding error.
Instead of reloading an old version of LabVIEW, I searched for an example .vi that doesn't use the DAQ Assistant.
There's a new way to search for example .vi files
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000004B6mSAE&l=en-US
So I connected the Analog input 0 to the 2.5VDC reference pin and ran the Analog Input example to see what it was.
The .vi of the example was exactly what I was going to make for this project!
So instead of a Data Acquisition system project, I will control my new CNC laser air assist blower motor using the Raspberry Pi Pico.
I'm upgrading my Laser engraver to 10W and the laser module came with an air assist port, but no blower.
It took me a while to mount the new laser on the old frame.
I found a nice Ametek BLDC miniJammer blower motor in in a box of stuff, so let's see if I can control it with the RPi pico using LabVIEW.
https://us.rs-online.com/m/d/c660b13dfa6bef51f52fa7e26bfa91be.pdf
I had to take apart the motor to figure out the pinout of the connector - none of the documents online showed a pinout.
There are only 3 pins, so I traced the pins back to power and ground pins on the ICs, and assume the last pin is the 0-4VDC control pin as the spec sheet states.
I made a frame for the blower motor from 1 inch 80/20 strut .
I wired up a 24VDC power supply to test the blower.
First blower motor test using a 10K control potentiometer.
So I will use the Analog out PWM signal from the Rpi pico to control the blower control pin.
The example .vi front panel shows this:
My test LED is working with the PWM signal.
The Scope confirms the PWM signal from the Pico.
Here is a video of the system with LabVIEW controlling the RPi Pico controlling the blower motor
I changed the front panel design for controlling the blower with a dial and reading back with a gage.
Here is the modified block diagram. I have multiplier blocks added so the units are 0~100 percent instead of 0-4095 counts.
Here is a video of the final solution before I mount everything on the Laser engraver.
Home · jancumps/pico_scpi_usbtmc_labtool Wiki · GitHub
I found the wiring pinout for the original laser module online
https://forum.snapmaker.com/t/reverse-engineering-the-module-wiring/3031/8
pin 1: +12V
pin 3: (inverse) Enable, PWM input
pin 5: 130 Ohm resistor to GND as module identification
pin 7: GND
pin 2,4,6,8: N.C.
I needed to invert the PWM signal from the CNC machine to the new laser and limit it to 0-5VDC, so I made a small PCB with a 5V regulator and a 74LS04 invertor IC.
I also needed the 130 ohm to GND resistor to identify the laser module.
The new laser uses a couple amps more than the system power supply is rated for, so I added its own 12V, 10A power supply.
It tested OK on the scope. The PWM signal was inverted and limited to 5VDC
Now to add the blower and test it.
I need a file with some G-Code to fire up the laser and set it at about %1 or 100mW, the default is %78 or 7.8W - way to high for testing!
Here's G-Code for a small shape:
;; G-code for laser engraving
; Generated by Snapmaker Luban
; G-code START <<<
G90
G21
M106 P0 S255
G0 F3000
G1 F140
G0 X-0.17 Y10.73
M3 P3 S7
M3
G1 X-10.75 Y3.04
G1 X-6.71 Y-9.41
G1 X6.38
G1 X10.42 Y3.04
G1 X-0.17 Y10.73
M5
G0 X-0.17 Y0.66
M107 P0
; G-code END <<<
That's certainly a firmware mod I need to investigate. I could use the LabVIEW interface to override the laser PWM settings....maybe later.
Here's a run with the laser operating:
Top Comments