M command timing is off when executed from GCode file
-
@nkts That's why I suggested to use the firmware facility instead - the SPI link between SBC and Duet is no realtime feature (yet). You can always remap the laser port dynamically or multiplex the Duet PWM port using a different command.
-
@chrishamm @jay_s_uk
I tried that and it is possible with a little work. However I have multiple lasers that I need to control individually with different PWM values for each of them so a multiplexer doesn't work for me.I only have 2 empty PWM pins on my 6HC board that i can use to setup the lasers as spindles with M950 and control them with M3 and M5. When doing this i have this error when the R value is higher than 3:
M950 R4 C"io5.out" Error: M950: parameter 'R' too high
Also is there a way to use the PWM pins on an expansion board (I have a 3HC) to configure the spindles on there? If I try to do this it tells me it is only possible on the main board. And is it possible to get 5V PWM instead of 3.3V?
-
@nkts looks like the maximum amount of spindles currently is 2 (or maybe 4 in the current beta?) https://docs.duet3d.com/User_manual/RepRapFirmware/RepRapFirmware_overview#firmware-configuration-limits:~:text=number of triggers-,MaxSpindles,-2
You could get round this by unmapping a spindle before using another one.
The spindles on CAN boards is a limitation I believe. Not sure when it will be removed though
-
@jay_s_uk I see, is there an "easy" way for me to up the max amount of spindles to at least 8?
The remapping is a little too slow for the use-case I have. I assume it is not planned to remove the limitation of the other boards as of now? If that was possible it would solve all of my issues
-
-
@nkts if you are set up to compile RepRapFirmware then you could increase that value yourself.
I can look at increasing the maximum in the next 3.5beta release. Can you explain your use case for 8 spindles?
-
@dc42 I should be able to do it myself. I would be very thankful if you could give me a walkthrough on what I need to do.
I have 8 lasers that I need to turn on and off individually and each of them will have a different power output every time they are turned on. Therefore I need to define each as a spindle so I can control them with M3 and M5. Depending on the direction my toolhead is moving multiple lasers with different and also altering power output need to be on at the same time. To make it easier for me to control them I need every laser to be defined as a different spindle because this will happen very often and quickly during movement. If I had 8 spindles defined that would solve the first big issue I'm having.
The second one is that I only have 2 empty PWM connectors on my 6HC board. I also have a 3HC board, but I can't use these PWM pins. When doing:
M950 R1 C"1.out1"
I get:
Error: M950: Port must be on main board
Is there a way to make this work? Would it be possible to use a PWM pin on a Sammy C21 board?
-
@dc42 I managed to up the number of MaxSpindles successfully
To my second problem: I found the error "Port must be on main board" in the IoPorts.cpp file. However I don't quite understand how I can bypass this restriction. Is it even possible?
What I mean: is the firmware set up to allow spindles on expansion boards and you just blocked this feature? Or isn't this implemented in the code at all?
If it is possible to avoid this limitaion by changing some code, could you please tell me where I need to look or what I need to change? -
@nkts the firmware is not set up to support spindles on expansion boards. To support them we would need to add new CAN messages to configure and control them. We haven't done that yet because until now we haven't been asked to support more than two spindles.
-
PS - I have created https://github.com/Duet3D/RepRapFirmware/issues/851.
-
@dc42 thank you very much!!