Skip Navigation

Posts
16
Comments
569
Joined
3 yr. ago

  • Why make this harder? A constant frequency simplifies the analog design

    I wasn't planning on variable frequency, you were speaking to the influence of frequency on voltage output earlier. I just meant that I could vary the frequency without messing up synchronization of the waves. I.E. I can produce two square waves of arbitrary duty and frequency up to 625kHz. The higher the frequency, the less resolution I have, however.

    Anyhow, the output will be filtered with at least some fat caps. My load is a static resistance (heating element). I could probably drive this thing with a 555.

    As far as I know, the Atmega328, at least, can't use the ADC to bypass the CPU and directly set the timer registers. The ADC can throw an interrupt and then the CPU sets the timer. When your pwm frequency is sub 100kHz, there is plenty of time to change the duty.

    I don't know that I will need to vary the duty with logic. It's just an idea I had that seemed neat. Quick coarse adjustment and then a fine tuned adjustment.

    I'm teaching myself about SMPS, and I'm curious. While the final circuit will have utility. I'm really learning how to use a scope, the newer AVRs, and switch mode power.

    Everything has switch mode in it now, my vehicles, my arc welder, every chunk of electroincs pretty much. It's treated like a black box, buy the chip, follow the data sheet. However, if you want to build or fix one from first principles, good luck. Most approachable reference I've found is the DC/DC Book of Knowledge by Steve Roberts. And even it assumes that you'll mostly be using an ASIC.

    Generally, I come up with an idea in electornics or programming that is novel to me, somebody else figured it out decades ago. That's why I'm wondering what you call the minumum pwm resolution and whatever this fast dumb logic adjustment to duty is.

  • I explained it poorly. The chip has an ADC that can operate in window mode. I. E. when my output voltage jitters high or low out of bound, I can use logic to very quickly effectively increase or decrease my duty cycle. (Actually substitute another pwm signal that is in pnase but with a larger or smaller duty)

    5V square PWM from the ATtiny goes to a gate driver capable of several amps at 5V, that gate driver switches a pair of logic level MOSFETs, one of the MOSFETs switching the coil and the other acting as the recitfier. Topology is a synchronus inverting buckboost.

    Changing the duty cycle then raises or lowers the voltage.

    At the same time, via interrupt or event channel, the cpu starts calculating a new duty cycle and setting the timers. Interrupts may take 100 cycles. Whereas, pwm at 625kHz will have completed an additional three cycles before I can even start to modify the duty from the program.

    None of this may matter. Static dumb resistive load, I could probably just about run my MOSFETs off a 555 and not even worry about feedback or regulation.

    However, the idea is interesting to me. Quick response regulation with more precise regulation happening as the CPU catches up.

    Seems like it would give you a flatter output.

    I've found when I discover an interesting electronic or programming technique or problem, that usually means I don't know the name. It's usually something figured out decades ago and there are references and papers that explain it and consider angles that I didn't know about.

  • Gain bandwidth seems to be really analogous to what I'm trying to figure out. If I can't find a version that is more digital/pwm specific: it will probably be easier for me to figure out what minimum resolution I need experimentally.

    I'm looking at a constant frequency, variable duty drive as that seems the simplest. Also, the higher I can get the frequency, the less ripple I'll have to deal with. However, there's nothing really stopping me from doing variable frequency.

    The timer I'm using is TCA. I haven't tried it yet, but it allows buffered register changes. I.E. the registers where I'm setting my duty and period can be updated in sync with the waveform. So, in theory, I can vary my waveform frequency and duty cycle all over the place. I'll actually be using two of these signals, the other will be for a mosfet in place of the rectifier diode. Dead spacing shouldn't be any trouble.

    I may even be able to use the programmable logic to combine 3 pwm signals into one per channel. I will have the spare internal outputs available.

    I'm still kind of studying on this and probably need to draw a picture. Say you have 3 square waves that all have the same period. They are synchronized on the rising edge. 1st signal is 25% duty, second is 50%, and the third is 75%. Depending on what a comparator is reading, your logic selects which signal to output. 50% to maintain and the others to drop or raise the voltage.

    So, if your voltage goes out of bounds, high or low, within a single clock cycle your square wave can be adjusted by some amount (25% amounts are just an example.) At the same time, your cpu begins grinding cycles to reset the buffers to adjust everything to a new duty center.

    It would probably be a small amount of fast logic adjustment. At a guess, 10% or less.

    I apologize if this is confusing and will draw it, if needed.

    Any idea what that would be called?

  • The period is divided up into 32 pieces, instead of a 256 bit width, if that makes sense. So, the frequency is 20mHz/32 = 625kHz. 0b100000 / 0x20.

    Yeah, and with the load I'll run, it's not real critical. I just figure there has to be a name for this sort of tuning. If I know what it's called, I can read up on it.

  • Ask Electronics @discuss.tchncs.de

    PWM resolution for switch mode power supplies.

  • I'm looking at the FAN3224, a gate driver capable of several amps at 5V to run my MOSFETs. I'll probably play with direct driving them with the ATtiny at first just to familliarize myself.

    The original circuit is running some sort of bridge configuration. I've used a 1.6ohm load for years, with wattage set to 14.5 or 14.8. However, the orignal is capable 25w in the lowest output version. I'm not sure what resistance range it's capable of pushing that 25w.

    And, yes, the goal is to build a variable DC supply. I'm finding it really interesting. I'm looking at the synchronus inverting buckboost. I think my final version would use half the components of the original.

    If I understand this stuff correctly, (real big if), with the convertor pushing negative voltage, I sidestep high side drive problems. My load is dumb resistance so it doesn't matter how noisy or negative its power is.

    So the ATtiny has an ADC capabale of running in windowed mode. A lot of the peripherals are able to run independently of the CPU, you can link them up with onboard programable logic called CLC. So, using logic I can tie the ADC to my PWM at pretty fast speeds. It also has a selection of internal voltage references. I'm planning to use some sort of voltage divider for feedback to the ADC, using the logic to vary my duty cycle when the voltage goes out of bounds.

    Before I get that far out in the weeds, I need to play with mosfets, pwm, an inductor, and my new scope.

  • Plan is for the ATtiny to actually mostly be asleep on the battery voltage. The 5V driver IC has an enable pin and goes into bypass mode when it's not enabled. Only when it wakes up will it turn on the 5V.

    I want the 5V for the 4.5V gates on my MOSFETs, the OLED display (IIRC, it will also run on 3.3V), and the 20mhz for PWM and ADC.

    DC/DC convertor. I'm hoping I can make a synchronus inverting buckboost supply in the neighborhood of 25w/6V max.

  • I'll be reading up on push-pull. Thank you!

    Main power source is a single cell lithium, so 3.7ish volts. Supply for the ATtiny is a 5V driver IC (I've already got it working).

    The convertor I want to build will be inverting as the load is basically a pure constant resistance. (14.5w 1.6 ohm typical). I think that means I sidestep all the problems with a voltage higher than my control.

    I'm hoping to use the window mode of the ADC and the programmable logic (CLC) to actually control the convertor mostly independent of the CPU.

  • I'm bumping against the edges of my ignorance here. I haven't done any calculations yet. I've been reading the DC/DC Book of Knowledge by Steve Roberts.

    I've got a working 5V switch mode supply using a driver ic for the ATtiny. Plan is to use that supply and the ATtiny to variably control a larger inductor/MOSFETs. This will power a resistive load around 25w max, 14.5w typical, 1.6ohm so roughly 4V/3A typical.

    The data sheet gives an absolute maximum of 40mA for output on a pin with 5-10mA being ideal. My understanding of the chart above is that the voltage will also sag below the 4.5V gate actiivation. I'm assuming trying to switch the MOSFETs with just the ATtiny either leads to a blown output or an overheated MOSFET.

    I guess I need to figure out my target frequency and work backwards from there. I've got a working reference circut, but all the ICs and MOSFETs have been laser obufuscated. Inductor is 1.5uH and 27A.

    So I'm assuming I need a higher frequency than what I can push with the ATtiny but I don't know that.

    Sorry for the novel. Writing this down helps me work the problem. Do you see anyrhing wrong in my assumptions/reasoning?

  • I was thinking bjt or opamp to drive the mosfets, but I'm not sure.

    And yeah, I'll be scoping it as I start testing. I'm just still wrapping my head around the synchronus inverting buckboost I think I want to use.

  • I'm hoping to end up with a pcb that has the features of an obsolete ecig that my spouse and I prefer. I've probably purchased a dozen of them over the years. The switches always fail.

    Given the politcal climate towards ecigs (What about the children?!!!!?), my particular harm reduction method continues to become more difficult to source. So, I'm just going to future proof things and build my own. I doubt the design will be worth any money so I'll probably open source it if it works.

    So pretty serious about durablility, it would be a tool for daily use. I plan for switches to be on a daughter board so I can just change them out.

    I'll be checking out the video this evening.

    Thanks!

  • Ask Electronics @discuss.tchncs.de

    Driving a logic level MOSFET with an ATtiny 3224

  • Same boat, somewhat. I keep a digikey cart and when it gets big enough, I'll order there. There's also digikey marketplace but the shipping costs aren't great. I need to start comparing prices on Newegg and Mouser to Amazon.

    The Amazon shit is sketchy but it's cheap and fast for things like interconnects, boost modules, i2c boarded sensors, etc.

    Just aliexpress has all the same stuff cheaper but when you need a widget by the weekend, it doesn't work.

  • We already confirmed he was watching porn. I always figured Betty White was absolutely depraved in the sack. Jeanette Nolan must have been a hell of a top, if you're into that.

  • Not OP.

    That sucks. Especially having to make poor people financial decisions, you often can't afford to make changes that will save you money in the long run. Been there done that.

    Still, there may be some things you can do to save electricity.

    Cheapo line meter. I use one on my well pump. It shows usage over time. You can figure out what's using the most juice. It does 200v as well as 110 and clamps on. Does have to be wired in to for it's power supply and ground.

    Also, Kill-a-Watt clones. $9.99. Shows you how much plug in things use.

    Offhand things that might help:

    • Hot water heater on a timer and turn down the thermostat. There wil be removed.
    • If you have an electric stove, inductance stoves are supposed to be the most efficent, but you probably can't afford one. Electric kettles for boiling water probably beat using a stove to heat water.
    • Use a kill-a-watt to figure out what is using juice when appliances/TV/PC/etc. is on standbym
    • Check freezer temp, it may be colder than you have to have it, turn up the thermostat.
    • Check anything with a motor that plugs in with the kill-a-watt, like box fans to see if they're pulling too much juice, when the motor bearings get shitty, you'll pull more over coming friction.
    • Use that clamp meter to check things like whole house blower fans, bathroom fans.

    Good luck.

  • Didn't know that was a thing. Very cool.

    I'm working through a book on sculpting while learning Blender. It's been surprisingly difficult to get the proportions correct when I print the studies.

  • I know that image from The Wall movie, but I guess it's also its own piece given the signature. That watercolor sky is absolutely beautiful.

  • Yeah, I haven't read the article yet, but the headline is certainly inflammatory. Change it to Biden and add some adrenochrome or satanic panic and it's q-nut BS. I just fucking looove that Blueanon is a thing now. Didn't we learn anything from that?

    I guess we learned that people are stupid and gullible.

    It makes me feel pretty down because it's so fucking hard to steer through the misinfo anymore. Hell, it could even be true. I'm too tired to dig on this one.

    Practice information hygiene and stay skeptical!

  • This is interesting. Can you give me a ballpark on your hardware cost for an 8 camera system? What does integration for NAS look like?

  • Lemmy.world Support @lemmy.world

    Delayed comment reply notification.

  • Thank you for the thorough response!

    It's unfortunate that the design compromises result in a tool with limited usability. I'm slightly interested in the desktop mills and lasers but haven't done much research on them. Your comment about printing being slow actually perked my ears up as that suggests increased rigidity needed for milling. It sounds like if I ever do decide to get a tiny mill or laser, I'm better off with a purpose built machine.

    As for software, G-code for a specific machine is all about the post at the professional level. Unfortunately, pro-grade CAM is around $20k a seat. A good post is often $4k or a lot of time painfully producing and testing it yourself. CAM/CAD is the only thing keeping me from Linux at work and on my primary home PC. I wasn't impressed with the 1.0 release of FreeCAD. The UI still seems to be designed by aliens.

    (Lemmy weirdness: I only received notification of your response last night.)

  • Could you please give your thoughts on its milling and laser capabilities? Do you own the 4th axis rotary?

  • Slashdot represent!

  • Lemmy Shitpost @lemmy.world

    The boiled peanut is superior to the baked bean.

  • techsupport @lemmy.world

    Preparing to upgrade to windows 11. Have a bitestick and a punching bag but need advice.

  • Ask Electronics @discuss.tchncs.de

    Antique Electro-Cautery Unit: Measuring voltage with ADC and general safety.

  • Lemmy.world Support @lemmy.world

    lemmy.world slow loading and timeouts, Jerboa app, morning of 2-18.

  • 3DPrinting @lemmy.world

    Recommendations for teenager's first printer.

  • Mushrooms @lemmy.world

    not a mushroom, but figure someone here will understand.

  • WatchTheRight @lemmy.world

    klanned karenhood

    whnt.com /news/madison/madison-public-library-cancels-moms-for-liberty-event-citing-capacity-issues-attorney-threatens-legal-action/
  • WatchTheRight @lemmy.world

    Sacramento Sheriff sharing automated license plate reader data with anti-abortion states

    news.yahoo.com /sacramento-sheriff-sharing-license-plate-133000119.html
  • WatchTheRight @lemmy.world

    Sound of Freedom: indie movie that Qs are getting wound up about.

    www.rottentomatoes.com /m/sound_of_freedom
  • WatchTheRight @lemmy.world

    Hate on Display™ Hate Symbols Database

    www.adl.org /resources/hate-symbols/search
  • WatchTheRight @lemmy.world

    Republican Marjorie Taylor Greene removed from US House Freedom Caucus

    www.reuters.com /world/us/republican-marjorie-taylor-greene-removed-us-house-freedom-caucus-politico-2023-07-06/
  • WatchTheRight @lemmy.world

    -meta- content and allowed posts

  • WatchTheRight @lemmy.world

    Attacks on Electrical Substations Raise Alarm

    www.nytimes.com /2023/02/04/us/electrical-substation-attacks-nc-wa.html