Welcome! Log In Create A New Profile

Advanced

Auto Switch Off

Posted by KaGen101 
Re: Auto Switch Off
May 27, 2014 02:35PM
Hi Guys, seems it isn't quite so cut and dry after all, but OK I'm using the Standard ACE ATX power supply, others have changed, but I thought at least two or three other people had already implimented this, hence I came away from my MicroSwitch method as they said it was working for them.

Would it not be possible just to add a loop to the M81 routine to waste 10 seconds, that probably won't complete in any case, or are you saying the the the PS_ON pin is just pulsed, and not physicaly turned off till the routine ends.


Please send me a PM if you have suggestions, or problems with Big Blue 360.
I won't see comments in threads, as I move around to much.
Working Link to Big Blue 360 Complete
Re: Auto Switch Off
May 27, 2014 05:23PM
Kim,

Instead of a microswitch that may limit your bed size for full stop, how about a microswitch at the upper limit of Z travel?

Would not be too hard to add a large washer to the top of the Z screw which would press on a microswitch mounted on the Z bracket. This may need a sightly longer rod, but easy to do.

Then you would not need to move the head to a predetermined position at all and could just issue a G1 Z201 to trigger machine stop, or even G1 Z201 F150 to give the hotend some time to cool a little before stop.

Just my idea.....

Rob.
Re: Auto Switch Off
May 28, 2014 08:01AM
I've put a scope on the PS_ON output and looked at what it does when I turn off the 12V supply to the Duet, when the 12V supply is also the only source of 5V. There is indeed a glitch on the PS_ON output:



This was measured using a 1.5K pullup resistor to a separate 5V supply. The horizontal scale is 50ms/division. The falling edge is around 50us long, although this is at the end of 2m of wire with a scope probe on the end and a very indirect ground connection. The datasheet gives the gate charge of the mosfet as 3.9nC @ Vdd=20V, so it's going to be somewhat greater than 1nC @ 5V. Even if we assume 1nC, 50us switching time implies a gate current of about 20uA, which is much higher than the leakage current specification of the SAM3X pins. So I think the SAM3X output high side driver transistor may be turning on slightly during power down.

Two things I may try:

1. Enable the brownout detector in the firmware;

2. Add a pulldown resistor of about 3.3K on the mosfet gate input.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].

Re: Auto Switch Off
May 28, 2014 08:07AM
Hi Rob, yes I did think of that, and may go down that road yet.... At the moment, it's all on hold, waiting to see what DC finds with the M81 routine.
At the moment the machine works fine, I just have an extra button to start it, but otherwise it's as it was before.
Shutting the Complete Machine down would be nice, but I seldom leave the printer alone, printing away at the moment.
I'm sure DC will work something simple out. I'd like to know more about other peoples ShutDown arrangements, and if it turns off the Duet as well.
It's not something that will stop me using the Machine, and I have a pile of other stuff to do on it, and also to design and print for other things.
I'm sure sooner or later one of us will have that Light Bulb moment, and it'll be something Easy and Cheap to achieve..


Please send me a PM if you have suggestions, or problems with Big Blue 360.
I won't see comments in threads, as I move around to much.
Working Link to Big Blue 360 Complete
Re: Auto Switch Off
May 28, 2014 10:43AM
Quote
dc42
I've put a scope on the PS_ON output and looked at what it does when I turn off the 12V supply to the Duet, when the 12V supply is also the only source of 5V. There is indeed a glitch on the PS_ON output:
This was measured using a 1.5K pullup resistor to a separate 5V supply. The horizontal scale is 50ms/division. The falling edge is around 50us long, although this is at the end of 2m of wire with a scope probe on the end and a very indirect ground connection. The datasheet gives the gate charge of the mosfet as 3.9nC @ Vdd=20V, so it's going to be somewhat greater than 1nC @ 5V. Even if we assume 1nC, 50us switching time implies a gate current of about 20uA, which is much higher than the leakage current specification of the SAM3X pins. So I think the SAM3X output high side driver transistor may be turning on slightly during power down.

Two things I may try:

1. Enable the brownout detector in the firmware;

2. Add a pulldown resistor of about 3.3K on the mosfet gate input.
I doubt a gate pulldown will do a lot - I suspect the SAM3X output is being actively driven high as the internal logic gates misbehave during brownout, and the FET turns off only after Vcc has decayed below its gate threshold. A series resistor as well as a pulldown might mask the issue by decreasing the gate voltage in general so that it is below threshold by the time the output drives high, but that's messy and uncertain. Your trace shows a 100mS erroneous pulse, which is very long, but I think could still be supressed by a RC filter along the values I suggested on the output, which will avoid modifying the Duet board. As said however, pulse duration probably depends on the rate of decay of Vcc, which is highly variable, so the filter should have a long time constant - I'd even go up to a 100uF cap. It is desirable to have some sort of filter in this application in any case, because switching the PSU could be expected to cause glitches on all signal lines for all sorts of reasons. Put a diode in parallel with the filter series resistor so that a low discharges the capacitor immediately. Assuming no external brownout reset is implemented, asserting the software reset is worth a try - it's success will depend on how the internal reset signal is gated to the output drivers. Another alternative would be to put a resettable retriggerable monostable in series that passes the state only after there has been a constant low for a second or so, but resets and passes a high immediately - but that's a relatively complex addition.

