xblax / flashforge_ad5m_klipper_mod

Unoffical mod for Flashforge Adventurer 5M (Pro) 3D printers to run Moonraker, custom Klipper, Mainsail & Fluidd
GNU General Public License v3.0
83 stars 4 forks source link

ADM5 Pro Filtration Fans are backwards and servo missing #68

Open johncotten opened 2 months ago

johncotten commented 2 months ago

The internal and external fans are flipped. Pin PB8 should be External, PB6 should be Internal. There is also a servo that flips the door when you engage External Filtration(fan). The default behavior for the servo is flipped down to only circulate internally. Both of the Pro's I received actually had the door installed upright which did not allow the servo to move. You can hear the server being activated on Nathan Builds Robots review of the pro when he's checking the filtration system. So internal filtration, which is just the blower to return air back to the chamber, should only be PB6. But External Filtration engages the servo, then both the Internal(blower) and External(4020) fans. Hope this makes sense.

consp commented 2 months ago

Pin PB8 should be External, PB6 should be Internal.

Maybe that's an issue with the AD5M non-pro config. @xblax do you know if there maybe is a difference between the original two configs? (just a wild guess)

See also #53 and #54 for reference since it's related. Would be good to add some info about this production issue somewhere since it's broken from factory by the looks of it.

johncotten commented 2 months ago

I swapped my pins and implemented #53. Thank you @Tiwatz! I updated the macros because I wanted all Air Filtration together.

printer.base.cfg:

[fan_generic internal_fan]
pin:PB6

[fan_generic external_fan]
pin:PB8

macros.cfg:

[gcode_macro END_PRINT]
gcode:
    G91                     ; relative positioning
    G1 X-2 Y-2 E-5 F2000    ; move away while retracting filament
    _COMMON_END_PRINT
    PLAY_MIDI FILE="getitem.mid" C=0
    AIR_CIRCULATION_STOP

[gcode_macro AIR_CIRCULATION_INTERNAL]
description: Turn on internal air circulation
gcode:
    SET_FAN_SPEED FAN=external_fan SPEED=0
    SET_FAN_SPEED FAN=internal_fan SPEED=1
    SET_SERVO SERVO=my_servo ANGLE=90

[gcode_macro AIR_CIRCULATION_EXTERNAL]
description: Turn on external air circulation
gcode:
    SET_FAN_SPEED FAN=external_fan SPEED=.8 ;dropped to 80 percent to quiet it down
    SET_FAN_SPEED FAN=internal_fan SPEED=1
    SET_SERVO SERVO=my_servo ANGLE=180

[gcode_macro AIR_CIRCULATION_STOP]
description: Turn off air circulation
gcode:
    SET_FAN_SPEED FAN=external_fan SPEED=0
    SET_FAN_SPEED FAN=internal_fan SPEED=0
    SET_SERVO SERVO=my_servo ANGLE=90

[gcode_macro M106]
rename_existing: M106.1
gcode:
    {% if params.P is defined and params.P|int > 0 %}
        {% if params.P|int == 1 %}
        RESPOND MSG="Fan does not exist!"
        {% endif %}
        {% if params.P|int == 2 %}
        SET_FAN_SPEED FAN=chamber_fan SPEED={(params.S|int / 255 )}
        {% endif %}
        {% if params.P|int == 3 %}
            SET_FAN_SPEED FAN=internal_fan SPEED={(params.S|int / 255 )}
            SET_FAN_SPEED FAN=external_fan SPEED={(params.S|int / 255 )}
            {% if params.S|int == 0 %}
                SET_SERVO SERVO=my_servo ANGLE=90
            {% else %}
                SET_SERVO SERVO=my_servo ANGLE=180
            {% endif %}
        {% endif %}
    {% else %}
        M106.1 S{params.S|int}
    {% endif %}
KaruroChori commented 2 months ago

I think that in order to properly calibrate it, and to fully implement some of the original functionalities, we need the base "temperature" as base level, and maybe the level you get while printing abs while enclosed. This should provide some realistic typical values to use as reference.

In terms of visualization, the fact it is shown as a temperature value is not a real problem, except that it could be confusing for the end user. I have no idea if there is a way to change visualization and units on mainsail/fluidd.

johncotten commented 2 months ago

I suppose someone could put these macros in the base config and use an if statement, (assuming we know how to identify between the 5M and the Pro, maybe using the TVOC sensor?) to hide the filtration for the 5m.

xblax commented 2 months ago

@johncotten Can you maybe attach the original klipper config from the 5M Pro? That is at /mnt/orig_root/opt/config/printer.base.cfg Would be interesting if the fans are named wrong there as well.

