Page 1 of 1

GCode not working as expected

Posted: Tue Jul 05, 2016 6:38 am
by DatenThielt
Morning all.

I noticed recently that once a print had finished the fan would continue running at 100% until either told to print again or I stopped it manuall (On a i3 Duplicator)

To fix this I thought I would add a 2 minute wait and then shut the fan off. Unfortunately this does not seem to do anything at all. The following is my ending script GCode.

Code: Select all

G28 X0 ; home X-axis
M104 S0 ; turn off extruder
M140 S0 ; turn off bed
M84 ; disable motors
G4 P120000 ; Wait 2 minuites
M246 ; dissable cooling fan
Am I doing something wrong? Any help would be appreciated. Thanks!

Re: GCode not working as expected

Posted: Tue Jul 05, 2016 8:03 am
by CompoundCarl
That's a pretty large value. The firmware might not support a P-value that large. Try a smaller one and see if it works (like P2000). You may also be able to do G4 S2 if your firmware supports it (http://reprap.org/wiki/G-code#G4:_Dwell)

Re: GCode not working as expected

Posted: Tue Jul 05, 2016 9:35 am
by Heutinck
Carl is right. The processor in the Melzi board will only support 16 bit values. so depending on if that register is a signed or unsigned integer, it can only hold up to 32767 or 65535 respectively. you may have to do the timer twice.

Re: GCode not working as expected

Posted: Tue Jul 05, 2016 12:12 pm
by DatenThielt
Thanks for the advise everyone. I have set it to one timer with a shorter intetger and will see what happens!