Welcome! Log In Create A New Profile

Advanced

Programming extra PWM signal to go with extruder activation

Posted by kris.sparky 
Programming extra PWM signal to go with extruder activation
March 25, 2015 02:40PM
Could anyone point me towards where I could add some extra code to activate one of the additional PWM outputs when I'm activating a particular extruder ?
I'm using Repetier 0.92.3 via [www.repetier.com] with the Panucatt Azteeg X3 Pro board (with a 24V power supply)

eg. when I activate T0/extruder 1, I'd also like to output a 24V signal from HEATER_PIN_5 (arduino digital PWM pin 5), which in turn will trigger the fan and led associated with that extruder.
Extruders 2,3, & 4 will then turn on ORIG_FAN_PIN, ORIG_FAN2_PIN, and LIGHT_PIN respectively when they are called.

---
Unrelated, I noticed a couple oddities in the Repetier configuration.h pin assignments.
The #define EXT0_ENABLE_PIN pointed to E0_ENABLE_PIN, while the actual pins.h only seems to point to indicate an ORIG_E0_ENABLE_PIN (subbing E0, E1, E2, ...).
Also the Azteeg X3 Pro documentation lists x-min-endstop as pin 2 and max as pin 3, while the standard using the Ramps 1.3 defaults is the reverse. I'm guessing the Azteeg X3 Pro documentation is a typo, but we'll see when I get to testing later this week.
Re: Programming extra PWM signal to go with extruder activation
March 27, 2015 05:15AM
That is what EXT0_COOLER_FAN is meant for. It will activate a cooler when extruder is hot or on.


ORIG_E0_ENABLE_PIN gets stored later in pins,.h to EXT0_ENABLE_PIN . Reason is the online config tool where you can select pins for everything and that uses the original pins.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Programming extra PWM signal to go with extruder activation
March 27, 2015 11:05AM
Thank-you for your help!
Quote
repetier
That is what EXT0_COOLER_FAN is meant for. It will activate a cooler when extruder is hot or on.
Thank-you. I read the description below the extruder cooler pin to mean that it wasn't always on while the extruder was active, but rather would cycle on if the extruder needed it.
"The extruder cooler is not the fan cooling your print! It cools only the extruder for a smaller transition zone."


Quote
repetier
ORIG_E0_ENABLE_PIN gets stored later in pins,.h to EXT0_ENABLE_PIN . Reason is the online config tool where you can select pins for everything and that uses the original pins.
I was looking through pins.h and didn't see that cross-mapping for my board, but I'll give it a shot both ways. I did verify that the Azteeg X3 Pro documentation was wrong and the pin assignment in pins.h is correct for the min/max x-end-stops.

I have had one little oddity since firing up my gantry, regardless of what distance I put in the "X min position", after homing the x-axis, the gantry will move back ~100mm in the x direction and then report that it's at that min position. eg. If I tell it the minimum x position is 0, it'll move ~100mm and then say it's at zero. Are there any geometry variables I should look at ? I suspect it could have to do w extruder offsets ?
Re: Programming extra PWM signal to go with extruder activation
March 27, 2015 11:16AM
In pins.h

// Original pin assignmats to be used in configuration tool
#define X_STEP_PIN ORIG_X_STEP_PIN
#define X_DIR_PIN ORIG_X_DIR_PIN
#define X_ENABLE_PIN ORIG_X_ENABLE_PIN
#define X_MIN_PIN ORIG_X_MIN_PIN
#define X_MAX_PIN ORIG_X_MAX_PIN

#define Y_STEP_PIN ORIG_Y_STEP_PIN
#define Y_DIR_PIN ORIG_Y_DIR_PIN
#define Y_ENABLE_PIN ORIG_Y_ENABLE_PIN
#define Y_MIN_PIN ORIG_Y_MIN_PIN
#define Y_MAX_PIN ORIG_Y_MAX_PIN

#define Z_STEP_PIN ORIG_Z_STEP_PIN
#define Z_DIR_PIN ORIG_Z_DIR_PIN
#define Z_ENABLE_PIN ORIG_Z_ENABLE_PIN
#define Z_MIN_PIN ORIG_Z_MIN_PIN
#define Z_MAX_PIN ORIG_Z_MAX_PIN

If you have multiple extruders, after homing it will go to the right so that all extruders can be selected without hitting endstop. It will also go to the right based on

#define ENDSTOP_X_BACK_ON_HOME 1
#define ENDSTOP_Y_BACK_ON_HOME 1
#define ENDSTOP_Z_BACK_ON_HOME 5

but a few mm to disable endstop is enough here.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Programming extra PWM signal to go with extruder activation
March 27, 2015 12:36PM
Thanks again. Your explanation really cleared things up.

Quote
repetier
If you have multiple extruders, after homing it will go to the right so that all extruders can be selected without hitting endstop.
That makes perfect sense, I had assumed I would need to do this manually.

Going back to the original question about enabling the extra outputs, I've made the following changes to my configuration.h file. This will probably vary for others based on their boards pin definitions.
#define EXT0_EXTRUDER_COOLER_PIN -1
#define EXT1_EXTRUDER_COOLER_PIN -1
#define EXT2_EXTRUDER_COOLER_PIN -1
#define EXT3_EXTRUDER_COOLER_PIN -1
to
#define EXT0_EXTRUDER_COOLER_PIN HEATER_5_PIN
#define EXT1_EXTRUDER_COOLER_PIN ORIG_FAN_PIN
#define EXT2_EXTRUDER_COOLER_PIN ORIG_FAN2_PIN
#define EXT3_EXTRUDER_COOLER_PIN LIGHT_PIN

The last thing I have to sort out is assigning a z-offset to the extruders, or a negative value to the z-probe height.
Re: Programming extra PWM signal to go with extruder activation
April 22, 2015 08:40PM
Hi Repetier,
I have everything working sort-of-ok, but I'm wondering if I can remove the extruder temperature requirements associated with the EXTx_EXTRUDER_COOLER_PIN so that it just turns on and off with the associated extruder and is not dependent on how high the target temperature is for that extruder, nor how much the extruder has cooled off.
Thanks!
Re: Programming extra PWM signal to go with extruder activation
April 23, 2015 03:28AM
Not natively. In Extruder.cpp quite at the top is the manage temperatures function ( void Extruder::manageTemperatures() ) which enables cooler fan. You can edit the condiftion to any condiftion you like, also I do not see why. The part you need to change should be this

            if(act->currentTemperatureC < EXTRUDER_FAN_COOL_TEMP && act->targetTemperatureC < EXTRUDER_FAN_COOL_TEMP)
                extruder[controller].coolerPWM = 0;
            else
                extruder[controller].coolerPWM = extruder[controller].coolerSpeed;

could look liek this if I understand you correctly:
            if( act->targetTemperatureC < 20)
                extruder[controller].coolerPWM = 0;
            else
                extruder[controller].coolerPWM = extruder[controller].coolerSpeed;


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Programming extra PWM signal to go with extruder activation
April 23, 2015 11:01AM
Thank-you again for the help. I'll give that a try and work on it from there.
Sorry, only registered users may post in this forum.

Click here to login