I think we should rename macros.cfg to macros_adm5.cfg and add additional macros_adm5_pro.cfg that has the Pro specific macros. The 5M Pro will have to include both files from printer.cfg

johncotten commented 2 months ago

Original AD5MP printer.base.cfg.txt

The pins are the same. But behavior of the fans are the same as my config above. I see some M106 changes when I compare the two files.

consp commented 2 months ago

Can now confirm that pins are reversed, weird.

consp commented 2 months ago

Both of the Pro's I received actually had the door installed upright which did not allow the servo to move.

Stock:

90 deg is external (tiny hole btw) 0 deg is internal

Mine works stock with those values but not with the values specfied in your config

johncotten commented 2 months ago

Just to make sure I'm saying this right. Default behavior is flap is closed for internal only, 0 degrees or at the 3 o'clock position. External, flap opens and moved into the 90 or 12 o'clock position? And when that does open you hear the servo change right? However it looks like it's a 90/180 flip according to the original config(which is the same for the current config too). [servo my_servo] pin:PC9 maximum_servo_angle: 180 minimum_pulse_width: 0.0005 maximum_pulse_width: 0.0025 initial_angle:90

initial_pulse_width:

Let me know if I need to pull the back off again and verify it's truly flipping correctly on my config.

consp commented 2 months ago

Default behavior is flap is closed for internal only, 0 degrees or at the 3 o'clock position. External, flap opens and moved into the 90 or 12 o'clock position?

Yes, that is what mine came with, 0 == flat (internal circulation), 90 == upright (external). I'd rather have some more confirmation since you already mentioned some from-factory issues. Mine makes nasty noises when you attempt to do 180. Probably n=2 is a bit too few to be sure.

edit: I guess mine is wrong (from factory that is) ... yours matches the flashforge code, we'd probably use those.

Procedure in the flashforge code: Internal:

SET_SERVO SERVO=my_servo ANGLE=90
SET_FAN_SPEED FAN=internal_fan SPEED=0
SET_FAN_SPEED FAN=external_fan SPEED=1

I guess they didn't care the fans were reversed

External:

SET_SERVO SERVO=my_servo ANGLE=180
SET_FAN_SPEED FAN=internal_fan SPEED=1
SET_FAN_SPEED FAN=external_fan SPEED=1

Stop is fans off and 90 degrees.

Interesting thing is, the manual code does 0/90 ... You cannot access it normally (hidden menu) but it does it differently.

aarghh ... now it's also making noises at 0 degrees (5-90 is fine, 95 and over and 5 and under is stalling servo). I'm going to open it up completely tomorrow and see what is wrong.

I guess it's me who will be opening the duct and reversing the servo.

consp commented 2 months ago

Internal (was 0, now 90) IMG_20240316_103025_MP External (was 90 now 180): IMG_20240316_103042_MP Without door: IMG_20240316_105632_MP

Long story short: They have some assembly instructions to manage, door was put in the wrong position and as a bonus the screw was to tight for the tollerances of these kind of molds. I greased it up as well and now works as expected.

johncotten commented 2 months ago

I wish I could say I "discovered" this, but I saw someone mention it on FB or YouTube and that because of the type of servo it was it was probably a fire hazard because it left the servo on and grinding or stuck. I cannot confirm if that is true, but oddly 1 of my pro's was too tight but not the other, but both were installed wrong. I am reuploading your first file, hopefully it keeps my changes, this is the orientation when the air duct is on the machine, so flap in the down position as default. So when the servo kicks on it flips it up. I can see the rubbing on your middle picture, definitely was too tight...

313397602-27e18da4-3bbd-47d3-9041-554c3d1a9d3c

consp commented 2 months ago

it was probably a fire hazard because it left the servo on and grinding or stuck.

Fortunately the wires will most likely melt and break before fire errupts.

For the servo grinding issue: maybe it's a good idea to set the defaults to 95 or 93 (which was safe for me) and 180. It mostly grinds in "internal" mode at the 90 position. This definately needs testing though by more users (or more printers).

Tiwatz commented 2 months ago

it was probably a fire hazard because it left the servo on and grinding or stuck.

Fortunately the wires will most likely melt and break before fire errupts.

For the servo grinding issue: maybe it's a good idea to set the defaults to 95 or 93 (which was safe for me) and 180. It mostly grinds in "internal" mode at the 90 position. This definately needs testing though by more users (or more printers).

