M950 and Pin Names
-
@woodworksimon said in M950 and Pin Names:
; RRF3 fan output FULL POWER AT 2000HZ
M42 p4 s1No voltage out - (tried p2 and p3 as well). Intend running laser off p4, I assume when I change to laser mode I am unable to get output unless G1 is called? So to set up focus position, I would have to return to CNC mode - First things first, why no output on these pins?
- Was that Fan2 output working when you were using RRF2?
- If you send M950 P4 C"FAN2" from the console, what is the response?
- If you are using laser mode, what M452 command do you ave for RRF3?
-
@dc42
1: Fan 2 (left hand pwm fan output on board) working before upgrade.
2: M950 P4 C"fan2" gives: Pin Fan2 is not free, so sent P4 C"Nil" , but still not free.
3: M452 is set to c"fan2" Q2000, and I have also prefixed the lines in my macro with M950 P4 C"nil" and M950 P4 c"fan2" to double check. -
@woodworksimon said in M950 and Pin Names:
M452 is set to c"fan2" Q2000, and I have also prefixed the lines in my macro with M950 P4 C"nil" and M950 P4 c"fan2" to double check.
That's the problem. You have allocated the Fan2 output to thew laser, so it's not available as GPIO. You can control it using M3 Sxx and M5 commands. and/or with S parameters on G1 commands.
Note, there is a bug in M3/M5 handling in the current RRF3, which will be fixed in the next release (the same bug is already fixed in RRF 2.05RC2). So for now, if using RRF3 then you should only control the laser using S parameters on G1 commands.
-
As I am double handling the CNC, I call the laser with a macro and return it (for safety) to cnc from the macro when when finished. The above settings were made in cnc mode (M453) and the m452 was only called after the M950 line.
If I run P4 C"nil" does that not release the pin anyway? -
@woodworksimon
Re the output from Fan2, (when we get it working) is it available to manually control as intended from a macro when stationery? BTW, am getting a steady 0.2v across the heater pins - correct? -
@woodworksimon said in M950 and Pin Names:
@woodworksimon
Re the output from Fan2, (when we get it working) is it available to manually control as intended from a macro when stationery? BTW, am getting a steady 0.2v across the heater pins - correct?In Laser mode, no. The laser will only fire during movement.
-
@dc42 Ok - Can use a macro to laser engrave after setting up first in cnc mode.
Will still need to send output to Fan 2 - how can I release the pins for output if NOT in M452 mode (nil doesn't work) -
If you haven't allocated the pin in M452 then it will be either free or configured as fan 2. If it is configured as fan 2 then you can free it using:
M950 F2 C"nil"
However, if you have set it up as the M452 laser control output, then I think M452 C"nil" ought to work.
-
@dc42
Been trying for the last hour or so, briefly got it responding, but would give me output in laser mode using M42 without the m452 command?Stubbornly refuses to release in either laser mode or cnc mode.
So put this macro together to try... if I am missing something, I apologise, but the comments are how I understand the logic... still not releasing!; RRF3 fan ON test
;################### HALF POWER AT 50HZ ##################; SET CNC MODE
M453;======================================================
; CLEAR FAN PIN OUTPUT BUFFER
;======================================================; release DUET pins 'fan 2' from FAN output
m950 f2 c"nil"; DOUBLE CHECK: RELEASE MAPPED GPIO OUTPUT P4
M950 P4 C"NIL"; PREPARE GPIOO output 'p4' ONTO FAN2 PINS AT 50HZ
m950 p4 c"fan2" Q50; SWITCH output ON p4 at HALF power 125/255
m42 p4 s125 -
Yes that should work. If you send M950 P4 with no other parameters, what is the response?
-
@dc42
'gpio port has no pin' - so why has the m950 p4 line not mapped onto fan2? -
Syntax query for the new M452 - was originally embedding it in Vectric post processor to automatically switch to laser mode. Ie "M452 P2 R50 F500" (Quotes are expected).
New M452 ie: "M452 C"fan2" R50 F500" errors because of the two sets of quotes I assume. Any thoughts as to a work around? -
@woodworksimon said in M950 and Pin Names:
@dc42
'gpio port has no pin' - so why has the m950 p4 line not mapped onto fan2?Probably because the original M950 P4 command failed, which is probably because the fan2 pin had already been allocated to something else.
@woodworksimon said in M950 and Pin Names:
Syntax query for the new M452 - was originally embedding it in Vectric post processor to automatically switch to laser mode. Ie "M452 P2 R50 F500" (Quotes are expected).
New M452 ie: "M452 C"fan2" R50 F500" errors because of the two sets of quotes I assume. Any thoughts as to a work around?Does the Vectric post processor provide a means for escaping quotes within the string, for example by preceding the embedded quote with a backslash character or a second quote?
If not, then I suggest you pick an un-allocated M-code, for example M4520. Use M4520 with no parameters in your post processor script. Then create file sys/M4520.g and put the full M452 command in that.
-
@dc42
done some digging - ascii codes to replace the quote marks.
Putting it all together, have I understood it correctly please:...- ######## RepRap 3 NEW COMMANDS #########
+--------------------------------------------------- - Command output after the header to switch LASER on
+---------------------------------------------------
+====================================================== - CLEAR FAN PIN OUTPUT BUFFER
- release DUET pins 'fan 2' from FAN output
"M950 f2 c[34]nil[34]" - DOUBLE CHECK: RELEASE MAPPED GPIO OUTPUT P4
"M950 P4 C[34]NIL[34]" - PREPARE GPIO output 'p4' ONTO FAN2 PINS AT 50HZ
"M950 P4 C[34]Fan2[34] Q50" - ====================================================================
- switch to LASER MODE on fan 2 logical pin 4, 20/255ths power @50Hz
"M452 C[34]fan2[34] r20 Q50" - ====================================================================
"G0 [XH] [YH]" - Rapid Home x&y axis
-
"G0 [ZH]"
- Rapid Home z axis
-
commented out to prevent z movement #### WORKING
+---------------------------------------------------
- Commands output for rapid moves
+---------------------------------------------------
begin RAPID_MOVE
"G0 [X] [Y] [Z]"
+--------------------------------------------------- - Commands output for the first feed rate move
+---------------------------------------------------
begin FIRST_FEED_MOVE - ####### RepRap 3 NEW COMMAND #########
"M42 P4 S0.5" -
Switch i/o pin P4 to 50%
- ########## END RepRap 3 NEW COMMAND #######
- ######## RepRap 3 NEW COMMANDS #########
-
That looks reasonable to me.
What is your reason for wanting to fire the laser when there is no movement, other than perhaps while testing the system initially?
-
@dc42
I have to be able to adjust the focus of the laser onto the surface - may be different heights depending on job - (turn it to low power and adjust Z height), before starting to etch a design on low power or cut through.With the cutting, as it is only a 10 watt diode, it relies on a critical focus to cut, I have heard that I should move the z down slightly during a multiple pass cut to achieve the most accurate cut. Will I have to do this manually?
I'll try out the new pp now and report back, if I may. -
Thanks for the explanation. I can look into providing a variant of M3 that allows the laser to be turned on without movement.
@woodworksimon said in M950 and Pin Names:
With the cutting, as it is only a 10 watt diode, it relies on a critical focus to cut, I have heard that I should move the z down slightly during a multiple pass cut to achieve the most accurate cut. Will I have to do this manually?
No, if you know how much you want to move Z down each time, you can do it in GCode, either by using relative motion commands or by using babystepping to adjust the focus in the first place..
-
@dc42
Thank you so much!
For the first time I feel I have understanding of the revised gcode and post processor and therefore full control of my laser - really only now for the first time.
Tomorrow will be busy. Thanks again -
@dc42 said in M950 and Pin Names:
I can look into providing a variant of M3 that allows the laser to be turned on without movement.
I think that would be welcomed by a lot of diode laser module owners! (like me).
-
@dc42 this would be an amazing addition if it's possible!