Code already exist in firmware for extruder fan??

Code hacking talk

Code already exist in firmware for extruder fan??

Postby AmazingSpanoMan » 2014-Jun-Wed-14-Jun

Edit Update: See second comment below please

Hi there. I have two Metal Simples that work great as long as the print is less than an hour or so long. Anything more than that and the extruder motor begins to overheat and skip steps. I've tried adjusting the POTs numerous times but either it skips like crazy or overheats. There seems to be no sweet spot on either printers. My solution was to run a fan on the extruder and that has been working well and I've been able to do prints for hours without issue. The next step in my adventure leads me to customizing the fan in a way that the printer controls it on its own.

Right now the fan is hardwired to the power supply so it is on all the time when the printer is plugged in. It gets a bit frustrating having to always unplug my printer when I'm not using it. Right now I have no need for a heated bed mod so I got to thinking... Can I reprogram the pin for the heated bed to control a fan? Ideally I would like it to turn on when the hot end hits a certain temp and turn off once it is cooled.This way I know that it will turn on and stay on even after the print is completed for a little to help aid in cooling the stepper. If that isn't possible maybe just have it so it turns on during a print and turns off when it is complete? Maybe it can be controlled in a start and end Gcode?

Just wondering if anyone had any luck with messing with the pins and doing something similar.

Also, are there any free pins that output 12V that can be used instead of the HPB connection? If there is then that can be used which will still leave the HPB connection open for future heated bed mods in the future.

Thanks in advance for any help.
  • 0

Last edited by AmazingSpanoMan on 2014-Jun-Thu-12-Jun, edited 2 times in total.
AmazingSpanoMan
Waiting for printbed temp...
 
Posts: 122
Joined: 2014-Mar-Thu-21-Mar
Reputation: 6

Code already exist in firmware for extruder fan??

Sponsor

Sponsor
 

Re: Help me get this code working on my printrboard!!

Postby AmazingSpanoMan » 2014-Jun-Thu-12-Jun

OK nevermind. How about this???

See this code I found in the configuration_adv.h:

Code: Select all
//This is for controlling a fan to cool down the stepper drivers
//it will turn on when any driver is enabled
//and turn off after the set amount of seconds from last driver being disabled again
#define CONTROLLERFAN_PIN -1 //Pin used for the fan to cool controller (-1 to disable)
#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run
#define CONTROLLERFAN_SPEED 255  // == full speed

// When first starting the main fan, run it at full speed for the
// given number of milliseconds.  This gets the fan spinning reliably
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100

// Extruder cooling fans
// Configure fan pin outputs to automatically turn on/off when the associated
// extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE.
// Multiple extruders can be assigned to the same pin in which case
// the fan will turn on when any selected extruder is above the threshold.
#define EXTRUDER_0_AUTO_FAN_PIN   -1
#define EXTRUDER_1_AUTO_FAN_PIN   -1
#define EXTRUDER_2_AUTO_FAN_PIN   -1
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed


This is literally what I want to do. Can anyone help me with how to activate and pin it correctly for my extruder fan?
  • 0

AmazingSpanoMan
Waiting for printbed temp...
 
Posts: 122
Joined: 2014-Mar-Thu-21-Mar
Reputation: 6

Re: Code already exist in firmware for extruder fan??

Postby AmazingSpanoMan » 2014-Jun-Thu-13-Jun

OK I know I'm talking to myself right now but I have more info.

I went into the Configuration.h and the Configuration_adv.h and "-1" the heated bed references. In pins.h the Heated bed is set to pin 20 so I changed that to -1 to shut it off and changed the -1 on the code above for the controller fan to pin 20.

My logic says by setting the controller fan pin to 20 and disabling the heatedbed pin I should be able to use one of the 12V connections and pin 20 to control it.

Any thoughts...
  • 0

AmazingSpanoMan
Waiting for printbed temp...
 
Posts: 122
Joined: 2014-Mar-Thu-21-Mar
Reputation: 6

Re: Code already exist in firmware for extruder fan??

Postby bres55 » 2014-Jun-Thu-14-Jun

I am afraid I don't know enough to help you, but assure you, you are not only talking to yourself. I will be very interested how you get on, in re-assigning the pins. It's amazing how little snippets of information help to build the bigger picture.
Good luck in your endeavour.
  • 0

