Signal names for VFD "PWM" port
-
The MB6XD with 3.5.12 firmware has 4 I/O ports at the top of the board adjacent to the I/O power input connector. On a LitePlacer Pick & Place machine I use
M42 P0 S1/0 to enable a vacuum pump and M42 P1 S1/0 for the vacuum solenoid
and M42 "P2" S1/0 to supply 12 volts to a 20 watt 450 nm diode laser.For debug the laser was replaced with a hobby servo allowing supplying 5V power via the PWM port.
It is not clear at all what this port should be called ... "P2" did not work nor OUT3, VFD since it is a string does it even matter?
What are the commands that will give a mid position of the servo arm?
Should I expect that there is no functional difference between running a pwm vs a laser? Given the absolute safety of using a servo for debug vs wearing safety goggles during a laser setup.
Where is the signal naming convention of the MB6XD defined?
-
@FlashPackets said in Signal names for VFD "PWM" port:
Where is the signal naming convention of the MB6XD defined?
In the page for that product in this wiki. https://docs.duet3d.com/Duet3D_hardware/Duet_3_family/Duet_3_Mainboard_6XD_Hardware_Overview#pin-names
-
What are the commands that will give a mid position of the servo arm?
That depends on your servo: what angle it covers, how the arm is mounted. Read Connecting hobby servos and DC motors. In the section Firmware configuration, you can find some sample code. You’ll have to check yourself what angle translates to the mid position of your specific servo.
-
@FlashPackets By default, RepRapFirmware has no defined ports, or pins defined as ports (except for stepper driver outputs). Ports and pins need to be defined, usually in the config.g file at startup, by M950 commands.
In each M950 command, the 'C' parameter defines the pin the port is to use. Ports can be set as different types, ie 'H' for heaters, 'F' for fans, 'J' for inputs, 'P' for general purpose outputs, 'S' for servos, 'R' for spindles, 'E' for LEDs. Each of these then need a unique port number, so they can be referred to, ie you could define H1, H2, H3, F1, F2, J1, P1, P2, S3 (P and S have to be unique from each other). Then other commands use this reference to control the port, eg
M42 P2 S1
.So look for the
M950 P2 C...
command in config.g, which will define where the laser is connected. You can change this (presumably it's using one of the OUT pins running at 12V) to 5V PWM pin which is named 'laser' or 'vfd', ieM950 P2 C"vfd"
and it can be controlled using M42. If you prefer to use servo angles with M280, change the 'P2' to 'S2'.
Alternatively, create a new port withM950 P3 C"vfd"
, and use it referring to 'P3', ieM42 P3 S1
.Finally, as @infiniteloop says, be careful when setting servo angles. Most servos can't go to 0 degrees, and often their range of motion is more like 10 to 170 degrees. Trying to force the motor to 0 degrees causes a servo to stall, and to draw maximum current as it tries to get to the position commanded, possibly damaging the Duet's 5V regulator.
Ian
-
Man that blue light is bright! Even with my safety goggles that turn blue painters tape black.
My objective is to melt or vaporize the 0.05mm cover tape on surface mount component carrier tape.
This code will produce a beam:
with config.g
M950 P3 C"laser"macro LASE
M42 P3 S1
G4 P100
M42 P3 S0This code does not work
config.g
M452 C"laser" R255 F500
Macro LASE
M42 P3 S1
G4 P100
M42 P3 S0For RRF 3.5.2 the notes suggest running "if I've read the notes correctly"
something like
config.g
M950 P3 C"!laser" Q1000macro LASE
G1 Y250 F1000 S100:20:40:60:80:10Does not work
The M42 notes suggest inverting the laser in M950 P3 C"!laser" Q1000
I think this is a bad idea as it leaves the laser enabled, then when power is activated via P2 that supplies 12V thereby violating a safety protocol. The beam should only be active by command.I'm sure that was not the intent of the comment, perhaps the note needs additional clarification.
Any suggestion on how to spice up the secret sauce to make the G1 command functional?
-
The M42 notes suggest inverting the laser in M950 P3 C"!laser" Q1000
Can you post a link to where it says this? I pretty sure we don't suggest inverting a laser as a starting point. It does say you can invert the output here https://docs.duet3d.com/User_manual/Reference/Gcodes#m42-switch-io-pin, but doesn't say to do it for lasers specifically!
If you configure your laser using M950, you are configuring a 'general purpose input/output', which is switched by M42. This is not specific to laser; it may be driving a spindle, an actuator, pump, or pretty much anything that needs a PWM or on/off input. Yes, it can be inverted, to allow for devices that expect an inverted signal to operate. No, it doesn't work with G1 S..., because it's not recognised specifically as a laser, just as something to be switched on and off. So it is up to the user to configure and use it sensibly.
If you use M452, ie laser device mode, that's different. The laser will only be activated by G1 S... commands, not M42 commands. There are various workarounds to get it to fire without moving, but generally you only want to do this for focussing. How to use M452 is written up here: https://docs.duet3d.com/en/User_manual/Machine_configuration/Configuration_laser
Ian
-
Here is what finally worked.
config.g
;Lasers
M452 C"laser" S0 R255 F500 ;0:macros/LASE
M42 P2 S1 ; Activate the 12 V power source
G4 1000 ; Wait 1 second for the fan to spin up
M3 S255 ; Specify the range of the PWM from 0 to 255
G1 X80 ; Move the laser head where there is a test object to burn
; Make sure that you have homed the machine if not then you will curse yourself in the
; next step, otherwise it will burn up from where it thinks 0,0 is, not where you think 0,0 is.
G1 X110 Y200 S255 F1000 ; RTFM again until everything is clear
M5 ; Shut down the laser
; Absolute magic!Thanks to the admins and their elves for their patience.
; next step
-
@FlashPackets I don't think the M3 and M5 commands will be doing anything, as you are using M452 S0 (non-sticky mode). If you want to use them, see https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m3-spindle-on-clockwise
Ian