Welcome! Log In Create A New Profile

Advanced

Marlin 2.0.9.5 on Sanguinololu 1.3a (with D12 PWM FAN)

Posted by Huxley re-new 
Marlin 2.0.9.5 on Sanguinololu 1.3a (with D12 PWM FAN)
February 08, 2024 01:48PM
Hello,
After 13 years since I started with Huxley - PLA parts started to crack so I thought to renew old time construction by adding PWM fan and some other ideas to improve print possibilities.
From time to time I upgrade firmware to keep up to date with new functions etc. (I'm using Arduino IDE 2.2.1)

Last week I spent time struggling with such annoying error (attached config and config.adv files):

"In file included from ...\Marlin\src\inc\MarlinConfig.h:49:0,
from ...\Marlin\src\HAL\AVR\HAL_SPI.cpp:34:
...\Marlin\src\inc\SanityCheck.h:1417:4: error: #error "The selected board doesn't support enough user-controlled fans. Reduce NUM_M106_FANS."
In file included from ...Marlin\src\inc\MarlinConfig.h:49:0,
...\Marlin\src\HAL\AVR\Servo.cpp:55:
...Marlin\src\inc\SanityCheck.h:1417:4: error: #error "The selected board doesn't support enough user-controlled fans. Reduce NUM_M106_FANS."
...\Marlin\src\inc\MarlinConfig.h:49:0,
...\Marlin\src\HAL\AVR\MarlinSerial.cpp:39:
...\Marlin\src\inc\SanityCheck.h:1417:4: error: #error "The selected board doesn't support enough user-controlled fans. Reduce NUM_M106_FANS."
...\Marlin\src\inc\MarlinConfig.h:49:0,
...\Marlin\src\HAL\AVR\HAL.cpp:24:
...\Marlin\src\inc\SanityCheck.h:1417:4: error: #error "The selected board doesn't support enough user-controlled fans. Reduce NUM_M106_FANS."
...\Marlin\src\inc\MarlinConfig.h:49:0,
...\Marlin\src\HAL\AVR\fast_pwm.cpp:24:
...\Marlin\src\inc\SanityCheck.h:1417:4: error: #error "The selected board doesn't support enough user-controlled fans. Reduce NUM_M106_FANS."
...\Marlin\src\inc\MarlinConfig.h:49:0,
...\Marlin\src\HAL\AVR\eeprom.cpp:24:
...\Marlin\src\inc\SanityCheck.h:1417:4: error: #error "The selected board doesn't support enough user-controlled fans. Reduce NUM_M106_FANS."
...\Marlin\src\inc\MarlinConfig.h:49:0,
...\Marlin\src\HAL\DUE\fastio\G2_PWM.cpp:43:
...\Marlin\src\inc\SanityCheck.h:1417:4: error: #error "The selected board doesn't support enough user-controlled fans. Reduce NUM_M106_FANS."

exit status 1

Compilation error: #error "The selected board doesn't support enough user-controlled fans. Reduce NUM_M106_FANS.""


I'm sure that D12 works with fan (checked), D10 PIN is used by bed (version with Mosfet on heatbed PCcool smiley but even with correctly set "pins_SANGUINOLOLU_11" I can't run M106 receiving "unknown command..."
My first thought was to comment out in "Sanitycheck...ini" line described in error message -> I was happy that compilation and upload passed until I tried M106 -> again with "unknown command..."

PLEASE - is there any one that could help me to solve this on 2.0.9.5 or eventually newer version of Marlin?
Attachments:
open | download - Marlin.rar (4.79 MB)
Re: Marlin 2.0.9.5 on Sanguinololu 1.3a (with D12 PWM FAN)
February 08, 2024 11:22PM
You have not defined a FAN_PIN

In provided pins_SANGUINOLOLU_11 you have

#if ENABLED(SANGUINOLOLU_V_1_2)
  #define HEATER_BED_PIN                      10  // (bed)
  #define X_ENABLE_PIN                        14
  #define Y_ENABLE_PIN                        14
  #define Z_ENABLE_PIN                        26
  #define E0_ENABLE_PIN                       14

  #if !defined(FAN_PIN) && ENABLED(LCD_I2C_PANELOLU2)
    #define FAN_PIN                            12  // Uses Transistor1 (PWM) on Panelolu2's Sanguino Adapter Board to drive the fan
  #endif
#else


The ENABLED(SANGUINOLOLU_V_1_2) is true but,
The #define FAN_PIN is never called as ENABLED(LCD_I2C_PANELOLU2) is false.

A second attempt is

#if !defined(FAN_PIN) && (MB(AZTEEG_X1, STB_11) || IS_MELZI)
  #define FAN_PIN                              12  // Works for Panelolu2 too
#endif

But once again (MB(AZTEEG_X1, STB_11) || IS_MELZI) is false, your not using one of these motherboards, so this is not called.


Simply add #define FAN_PIN 12 to your Configuration.h eg

#ifndef MOTHERBOARD
  #define MOTHERBOARD BOARD_SANGUINOLOLU_12
  #define FAN_PIN 12
#endif


The only change in pins_SANGUINOLOLU_11.h that is actually required and is being used is this on line 95
#define HEATER_BED_PIN                      10  // (bed)

Edited 3 time(s). Last edit at 02/08/2024 11:32PM by Dust.
Re: Marlin 2.0.9.5 on Sanguinololu 1.3a (with D12 PWM FAN)
February 09, 2024 12:43AM
as far as I can tell you don't have a display?

I have attached Upgraded to Marlin 2.1.2.2 Configs

you still need
#define HEATER_BED_PIN                      10  // (bed)
in Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h


You should also try platformio under vscode, its is so much faster than Arduino IDE.

Edited 1 time(s). Last edit at 02/09/2024 01:00AM by Dust.
Attachments:
open | download - Configuration.h (126.7 KB)
open | download - Configuration_adv.h (173.2 KB)
Re: Marlin 2.0.9.5 on Sanguinololu 1.3a (with D12 PWM FAN)
February 10, 2024 06:13AM
Thank you Dust,

Maybe it's a bit weird but I have spare LCD panel which I don't use to operate 3D printer, I prefer PC to start printing, etc. (using SD of course).

Adding "#define FAN_PIN 12" under board type in Configuration.h file solve my problem (looks so easy but wasn't for me smiling smiley )
M106 began to operate FAN but I had also to uncomment "#define FAN_SOFT_PWM" to be able to adjust voltage (M106 S0~255).

Speaking about platformio I tried to learn how to use it but for a guy without almost any skills with programing it was like magic so I'm happy that I still know how to use newer Arduino after swap from ver.1.0.5.

Now I can end up with board case project and slowly starts to collect prints, new rods and firmware tweaks to judge was it worth to re-new it like that .

Regards
Kamil

Edited 1 time(s). Last edit at 02/10/2024 06:15AM by Huxley re-new.
Sorry, only registered users may post in this forum.

Click here to login