{"action":"created","issue":{"url":"https://api.github.com/repos/KevinOConnor/klipper/issues/81","repository_url":"https://api.github.com/repos/KevinOConnor/klipper","labels_url":"https://api.github.com/repos/KevinOConnor/klipper/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/KevinOConnor/klipper/issues/81/comments","events_url":"https://api.github.com/repos/KevinOConnor/klipper/issues/81/events","html_url":"https://github.com/KevinOConnor/klipper/issues/81","id":285028927,"number":81,"title":"enhancement: Support configurable PWM rates on Extruder/Bed PID controllers in RAMPS-type config","user":{"login":"andrewsil1","id":6378285,"avatar_url":"https://avatars3.githubusercontent.com/u/6378285?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewsil1","html_url":"https://github.com/andrewsil1","followers_url":"https://api.github.com/users/andrewsil1/followers","following_url":"https://api.github.com/users/andrewsil1/following{/other_user}","gists_url":"https://api.github.com/users/andrewsil1/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewsil1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewsil1/subscriptions","organizations_url":"https://api.github.com/users/andrewsil1/orgs","repos_url":"https://api.github.com/users/andrewsil1/repos","events_url":"https://api.github.com/users/andrewsil1/events{/privacy}","received_events_url":"https://api.github.com/users/andrewsil1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-29T03:42:12Z","updated_at":"2017-12-29T04:32:17Z","closed_at":null,"author_association":"NONE","body":"I have a printer (Felixprinters Tec4) which uses a cloned RAMPS 1.4 controller and Repetier firmware as \"Stock.\"  After a few hours of tinkering I was successful in getting good initial prints from Klippy. However, this printer needs a higher PID PWM rate - \r\n\r\nOn this particular printer, PWM for the bed is a must in order to control temp more tightly, as otherwise bed expansion/contraction causes waves in layer-to-layer Z-height when using bang-bang type heat management. However, at the low PWM rate being used by the PID code in most firmware, PWM rate there is a fairly large voltage sag (visible flicker in the 12V power supply LEDs, and noise (slight random instability) in the measured temps from the extruder and the bed, as well as sporadic shutdowns of the board.  In the stock firmware release notes, there is the following note: \r\n\"Updated frequency from 16 hz to 128hz. This fixed also the bug where PID control at 70% dutycycle caused the control board to turn off, when stepper drivers are turned off.\"  \r\n\r\nWhen this change was made in the Repetier fork for the Felix printer, the voltage droop, flicker, and noise in temp readings pretty much vanished.  \r\n\r\nWould it be possible enable a similar feature in Klipper to raise the PWM rate for PID?"},"comment":{"url":"https://api.github.com/repos/KevinOConnor/klipper/issues/comments/354396614","html_url":"https://github.com/KevinOConnor/klipper/issues/81#issuecomment-354396614","issue_url":"https://api.github.com/repos/KevinOConnor/klipper/issues/81","id":354396614,"user":{"login":"KevinOConnor","id":3004890,"avatar_url":"https://avatars3.githubusercontent.com/u/3004890?v=4","gravatar_id":"","url":"https://api.github.com/users/KevinOConnor","html_url":"https://github.com/KevinOConnor","followers_url":"https://api.github.com/users/KevinOConnor/followers","following_url":"https://api.github.com/users/KevinOConnor/following{/other_user}","gists_url":"https://api.github.com/users/KevinOConnor/gists{/gist_id}","starred_url":"https://api.github.com/users/KevinOConnor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KevinOConnor/subscriptions","organizations_url":"https://api.github.com/users/KevinOConnor/orgs","repos_url":"https://api.github.com/users/KevinOConnor/repos","events_url":"https://api.github.com/users/KevinOConnor/events{/privacy}","received_events_url":"https://api.github.com/users/KevinOConnor/received_events","type":"User","site_admin":false},"created_at":"2017-12-29T04:32:17Z","updated_at":"2017-12-29T04:32:17Z","author_association":"OWNER","body":"On Fri, Dec 29, 2017 at 03:42:13AM +0000, Andy Silverman wrote:\n> I have a printer (Felixprinters Tec4) which uses a cloned RAMPS 1.4 controller and Repetier firmware as \"Stock.\"  After a few hours of tinkering I was successful in getting good initial prints from Klippy. However, this printer needs a higher PID PWM rate - \n> \n> On this particular printer, PWM for the bed is a must in order to control temp more tightly, as otherwise bed expansion/contraction causes waves in layer-to-layer Z-height when using bang-bang type heat management. However, at the low PWM rate being used by the PID code in most firmware, PWM rate there is a fairly large voltage sag (visible flicker in the 12V power supply LEDs, and noise (slight random instability) in the measured temps from the extruder and the bed, as well as sporadic shutdowns of the board.  In the stock firmware release notes, there is the following note: \n> \"Updated frequency from 16 hz to 128hz. This fixed also the bug where PID control at 70% dutycycle caused the control board to turn off, when stepper drivers are turned off.\"  \n> \n> When this change was made in the Repetier fork for the Felix printer, the voltage droop, flicker, and noise in temp readings pretty much vanished.  \n> \n> Would it be possible enable a similar feature in Klipper to raise the PWM rate for PID?\n\nIt's not currently configurable.  As a test, you could change the code\n- in klippy/heater.py, change the line with \"PWM_CYCLE_TIME = 0.100\"\nto 0.010 and then do a manual restart (sudo service klipper restart).\nAlso, be sure to set the heater_bed max_power field if that's\nnecessary.\n\nIf you need faster than 10ms PWM rates then hardware pwm is\nnecessary.  That's also not difficult, but would require some further\ncode changes.\n\n-Kevin\n"}}
{"actor":{"display_login":"KevinOConnor"}}