Vacuum Sensor reading

152 views
Skip to first unread message

Developer Algo

unread,
Nov 26, 2024, 5:16:31 PM11/26/24
to OpenPnP
I have a  SMC ZSE30A-01-C configured as Vacuum Sensors using an Analog Output  connection to Duet3 6XD controller. But i can't seem to get OpenPnP to read the value  when i try to test the vacuum sensing actuator

Duet3 6XD config.g

M308 S1 P"2.io0.in"  Y"linear-analog" A"VG1 Pressure"  F0  B37 C-130

OpenPnP Config:

PSensorSMC1 Actuator for S1 sensor

ACTUATOR_READ_COMMAND : M308 S1

ACTUATOR_READ_REGEX : (?<Value>-?\d+\.\d+).*

Response from M308 S1  command :

Sensor 1 (VG1 Pressure) type Linear analog using pin 2.io0.in, last error ok, reading -0.3, unfiltered, range 37.0 to -130.0

Note: When i try to test the Vacuum sensing actuator by reading it from OpenPnP side   i get an error  " No matching Response" even though i get a response.  I suspect my " ACTUATOR_READ_REGEX is not formatted correctly  for the response. 

Any help ?
                                                          
Vacuum_sensors_reading_1.png
Vacuum_sensing_logs.log
Vacuum_sensors_reading_3.png
Vacuum_sensors_reading_2.png

SM

unread,
Nov 26, 2024, 6:25:00 PM11/26/24
to OpenPnP

I have never really understood the usefulness of vacuum sensors on faster machines, but you could play around on regex101.com, for example.

You could try that: 
reading (?<Value>-?\d*\.?\d*)

But aren't there much shorter answers using the existing reprapfirmware object model?

Wayne Black

unread,
Nov 26, 2024, 6:54:58 PM11/26/24
to ope...@googlegroups.com
On my duet rrf3.5 I used;
M118 P1 S{sensors\u002Eanalog[1]\u002ElastReading} for the read
(?<Value>-?\d+\.\d+).* for the regex
I dont currently use this tho, the sample freq is slow, 200-250ms

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/openpnp/b15ec4c9-9333-4715-b5a9-2ae6308b2bc4n%40googlegroups.com.


--
Wayne Black
Owner
Black Box Embedded, LLC

Developer Algo

unread,
Nov 26, 2024, 7:00:55 PM11/26/24
to OpenPnP
using M308 command seems a little faster 

Wayne Black

unread,
Nov 26, 2024, 7:09:46 PM11/26/24
to ope...@googlegroups.com
The sampling freq has nothing to do with gcode protocol processing or data transfer. The Duet/RRF analog-in algorithm revolves around 3d printing temperature sensing, aka the Heat Task. Its ~4Hz no matter how you call the value. I chatted w D Crocker a bit about this. If you want to sample faster you'll need to leverage the RRF probe function, this is limited to x1 input though.

Developer Algo

unread,
Nov 26, 2024, 7:10:48 PM11/26/24
to OpenPnP
tried   reading (?<Value>-?\d*\.?\d*)
but that didn't work. Regex101.com does match it correctly but OpenPnP says " No Matching reponse " 

Developer Algo

unread,
Nov 26, 2024, 7:14:42 PM11/26/24
to OpenPnP
Hey Wayne,

Ah !!! Ok !!!  The sampling frequency is really low  ~ 4 Hz . As a side question : Is there a way to increase it to acceptable rates ?

Wayne Black

unread,
Nov 26, 2024, 7:16:09 PM11/26/24
to ope...@googlegroups.com
You can see it works for me in regex.
image.png

Developer Algo

unread,
Nov 26, 2024, 7:47:47 PM11/26/24
to OpenPnP
Hey Wayne,

i am able to read it now using your older method 

SM

unread,
Nov 26, 2024, 7:48:12 PM11/26/24
to OpenPnP

Developer Algo

unread,
Nov 26, 2024, 7:54:44 PM11/26/24
to OpenPnP
yep , read that 

Developer Algo

