Back with opnpnp again
-
I already have my machine configured with duet2 wifi with X, Y and Z axes and C and D rotary nozzles plus a few actuators.
To finish I need to read the analog signal of 2 vacuum sensors, but I don't see how to read only the value.
I have tried with:
M308 S1 P "e0temp" Y "linear-analog" A "MySensor2" F1
but reading it gives me this
Sensor 1 (MySensor2) type Linear analog using pin e0temp, reading 99.9, last error: sensor not ready, filtered, range 0.0 to 100.0
I just need to read only the value.
Any idea how to do it?
Jose
-
The reading of 99.9 suggests that the analog input is at +3.3V. Have you measured the voltage on the input?
-
The value is OK, but I only want to read 99.9
-
@qlfecv said in Back with opnpnp again:
The value is OK, but I only want to read 99.9
Please explain what you mean. What is the voltage on the analog input pin?
Edit: Do you mean that you want a shorter response? You can get the value from the object model, for example using M409, or refer to it in a 'echo' command.
-
Yes, I want shorter response.
How work M409 with M308 sensor?
-
echo sensors.analog[1].lastReading 25.9
-
Thanks @dc42,
-
@dc42 Is posible read digital value? (4095)
-
You could set the range in M308 to 0 to 4096 instead of 0 to 100. Then if you don't want any decimals, use the floor( ) function in the echo command to convert the reading to integer. Or you can stay with 0 to 100 and multiply by 4096.0/100 first. See https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Expressions to see what expressions you can use within the echo command (and in lots of other places).
-
Thanks again
-
I don't understand that I'm doing wrong.
I have this configuration
M950 C"bedtemp" C"nil" M308 S2 P"bedtemp" Y"linear-analog" A"V_Sen_H2" F1 L0 H4095
The pin is 0V I send this
echo sensors.analog[2].lastReading 0.0
Now pin 3.3v
echo sensors.analog[2].lastReading 100.0
-
@qlfecv, the M308 documentation for Linear Analog sensors was wrong. The min and max reading parameters are B and C, not L and H. So use B0 C4095.
-
Ok, so I try it.
@dc42 what is the best option to add the sixth axis?
I don't like using additional hardware, but with duet2wifi I have no other solution.
When I can I will buy one " Duet 3 Main Board 6HC".
-
@qlfecv where are you based?
-
In Barcelona, Spain
-
-
@dc42 said in Back with opnpnp again:
@qlfecv, the M308 documentation for Linear Analog sensors was wrong. The min and max reading parameters are B and C, not L and H. So use B0 C4095.
Working fine