-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update code base to Marlin 2.1.1 #364
Conversation
c55dadc
to
346c911
Compare
Awesome! |
Sure, take your time. I only have one printer to test and only did a single real print so far (and some dummy test-sequences). But especially for the Chiron implementation the changes were made blindly, so I can only say it compiles... For the soft PWM changes I honestly can't remember if I experienced the ticking issues back in 1.4.0, so no idea if it is still present for anyone. Disabling the sanity check, i.e. tolerate the conflict as we did before, would be another possibility of course. |
After all, I only own a Mega S and cannot test the Chiron implementation. But I know some people who do that. For now, I'll go through the code myself, then I'll compile everything and then have it tested. Let's write on Discord if you like. |
I tested it and now the cooling fan is pulsing slowly, for example setting the fan speed to 50% |
You are right, seems too slow. The previous attempt in 1.4 was 5 (32x speed) with dithering caused issues, so we should figure out something in between. |
Yeah, I was about to say, |
If you activate SOFT_PWM, the heaters are also controlled via software pwm. I don't know why, but this has caused some bed MOSFETs to bust in the past. |
So whats the alternative? |
2c9ef30
to
9c48bc6
Compare
I don't know. As @stklcode mentioned, activating the dithering might be the problem here. Also it could be helpful to increase the pwm frequency. |
How was it handled prior to his Update to 2.1.1 ? Hardware PWM seems to have worked there on the fans as well, unless you had SOFT PWM enabled too in your latest build? |
We used hardware PWM in previous versions (except 1.4.0). This conflicts with the speaker feature, as both speaker and fans share the same AVR timers. This has always been kind of a problem, but prior to Marlin 2.1 there simply was no sanity check which prevents the firmware from building now. If there really is no suitable combination of soft PWM, frequency scaler and dithering, we can either not use the speaker or comment out the sanity check and tolerate the "problem". Typically during print there aren't really many sounds to be played, so it should be acceptable that the speaker messes up with the fan PWM and vice versa. I believe it's only the fan, so fan speed is inaccurate during sound playback and sound is messed up when the fan speed changes at the same time. It's not pretty, but doesn't really affect the print job either. |
I have the speaker completely off anyway, how would I go about re-enabling hardware PWM the way it was before? In my use case the speaker was annoying so Id be fine with it gone, can always just use octoprint to get audio feedback. |
If have both You'll run into an error during build. Marlin-2-0-x-Anycubic-i3-MEGA-S/Marlin/src/HAL/AVR/inc/SanityCheck.h Lines 67 to 73 in 986e416
Introduced in MarlinFirmware/Marlin#23672 |
So to get Pre-2.1 HardwarePWM FAN behavior, what do I have to do? Disable speaker and soft pwm? (Edit: Didn't notice the Conditional above errors only if speaker is on and soft off) imo the MOSFET burning out is arguably the worse option, hence I'd rather have a buggy speaker or no speaker and I'm sure most others as well. |
Exactly.
First option will give you the pre-2.1 behavior, second will disable the speaker completely. |
Perfect, for the public release maybe we should go with buggy speaker or offer 2 builds one with speaker and soft pwm and one without? Like I said I'd argue its better to not have the risk of blown mosfets. |
Hi, Best regards |
9c48bc6
to
33e9e94
Compare
I rebased my PR, reverted back to hardware PWM and disabled the sanity check with a corresponding comment. Just keep it "as is" for now and pospone optimization, if possible. |
Another Info that might be useful is the official MEGA S Firmware, where SOFT_PWM is used, but no PID for Heaters. -> Click here.
Maybe I should get out my oscilloscope and take a good look at the PWM signals from the heaters to find out why MOSFETs have died in the past. |
Personally have no skill with a oscilloscope, so go ahead 😅, I have a Mega S as well though if you need me to test something |
Actually I had no issues with scale 2, fan has less ticking at 25% with 3. Just one small print job so far, normal brhavior. Didn't measure anything yet, maybe some time next week (connectors arrived yesterday, so I have a comfortable breakout cable now) |
Remove unused variables, sanitize declarations and apply uncrust.
The hardware PWM for fan control conflicts with the speaker setup. While this has always been an issue, sanity checks now fail because of this. We've used soft PWM in 1.4.0 and reverted back to hardware PWM in 1.4.1, so we probably need some additional investigation and testing here.
33e9e94
to
bd49cc3
Compare
Description
This PR updates the upstream sources to Marlin 2.1.1
Changes
Z_DRIVER_TYPE
andZ2_DRIVER_TYPE
anycubic_touchscreen
code with relevant changesTested
The firmware builds for all targets
I've tested the
MEGA_P_DGUS_BLT_10
target on my printer, including special menu, autoleveling and laser. Works so far.Benefits
The updates introduces new features and bugfixes in Marlin. It also brings this project closer to upstream for future development.
Configurations
The configuration files have been updated and hopefully all customization remain functional.
I have enabled
FAN_SOFT_PWM
withSOFT_PWM_SCALE
value 2 (~15Hz), because of conflicts withSPEAKER
(same timer for hardware PWM).This has been an issue ever since that is just rarely is noticed (strange speaker sounds when fan speed changes during playback or short interrupt of fan speed), but latest sanity checks prevent compilation.
We hat soft PWM enabled in 1.4.0 (d19dbf0) and disabled it again in 1.4.1 (7071629), so we probably need some further testing here.
Related Issues
None.
Side note
I have done complete rabase of this repository on top of Marlin 2.0.5.3 where it all started: https://github.com/stklcode/Marlin/tree/knutwurst Makes merging upstream changes and conflict resolution much easier with proper tooling, so probably a well spent hour.
For this PR I have applied patches derived from the "knutwurst-next" branch where a real merge of 2.1.1 was done: https://github.com/stklcode/Marlin/tree/knutwurst-next