bres55
I'm an end stop.
 
Posts: 50
Joined: 2014-Mar-Tue-18-Mar
Location: Folkestone, UK.
Reputation: 1

Re: Code already exist in firmware for extruder fan??

Postby teicher » 2014-Jun-Thu-17-Jun

AmazingSpanoMan wrote:OK I know I'm talking to myself right now but I have more info.

I went into the Configuration.h and the Configuration_adv.h and "-1" the heated bed references. In pins.h the Heated bed is set to pin 20 so I changed that to -1 to shut it off and changed the -1 on the code above for the controller fan to pin 20.

My logic says by setting the controller fan pin to 20 and disabling the heatedbed pin I should be able to use one of the 12V connections and pin 20 to control it.

Any thoughts...


I think the pin reassignment will work, it'd be harmless to try to flash the board and probe the pins with a multimeter to check for voltages when the conditions exist to turn on the fan.
  • 0

teicher
Layer 300 of 1234
 
Posts: 318
Joined: 2014-Apr-Fri-20-Apr
Reputation: 15

Re: Code already exist in firmware for extruder fan??

Postby AmazingSpanoMan » 2014-Jun-Fri-10-Jun

OK so I scanned the code made changes where I think they should be made to change the pin I'm going to test it tonight on one of my metal simple
You can download the hex and source code if you want to take a look or try it.


https://www.dropbox.com/s/pkrqvs03bnl3e ... v1.cpp.hex
https://www.dropbox.com/s/pkdoj6961rmxu ... %20Fan.zip
  • 0

AmazingSpanoMan
Waiting for printbed temp...
 
Posts: 122
Joined: 2014-Mar-Thu-21-Mar
Reputation: 6

Re: Code already exist in firmware for extruder fan??

Postby EddB » 2014-Jun-Fri-11-Jun

If you are working off printrbot wiring for the heatbed (heatbed plugs) on the printrboard, be sure to check the plug wiring with a voltage meter. PB plug wire are red and black. Usually red=positive and black=negative. Not in this case, so don't trust the wire color codes. Check them yourself. The 2 pins closest to the corner are negative. The 2 pins facing the center of the board (or hot end plug) is positive.
The two inner wire (positive) are always on. The mosfets/software controls the 2 wires closest to the corner (negative) . .
Ed
  • 0

Complete printable 1405 Simple https://www.youmagine.com/designs/compl ... s-edition/ or thing:425164

True Wireless Slicing and Printer Cloud+Web Server w/ AstroPrint PcDuino v2

Printrbot Simple 1405 with XL bed and
Printrbot Simple 1311 Printing ABS andPLA on kapton/borosilicate glass
Printrbot XL volume / tower upgrade GT2 X Timing Belts (thing:194686) GT2 Y Timing Belt Mod (thing:194586)
Custom 320 x 230mm aluminum bed frame w/ 3 x 8mm rods
430 watt ATX power upgrade for 8.5" heat bed via SSR
EddB
ACME leadscrew
 
Posts: 376
Joined: 2013-Dec-Thu-00-Dec
Location: Burbank, Calif.
Reputation: 28

Re: Code already exist in firmware for extruder fan??

Postby AmazingSpanoMan » 2014-Jun-Fri-12-Jun

EddB wrote:If you are working off printrbot wiring for the heatbed (heatbed plugs) on the printrboard, be sure to check the plug wiring with a voltage meter. PB plug wire are red and black. Usually red=positive and black=negative. Not in this case, so don't trust the wire color codes. Check them yourself. The 2 pins closest to the corner are negative. The 2 pins facing the center of the board (or hot end plug) is positive.
The two inner wire (positive) are always on. The mosfets/software controls the 2 wires closest to the corner (negative) . .
Ed



Yeah I noticed that on the writeup on reprap.org. The only thing I'm trying to figure out is if it really is pin 20 that it needs to be changed to to reroute control of the fan to that (those two) pins. I saw in another post someone saying that the hotend was 14 and the bed was 15 so now I'm second guessing my ability to read the code.
  • 0

AmazingSpanoMan
Waiting for printbed temp...
 
Posts: 122
Joined: 2014-Mar-Thu-21-Mar
Reputation: 6


Return to Hack talk

Who is online

Users browsing this forum: No registered users and 1 guest