bigtreetech / BIGTREETECH-SKR-PRO-V1.1

Aiming at some problems existing in 3D printed motherboards in the market. Bigtree Technology Co., Ltd. launched a high performance 3D printer master board with STM32F407ZGT6 as the core controller, BIGTREETECH-SKR-PRO-V1.1.
276 stars 222 forks source link

fan0 pin PC8 not compiling #50

Closed djshrapnel closed 5 years ago

djshrapnel commented 5 years ago

I'm fairly new to this, I've dabbled in the past with programming tho. My setup is an ender 3 pro, mainboard skr pro with TMC5160 on X&Y, LV8729 on Z&E. I've gotten a majority of it working, still having a little bit of overheating issues (didn't reach overtemp yet tho)

When trying to add PC8 pin to use_controller_fan, I get a compiling error within 10secs. I tried switching switching fan_pin to fan0_pin in skr pro pins file and it compiled but I get a bunch of warnings.

Is this a fix or is there some other issue going on?

Also I found a section regarding part cooling fans and would like to assign it to the 3rd set of pins but im not sure if I understand how fanmux0_pin works.

omahena commented 5 years ago

What is the error you get reported? Are you compiling this repository or the main Marlin repository?

I am compiling the main repository and get a successful build when I use the PE6 pin. I get an error if I (re)use the PC8, because I am already using it for the hotend fan. So the build naturally complains with:

#error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN."

I never used the FANMUX pins. But an educated guess is that it will use the pins you provided as bits for a counter/ fan selector. So let's say you just need two fans and you use FANMUX0_PIN and bind it to PC8. Then when the board would set the pin to low the FAN0 would come to life, when the pin would be set to high the FAN1 would come to life. If you use two pins - you get to count to four and with three pins to eight.

But such a solution would require a fan controller. A board that can take in 3 bits of info in and drive a few fans.

djshrapnel commented 5 years ago

I'm using the main marlin repo. I guess I did have the exact same error as you.

My setup and plan was to use pin PE5 on my extruder setup on E0 auto fan pin and works fine, PE6 would be part cooling fan which compiled fine on fanmux0 pin, however I don't have a fan on it or mounted yet so I haven't tested it yet.

I was going to use PC8 as controller fan but hense my issue.

Is PC8 a hardware specific pin that marlin won't let me use?

omahena commented 5 years ago

The error simply means that the PC8 pin is already in use elsewhere. So it is not hardware specific in a way that Marlin wouldn't let you use it. But it is hardware specific in a way that it allows a fan to be connected to it.

Your problem should be a simple allocation decision question. I went with the default. These are defined in Marlin\src\pins\stm32\pins_BIGTREE_SKR_PRO_V1.1.h:

#define FAN_PIN            PC8  // Fan0 - part cooling
#define FAN1_PIN           PE5  // Fan1 - extruder

And in Marlin\Configuration_adv.h I configured to start cooling the hotend when it reaches 50C:

#define E0_AUTO_FAN_PIN PE5
...
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255   // 255 == full speed

This leaves you PE6 for case cooling. The number of (convenient) fan connectors is my only complaint about the board. But you should be able to use any PWM capable pin in the EXTENSTION-1 connector with some custom wiring (although the provided power likely will not suffice to drive a fan directly).

You can of course also change pin assignments as you wish. I agree Marlin could use different names for the pins to make things more obvious.

djshrapnel commented 5 years ago

Yea I kind of noticed the lack of fan pins, I guess I will have to wire things the other way or look into the extensions if I really have to. Thanks for clearing some of this up

omahena commented 5 years ago

@djshrapnel You are very welcome. I hope we didn't have a misunderstanding... Because with a single extruder (hotend + part fan) and case fan, you need three fans... And the three fan connectors should cover your Ender 3 Pro. Unless... mods. :)