Duet3 PnP Vacuum Sensor or Trigger?
-
I have a large CoreXY machine that I'm trying to configure as a Pick and Place. I'm having trouble understanding the usage for detecting vacuum. The wiki has an example for PnP:
https://docs.duet3d.com/User_manual/Machine_configuration/Configuration_OpenPnP
But when you get down to the end, it says "to be completed"
Here's my situation:
I have two "pickers" with vacuum cups attached to outputs (active output = picker goes pick). Then, I have two vacuum generators with "achieved vacuum" switches on them.
Do I set these "achieved vacuum" switches to sensors or triggers?
I guess what's my config.g look like here?
Here's a pic/diagram:
![alt text]( image url)What do I do here?
; Fan Control M308 S3 Y"mcu-temp" A"MCU" ; configure sensor 3 as on-chip MCU temperature sensor M308 S10 Y"drivers" A"MCU2" ; configure sensor 10 as on-chip driver temperature sensor M950 F2 C"out1" Q30000 ; create fan 2 on pin fan2 and set its frequency M106 P2 H3 T28:40 ; set fan 2 temp range (T:) and Sensor (H) values, at T28 deg C, fan will be at 40% power ; Vacuum Control M950 P3 C"out3" ; create Vacuum Nozzle P3 0 on Pin OUT_3 M950 P3 C"out4" ; create Vacuum Nozzle 1 on Pin OUT_4 ; Vacuum nozzle input 0 on Pin IO_0.in (green/white) ; Vacuum nozzle input 1 on Pin IO_1.in (red/blk) ; Activate Card Grabber ; extend cylinder 0 on Pin OUT_5 ; extend cylinder 1 on Pin OUT_6 ; Cylinder0 retraction detect on pin i02.in ; Cylinder1 retraction detect on pin i01.in ; Led Control ;LED is on OUT_0
Thanks in advance...
-
@chronolite said in Duet3 PnP Vacuum Sensor or Trigger?:
M950 P3 C"out3" ; create Vacuum Nozzle P3 0 on Pin OUT_3
can I trigger so the outX retracts the nozzle as soon as the vaccum is detected?
Then when I turn off the vaccum pump, trigger back down?
or is there a way to make this a sensor?
-
Okay I think I've made some progress.
M950 P2 C"out0" ; should in theory assign p2 to out0?
M42 P2 S1 ; should turn on p2
M42 P2 S0 ; should turn OFF p2HOWEVER, none of these actually turn off out0, kinda. M42 P2 S1 takes out0 from 9v to 24v, and vice versa for S0, but it never really turns off. It is not in my config.g anywhere.
-
@chronolite So, I'm not sure this is the best way to get what you want but I think it'll work...
You can define each vacuum input as a Zprobe and it's easy to get the value from RRF. Like so...
; define Z probe #3 as switch on pin io6.in M558 K3 P8 C"io6.in"
then, from what I can tell in the doc, to get the value into OpenPnp you'll need to write a regex to convert the current reading value from the G31 query command->
; read Z probe value G31 K3
->
G31 K3 Z probe 3: current reading 1000, threshold 500, trigger height 0.700, offsets X0.0 Y0.0 A0.0
Mine returns this with the test above and no connection to the pin. Inverted it reads 0.
This lets you easily substitute analog sensors by changing the probe type I think. -
To add a little more color, OpenPnp wants to control the vacuum stuff automatically as I recall - you just need to program the gcode script (and regexes) in the OpenPnp actuator definitions.
I think you really don't want to control the vacuum via your own triggers because I seem to recall OpenPnp defining delays to let real life catch up to instrumentation.
It's been a while though and I apologize if this is out of date or wrong nowadays.
-
@markz That was the golden nugget
Took me a few days, (a week, fffff) but yeah I'm not using OpenPNP so I have to create this in python directly, and the secret was in using G31. I really appreciate your help.