Multiple spindle setup question (MDI commands to second spindle flagging error.)

More
17 Apr 2024 22:30 #298503 by jtrantow
I'm in the process of adding a laser diode to my router.

The laser needs 12V, PWM, GND. the 12V power is connected via a relay.
I have each of these signal working correctly when the relay is controlled by coolant mist signal. I can change the PWM to xx% using a M67 E0 Sxx. I'd like to control the laser as a second spindle and have the 12V relay be controlled by spindle.1.on.

I specify loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS num_spindles=2 and I can see both spindles in halshow, but when I send a "M3 $1" MDI command, I get the following message:

"Spindle ($) number out of range in M3. Command num_spindles=1 $=1."

I see a similar message when I try "S20 $1".

At this point, I don't need control over spindle.1 from the GUI but I would like it to work from MDI or gcode.

What else is required (besides num_spindles=2) to get multiple spindles working? 
 

Please Log in or Create an account to join the conversation.

More
19 Apr 2024 12:29 #298613 by jtrantow
Did some more searching and looks like I just need to add:

[TRAJ]
SPINDLES = 2

[SPINDLE_0] in ini file with max min speeds
[SPINDLE_1]

forum.linuxcnc.org/24-hal-components/517...w-is-to-do-to-get-it
 
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
19 Apr 2024 17:05 #298628 by jtrantow
Adding SPINDLES=2 to [TRAJ] section of .ini got me further in the process. The laser now enables in response to M3 $1. Air compressor turns on M8 (coolant flood), crosshair laser turns on with M7.

However when I run code it's waiting whenever at the first move whenever spindle.1.on is true (I use M3 $1 to set it true.) I also tried the M3 $1 before I run the following g-code and still runs to the G0 X0 Y0 X7 line and waits???

setp spindle.1.at-speed true

What else needs to be setup for gcode movement to work when a spindle is on? 
% (TESTCUTS)
G90 G94 G17 G91.1
G21
G17 G90 G94
G54
G64 P0.001 Q0.001
(Flood cooling turns air compressor on.)
M8 (Zero laser PWM.)
M68 E0 Q0
( M3 $1 enables laser 12V power.)
(M3 $1)
G0 X0 Y0 Z7
(mist controls crosshair for test run.)
M7
M67 E0 Q95
G1 Y-75 Z-1.5 F300
M67 E0 Q0 (Disable laser.)

M5 
(Turn off compressor and crosshair.)
M9
G0 Z15.
M30
%

Please Log in or Create an account to join the conversation.

More
19 Apr 2024 17:49 #298641 by tommylight
What is the laser for? Cutting vectors or drawing bitmaps?
As a spindle you might do first but not the second, for that you need M67.
If you are just trying to turn it on as a spindle and run it as DOUT/M67, i do not know if that works, but i do know that for M67 to work i removed everything relating to spindle.
Knowing LinuxCNC, i am pretty sure it can be done, just no idea what would have to be done exactly, but probably removing everything regarding spindle except the on/off functionality might just work.
Did you try
M3 $1 S333
or whatever S value?

Please Log in or Create an account to join the conversation.

More
19 Apr 2024 18:55 #298657 by jtrantow
Intent is to use if for both vectors/bitmaps from lightburn or f360 generated gcode.
I haven't found a great F360 processor but lightburn generates files with M3/M67's.

Basic connections are:
laser_enable connected to the laser +12V power
laser_pwm from motion analog out
laser-cross-hair connected to relay powering smaller laser. (coolant-mist)
laser-air-relay connected to air compressor relay  (coolant-flood)

Yes, I can enable the laser/power with one of the coolant pins and it all works(without the M3 $1).
I was trying to stay close to the lightburn method and that also let me use the flood and mist buttons to turn on the air compressor and crosshair laser without changing the gui(gmoccapy).

Not sure what's missing that causes it to wait??
I tried M3 $1 S100 without any success.

Please Log in or Create an account to join the conversation.

More
19 Apr 2024 21:22 #298672 by tommylight
Yeah, sorry i forgot about it, distress.
Try wiring the output in hal instead of spindle-on try spindle-cw.
Did you already add this to hal
setp spindle.1.at-speed true
?

Please Log in or Create an account to join the conversation.

More
19 Apr 2024 22:11 #298677 by jtrantow
Yes, I had at-speed true. 

Rethought my approach to this machine. I'll be using a different config when its running the plasma cutter so I might as well have three configs. router spindle, laser, plasma.

Changed back to num_spindles=1 and use spindle.0.on instead of spindle.1.on to enable the laser power relay and everything works. Not sure whether I should open an issue but I'm giving up on multiple spindles in one config. I've got some leather pads to cut for my kayaks so enough monkeying around with the config and time to make some smelly leather cuts.

Thanks for the support and have a great weekend!
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.139 seconds
Powered by Kunena Forum