On my servo the internal gears broke. Flashforge sent me a new one but the gear was way too loose on the "door". I bought a metal geared one on Amazon (ordinary sg90) and it was the same thing, way too loose. So I had to take two servos apart and replace the broken piece on the original servo. So I guess the servo will break before any fire will occur. Btw my door was in the wrong direction as well.

johncotten commented 2 months ago

I will take mine apart in the next few day and double check it's working with the new macros. It "sounds" right, and I had verified the stock software was working and sounding correct, and it's the same sound.

consp commented 2 months ago

Added the script and suggestions of splitting up the files. @xblax I don't know what is sensible so created multiple commits with all the different parts.

Changed the default angle to 95deg since on my machine it sometimes starts complaining (and getting hot) at 90. Shouldn't make too much of a difference, it's not airtight anyway.

Someday I'm going to replace it with a 3d printed version with a 60 or 80mm fan in there and a proper big door but that's a project for another day.

xblax commented 1 month ago

@consp This looks good, but I will try to avoid the duplicated END_PRINT before adding this. Maybe via a hook that we add to _COMMON_END_PRINT (untested):

{printer['gcode_macro _M5PRO_MACRO_HOOKS'].common_end_print|default("")}
consp commented 1 month ago

I'll have a look, not used to the advanced klipper stuff yet.

johncotten commented 1 month ago

it was probably a fire hazard because it left the servo on and grinding or stuck.

Fortunately the wires will most likely melt and break before fire errupts.

For the servo grinding issue: maybe it's a good idea to set the defaults to 95 or 93 (which was safe for me) and 180. It mostly grinds in "internal" mode at the 90 position. This definately needs testing though by more users (or more printers).

Double check both 90 and 95 and did not really see any difference, so I'm good with 95. FYI the actual air movement is very minimal, seems like a lot of design for not a lot of air flow. Contemplating replacing the external fan to pull a lot more air out of there.

Default state is internal with flap down: IMG_6780

External Filtration on, flap up: IMG_6779

And proper sound of flap opening:

https://github.com/xblax/flashforge_adm5_klipper_mod/assets/57412810/f2bc0763-7384-47d0-9e5f-d0c3c52f76e3

consp commented 1 month ago

Contemplating replacing the external fan to pull a lot more air out of there.

yes I'm looking into that as well. Maybe a duct with a 80mm fan. I've got some high static pressure fans laying around which would suite the job. Same for internal, complete replacement.

Also, half of the "external fan" air is blown into the pcb.

consp commented 1 month ago

@consp This looks good, but I will try to avoid the duplicated END_PRINT before adding this. Maybe via a hook that we add to _COMMON_END_PRINT (untested):

{printer['gcode_macro _M5PRO_MACRO_HOOKS'].common_end_print|default("")}

I'm actually in favour of not doing the circulation stop at endprint time and leaving it out. Switched to abs printing and I want it to continue running after the print has finished so I added it to the slicer settings instead. Also makes more sense since it's related to the material used. see 19abdd4

xblax commented 1 month ago

I'm actually in favour of not doing the circulation stop at endprint time and leaving it out. Switched to abs printing and I want it to continue running after the print has finished so I added it to the slicer settings instead. Also makes more sense since it's related to the material used. see 19abdd4

Yes, makes sense. You could even have a delayed G-Code macro to keep the fans running for a fixed time after printing.

I now included the macros on master.

Tiwatz commented 1 month ago

I just noticed in macros-pro.cfg line 38 should be SET_SERVO SERVO=my_servo ANGLE=180

consp commented 1 month ago

I just noticed in macros-pro.cfg line 38 should be SET_SERVO SERVO=my_servo ANGLE=180

That seems correct. Since it's quite a nasty bug I've already pushed it to master.

MrSolidus89 commented 2 weeks ago

Sorry guys, but is it possible to create the same system for the 5M? or print the same conveyor and add servo plus fan?

consp commented 2 weeks ago

Sorry guys, but is it possible to create the same system for the 5M? or print the same conveyor and add servo plus fan?

Haven't seen anyone make one yet, should be possible since the plastic parts and attachment points are the same. My advise will be to make one which does not use a blower fan and has a larger door since it's all a bit tiny.

MrSolidus89 commented 2 weeks ago

Sorry guys, but is it possible to create the same system for the 5M? or print the same conveyor and add servo plus fan?

Haven't seen anyone make one yet, should be possible since the plastic parts and attachment points are the same. My advise will be to make one which does not use a blower fan and has a larger door since it's all a bit tiny.

it would be interesting if a 5M PRO owner could replicate the same thing so that we who have the 5M can also take advantage of this filtering system for the closed chamber