Announcement

Collapse
No announcement yet.

Sending PWM through a relay

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • clearchris
    replied
    Re: Sending PWM through a relay

    At full blast, 2 minutes 22 sec from room temp to 200C. 190C temp rise is about 1.3C per second, straight slope, no lagging at the top either. SSR heat sink was warm, definitely not hot. No popped breaker. Looks like green light for a reflow profile.

    Attached Files

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    Originally posted by Curious.George View Post
    Breaker stuff
    Agree 100%. I figure I'll run it flat out a bit, and if it doesn't pop, it should be ok. I really need to get a clamp meter...

    Originally posted by Curious.George View Post
    It's not like accounting where you CAN (and MUST) account for every penny in order to "get it right".
    Not entirely true. Accountants use "due diligence" which is defined as: such diligence as a reasonable person under the same circumstances would use : use of reasonable but not necessarily exhaustive efforts.

    Originally posted by Curious.George View Post
    What was involved in that? I've wanted to get "licensed" just to be able to repair out freezer (cuz they don't make anything similar, any more) as I don't think refrigerants are sold to "Joe User".
    You need to take the EPA 608 test. Taking the test licences you to work on refrigeration and buy refrigeration products, on a federal level. On a local level, some states do allow you to work on your own equipment, some don't. Most states won't let you work on someone else's equipment without being a registered contractor, and going through hoops to get that including an apprenticeship, etc. Even if the state will allow you to work on your own equipment, it's not common to get DIY people, HVAC supply houses will often choose not to do business with those who are not contractors. I have been told to leave a few, and one even threatened to call the police on me, and I was entirely polite and not argumentative. I think he was just a generally ornery person and having a bad day on top of it. Some will try to stick you with "retail" prices, which are jobber prices times 4, or as much as they think you have in your pocket. Online buying is easy, though I have a place I like to go to in an emergency. I usually bring them donuts, I find it's really hard for people to be a jerk to someone who just stuck a donut in their mouth. You are also required to have "recovery equipment" which isn't as expensive as it was, but can still cost you a few hundred.

    And you can work on refrigeration without the EPA test, you just aren't allowed to hook up gauges, braze in a new compressor, etc. Most of the things that go wrong are capacitors, fan motors, thermostats, dirty coils and somewhat more rarely compressor start relays. Most repairs I make to refrigeration I don't even touch my gauges.

    I'll warn you, repairing refrigeration gets expensive quick. There are a LOT of tools you need to do a good job, though it's surprising how little some of the old timers use. Those guys are all about rules of thumb - "beer can cold" good to go!

    Originally posted by Curious.George View Post
    You may want to track how often each spool gets "baked". If, for example, you notice that the filament starts getting brittle, you might discover that three drying cycles is the limit before the medium is "compromised" -- that may help you plan your material usage (e.g., take the "last half" of the spool and "store it" so it doesn't need to get baked, repeatedly, before you need it)
    I haven't noticed this to be the case, but it's a good point, I'll keep an eye on it.


    If anyone wants to see the oven in action, I made a short vid: https://drive.google.com/open?id=1gC...vVBDCiA9oZlUn_
    Last edited by clearchris; 05-03-2020, 02:06 PM.

    Leave a comment:


  • Curious.George
    replied
    Re: Sending PWM through a relay

    Originally posted by clearchris View Post
    Making it work is half the fun! No constraints, it's too easy.
    As long as you keep in mind that it can decide to NOT work right when you are in the middle of something that you'd EXPECTED to work. E.g., if a breaker trips because it calls for more heat than you'd previously expected, resetting the breaker will likely just cause it to trip AGAIN -- cuz now it needs all that previous heat PLUS some more.

    [I don't mean to be pessimistic. Rather, its the nature of my job -- I can't come up with solutions that only work "sometimes"...]

    [messy loops]

    I'm starting to believe that.
    Keep at it long enough and any doubts you have on the subject will evaporate! :> Just be ready to decide "this is good enough" -- for some value of "good enough". It's not like accounting where you CAN (and MUST) account for every penny in order to "get it right".

    HVAC / Refrigeration can be such a pain. I took the certification test so I could do my own work, but I always need an extra cup of coffee to do it. I hate to say it, but it has been a while since I have taken the torch out (please nothing break).
    What was involved in that? I've wanted to get "licensed" just to be able to repair out freezer (cuz they don't make anything similar, any more) as I don't think refrigerants are sold to "Joe User".

    [dehydrator]

    You may want to track how often each spool gets "baked". If, for example, you notice that the filament starts getting brittle, you might discover that three drying cycles is the limit before the medium is "compromised" -- that may help you plan your material usage (e.g., take the "last half" of the spool and "store it" so it doesn't need to get baked, repeatedly, before you need it)

    At least I'm getting a lot of use out of the oven already.
    Yeah, and when its not melting lead/zinc, you can always bake COOKIES!!!

    Good luck! Time for lunch...

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    Originally posted by sam_sam_sam View Post
    Why not use a heat lamp and a CPU fan at very low speed

    From you are saying I will probably have to do the same thing with a roll that I took out the bag and did not realize that why it was inside a sealed bag and also did not realize that bag was resealable
    If it's PLA, just put it back in the bag with the desiccant, you should be ok. PLA takes a while to absorb moisture. If it's super cheap ebay PLA, I'd definitely dry it. If it's a reputable brand, and the package didn't have holes and appeared to be vacuum sealed, you should be ok. When PLA swells, you will start noticing overextrusion, you will have to change your flow multiplier, etc. But it doesn't print too badly. The other filaments will act downright horrible. I literally will not print with PETG unless I have baked it in the past 48 hours. Aside from the extrusion multiplier, you probably wouldn't notice much with PLA as your printer is stock. My $160 printer has three years of mods and probably at least another $150 in it, and it prints better than most $600 printers out of the box.

    The problem is, I now dry my PLA at 120F. I have ruined more than one spool of PLA. If it's too hot (140F might be too hot) it can turn brittle to where it snaps in your hands (BTDT) and it can also melt together (BTDT). Much lower than 120F and I don't know how much drying you will have. But if your temp spikes, you can easily ruin PLA. ABS, PETG and NYLON you don't have to worry much about ruining it.

    Some people get away with a small incandescent light in a bucket or a food dehydrator, but I'm not convinced. Now with the oven, I can set it and walk away knowing that I can hold temp to within 1C.

    You might also consider building a dry box. That way your spool stays dry when it's out of the package. I also have a few 5 gallon buckets that I store the filament in. Pic attached.

    When people ask my why I have a 3d printer, I jokingly respond that I have a 3d printer so that I can print parts for the 3d printer. That's not entirely true, but sometimes it sure feels like it's true. So, get on thingiverse and find a drybox design that you like, and start looking around for a sealable container that works for you. Speaking of which, get on the ender 3 groups and ask them what parts break and what you should upgrade / print spares for. I keep a decent sized stock, and it has saved me plenty of times. The parts are dirt cheap if you order them from overseas, much more expensive if you need them in a hurry.

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    Originally posted by Curious.George View Post
    You can peek at the wire by pulling the receptacle out and looking at the connections to the fixture. Chances are, if it's fused at 15A, it's 14AWG.
    Yeah, my house was built in apparently a transitional period. It's older, all 12ga wire and 20a breakers, but only recently rewired outlets have ground. I didn't know there was a period between 12ga wire adoption and three prong outlets, I always thought it happened around the same time.

    Originally posted by Curious.George View Post
    That's why I suggested using TWO cords: e.g., one for the resistive heaters and one for the halogens. It seems a logical way to split the load.
    Making it work is half the fun! No constraints, it's too easy.

    Originally posted by Curious.George View Post
    Again, control loops are often messy and the "remedies" often are kludges.
    I'm starting to believe that.

    Originally posted by Curious.George View Post
    To get good control, you may have more than one air handler, each operating at different temperature/flowrate/humidity levels. And, a mechanical "vane" that acts as a valve to select between "air handler A" and "air handler B". This is easier than trying to get a single air handler to quickly switch from supplying, for example, hot/moist air to cold/dry air.
    HVAC / Refrigeration can be such a pain. I took the certification test so I could do my own work, but I always need an extra cup of coffee to do it. I hate to say it, but it has been a while since I have taken the torch out (please nothing break).

    A lot of really cool tools in refrigeration though. I love my ultrasonic leak detector. It has all kinds of uses.

    Right now I'm running a cycle to dry out my desiccant. Working well so far, but temperature really not important so I'm running the resistive heaters. Tomorrow, I'm going to see if I can preheat a galaxy S7 so I can change out the menu button/antenna board. The screen has to come off to do it. Fun times.

    At least I'm getting a lot of use out of the oven already.

    Leave a comment:


  • sam_sam_sam
    replied
    Re: Sending PWM through a relay

    Why not use a heat lamp and a CPU fan at very low speed

    From you are saying I will probably have to do the same thing with a roll that I took out the bag and did not realize that why it was inside a sealed bag and also did not realize that bag was resealable

    I glad you posted this information

    Leave a comment:


  • Curious.George
    replied
    Re: Sending PWM through a relay

    Originally posted by clearchris View Post
    Heh, I feel like I just got hazed. Am I a member of the club yet?
    I'm just giving you a head's up that you will likely find this to be a frustrating experience.

    Eh, there's wiggle room, it's not like it's going to melt down at 16a. I'd be more concerned with the wire in the wall, but if it's 12ga (it is), it's good to 20a.
    You can peek at the wire by pulling the receptacle out and looking at the connections to the fixture. Chances are, if it's fused at 15A, it's 14AWG.

    I have an 60a (iirc) outlet for my welder. Don't recall if it has neutral though. Really don't feel like messing with one of those enormous plugs on the end of my oven. Plus I don't have an extension cord for that...
    That's why I suggested using TWO cords: e.g., one for the resistive heaters and one for the halogens. It seems a logical way to split the load.

    I'm trying as hard as I can to keep this simple. The software is a bit complex, but really I haven't had to do much coding yet. Just reading the code so I can figure out what hacky configuration I can make work.
    Again, control loops are often messy and the "remedies" often are kludges.

    For example, in many industrial processes, you often have cascaded loops because the heating/cooling/humidification/dessicating element (e.g., in an air handler) may be distant from the "point of delivery" -- which is where you ultimately want to control at. But, using that as a SINGLE sense point means you have SECONDS of lag built into the loop as it takes the "treated air" that long to travel down the ductwork to reach the sensor. So, you add a sensor near the control element and build a loop, there. Then, superimpose another loop AROUND that using the "remote" sensor. I.e., an air handler is expensive (tens of kilobucks)

    To get good control, you may have more than one air handler, each operating at different temperature/flowrate/humidity levels. And, a mechanical "vane" that acts as a valve to select between "air handler A" and "air handler B". This is easier than trying to get a single air handler to quickly switch from supplying, for example, hot/moist air to cold/dry air.

    If you're moving thousands of dollars worth of "product" through the process each hour, the cost of the second air handler is "nothing", over time.

    Leave a comment:


  • eccerr0r
    replied
    Re: Sending PWM through a relay

    Nice thing about freeze drying is that it's pretty much put in and forget, much like desiccant, except you just need to power it. "Cold" is relative, you can do it at 20°C just fine, no need to go to 0°C.

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    Originally posted by eccerr0r View Post
    From the constraints you put, freeze or otherwise cold drying is the ideal way to get rid of the water if you don't want to deal with the desiccant...
    Never considered that, the equipment is pretty expensive, isn't it? Plus, plastic doesn't always do well with the cold.

    Oh, I have desiccant too. I have what's called a "dry box" with desiccant where the filament lives when it's outside of my sealed 5 gallon buckets. My next oven profile will probably be a cycle to dry out my desiccant.

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    Originally posted by Curious.George View Post
    Welcome to the joys of loop tuning! You will discover that it can be really frustrating as you're never sure if what you're doing is making things BETTER, or WORSE. It's ART more than SCIENCE.
    Heh, I feel like I just got hazed. Am I a member of the club yet?

    Originally posted by Curious.George View Post
    Note that, to a certain extent, you can limit the number and frequency of such "disturbances". E.g., when you bake a cake, you don't keep opening the door just to see how it looks!
    Yeah, I don't plan on ever opening the oven when it's in process. I just did it for the funsies.

    Originally posted by Curious.George View Post
    I assume its not practical to process PORTIONS of spools? I.e., you need to have "enough dry stock" to complete a print... it's not like you can piece together shorter lengths...
    Well, I said "small spool" I meant "almost empty spool" because I didn't want to lose a full spool if something went wrong. And I can't get my cheesy ebay $12 spools anymore, china is shut down, I have been having to get the $22 fancy spools. High rollin!

    And my printer is so small, I don't go through that much plastic per print. 1kg is a LOT of plastic.

    Originally posted by Curious.George View Post
    In the US, that's a "kitchen" circuit and requires a different plug/receptacle (normal receptacles are only rated to 15A -- 1800W, underated). Instead of the parallel blades ||, it will have perpendicular blades -|. Dedicated refrigerator and furnace outlets MAY be 20A capacity. And, outdoor or garage outlets. You may find it more convenient to run TWO power cords to two different outlets (on different circuits). I wired the two (required!) kitchen "countertop outlet" circuits so that every other outlet was on the same branch. So, as long as I connected to two different -- but adjacent -- "receptacles", I was guaranteed to have two circuits available.
    Eh, there's wiggle room, it's not like it's going to melt down at 16a. I'd be more concerned with the wire in the wall, but if it's 12ga (it is), it's good to 20a.

    Originally posted by Curious.George View Post
    [If you have an electric range or clothes dryer, you can access two separate circuits in the same (220VAC!) outlet, there. Keeping in mind that they will be out-of-phase whereas two random branch circuits may or may not be!]
    I have an 60a (iirc) outlet for my welder. Don't recall if it has neutral though. Really don't feel like messing with one of those enormous plugs on the end of my oven. Plus I don't have an extension cord for that...

    Originally posted by Curious.George View Post
    You could also "outboard" the fan, tying it to the oven with rigid or flexible ductwork.
    Oh hell no. Aside from the crazy complication, it's a recirculation fan, that would bleed heat like crazy. Hehe.

    I'm trying as hard as I can to keep this simple. The software is a bit complex, but really I haven't had to do much coding yet. Just reading the code so I can figure out what hacky configuration I can make work.

    Leave a comment:


  • eccerr0r
    replied
    Re: Sending PWM through a relay

    From the constraints you put, freeze or otherwise cold drying is the ideal way to get rid of the water if you don't want to deal with the desiccant...

    Leave a comment:


  • Curious.George
    replied
    Re: Sending PWM through a relay

    Originally posted by clearchris View Post
    CG: I spent yesterday changing the pid values and observing.
    Welcome to the joys of loop tuning! You will discover that it can be really frustrating as you're never sure if what you're doing is making things BETTER, or WORSE. It's ART more than SCIENCE.

    Also did some testing, opening the door, a few times, the algorithm corrected quickly, no issues.
    Note that, to a certain extent, you can limit the number and frequency of such "disturbances". E.g., when you bake a cake, you don't keep opening the door just to see how it looks!

    Otherwise, I wrote some python scripts to generate my profiles, the gcode didn't react quite the way I expected it to, so there's some long stretches of "dwell for 5 seconds", "display temp" repeat. I put it through enough cycles to have some confidence that it's not going to go completely haywire, it will perform according to expected parameters.
    If you can programmatically "watch" what's happening, you can always raise an alarm or pull the plug if your code sees something wonky.

    I have a small spool of filament in there right now, we'll see how it works in three hours. This is the first loaded test.
    I assume its not practical to process PORTIONS of spools? I.e., you need to have "enough dry stock" to complete a print... it's not like you can piece together shorter lengths...

    After that I need to see what the power consumption is with all heaters on. I measured the resistive heaters, combined they pull 10.4A. I wasn't able to get a meaningful measurement from the halogens as the resistance changes with heat. I don't have a clamp meter, I think I'll just turn it on and cross my fingers. We'll see. According to the label, they are 1000 watts total, so at 120v, that should be 8.3A. With electronics, that shouldn't put me over 20a, but who knows if the labels are accurate.

    In the US, that's a "kitchen" circuit and requires a different plug/receptacle (normal receptacles are only rated to 15A -- 1800W, underated). Instead of the parallel blades ||, it will have perpendicular blades -|. Dedicated refrigerator and furnace outlets MAY be 20A capacity. And, outdoor or garage outlets. You may find it more convenient to run TWO power cords to two different outlets (on different circuits). I wired the two (required!) kitchen "countertop outlet" circuits so that every other outlet was on the same branch. So, as long as I connected to two different -- but adjacent -- "receptacles", I was guaranteed to have two circuits available.

    [If you have an electric range or clothes dryer, you can access two separate circuits in the same (220VAC!) outlet, there. Keeping in mind that they will be out-of-phase whereas two random branch circuits may or may not be!]

    I also need to get some small zero crossing SSR on order so I can do PWM control on the fan. I have concerns that the fan just wasn't made to be run as much as I'm going to run it. PWM might help lower the load on it.
    You could also "outboard" the fan, tying it to the oven with rigid or flexible ductwork.

    Are we having FUN yet? :>

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    eccerror: 3d printing filament. PLA, ABS, PETG and NYLON all absorb water, listed in order of increasingly hydroscopic filaments. PLA needs it every few months, ABS maybe once a month or two, PETG every few days, and NYLON after every single print. If you print with wet filament, it causes problems, blobs and drooling from H2O evaporating in the hot end, and it the worst cases, extreme porosity and lack of adhesion. Some people use dessicant or a light bulb in a bucket, but I like my filament really dry. If you overheat it though, it becomes brittle or stuck together, neither is desirable, so temperature control is important.

    CG: I spent yesterday changing the pid values and observing. I came to the conclusion that it would be a whole lot easier to just run one of the halogen lights and use the resistive heaters as boost only for high temps. Ran a pid tune on the lower halogen heater, and ran some 10 minute cycles. The halogens overshot by 1-2C and settled pretty much solid at 1-2C over target. I'm ok with that for now. Also did some testing, opening the door, a few times, the algorithm corrected quickly, no issues. I also checked temperatures front, back, top, bottom, side to side, and it's remarkably uniform. No more than 1C variation anywhere. My meter measured 47-48C when the system showed 51C. The variation could easily be error in the thermocouples.

    Otherwise, I wrote some python scripts to generate my profiles, the gcode didn't react quite the way I expected it to, so there's some long stretches of "dwell for 5 seconds", "display temp" repeat. I put it through enough cycles to have some confidence that it's not going to go completely haywire, it will perform according to expected parameters.

    I also found a plugin to enhance the graphing in octoprint. Pretty nice. Pic attached.

    Next steps:
    I have a small spool of filament in there right now, we'll see how it works in three hours. This is the first loaded test.
    After that I need to see what the power consumption is with all heaters on. I measured the resistive heaters, combined they pull 10.4A. I wasn't able to get a meaningful measurement from the halogens as the resistance changes with heat. I don't have a clamp meter, I think I'll just turn it on and cross my fingers. We'll see. According to the label, they are 1000 watts total, so at 120v, that should be 8.3A. With electronics, that shouldn't put me over 20a, but who knows if the labels are accurate.
    Then see if I can get a meaningful pid tune on all heaters at 225C, and maybe just the halogens at 225C. My current thinking is the resistive heaters can help boost the temp on the ramp up, but should be cut out pretty soon and temp held with the halogens alone so the oven can ramp down quickly.
    I also should make a shield for at least the lower halogen to protect it from dust, etc. I think I might miss the oven flashing and lighting up my garage behind me.
    I also need to get some small zero crossing SSR on order so I can do PWM control on the fan. I have concerns that the fan just wasn't made to be run as much as I'm going to run it. PWM might help lower the load on it.

    Attached Files

    Leave a comment:


  • Curious.George
    replied
    Re: Sending PWM through a relay

    Originally posted by clearchris View Post
    That's actually a good explanation and answered one of the questions I had yet to ask. I have had the oven make a few runs today, with different pid settings, and one run in particular had the temp locked in at +/-0.1C, except 3 degrees too high. The accumulated error certainly accounts for that. On that run, I started the run with the oven temp higher than the set point. That probably messed up things.

    So, humble pie time for me, you were right CG. Looks like I am going to have to do some pid tuning. I can't have too much variance on this particular profile. My primary case for this oven is actually to do filament drying. Too much heat, and the spool will be melted together and useless. So I'm reading up on PID systems.
    Control Systems aren't trivial. There are folks who devote their careers JUST to Control System Engineering! There's a lot of fancy math involved and gobs of "theory".

    Most folks deal with a particular niche of controllers and controlled systems. Within a given niche, you can develop rules-of-thumb for how to mate control to plant.

    For example, if you buy an HVAC system for your home, the guy who sells it to you WON'T have a formal education in controls/systems engineering. Instead, he'll have picked up a set of rules-of-thumb that guide him in sizing the plant for your particular home in your particular climate with your particular environmental exposure, etc.

    Will it be "optimal"? <shrug> Doubtful -- unless if serendipitously. But, it will likely be "good enough".

    There are also "tricks" that can be applied in certain circumstances. E.g., you may find switching to infrared lights gives you better control in a certain temperature range. Or, decreasing the efficiency of your plant (like venting heat OUT, deliberately, so the heating elements TEND to be on more continuously at a particular temperature/range).

    Businesses that rely on "processes" spend lots of money trying to improve on their controls and the efficiency of those processes. Hence the "specialists".

    Sorry, I can't recommend anything to give you a crash course as most of the texts that I have are heavy on theory -- which quickly makes things incomprehensible ("How does this relate to MY problem?")

    The easiest way to understand where your problems MAY lie is to collect data on the process in-action/under-control. E.g., if you could look at the actual temperature and see when the controller was calling for action, you might be able to figure out what it's "doing wrong" (or, suboptimally). Then, go back and think about the hooks that you have into the controller that you might be able to tweak to coax it into behaving more like YOU think it should.

    (the controller/control loop/tuning software doesn't know what YOUR needs are!)

    You can also look to see what "advanced features" (if any) are supported in the software and contemplate how they might help you.

    For example, the integrator accumulates errors. As the actual temperature approaches the setpoint, the error term diminishes. BUT, the accumulated error still persists! So, the loop could overshoot as the accumulated error is "bled off".

    Some loops include a provision to limit just how much error can accumulate ("integrator windup") so this doesn't get out of control. Others include provisions that automatically ZERO OUT the accumulated error when the actual error reaches zero (the thinking being that this will stop the loop from overshooting).

    There are a shitload of /ad hoc/ solutions out there that help in some applications... but not in others. Once you SEE how your controller is actually operating, you can start hypothesizing, "Gee, if I could just stop the accumulated error from driving the temperature PAST the setpoint..."

    Or, whatever.

    Play. Observe. Think.

    Put a brick in the oven so you don't have to worry about burning something.

    Put a COLD brick in and see how things change.

    Etc.

    Leave a comment:


  • eccerr0r
    replied
    Re: Sending PWM through a relay

    drying... filament... of... what compound? There are other ways to do a liquid-solid separation?

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    That's actually a good explanation and answered one of the questions I had yet to ask. I have had the oven make a few runs today, with different pid settings, and one run in particular had the temp locked in at +/-0.1C, except 3 degrees too high. The accumulated error certainly accounts for that. On that run, I started the run with the oven temp higher than the set point. That probably messed up things.

    So, humble pie time for me, you were right CG. Looks like I am going to have to do some pid tuning. I can't have too much variance on this particular profile. My primary case for this oven is actually to do filament drying. Too much heat, and the spool will be melted together and useless. So I'm reading up on PID systems.

    Leave a comment:


  • Curious.George
    replied
    Re: Sending PWM through a relay

    I'm not sure my example was explicit enough... <frown>

    Tuning at a particular operating point just says "that's the 'best' performance you'll likely get from the controller when paired with that system at that operating point".

    It's not a guarantee that you'll get "acceptable" control!

    Again, imagine trying to heat your house to 110F in the winter. It ain't gonna happen with the typical plant in a home.

    So, you may or may not be able to use your oven+controller for the various uses you envision (e.g., you won't be able to melt diamonds!). You need to either design for a particular application/usage or MEASURE how well it performs and see if that is acceptable to you.

    You want to get a feel for the capabilities of your system before you start "applying" it (you wouldn't even try to tow a motor home up Pike's Peak with a VW bug!)

    [Everything is always "data" in my world!]

    Leave a comment:


  • Curious.George
    replied
    Re: Sending PWM through a relay

    Originally posted by clearchris View Post
    Yep, my LED is definitely flickering, it's definitely not operating in bang-bang mode.
    OK. I can't see it, from here... :>

    So here's a question.
    Here's an answer: blue

    Can pid tuning account for the non-linearity of the heating process? I.e. as the setpoint gets hotter, the element needs to be left on longer for each 1c increase in temp?
    Yes, and no.

    First, understand what the three terms -- Proportional, Integral and Derivative -- try to address.

    All (effectively) operate on the "error" term -- the difference between the observed process value and the desired setpoint for that value.

    The proportional term applies "control" to a degree ("strength") proportional to the current error; the farther "off" the process is from the desired setpoint, the more "correction" it tries to apply.

    But, getting that "proportional gain" exactly correct at a variety of operating points is virtually impossible. It's like knowing exactly how hard to hit the brakes while driving WITHOUT WATCHING TO SEE HOW CLOSE YOU"RE GETTING TO THE HAZARD! So, with just a proportional term, you expect the process to settle out at some operating point that's "not quite" the desired setpoint. There will be an offset (or, the loop will "hunt" forever oscillating above and below the setpoint because it always overcompensates -- gain too high).

    The integral gain (this is a misnomer, in the classical model, but easier to understand in these terms) acts on the ACCUMULATED error term. I.e., you add up error terms continuously and apply an amount of control based on the "current accumulation" -- defined by the integral gain.

    So, in the case where the proportional-only controller settles in at some point that's not quite what you desired (setpoint), there is a persistent error term -- the difference between where you ended up and where you WANTED to end up. If you keep accumulating (integrating!) this error, the accumulated value will grow and grow. If you apply an additional amount of "control" based on this accumulation, you will end up closing the gap between what the P-only controller was able to do and "desired".

    When you get to the actual set point, the error will become zero and the integrator/accumulator will stop growing.

    [Get the integral gain wrong and the loop will ALSO oscillate -- see how tuning can be tricky?]

    Note that the integrator can have "accumulated" a shitload of error by the time the process actually closes the gap to the setpoint. So, it can overshoot -- too much "control".

    The Derivative term acts to predict the future. If, for example, it sees the error shrinking, it can start throttling back the control that the P & I terms would otherwise be applying -- to limit the amount of overshoot.

    [The old, round, classic "Honeywell" thermostats implemented this "look ahead" feature with an "anticipator" that would preheat the THERMOSTAT in anticipation of the heated household air! So, as the thermostat called for heat, the anticipator would start throttling back on that. Most anticipators were not set correctly. :> ]

    OK, now, to your question.

    Having "decent" values for the three gains means the loop will TEND to settle at the setpoint, EVENTUALLY. How quickly it attains that setting and how closely it maintains it (as well as how EFFICIENTLY it does this... every action costs energy!) depends on the values and how the system's characteristics may have changed -- at your current "operating point".

    By way of example:

    Imagine you have your thermostat in your dining room. Assume it's ttuned perfectly -- the furnace promptly brings the room temperature to the desired setpoint and maintains it there, closely.

    Now, imagine the outdoor temperature plummets to -26F (coldest I've ever experienced) and the wind picks up (exacerbating any air leaks in your house). You would expect the furnace to have to work harder to maintain the same indoor temperature, right? It would take longer to get to a desired setting -- more control effort. And, it may have to be active more frequently.

    This is because the characteristics of your SYSTEM -- your furnace+house+outdoor environment -- have changed. The control loop may not be operating optimally in that set of circumstances.

    But, assuming your furnace can generate more BTUs than your walls LOSE, you expect the temperature to eventually settle down and the furnace click off -- even if it may click back on a minute later to adjust to the losses of the past minute!

    Now, assume you close the doors to the dining room, isolating it from the influence of the other rooms (thermal loads) in the house. When the furnace eventually turns on, it will probably overshoot the desired temperature -- because there's so llittle air volume compared to the capacity of the furnace! Again, the system's characteristics have changed. You need to retune for those new conditions.

    The same is true if you move outside of the "typical" comfort range that the HVAC was sized for. Try to cool your house to 50F and it's just not going to happen (if the outdoor temperatures are 100F). Or, heat it to 110F (if the outdoor temperatures are -20F).

    "Plants" (furnace/air conditioner) are "sized" to fit the typical needs of the particular home. The refrigeration unit that your grocer uses to keep his produce fresh is DESIGNED to operate at a different range of temperatures. Using it in a home would be counterproductive -- bigger is not necessarily better.

    My use case is that the oven will have many purposes. The most common one is baking my filament for the 3d printer (yes, it's hygroscopic and needs dehydration periodically), and that operates around 120F-160F. The temp is floating a few C hotter than the set point because I did the pid tune at 100C. Now I can just use different pid parameters for different setpoints, but that somehow seems... inelegant.
    It all boils down to the QUALITY of "control" that you want.

    Do you care if the loop overshoots the setpoint considerably when operated at a different point? Or, if it takes longer to get TO a setpoint?

    When you cook/bake/roast, you often preheat the oven. This, despite the fact that the oven's temperature controller will bring the temperature to the desired setting, EVENTUALLY. But, the cooking/baking/roasting times that you have expect the item to be in an oven AT that temperature... not one that will eventually GET to that temperature!

    In the case of baking, the time spent waiting for the temperature to attain its desired setpoint can ruin the item -- because baking is all about chemistry and chemical reactions (which run at different rates based on temperature).

    If I'm drying my clothes, I really don't care how long it takes for the dryer to get up to temperature. Or, just how hot it actually gets (as long as I'm not drying some delicate synthetics).

    Bottom line: PID isn't a panacea. It's just a tool that you have to decide how best to apply, based on YOUR criteria.

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    Yep, my LED is definitely flickering, it's definitely not operating in bang-bang mode.

    So here's a question.

    Can pid tuning account for the non-linearity of the heating process? I.e. as the setpoint gets hotter, the element needs to be left on longer for each 1c increase in temp?

    My use case is that the oven will have many purposes. The most common one is baking my filament for the 3d printer (yes, it's hygroscopic and needs dehydration periodically), and that operates around 120F-160F. The temp is floating a few C hotter than the set point because I did the pid tune at 100C. Now I can just use different pid parameters for different setpoints, but that somehow seems... inelegant.
    Last edited by clearchris; 05-01-2020, 05:55 PM.

    Leave a comment:


  • Curious.George
    replied
    Re: Sending PWM through a relay

    Originally posted by clearchris View Post
    GC: The first part of that graph is the software measuring the system, overshoot is expected and a desirable part of the measurement.
    Most autotune algorithms work by disabling the "real" control loop (replacing it with bang-bang control) and letting the process (that's your oven) deliberately oscillate. This produces what are termed the "ultimate period" and "ultimate gain" of the process -- how the process behaves in the absence of any tuning.

    So, the oscillation you see in the beginning is the process's "ultimate period" (1/frequency) manifesting during the auto-tune.

    The magnitude of that oscillation is the ultimate gain (scaled).

    From these two parameters, you can come up with some "moderately aggressive" values for the proportional, integral and derivative gains that the controller should use.

    In certain processes, you can compute these from a single oscillatory cycle.

    [The hazard in universally applying these techniques is that any OTHER disturbance that comes along will confuse the tuning algorithm -- the tuning algorithm CREATES the artificial disturbances that cause the process to oscillate and rely on that exclusive interaction]

    Note that you can tune to compensate for DISTURBANCES (oven door being opened, oven leaking) or for SETPOINT changes. (I alluded to this in an earlier comment).

    If you tune for disturbances, then your process tries to maintain the "best" control (that is possible for that degree of "aggressiveness") holding things constant.

    But, the loop may respond suboptimally to changes in the setpoint! (which many processes require). You want to tune differently if you want the controller to "settle" on a new setpoint rapidly (vs. holding a setpoint indefinitely).

    The second part of the graph overshot a smidge because I didn't turn on the pid controller. You see the signal drop to zero because I took it offline and reconfigured it with the pid parameters. After that, the temperature overshoots a tiny bit because of the heat already in the system, but after that it holds solid.
    Again, there's no way to tell if it's "holding solid" because it is actively BEING HELD at that value.

    [I'm not saying it ISN'T "being held"; what I'm saying is that you should be looking to see how much "work" the controller is doing during these times to determine how much faith you have in its performance. The only practical way to gauge that "work" is to watch to see when the controller is actually "exerting control"]

    I don't have anything on the graph to show the controller clicking on and off, but I did build an led into the arduino that will turn on when the heater is engaged. Yes, there is an LED in the SSR that performs the same purpose, but the one on the arduino is considerably brighter, it's much easier to see.
    So, the take away from my comment should be: WATCH THE LIGHT to see if it's "doing anything". This isn't scientific but, rather, intuitive -- if its "doping something" and the results LOOK good, then assume it's DOING THE RIGHT THING.

    Leave a comment:

Working...
X