Direct Acting Bed PID

Thanks @Sineos . You are correct, the PID is performing correctly during the BEDPID tuning process. This video is what I was referring to and don’t understand.
After a 2+ year hiatus with printing, this what I have. Hindsight, I should have went with a something different. Live and learn. Maybe something different is on the horizon.

1 Like

sensor_type has been changed.

When attempting to execute the commands, I received file not found

root@K1Max-B8E5 /root [#] cd ~
root@K1Max-B8E5 /root [#] ls -l
total 1
drwxr-xr-x 3 root root 1024 Apr 14 02:20 K1_Heater_Test
root@K1Max-B8E5 /root [#] cd K1_Heater_Test
root@K1Max-B8E5 /root/K1_Heater_Test [#] ./install.sh
-sh: ./install.sh: not found
root@K1Max-B8E5 /root/K1_Heater_Test [#] chmod +x install.sh
root@K1Max-B8E5 /root/K1_Heater_Test [#] ./install.sh
-sh: ./install.sh: not found
root@K1Max-B8E5 /root/K1_Heater_Test [#]

1 Like

Did you do this part

git clone https://github.com/TheFuzzyGiggler/K1_Heater_Test.git

?

1 Like

Yes…Directory and files are there

root@K1Max-B8E5 /root/K1_Heater_Test [#] ls -l
total 42
-rw-r–r-- 1 root root 35149 Apr 14 02:20 LICENSE
-rw-r–r-- 1 root root 346 Apr 14 02:20 README.md
-rw-r–r-- 1 root root 1088 Apr 14 02:20 heater_bed.py
-rwxr-xr-x 1 root root 2343 Apr 14 02:20 install.sh
root@K1Max-B8E5 /root/K1_Heater_Test [#] ./install.sh
-sh: ./install.sh: not found
root@K1Max-B8E5 /root/K1_Heater_Test [#]

1 Like

Do…

cd ~
rm -r -f K1_Heater_Test

and then try it all again, I changed the shebang line on the shell script.

1 Like

or hell, To make it easy

cp ~/K1_Heater_Test/heater_bed.py ~/klipper/klippy/extras/

I thermal epoxied 4 thermistors into brass standoffs and threaded them into the bed in 4 corners and ran them in series/parallel to my temp input connector. So I get the average of the temp across the entire bed with a more direct thermal connection. :muscle:

Not the “best” way to do it probably but certainly better than the typical bed heater thermistor placement.

2 Likes

root@K1Max-B8E5 /root/K1_Heater_Test [#] ./install.sh
-sh: ./install.sh: Permission denied
root@K1Max-B8E5 /root/K1_Heater_Test [#] chmod +x install.sh
root@K1Max-B8E5 /root/K1_Heater_Test [#] ./install.sh
./install.sh: line 14: syntax error: bad substitution
This script must not run as root
./install.sh: exit: line 18: Illegal number: -1
root@K1Max-B8E5 /root/K1_Heater_Test [#]

This is what @Sineos was eluding too…Not standard file structure

root@K1Max-B8E5 /root/K1_Heater_Test [#] cp ~/K1_Heater_Test/heater_bed.py ~/klipper/klippy/extras/
cp: can’t create ‘/root/klipper/klippy/extras/’: No such file or directory
root@K1Max-B8E5 /root/K1_Heater_Test [#]

Okay yeah, I’m getting more concerned we’re going to break something cause I don’t know what Creality has done.

Maybe the best “workaround” would be to set your bed temp at 105 so if it snaps back it’ll be at 100 instead of 95?

Kind of annoying, but maybe the easiest way?

1 Like

I was thinking the same thing. I tried it earlier and it “worked” and is good enough for printing. It’s just annoying to look at. Thank you again for all of your help. It was a good learning experience for me. I hope I did not waste too much of your time.

Not a problem and not a waste of time, I’m still learning the Klipper code so these things are good practice for digging into different aspects of it.

Found a video that might help if you want to switch to the “real” Klipper.

Like the video says, Be aware that you’ll probably have to reconfigure your printer if you switch to the “true” Klipper. That’s not super hard but it’s a hurdle to jump through a bit.

Depends on how much you want to mess with it.

1 Like

Awesome, thanks. I’ll give it a look and see what kind of trouble I can get into.

Nice idea. Although I wanted to point to another item, which I think Creality want to tackle here:

  • E.g. on my 8mm bed with a silicone heating mat, the “leading” temp sensor is on the silicone mat (basically the right thing, since you don’t want a melting mat or constantly replace thermal fuses)
  • At 100°C target bed temperature, the spring steel PEI surface is effectively only 80°C
  • In my workflows, I’m accounting for this with
    1. A static offset for different bed temperatures (I only use 5 bed temperature: Cold, 60°C, 80°C, 100°C, 120°C)
    2. When heating up the bed, then initially overshoot to bring the surface up to temperature faster → This is what I think, Creality is doing here

@TickleMeEm0, my recommendation:

  • If this effect only happens during the PRINT_START macro, then it is wanted and even makes sense, IMO
  • Cross-check with M140 or the SET_HEATER_TEMPERATURE command → I would almost suppose that this does not have the effect

@Sineos, I like your thoughts around workflow. I need to look into this more as it helps make things a little more straight forward and covers most, if not all materials one would run.
As for the initial overshoot, are you pushing values to wind the PID up faster or just a “initial setpoint”?

I couldn’t find the M140 command, but in my PRINT_START.cfg I found this

{% if ‘BED_TEMP’ in params|upper and (params.BED_TEMP|float) %}
{% set bed_temp = params.BED_TEMP %}
{% endif %}

Also, is there a way to pull all of the code into Visual Studio or something similar? It’s kinda wonky using the file manager in MainSail or Fluuid to find stuff.

Visual Studio Code works.

I use Jetbrains tools cause I pay to get all their tools at once (I use some for work).

Pycharm community works great, I’ve been doing all my Klipper programming in Pycharm Professional which allows remote debugging the Klipper instance straight from my printer and I can set breakpoints and watch it in real time.

Just fork the Klipper repository to your own github and use the Github integration on whatever IDE you choose to pull in the code from your forked repository.

Then you should be able to edit and do whatever you want.

If you’re really adventurous you can set Moonraker to update Klipper from your repository and not the base one to make your printer use your changes (you can always change it back later). I don’t know about setting up remote debugging in Pycharm Community or VSC but it might be possible.

Thanks, @TheFuzzyGiggler. I’ll see what I can’t figure out with VSC. PyCharm looks great, but it’s hard to justify the cost to me for just playin around :open_mouth:

Pycharm Community is free.

Pycharm Professional is the paid version.

1 Like

I didn’t even see the Community version at first…downloading now to check it out.
Thanks

2 Likes

After further troubleshooting, it was found that one of my MOSFET’s on the heat bed control board were toast and causing the instability in heating. I replaced with a 40A SSR and am able to hit and maintain setpoint within 0.1 degree C.
Thank you @TheFuzzyGiggler and @Sineos for all of your help and guidance!

3 Likes