Electromagnetic Switching Toolhead
February 17, 2021 01:17PM
I'm trying to configure "electromagnetic switching toolhead" for my costum 3D Printer construction. My Printer is running on the SKR PRO v1.1 + TMC2209 + Marlin Firmware 2.0.7.2. I have 3 tools that can be changed by a quickrelease system, locked by an elektromagnet. The Magnet is switched by a relay which is controlled by a digital pin on the board.

Nearly everything is working fine, but the electromagnet is not switched on/off at toolchange (by G-Code T0, T1, T2). I couldn't find any hint in the internet (or configuration), where the Pin for switching the e-magnet is defined. Does anyone know where to define that pin?

Because I had no success with "electromagnetic switching toolhead", I also tried "switching toolhead" (theoretically by servo, but I switch the relay and control the magnet instead) as plan B. --> here I can define SERVO0_PIN and should get a signal out of the defined pin (in my case "PA1" is used). I can perfectly control the pin by "M42 PA1 S0/S255" but the command "T0" doesn't switch on/off the pin. I have no idea why it doesn't.

My more prefered solution would be elektromagnetic switching toolhead.

I hope someone can help me solving this issue. If I forgot any detail please just ask.
Re: Electromagnetic Switching Toolhead
February 17, 2021 07:02PM
#elif !PIN_EXISTS(SOL0)
      #error "(ELECTRO)MAGNETIC_SWITCHING_TOOLHEAD requires SOL0_PIN."

so you need #define SOL0_PIN {something}
Re: Electromagnetic Switching Toolhead
February 18, 2021 11:14AM
Oh, thanks, that helped already!

I wrote
#define SOL0_PIN PA1
into pins_BBT_SKR_PRO_common.h and uncomment
#define ELECTROMAGNETIC_SWITCHING_TOOLHEAD
in configuration.h

I already tried it out and noticed:


SOL0_Pin is at 0V at 3DPrinter boot. In the moment when the bootscreen is over and the Infoscreen appears, SOL0_Pin changes to 3,3V and switchs my relay (maby because the printer thinks he is holding tool 0, but actually he isn't, because at beginning all 3 tools are parked at the front, idn, doesn't matter now).

When I execute a toolchange with command "T1" the mechanical part is working fine: Printer moves to T0 parking position to put tool 0 down, then it moves a little backwards and drives to T1 parking position, drives a little forward to grab T1 and then continue printing. But the relay is again not switched on/off in that process.



But whats interesting, when I set SOL0_Pin to 0V by
M42 P36 S0
then SOL0_Pin gets activated at next toolchange when the carrage that holds the tool arrives at old tool parking position to put the old tool down. But SOL0_Pin doesn't get turned off again when the carrage should grab the new tool at new tool parking position. After first toolchange the situation is like after startup, relay is permanently switched on, also in case of a toolchange.
Re: Electromagnetic Switching Toolhead
February 24, 2021 01:13PM
Anyone has an idea?

If you need some extra information to that I gave you, please let me know.
Re: Electromagnetic Switching Toolhead
February 27, 2021 03:59PM
if you manually run M42 P36 S0 and M42 P36 S1 does it work?
Have you try other extruder with SOL1 to see if this is doing the same
Re: Electromagnetic Switching Toolhead
February 28, 2021 03:31AM
Yes M42 P36 S0/255 works fine, but the T0/1/2 command doesn't switch my relay.

What do you mean with:

Quote
alfadex
Have you try other extruder with SOL1 to see if this is doing the same

I have only one electromagnet that is attached to my carrage and my 3 extruders are having a M8 nut that gets pulled to my magnet when it's turned on. Is this a mistake in my thinking that i only have one electromagnet (mounted to my carrage)?
Re: Electromagnetic Switching Toolhead
February 28, 2021 04:18AM
try an different IO pin, Ive seen PA1 has issues with timer conflicts on some of these type of boards....

also add "#define DEBUG_TOOL_CHANGE" to your Configuration.h and recompile
It will spit out lots of debugging for the tool change over serial_port

Edited 1 time(s). Last edit at 02/28/2021 04:24AM by Dust.
Re: Electromagnetic Switching Toolhead
February 28, 2021 05:31AM
I tried different IO pins, that didn't solve the problem...

But adding "#define DEBUG_TOOL_CHANGE" to Configuration.h solved it....I added that line and now my magnet is switching smiling bouncing smiley

thanks a lot!!
Re: Electromagnetic Switching Toolhead
February 28, 2021 07:37AM
Electromagnetic switching toolhead is actually working now, but whenever i switch off my relay (that is connected to the electromagnet) the serial connection to my PC (I use the machine control panel from Simplify3D) crashes with the errormessage "WARNING: Device unplugged while connected to port - Disconnected."

If I unplug the electromagnet from the relay and only switch the relay without load, it doesn't effect the serial communication. I use a standard arduino relay, as far as I know it has a free wheeling diode.

Can someone help me?
Re: Electromagnetic Switching Toolhead
February 28, 2021 12:49PM
You said it hapend when you switch off the ralay . It would be more usual to happent when you switch on, however even if this does not happent when you disconnect electromagnet, i would use SSR instead of relay. Also electromagnet should have free wheel diode and try to shorten as possible usb cable or use one with shield. Which electromagnet are you using
Re: Electromagnetic Switching Toolhead
February 28, 2021 01:06PM
The electromagnet i am using...

Next step I will try to attach a free wheeling diode to the magnet. The funny thing is that it doesn't effect the mainboard or steppermotors, display, etc.

Accept from the PC all parts work without problems when turning off the magnet.confused smiley
Re: Electromagnetic Switching Toolhead
March 02, 2021 11:53AM
Update: I connected the electromagnet to +24V powersupply and to the GND of the mainboard...i just changed the ground connection from a connector of the mainboard to the connector of the powersupply and now the connection to the PC works well grinning smiley...without free wheeling diode...
Re: Electromagnetic Switching Toolhead
March 02, 2021 12:03PM
Ground of the mainboard and ground of the power supply should be common, isn't it?
Re: Electromagnetic Switching Toolhead
March 02, 2021 01:57PM
The mainboard is powered by the same supply as the magnet, so ground is the same. It's actually very strange confused smiley

Maaaby it's an issue with the voltage converter from 24 volt powersupply output to 12V mainboardvoltage...the voltageconverting happens on the mainboard itselfe...idk grinning smiley

Edited 1 time(s). Last edit at 03/02/2021 01:57PM by Klaus1207.
Sorry, only registered users may post in this forum.

Click here to login