Welcome! Log In Create A New Profile

Advanced

FAN/Cooler control & Azteeg X3

Posted by CmdrKeen 
FAN/Cooler control & Azteeg X3
March 12, 2014 09:08PM
Anyone get the fan control to work on the Azteeg X3? Extruder cooler works fine, but filament doesn't... at least, not for me.

I've had this problem since I got the board up and running actually (091r0).. and I just pushed 091r6 today to see if that'd fix it (it didn't).

Anyone else have this issue? I had this problem once before and I fixed it, but it was awhile back (v091r0?) and I don't remember what I did. Config.h is attached here for anyone who wants to see what I'm doing. I've tried to manually define the fan pins as pin 5 for FAN_PIN and FAN_BOARD_PIN as pin 6 (does the fan board settings do anything? I can't figure out what causes it to turn on).

Now that I'm at 091r6, I'm going to have to hack it again to bring "allow cold extrudes" and fix the damn pid tuning thing bit again too..
Attachments:
open | download - Configuration.h (19.4 KB)
Re: FAN/Cooler control & Azteeg X3
March 13, 2014 02:02AM
you have to use the digital pin 9
to cool the print


DELTA Printer - Duet -Touch5" - E3D_V6
Re: FAN/Cooler control & Azteeg X3
March 13, 2014 09:28PM
Why pin 9? I don't have that specified anywhere in my configuration settings at all.

The way the code *should* be working (unless I'm misreading it)

Step #1. Read "configuration.h"

#define NUM_EXTRUDER 1
#define MOTHERBOARD 34

#include "pins.h"

2. STOP processing Configuration.h, go read pins.h:
<... snip! ...>
/****************************************************************************************
* Arduino Mega pin assignment
*
****************************************************************************************/
#if MOTHERBOARD == 33
#define MOTHERBOARD 3
#define RAMPS_V_1_3
#elif MOTHERBOARD == 34
#define MOTHERBOARD 3
#define RAMPS_V_1_3
#define AZTEEG_X3
#endif

So our motherboard is #34, which means RAMPS_V_1_3 gets defined, so does AZTEEG X3.

// pins.h cont'd



#ifdef RAMPS_V_1_3

#define LED_PIN            13
#define ORIG_FAN_PIN            9
#define PS_ON_PIN          12

<... snip! ..>

#ifdef AZTEEG_X3

<... snip! ...>

#define ORIG_FAN_PIN           4
#define ORIG_FAN2_PIN          5
#define LIGHT_PIN         6
#define BEEPER_PIN        33  // Activate beeper on extension shield
#define BEEPER_TYPE        1

3. in the RAMPS_V_1_3 section, ORIG_FAN_PIN was defined as #9.
4. In the AZTEEG_X3 section, it was redefined as pin 4.
5. Return to Configuration.h

#define FAN_PIN ORIG_FAN2_PIN     
#define FAN_BOARD_PIN 6

 <... some parts removed ...>
#define EXT0_EXTRUDER_COOLER_PIN ORIG_FAN_PIN
#define EXT0_EXTRUDER_COOLER_SPEED 255

<.. snip! ...>
#define FEATURE_FAN_CONTROL 1

5. FAN_PIN is set to ORIG_FAN2_PIN (which from pins.h in the Azteeg X3 section was set as 4.

When the code runs, it looks like PWM control is done via HAL.cpp in the PWM_TIMER_VECTOR Interrupt block:

/**
This timer is called 3906 timer per second. It is used to update pwm values for heater and some other frequent jobs.
*/
ISR(PWM_TIMER_VECTOR)
{
    static uint8_t pwm_count = 0;
    static uint8_t pwm_count_heater = 0;
    static uint8_t pwm_pos_set[NUM_EXTRUDER+3];
    static uint8_t pwm_cooler_pos_set[NUM_EXTRUDER];
    PWM_OCR += 64;

<.. snip! ..>

#if FAN_BOARD_PIN >- 1
        if((pwm_pos_set[NUM_EXTRUDER+1] = pwm_pos[NUM_EXTRUDER+1])>0) WRITE(FAN_BOARD_PIN,1);
#endif
#if FAN_PIN>-1 && FEATURE_FAN_CONTROL
        if((pwm_pos_set[NUM_EXTRUDER+2] = pwm_pos[NUM_EXTRUDER+2])>0) WRITE(FAN_PIN,1);

<..snip!..>
#if FAN_BOARD_PIN>-1
    if(pwm_pos_set[NUM_EXTRUDER+1] == pwm_count && pwm_pos_set[NUM_EXTRUDER+1]!=255) WRITE(FAN_BOARD_PIN,0);
#endif
#if FAN_PIN>-1 && FEATURE_FAN_CONTROL
    if(pwm_pos_set[NUM_EXTRUDER+2] == pwm_count && pwm_pos_set[NUM_EXTRUDER+2]!=255) WRITE(FAN_PIN,0);
#endif

Since FAN_PIN isn't overridden anywhere else that I can find, the PWM ISR should be toggling FAN_PIN (pin 4) on and off..

So it *should* be working just fine.. but it's not. I've tried defining random pins as well (4, 7, 11, etc.) and the fan always seems to spin @ about 50%, regardless what I send M106/M107 wise.
Sorry, only registered users may post in this forum.

Click here to login