Dave
(#106)
Re: Auto Switch Off
May 28, 2014 12:48PM
My reasoning was that the fall time of the output and the mosfet gate charge led me to believe that the gate current being sourced by the SAM3X as is powers down was about 20uA, at least during the time that the mosfet was turning on. Of course, it could have been that the current that the SAM3X can source during power down rises to a higher peak value before dropping again. But if it remained below 100uA, then a 3K3 gate pulldown resistor would take care of it.

So I've added a 3K3 gate pulldown resistor, and the glitch is gone. I'll recommend this mod to RRP for the next version of the Duet.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Auto Switch Off
May 28, 2014 01:19PM
Quote
dc42
My reasoning was that the fall time of the output and the mosfet gate charge led me to believe that the gate current being sourced by the SAM3X as is powers down was about 20uA, at least during the time that the mosfet was turning on. Of course, it could have been that the current that the SAM3X can source during power down rises to a higher peak value before dropping again. But if it remained below 100uA, then a 3K3 gate pulldown resistor would take care of it.

So I've added a 3K3 gate pulldown resistor, and the glitch is gone. I'll recommend this mod to RRP for the next version of the Duet.

I did not believe it would have had such an effect - very well analysed!

Dave
(#106)
Re: Auto Switch Off
June 03, 2014 04:59PM
Hi Kim

We think very much alike I have the same idea of powering down. Think the micro switch should be on the x-axes and the end g code should park the head on x pos 210 well outside print area. So you would print max size objects. You don't need the overrule switch because when it is powered down you can just move the extruder head to power back on the printer.

Henrik

Edited 1 time(s). Last edit at 06/03/2014 05:02PM by Rothestar.
Re: Auto Switch Off
June 04, 2014 05:06AM
Hi Henrik, yes I did think about that option. But decided that I was going to have the HotEnd go to about X0, then lower down to Z-5 to operate the switch.
I stopped going down the MicroSwitch route when people said the M80/M81 commands worked, but after wiring it up on my machine it didn't work.. It just Blipped the Power off and back on again...
Since then DC has come up with the 3k3 resistor idea to overcome the Blip.... Unfortunately, I haven't had a chance to look into it since he came up with the solution.
Hopefully it will work, but this time coming to work I haven't brought the printer with me, and so I'll have to wait two weeks or more to find out.
If the M80/81 commands work, then that is quite a neat solution to the problem, but the MicroSwitch way is just as easy, and I feel is a more positive solution to suit what I want to do.
It would also give me another way to stop the printer, if things went pear shaped, I can Dab the Switch. So I still like the idea of a switch. There isn't any reason for not using both ways to be honest, wired in togeather.
On my printer, I have my cleaning RAMP (for want of a better way of discribing it) fitted at about X204, which I thought might be a bit close to the Switch if mounted on the extream of X axis.
Also in my case, normally the printer travels with me all over the country, so it gets rattled around in it's caring case as the car goes over bumps, so I try not to leave to much weight hanging to far along the X axis,
to try to cut down the levering affect it would have.

Unfortunately I've had to be busy with other things, so haven't even completed fitting my replacement table...
In fact I'm even thinking of selling the printer after I get the table leveled and it working. So I'll concider any offers if any ones interested.
Kim..


Please send me a PM if you have suggestions, or problems with Big Blue 360.
I won't see comments in threads, as I move around to much.
Working Link to Big Blue 360 Complete
Re: Auto Switch Off
June 04, 2014 09:57AM
If anyone else wants to try adding the 3k3 resistor, here is a photo of how I did it:



I soldered an 0603 resistor across the bottom 2 pins of TR7. I mounted the resistor with one edge to the PCB, so that the pads on what should be its underside rest on the legs of the transistor. It might have been easier to use a 0805 resistor. There is probably room to use a small through-hole resistor.

WARNING: modifying the Duet board is likely to invalidate your warranty, unless you get RRP to agree to it first.

Edited 1 time(s). Last edit at 06/04/2014 09:58AM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].

Re: Auto Switch Off
September 03, 2014 11:25PM
Hmmmmm here's waking up an old thread... Seems like years ago instead of months.
Ok here's the thing. I've only JUST got around to fitting the 330ohm resistor across TR7 as DC suggested to stop the machine after a print.
Yep it works (nice one DC) when I issue the M81 command via Proterface, and seems to stay in that active shutdown mode not matter how long I press the By Pass Button to power it up while it's also getting a suply from the USB. OK I understand that and why....
And if I issue the M80 command via Pronterface, yep it's all systems go again... So it seems to work... (This is with the USB power running the Duet...at the same time...)
Now one of the leads has pulled out my Nozzle Heater Cartridge, (which explains some strange things that have been happening), so I did the mod as the machines on downtime till the New Cartridge Heater arrives later today... Now I wasn't expecting the M81 command to work while the USB lead was supplying a second source of power to the machine, so I wrote a very short Gcode file to simulate it doing something, and then I was going to pull out the USB while the machine was moving. (Hope your with me so far)....
Ok so I homed X & Y (I can't home Z as it's all adrift), then ran the Gcode, and the machine stopped dead, and only made a token effort to move, which supprised me.
I'm guessing the file was read as a whole, and buffered, and as soon as it read the M81 it was basicaly like hitting an Emergancy stop....
Here's the file... All three line of it..
G1 X50 Y50 F1500
G1 Y100 F200
M81
So my question is....
As the printer DIDN'T do the moves I was expecting it to do before shuting down, should I be adding M81 to the custom END part of Slicer, or something else.....
(I'm just wondering IF the machine ignored the two lines above, and just shut down, wouldn't it also ignor the last lines of a real gcode file, and just powerdown possibly not finishing the print?
Kim


Please send me a PM if you have suggestions, or problems with Big Blue 360.
I won't see comments in threads, as I move around to much.
Working Link to Big Blue 360 Complete
Re: Auto Switch Off
September 04, 2014 02:10AM
Move commands (G1 and a few others) are buffered, while the rest are not, so M81 will be executed while there are still things in the buffer. The firmware will keep going through the buffer and run those commands, but they obviously won't do much when 12V power is off.

You need to either run a command that waits for the buffer to be emptied, or just have a delay long enough that it is likely to finish whatever it is doing before powering down.

I have the Duet control power through the ATX PS_ON pin, and I just have a two minute delay before shutting down (to cool the hotend a bit to avoid plugging it up). An M1 command before M81 should do the trick though, it waits until the buffer is empty and then shuts off motors and heaters.
Re: Auto Switch Off
September 04, 2014 02:45AM
Quote
dc42
Kim, as I attempted to describe in my earlier message, you can have M81 power down the Duet completely. Just power the 5V supply from the 12V as usual. Then to start it up, you need a push button wired between ATX ON and ground (i.e. where the link is on the ATX power PCcool smiley, and an M80 command in config.g to keep the power on when you release the push button.

You can use the G4 command to program a delay before the M81 command.


Hi David,

i think this is a good Thing for me.

I want to add a small push button to do like you described.

Is this uncritical at the actual state of the Firmware?

Can you post a wiring diagram?

Thanks
Re: Auto Switch Off
September 04, 2014 04:50AM
Hi Kim,

I'll change the firmware in my next release so that it waits for moves to complete before actioning the M81 command. In the meantime I suggest you put G4 P1 before the M81 command. This commands a 1ms delay, but also waits for moves to complete. However, you might want to use a much larger delay to give time for the fan to cool the hot end down. The resistor I added was 3.3K not 330R, however 330R will be OK apart from increasing the current consumption by 0.9mA 9mA.

Hi muggi,

For wiring all you need to do is:

- buy a 2-pin header socket with 2.54mm spacing (or a 2-pin Molex header shell would probably be OK), and crimp pins to fit it. Just like the ones I supply with my hot end board. Connect the wires of a normally-open push button to the 2 pins. Then remove the jumper from the ATX power board and substitute the 2 pin header socket.

I'm not sure what you mean by "Is this uncritical at the actual state of the Firmware?". You will need to use my fork of the firmware (or zombiepantslol's), because the RRP 0.78a release doesn't support the M80/M81 commands. Maybe RRP's firmware never will, because the Ormerod 2 doesn't use an ATX power supply and so it isn't possible to use the Duet to shut off the power without additional electronics.

Edited 3 time(s). Last edit at 09/04/2014 08:38AM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Auto Switch Off
September 04, 2014 05:40AM
Thanks David,


thats easy. So i will try it the next days.

Edited 1 time(s). Last edit at 09/04/2014 06:07AM by muggi.
Re: Auto Switch Off
September 04, 2014 06:50AM
Hi David, thank you very much for that. I was just about to say that M81 was doing the same as M112 (Emergancy Stop), but you've beaten me to it.
It might be a good addition to the Web Interface to have an Emergancy Stop Button linked to M112. ( You may already have it there, I can't run the Web Interface at the moment, and can't remember...).

I'll leave the 330R in if it's only a 0.9mA differance. I was a bit nervous about soldering to a Surface Mount Transitor to be honest, especialy on a moving ship, but I guess S.M. components get to sink the heat away better.

Just tested that test file with:-

G4 P1
M81

on the end, and it works perfectly.....
I've now changed my Custom End Code to:-

G1 X2 Y190; park the machine
G4 P1; Clears the buffer
M81; Power Down the Machine.

A perfect result... Thank you for giving up your time for this.

BTW I think my printer lock up the other day was caused by the Cartridge Heat Lead breaking off right at the base of the Cartridge, and then making and breaking...
The leads were well supported, so it wasn't noticed untill it finaly brokedown fully.
And that would also explain a drop off in print quality recently. I'm guessing that when the nozzle temperature fell off due to it going open circuit, the firmware may have
stopped when the temperature went out side of it's limit, and was waiting for it to come back up to temperature as the Bed temperature was working fine with the heat turning on and off so the firmware was still running.

Thanks again,
Kim...
(Looking forward to your LCD Display....)

Edited 2 time(s). Last edit at 09/04/2014 09:22AM by KimBrown.


Please send me a PM if you have suggestions, or problems with Big Blue 360.
I won't see comments in threads, as I move around to much.
Working Link to Big Blue 360 Complete
Re: Auto Switch Off
September 04, 2014 08:40AM
Quote
KimBrown
I'll leave the 330R in if it's only a 0.9mA differance. I was a bit nervous about soldering to a Surface Mount Transitor to be honest, especialy on a moving ship, but I guess S.M. components get to sink the heat away better.

My mistake, I should have said 9mA (ie. the 3K3 resistor take 1mA, the 330 ohm resistor takes nearly 10mA).



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Auto Switch Off
September 11, 2014 02:09PM
Quote
dc42

Hi muggi,

For wiring all you need to do is:

- buy a 2-pin header socket with 2.54mm spacing (or a 2-pin Molex header shell would probably be OK), and crimp pins to fit it. Just like the ones I supply with my hot end board. Connect the wires of a normally-open push button to the 2 pins. Then remove the jumper from the ATX power board and substitute the 2 pin header socket.

I'm not sure what you mean by "Is this uncritical at the actual state of the Firmware?". You will need to use my fork of the firmware (or zombiepantslol's), because the RRP 0.78a release doesn't support the M80/M81 commands. Maybe RRP's firmware never will, because the Ormerod 2 doesn't use an ATX power supply and so it isn't possible to use the Duet to shut off the power without additional electronics.



Hi David, and all others,

if i remuve the jumper from the ATX power board and substitute it with i push button it will have the effect like a jumper, thats easy. But i think to control the ATX power (in config.g M80 and in the END-Gcode m81) i will need also a connection from the duet to the atx board, or not?
Re: Auto Switch Off
September 11, 2014 02:57PM
Hi Muggi, no you don't need another connection. But you will need to solder a 330k ohm resistor across TR7, else you hear the fan speed drop, and come up again when the M81 command is issued. To have it auto shutdown after a print the Custom End Code in Slic3r needs to be altered slighty.
You need to add at the end of it:-
G4 P1; This waits till the buffered Gcode commands have finished.
M81; Sht the machine down

The resistor DC42 used was a surface mount (it looks like a nail in the picture), but I used a 1/8thW discreate resistor (I actual got the value wrong and used a 330 ohm, but it still works fine)
(See his picture further up the thread). The press button is only needed if you are using a network connection to the printer. I use USB and it works fine, and I don't have to touch the press button.
DC came up with the fix...
Kim


Please send me a PM if you have suggestions, or problems with Big Blue 360.
I won't see comments in threads, as I move around to much.
Working Link to Big Blue 360 Complete
Re: Auto Switch Off
September 11, 2014 06:17PM
Quote
muggi
if i remuve the jumper from the ATX power board and substitute it with i push button it will have the effect like a jumper, thats easy. But i think to control the ATX power (in config.g M80 and in the END-Gcode m81) i will need also a connection from the duet to the atx board, or not?

Yes, you also need to add a wire from the PS_ON output of the Duet to the middle pin of jumper block K1 on the ATX board.

The value I suggest for the extra resistor is 3.3K, although a little lower (e.g. 1K) would work just as well.

Edited 1 time(s). Last edit at 09/11/2014 06:19PM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Auto Switch Off
September 15, 2014 06:52PM
Hmmmmm I forgot about that.... cos I did the part of the convertion sometime ago, and only resisently built up the courage to solder the resistor in.


Please send me a PM if you have suggestions, or problems with Big Blue 360.
I won't see comments in threads, as I move around to much.
Working Link to Big Blue 360 Complete
Sorry, only registered users may post in this forum.

Click here to login