unread,
Nov 26, 2024, 7:57:35 PM11/26/24
to OpenPnP
Wayne,

waiting to get more information  from you if possible on how you solved the Duet3D Sampling frequency problem by using the RRF probing function. I am using RRF 3.6.0 

Wayne Black

unread,
Nov 26, 2024, 8:41:27 PM11/26/24
to ope...@googlegroups.com
I haven't been using vacuum sensing as I could never really get it to work well. I do plan on implementing in the future, but it will not use Duet RRF analog in. It will be binary io, part On, part Off.

Essentially a 2ndary mcu will sample vacuum sensors and set Duet input pin states for part On and part Off. The 2ndary mcu baseline vacuum level will be set by Duet each tip change via the Duets aux serial peripheral. Any increase in vacuum above the hysteresis band measured by the 2ndary mcu will trigger Duets part On pin. Should be quick and effective. 

Im currently doing something similar but for Z axis  XY interlock and its working well. A 2ndary mcu polls a foc motors position/error encoder and anything greater than a degree triggers a Duet input pin. It would be nice if the motor MKS Servo42D had a simple output for this, but it doesn't. I needed to do this as I just suffered a big crash during a tip change. The original Z motor lost steps pulling a tip off and proceeded to crash into the next tip station. Its a mess. 

All that said, vacuum is non essential in my setup and Ive gotten along without it for the last year or so. You may want to ask yourself how important it is at this point of your build.

If you want to stick w native Duet peripheral look into the Duet RRF probe functioning. I dont know anything about it, but DC42 (David, aka Mr Duet) offered it as an option.

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.

Developer Algo

unread,
Nov 26, 2024, 9:02:33 PM11/26/24
to OpenPnP
Ah!! i did chat with dc42 about reading Pressure sensors , he directed me to use M308 Command to configure and read Analog output from the sensors. That's what i have the sensors configured with.

Here is my sample config:

e.g 

Duet3 6XD config.g using RRF 3.6 

M308 S0 P"2.io0.in"  Y"linear-analog" A"VG1 Pressure"  F0  B37 C-130

OpenPnP 2.0 Config:

ACTUATOR_READ_COMMAND       ------           M118 P0 S{sensors.analog[0].lastReading} 
ACTUATOR_READ_REGEX               ------           (?<Value>-?\d+\.\d+).* 


NOTE: 
i tried using   M308 S0  in  OpenPnP to read the values of the Sensor but  i got an error even though i got a full  response back 

Response from M308 S0  command in OpenPnp:

Sensor 0 (VG1 Pressure) type Linear analog using pin 2.io0.in, last error ok, reading -0.3, unfiltered, range 37.0 to -130.0

When  i look at The Duet Object Model  i see under sensors/analog[0]  ===> sensors.analog[0].lastReading . I am able to read the value directly.

What i am not sure is if M308 Command was a way to try and resolve/get around the  low sampling frequency issue 

Wayne Black

unread,
Nov 26, 2024, 9:15:48 PM11/26/24
to ope...@googlegroups.com
Hmm I think you need to review the HW documentation. io2 is a binary gpio pin, you can't measure an analog signal with this pin.
image.png


Message has been deleted

Mike Menci

unread,
Nov 27, 2024, 3:14:02 AM11/27/24
to OpenPnP
I have the same sensors from SMC   - intention is to use only ON/ OFF outputs for PnP  & limit where vacuum triggers ON-OFF is set with SMC settings and not PNP !!  PnP doesn't need to know what the vacuum value is - We observe the part is on of Off only!  
Correct '?
ZSE30A_xx.png

SM

unread,
Nov 27, 2024, 9:09:16 AM11/27/24
to OpenPnP
>> yep , read that

Sorry, my mistake. I forgot that actuatorRead uses method matches() and not find() for partial matches.
With slightly modified code, M308 would also work.
On an input with analog capabilities you get (e.g. on MB6HC) an updated value every 250ms - so pretty useless for PnP.
Reply all
Reply to author
Forward
0 new messages