Manual tool head swapping, auto configure config need ideas
-
Im after some ideas on how to auto reconfigure the config.g file depending on which tool head ( extruder assembly) fitted, ive looked at the tool change macros and they dont seem to be able to do what i require.
- Tool head 1 , extruder steeps/mm 600 , max current 1.5, max temperature 500C, max print area 290 x 290, nozzel offset ,
- Tool head 2 , extruder steeps/mm 300 , max current 700ma, max temperature 300c ,max print area 310 x 310, nozzel offset
Each tool head is on a multi pin connector and 2 pins are reserved to identify which tool head it is. Using a analogue input on the Duet board the voltage input would determine the tool head fitted.
e.g voltage between 0 to 1V tool head 1, between 1 to 2V tool head 2 etcHas anyone already done this is so please point me in the right direction.
-
@moth4017 I think you need to provide a bit more information as to what it is you are trying to do.
So for instance do your toolheads get changed dynamically during a print or are they static in that you start the system with a particular tool connected.
Are the tool heads identical from an electrical point of view? So for instance do they have the same setup of fans/heaters/stepper connections and are they always on the same pins? If not then you may need to take care to set any pins that can change function into a "safe" state before switching tools (assuming you switch them dynamically), you will probably need to do this anyway if a stepper is involved.
Other than that I don't see any reason why you can't simply detect the tool currently attached and then use that information to define the steps/print area etc. either when the system starts or in one of the tool selection macros. (probably the post macro as you will need to have the tool attached to be able to sense which one is attached).
Good luck!
-
Hi , tools head changed per job , not mid print.
electrically and mechanically can be different hence almost needing 2 config files. but the pin connections would not change , eg pin 1 to 4 always stepper , pin 6,7 heater hot end etc -
@moth4017 Do you intend to swap toolheads when you have the control board powered on? If you do then you will need to take care as stepper drivers may not be happy with having the stepper disconnected/connected (especially if powered on). Other than that I would have thought you could simply detect which toolhead you have connected and then configure all of the required settings. You might want to consider putting each set of settings in a separate file and calling the file with M98. You could probably make things more complex by using different RRF tools for each toolhead, but given that it sounds like your setup is not that dynamic I think that keeping it simple would be an advantage.
-
@moth4017 It sounds a bit like my own situation. I have 4 different hot ends, (single input, dual input, 6 input mixing, and 6 input multi material). So the machine needs to be configure differently to suit each each hot end type. Things like the number of tools, but also accelerations and a few other settings. Then there are macros which have the same name but behave differently depending on the hot end in use.
The way I deal with it is make use of M505. So my SD card folder structure has the /sys folder then within that there are 4 different sub folders. The config.g file within /sys contains just this:
; ******CHOOSE .SYS PATH ****** M505 P"6InputMultiMat" ;M505 P"6InputMixing" ;M505 P"SingleInput" ;M505 P"2Input" M98 P"config.g"
In the example above, the sys path is changed to the sub folder "6InputMultiMat". If I want to change to a different hot end, I uncomment the relevant M505 and comment out all the rest. Then within that subfolder is the the "real" config,g along with all the homing macros and other macros that are specific to that particular machine configuration.
The easiest way to start is to create the sub folders, then copy the entire contents of /sys into each of those sub folders, then edit each one as necessary. Ohh and in each config.g file I have an M291 which pops up with a message telling which configuration has been loaded.
-
@deckingman said in Manual tool head swapping, auto configure config need ideas:
each config.g file I have an M291 which pops up with a message telling which configuration has been loaded.
This is a good idea" each config.g file I have an M291 which pops up with a message telling which configuration has been loaded."
-
@moth4017 Reading your first post again, you could use an external trigger to run a macro which will change the sys path and run the tespective config.g.
-
@moth4017 said in Manual tool head swapping, auto configure config need ideas:
Using a analogue input on the Duet board the voltage input would determine the tool head fitted.
How would you define that analogue input?
If it's a fake thermistor definition, you could read the different analogue values as temps and write a macro which selects the corresponding config. -
yes that is exactly what i was thing off, unless there is another/better way to do that .
then run some conditional statements to run the correct config for the tool head.
-
@moth4017
There are not many analogue devices in RRF. Thermistors and some Z-probes are the only ones AFAIK.
Just make sure you check for temp-ranges rather than fixed values in your macro. -
@moth4017 If you've got two pins on your connector, and you only have two tools, why not use them as digital inputs? It would make it very easy to run a trigger macro. So pin (a) high would be one tool, pin(b) high would be the other tool, and if you wanted, both pins high could be a third tool. You also have neither pin high which could be used as a forth tool, but probably better to reserve that combination for "no tool present".
-
@deckingman
i was trying to use only one input on the Duet board, but i could use 2 inputs and do some logic for each tool head giving me up to 3 tool heads .Using a PT1000 input i do have the option of 1k to 2k8 in resistance to go from 0C to 500C , should be able to use precision resistors to do 50C intervals .
-
@moth4017 If you decide to go the digital io route, it does give you a lot more flexibility for the future. For example, I use 5 io pins with my jog joystick and only 4 trigger macros which gives me movement in 8 directions at two different speeds. So 16 combinations from those 5 io pins.
-
@moth4017 YOu can do this the simple stupid way by using the slicer. You can add another priter profile or add another filament setting putting all the necessary gcodes in the custom section
Another way is you add another tool in rrf and make sure your custom settings are applied by calling a macro or similar
-
Looks like Stephan from CNC kitchen may have done this wit Duet
https://www.cnckitchen.com/blog/tool-swapping-with-the-whambam-mutant-v2-review -
@deckingman Could you please share your jog joystick macros?
-
@MacKoz said in Manual tool head swapping, auto configure config need ideas:
@deckingman Could you please share your jog joystick macros?
Here you go...
; ******Trigger 5 - Joystick left,right, forward or backwards ******** ; IO Pin to switch connections J5=left, J6=Right, J7=Forward, J8=Backward if state.status != "processing" ; make sure that a print is NOT running G91; Set relative M400; wait for any moves to finish G1 F3000 ; set feedrate to 100mm/sec M118 S"Trigger 5 - Joystick" while sensors.gpIn[5].value=0 | sensors.gpIn[6].value=0 | sensors.gpIn[7].value=0 | sensors.gpIn[8].value=0 if sensors.gpIn[5].value=0; joystick left if sensors.gpIn[7].value=0 ; joystick left and forwards M400 echo "Left and forward" if sensors.gpIn[4].value=0 ; check for long move button press G1 X-20 U-20 Y-20 V-20 else G1 X-0.5 U-0.5 Y-0.5 V-0.5 elif sensors.gpIn[8].value=0; joystick left and backwards M400 echo "Left and backwards" if sensors.gpIn[4].value=0 ; check for long move button press G1 X-20 U-20 Y20 V20 else G1 X-0.5 U-0.5 Y0.5 V0.5 else ; joystick left only M400 echo "Left" if sensors.gpIn[4].value=0 ; check for long move button press G1 X-20 U-20 else G1 X-0.5 U-0.5 elif sensors.gpIn[6].value=0; joystick right if sensors.gpIn[7].value=0 ; joystick right and forwards M400 echo "Right and forward" if sensors.gpIn[4].value=0 ; check for long move button press G1 X20 U20 Y-20 V-20 else G1 X0.5 U0.5 Y-0.5 V-0.5 elif sensors.gpIn[8].value=0; joystick right and backward M400 echo "Right and backwards" if sensors.gpIn[4].value=0 ; check for long move button press G1 X20 U20 Y20 V20 else G1 X0.5 U0.5 Y0.5 V0.5 else ; joystick right only M400 echo "Right" if sensors.gpIn[4].value=0 ; check for long move button press G1 X20 U20 else G1 X0.5 U0.5 elif sensors.gpIn[7].value=0 ; joystick forwards only M400 echo "Forward" if sensors.gpIn[4].value=0 ; check for long move button press G1 Y-20 V-20 else G1 Y-0.5 V-0.5 elif sensors.gpIn[8].value=0 ; joystick backward only M400 echo "Backwards" if sensors.gpIn[4].value=0 ; check for long move button press G1 Y20 V20 else G1 Y0.5 V0.5 else break else break
Not sure what's happened with the formatting here but that fist "while" statement is all one line.Edit - looks fine now...As well as the 4 direction switches, I also have press button which will change the jog length between 20mm and 0.5mm.
Just to break that macro down, the gpios are normally high so there is a while loop which runs (and repeats) if any of the 4 gpios (switches) are low. The first "if" checks if the "left" switch is made. The next "if" checks if the forward switch is also made. The next "if checks if the "fast jog" switch is also made. If all those "ifs" are true then the carriages will move -20 in X and -20mm in Y (note that I have a Core XYUV so I'm actually moving X,Y U and v). The first "else" (that is to say the "fast jog" button is not pressed) will move the carriages in the same directions but only by 0.5mm. The first "elif" checks if the backwards switch is made as well as the left switch. In which case the carriage moves either 20 or 0.5mm but in -X and +Y (left and backwards). Then there is an else which means that only the left switch is made so only move left. That sequence of checks is repeated for the right+forwards / right+backwards / right only combinations. Then two further "elifs" check the remaining forward only (-Y) and backwards only (+y) conditions.
So as long as I hold the joystick, the carriage will continue to jog and while it is jogging I can toggle between 20mm (fast) and 0.5mm (slow) jogs by pressing or releasing the push button. If I release the joystick the macro will end. If I move the joystick say from left to right, the macro will end than immediately start again.
The command in config.g to call that macro is.....
M581 P5:6:7:8 T5 R2 S0
So "making" any one of the 4 switches will trigger the macro.
HTH
Edit. A further, useful embellishment would be to check if the axes had been homed first. As it stands, I could potentially jog the carriages into the frame and do some damage. I did have the foresight to add a condition which prevents the macro from running if a print is in progress but since firmware version 3.2. that is handled by the R2 parameter in the M581 so that check could now be omitted.
-
@deckingman Thank you.