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

    GC: The first part of that graph is the software measuring the system, overshoot is expected and a desirable part of the measurement. 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.

    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.

    Leave a comment:


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

    Originally posted by clearchris View Post
    Making progress! This is what it's supposed to look like when you do a pid tune in klipper. Look at that nice steady temp holding afterwards (ignore the gap, I borked it up and had to reset).ATTACH]211640[/ATTACH]
    Unless you can see the "control" signal on the graph, there's nothing to say that it's not "holding" just because the enclosure isn't "leaking".

    What you want to see is the control and the sense before you can attest to the performance of the controller.

    It still seems like there is a lot of lag -- when the heating elements are turned on, they overshoot, considerably. (again, without seeing the control signal, you can't tell if this is because they are being commanded to remain on or if they just "coast too far", once engaged.

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    I don't know that I would use klipper for a hot air station or a soldering iron unless you have a repeatable process where you need to ramp, etc for a very specific and repeated application. If you open it up, you can see what the MCU is, and there are people who have replaced the stock firmware with a better custom made solution. The problem is that there are many different variants of what looks like the same basic iron/hot air station, many more than you would think. There are a few firmwares up on github. They report great results.

    I don't think you need to replace the guts of either with an SSR, most of these devices have an optocoupler and a triac, which is basically what is in an SSR.

    Leave a comment:


  • sam_sam_sam
    replied
    Re: Sending PWM through a relay

    Thanks for sharing this information I was hoping that you went this way

    But let us know if you get the G code to work correctly the you want it to work

    I might do something similar for my board heater but use a Ender 3 controller but use a 1000 watt controller that I used for a battery spot welder transformer controller but the electronic version of and see if this concept will work or not ( ? Mark )

    Here is the link to where you can one or just see what it looks like

    https://www.mpja.com/Hot-Air-Rework-...info/34737+TL/
    The one I use most often is the version that has the hot air gun and the soldering iron ( in one unit) which is very hard to find now there is a newer version but I do not know if it uses the same controller or not )

    Or I might use a ZD-939-L temperature controlled hot air gun controller which has very good controller stability surprisingly enough for it cost but weather or not I get the same exact results doing this setup remains to be seen ( now I might have to use a bigger SSR setup )
    Last edited by sam_sam_sam; 04-30-2020, 10:48 PM.

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    More testing. 75% heat, lower resistive heater with both upper and lower 500w halogens. I started out going for 200C without any pid. Ramp up was quicker than I expected, and hey, nothing lit on fire, so after checking on it, I went for 250C. I sure like the slope of those lines. I don't think I'll have any problem running lead free reflows (not that I will, I'm all about the Pb). I'll have to tune things a bit and make a reflow profile, but I can easily see starting the preheat/dryout with top and bottom resistive heaters (getting them good and hot) and when it's time for the reflow swapping over to the halogens for a quick burst of heat to get to liquidus, hold for 30, and back down again.

    Maybe I go full blast with all heaters, cut the resistive heaters at liquidus, hold with the halogens and ramp down with the halogens. Since the profile has to run in 8 minutes, the oven isn't soaking up as much heat as I thought it would. Cooling shouldn't be a problem.

    Though admittedly, this is an unloaded test. I don't think a board is going to add a lot of thermal mass though. And these are air temps, not top of the board temps.

    Tommorrow I'm going to have measure the resistance of the heaters and do some math. The oven was rated for 13a, and I added two 500 watt elements which puts me over a 20a circuit, barely. If I downgrade to 400w bulbs, or maybe a 350 on top and keep the 500w bottom, I could squeak by at a touch above 19a. I don't know how much I trust the labels on any of them though. I really want to be able to run this from a standard 20a circuit.

    I need to fashion some shields for the halogens too, at least the top one, I can't actually look into the oven when they are on, it's like staring into the sun.

    Also need to start writing some gcode and see how it all works.

    I love it when a plan comes together.

    Attached Files
    Last edited by clearchris; 04-30-2020, 10:12 PM.

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    Klipper looks like it drives the SSR with PWM. If it's not PWM, it's switching it pretty quick. The SSR line out is connected to the line side in (not coil) of four relays that independently switch four heaters. I'm switching the relays based on which heaters are to be used, but it's doing the temp control through the SSR. Here's the process:

    SSR off, relays off, in that order
    configure relays for required heaters, some on, some off
    switch SSR (with pwm?) to feed voltage through all configured relays which do not change
    If the heater configuration needs to change, repeat process

    I don't think this design is putting much, if any, strain on the relays. The relays might actually last longer like this, because the relays are never going to switch on or off while power is applied. And we all know that sparking during make/break is the main wear on a relay.

    I could have done this with 4 SSR, or maybe fewer, but I like this design. The relays are dirt cheap, and you can get one nice SSR with a big heat sink to switch, instead of 3-4 fake foteks with a small piece of aluminum as most ovens are done. If you see in the picture, I have a carlo gavazzi 25A SSR driving this. It's a legit SSR that I feel comfortable driving at 25A, at least for a reflow session. Actually this whole project has been dirt cheap.

    toaster oven: found on neighbors curb
    4 relay board: from stock, a few bucks originally
    arduino: chinese clone, $3
    arduino shield: $2
    max6675: Probably $7 10 years ago
    thermocouple: from stock, $3
    carlo gavazzi relay: ~15$ over 10 years ago. It failed, tossed in box, pulled out and repaired because I needed a SSR
    big relay heat sink: don't remember
    ceramic insulation: $16 from grainger
    high temp silicone: $6 home depot
    raspberry pi zero: ~15 from sparkfun
    OTG usb adapter: a few bucks
    Two halogen light sockets: ~$3 each from china
    two halogen lamps, 500w: from stock since my halogen lamps busted
    high temp wire (2mm^2 IIRC): ~10 I think, from china
    hardware
    electric box, switch, plug, cord, terminal strip, usb charger: no clue, had in stock
    hardware, threaded inserts for protecting cords entering/leaving the oven

    I'm sure there's something I'm forgetting, but that list is pretty close.

    Plus, the most important reason why I went with this design: I ordered cheap SSRs from china (not fotek) before chinese new year, then covid happened, etc. I gave up on ever receiving them and designed this out of stock I had on hand.

    Leave a comment:


  • sam_sam_sam
    replied
    Re: Sending PWM through a relay

    I have ask you a question about this setup

    Are you turning on and off the heater or are PWM the output I know you have mentioned that you trying to PWM a contactor but my concern is how long will your contactor last doing this

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    Making progress! This is what it's supposed to look like when you do a pid tune in klipper. Look at that nice steady temp holding afterwards (ignore the gap, I borked it up and had to reset).

    Garbage in, garbage out. Nicely tuned thermocouple, much better results!

    Attached Files
    Last edited by clearchris; 04-30-2020, 05:46 PM.

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    The plot thickens!

    I have another thermocouple, just a cheesy, plastic jacket "waterproof" (it's not at the end) typek thermocouple. I left it long, and tested. Lots of noise. I cut it short to about 1' long, I had only 0.1c movement, great improvement. Can't put it in the oven, it's guaranteed to melt.

    So I cut my oven type-k thermocouple short. Still a lot of noise. The oven thermcouple is stainless braid jacket with two seperate high temp wires in the braid. It's also mounted in the oven, and the oven is connected to ground. If I tie the thermocouple shield to ground on the arduino, I get +/-0.1C temperature stability. Are there any downsides to doing this?

    Leave a comment:


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

    Originally posted by clearchris View Post
    And here's the first pid tune. Temperature is a bit shaky, after the pid tune, I'm getting 0-7C overshoot.
    This is usually indicative of lag in the loop. That may be a true "delay" (in sensor or actuator) or an effective delay (e.g., thermal mass of heating elements).

    I can't recall if you have true proportional control or just on/off. In either case, it might help you troubleshoot the system if you can superimpose the actual control signal on the plot. I.e., you'd be able to see if the process was "coasting" past its setpoint or if the controller wasn't adequately anticipating response.

    If you can get actual coefficients out of the controller, there are tools that you can use to model the loop to see how tweaking those could improve your response.

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    Yeah, I think it's error from the noisy thermocouple, messing up the pid tune. This was just a dry run, so I have probably almost an extra meter of thermocouple wire hanging on there acting an an antenna for stray signals. I'm going to trim that and wire it up in the morning. I think that should help quite a bit. I have worked with these max6675 in refrigerators in the past, and I don't remember them being quite this noisy. You would think they would receive some noise from the compressors... Now that I think of it, I always ran software SPI, and I ran them slow. This one is running hardware SPI, and at the default, it's a bit faster. I may have to slow down the clock.
    Last edited by clearchris; 04-29-2020, 10:37 PM.

    Leave a comment:


  • goontron
    replied
    Re: Sending PWM through a relay

    Way Underdamped

    Still impressive!

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    In case anyone was interested in an update, I have the hardware together, and the software about 50% there.

    Here's the electronics on my bench, ready to be wired to the oven.


    And here's the first pid tune. Temperature is a bit shaky, after the pid tune, I'm getting 0-7C overshoot. I need to take the noise out of the thermocouple first. If that doesn't work, I might have to replace the max6675 (I found it in my box...) with something a bit more modern. On the plus side, that was with only 25% of heating capacity, I only had the lower resistive elements on and the fan on. The ceramic insulation really helped out. The down side is that cooling may become an issue, the oven now holds heat for a long time.
    Attached Files
    Last edited by clearchris; 04-29-2020, 08:15 PM.

    Leave a comment:


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

    Originally posted by clearchris View Post
    GC: I think we agree. The only difference is that people think I'm running the RPIZW to have a local interface (which I guess it could, but I won't be using it except for increased processing power and wifi), when it's strictly going to be feeding the GCODE to the MCU and running the octoprint web service. Any administration, coding, etc, will be at a desktop or mobile phone running to the octoprint web service.
    Think about it...

    If your "device" (be it an oven controller, DSO, LA, etc.) is connected to your internet, then you CAN have a "local interface" anywhere/everywhere that you have (or CAN have) a computer.

    So, if you happen to be "working" out by the oven and want to monitor its operation, you drag out a laptop and set it next to the oven and open a window into the oven's controller. If you are NOT interested in the oven's operation, you just don't open that window (or, don't drag out the laptop).

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    Duplicate post.

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    GC: I think we agree. The only difference is that people think I'm running the RPIZW to have a local interface (which I guess it could, but I won't be using it except for increased processing power and wifi), when it's strictly going to be feeding the GCODE to the MCU and running the octoprint web service. Any administration, coding, etc, will be at a desktop or mobile phone running to the octoprint web service.

    Leave a comment:


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

    Originally posted by clearchris View Post
    Curious: GCODE is actually a very, very old spec that runs most CNC equipment. And you are exactly right, there will be no knobs, buttons or displays on the oven. It's all going to be handled through octoprint and the gcode profiles. And yes, gcode is pretty bizarre, it's not what anyone would use if they were constructing it today, but it's what everyone uses because it's a legacy tech that just kind of still works.
    That was my point. You need a "high level" interface to program the oven. Adding that TO the oven is just silly as it commits lots of resources to a low usage task.

    Instead, you would want to leverage an existing "high resource" tool -- a PC -- to do that work at a higher level of abstraction (so you're less likely to make a mistake in the programming).

    That leaves you with a "transport" issue: how do you MOVE the information back (and forth!) to the oven from the PC.

    One way is to write a memory card (SD, etc.) and physically carry it to the oven, insert it and press START. The oven can store any observations made during the process on that card -- which can then be examined LATER, when the process is complete and the card removed and returned to the PC.

    That requires a minimalist interface -- insert card, press START, wait for light to turn off to indicate process complete. But, gives you no way of interacting with the process.

    I like having "headless" devices that I can talk to from ANY machine on my local internet. This lets me apply higher level tools to those activities. And, decouples the user interface from the actual process/mechanism. E.g., let the oven sit out in the garage (low cost space) while I can sit in my office and work on other activities WHILE it is doing its thing. Yet, still be able to monitor and control it.

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    Curious: GCODE is actually a very, very old spec that runs most CNC equipment. And you are exactly right, there will be no knobs, buttons or displays on the oven. It's all going to be handled through octoprint and the gcode profiles. And yes, gcode is pretty bizarre, it's not what anyone would use if they were constructing it today, but it's what everyone uses because it's a legacy tech that just kind of still works.

    Leave a comment:


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

    Originally posted by redwire View Post
    Octoprint server runs on a Raspberry Pi or Beaglebone or PC etc. something with Ethernet? For me that's too much to need a PC/laptop and usb connection to the oven controller, something that only has one-in one-out.
    But you're not going to be twiddling any "knobs" on a "front panel". You're going to use it by defining a profile (did you want to have a numeric keypad and some bizarre set of "codes" to set up, store, and recall profiles? and a graphic display to view the temperature history AT the oven??).

    Run a semi-permanent cable to your "shop computer" and just load that app when you want to interact with the oven. Treat it as a computer peripheral instead of as an appliance.

    Leave a comment:


  • clearchris
    replied
    Re: Sending PWM through a relay

    I have a RpiZeroW ready to go. I think it may have ran me $12. It's actually smaller than my arduino.

    I haven't run into that issue with any thermocouple I have used so far, but I haven't tested the one I just installed. You may have saved me a bunch of time.
    Last edited by clearchris; 03-21-2020, 07:54 PM.

    Leave a comment:

Working...
X