PID Controller How Do I Lower OUTPUT Freq?

Hey guys Im very new to Arduinos and coding. I found a PID Controller online that will work great to control my DIY 3D printers extrusion and heat plate. So far I'm using a simple 80w Mosfet it runs great on the S8050npn to my IRF9Z24. Almost no heat but maybe a logic level NChan Hexfet will do better being a lower gate current drive-able switch, and using a digital pin to drive the fet straight up...less components.... But that's all stuff I can handle.

Im having troubles running my Heat Plate. This is a ANYCUBE ULTRABASE, didn't realize when I bought it this F***er it take 140-145w to run this @ 12v...11A? :confused: :astonished: ..I figured around 30-60w like extrusion heads but these guys don't even have on there website the wattage or amperage rating??? I had to find it off reprap. This was also after frying a couple fet's trying to do the same thing as my PID ExtHead controller.

So today I jumped my 80w fets up to 5v base 200w transistors(2 in Parallel) was getting a great waveform but even with two in series I cant limit the current enough without Sinking the crap out of these discretes. So I had the bright idea of sending my Arduino PID waveform through a 760w sub amp I had laying around. Simplest way I could think of powering this without more$$.

So I think it may work but my frequency is to high on my output of this PID. So can any of you guys help me out? I cant find how he's setting output frequency. I see where he sets the PID calculation freq but not actual waveform wise. I'm trying to get this down to the 100-200hz range of where Subs amps operate decently.

PID_Extruder.ino (2.9 KB)

PID_v1.cpp (7.87 KB)

PID_v1.h (3.9 KB)

Why did you use a p-channel mosfet (high-side) to switch the heater.

And one with a poor Rds(on) value of 0.28ohm for a 1ohm heater.

Transistor wattage is irrelevant.
Post a diagram.
Leo..

Not sure what you mean by PID calculation frequency. PID control involves using a PID controller to set the behaviour of a feedback system... to make the output behave in a particular way in response to particular control inputs. If the system is a digital one... then choice of sampling frequency will definitely have an effect on control system behaviour. But.... for now.... what do mean by pid frequency?

Answer it my self, Duh analogWrite......internal 64 prescaler super simple... surprised 46 reads nobody.... :frowning:

TCCR1B = (TCCR1B & 0b11111000) | 0x04;

Setting precaler to 256 dropped me from 490 to 122.589 Sweeeeeeeet!!!

I wonder if you meant PWM output frequency rather than PID?

There is a big difference.

...R

nissan20det:
Answer it my self, Duh analogWrite......internal 64 prescaler super simple... surprised 46 reads nobody.... :frowning:

You mean 46 views and nobody answered your question, and you're surprised? If so.... then that's probably because your description of what you're trying to do is unclear or even erroneous.

your description of what you're trying to do is unclear or even erroneous

That is being kind!