Power supply part 4 - Page 1
Forum section: electronics / general

author: IanB
author_rank: Super Contributor
timestamp: December 03, 2011, 07:17:28 am
content: All this PWM filter stuff is a bit meh. It would look far more impressive to attach a stepper motor to the ten turn pot and control the stepper motor from the micro

author: IanB
author_rank: Super Contributor
timestamp: December 03, 2011, 07:21:03 am
content: One of the more enjoyable uploads though. The visual and practical stuff with simulators and graphs and oscilloscope traces teaches concepts a lot better than textbooks.

author: benemorius
author_rank: Regular Contributor
timestamp: December 03, 2011, 08:20:35 am
content: Quote from: IanB on December 03, 2011, 07:21:03 amI agree. For some reason, I really enjoyed getting to watch things go from theory to simulation to circuit probing. I guess maybe seeing that sexy new InfiniiVision scope may have had something to do with it.

author: McMonster
author_rank: Frequent Contributor
timestamp: December 03, 2011, 09:06:48 am
content: I think there's a small problem in the video, it's all black around 30:50 to 31:28.

author: benemorius
author_rank: Regular Contributor
timestamp: December 03, 2011, 09:35:44 am
content: Quote from: McMonster on December 03, 2011, 09:06:48 amYes, there's a superfluous clip from 30:53 to 31:28 which repeats the audio from 30:18 to 30:53 with blank video.

author: EEVblog
author_rank: Unknown
timestamp: December 03, 2011, 09:40:45 am
content: Quote from: IanB on December 03, 2011, 07:17:28 amJust like on those expensive Hi-Fi's where people want to see the knob spin at their command from the chair huh?Dave.

author: tnt
author_rank: Regular Contributor
timestamp: December 03, 2011, 09:41:39 am
content: About those "probing glitches". How do you get rid of them ?A video about probing techniques and pitfalls would be useful.

author: EEVblog
author_rank: Unknown
timestamp: December 03, 2011, 09:42:13 am
content: Quote from: benemorius on December 03, 2011, 09:35:44 amCombination of Sony Vegas screwing up, and a bit of PEBKAC.Dave.

author: ejeffrey
author_rank: Super Contributor
timestamp: December 03, 2011, 10:11:21 am
content: Quote from: EEVblog on December 03, 2011, 09:40:45 amMy parent's used to have a cheap all-in-one unit with a motorized volume knob. This was from before it was standard to convert everything to digital and I guess for some reason digital potentiometers were ruled out. Sadly it broke down and they threw it out before I could recover the volume pot.

author: zargnut
author_rank: Contributor
timestamp: December 03, 2011, 01:59:25 pm
content: Really interesting and well explained for a newbie. When you finalize your design, would you consider posting your schematic and parts list? I would love to build it. But could use the extra hand-holding a printable reference would provide.thanksdan

author: firewalker
author_rank: Super Contributor
timestamp: December 03, 2011, 04:11:14 pm
content: Dave, a small request...Can you use the rotary encoders method for the project? Rotary encoders always gives me a hard time. Will you, fantastic Dave?Alexander.

author: tnt
author_rank: Regular Contributor
timestamp: December 03, 2011, 04:46:26 pm
content: For those who like math, the dual stage RC filter has this transfer function :And present this impedance to the input:(it's all from a 'back of the envelope' attempt, so I might have made a mistake but it "looks" right)

author: leniwiec
author_rank: Contributor
timestamp: December 03, 2011, 05:56:42 pm
content: Hello everybody! ;-)Dave, really good episode imo.I am wondering about few thing, regarding to this episode. Is there any method to make integral from pwm signal really quick, for example let's get the situation where whole power supply is build around micro and hysteresis for current limiter is in software, then we need really quick reaction.Second thing that I think may be interest, specially for nob is measurements instruments for power supply, and also method of connecting it. For example in symmetrical power supply this is not so obvious.Also I wondering about how they measure current in all of those cheap-china powersupplys where they have 3 terminals and only one 3-4 digits amp meter and the current may flow in 3 "path" (plus2ground, minus2ground and plus2minus).Cheers!Ps. sorry for my language - it may be not so good (en is not my native)

author: EEVblog
author_rank: Unknown
timestamp: December 04, 2011, 04:26:58 am
content: Quote from: firewalker on December 03, 2011, 04:11:14 pmYep, I'll be using them.Dave.

author: EEVblog
author_rank: Unknown
timestamp: December 04, 2011, 04:28:16 am
content: Quote from: leniwiec on December 03, 2011, 05:56:42 pmYou'd use a fast DAC instead.Dave.

author: dcel
author_rank: Regular Contributor
timestamp: December 04, 2011, 06:27:37 am
content: DaveHaving been "out" of electronics for years, I have decided to get back into it and teach myself pic microcontrollers. I have been watching the eevblog for a while and felt compelled to actually sign up for the eevblog forum (first forum I have ever subscribed to) just so I could tell you thanks for the work you are doing here and keep up the great work. I have learned more watching your eevblog than in 3 years vocational electronics and a year of college electronics ( too much theory and math). I have recommended your eevblog to a friend returning to college for electronics as well.I especially look forward to building a pic controlled power supply for the lab I am setting up now. I can't wait for the next video...Thank you,Chris

author: EEVblog
author_rank: Unknown
timestamp: December 04, 2011, 08:48:21 am
content: Thanks Chris, and welcome.Dave.

author: ejeffrey
author_rank: Super Contributor
timestamp: December 04, 2011, 09:55:14 am
content: Quote from: leniwiec on December 03, 2011, 05:56:42 pmAs dave said, use a real DAC. Filtering PWM is cheap and easy, but very low performance. It is fine for generating low resolution DC signals, but if you need anything fancy a DAC is what you want. Even a cheap DAC will outperform the PWM signal by a lot. That said, designing a control loop with a microprocessor in the feedback loop is significantly more complicated to get right. It takes some effort to have anywhere near as fast of a response time as a cheap op-amp and guaranteeing stability is considerably harder due to the latencies involved.QuoteThese power supplies are floating and only connected to the + and - terminals. The ground terminal is simply connected to the chassis ground and to the mains earth connection. They are generally provided with clips that let you short either the + or the - output to ground in order to make a positive or negative voltage supply. All current is returned to the - output, only leakage current from the powered device flows through the ground pin.

author: slateraptor
author_rank: Frequent Contributor
timestamp: December 04, 2011, 10:50:44 am
content: Quote from: tnt on December 03, 2011, 04:46:26 pmI'm pretty sure the filter was a cascaded 2nd-order RC low pass with a transfer function:...and the output impedance of the filter (assuming the output impedance of the input source is negligible) from Laplace-domain to jw-domain:Input impedance of the filter in Laplace domain (assuming buffer input impedance is ideally infinite):I won't bother simplifying this one. Then again, I might not be remembering the filter from the video correct..."back of the envelope" calculations from "back of the mind" thoughts fo sho.

author: slateraptor
author_rank: Frequent Contributor
timestamp: December 04, 2011, 11:06:56 am
content: Quote from: tnt on December 03, 2011, 04:46:26 pmP.S. and for the record, I don't like math in the same way I don't like condoms: it's an indispensable tool when the task at hand calls for it, but when the task is complete, most people won't dare touch it and it gets flushed down the toilet either way. =\

author: george graves
author_rank: Super Contributor
timestamp: December 04, 2011, 11:33:31 am
content: Any reason why using a digital pot wasn't an option?I'm thinking of modding an off the shelf, coarse/fine typical bench top supply with some digital pots - mostly to give me programmable features. Any thoughts?

author: firewalker
author_rank: Super Contributor
timestamp: December 04, 2011, 11:54:53 am
content: Nice!!!I guess you are going to use a PIC mcu. It would be also nice to select C a compiler in order to make the code (The part for decoding the decoders is "essential" for me) portable for AVR e.t.c.Alexander.Quote from: EEVblog on December 04, 2011, 04:26:58 amNice!!!I guess you are going to use a PIC mcu. It would be also nice to select C a compiler in order to make the code (The part for decoding the decoders is "essential" for me) portable for AVR e.t.c.

author: tnt
author_rank: Regular Contributor
timestamp: December 04, 2011, 12:10:23 pm
content: Quote from: slateraptor on December 04, 2011, 10:50:44 amThis doesn't look right. It looks just like you multiplied the two transfer function of each stage.The RC filter has this transfer function :Butonlyif the loading impedance at the output if negligible. Which is the case for the second stage (because feeding an opamp), but not for the first stage which is loaded by the second stage and introduces another term.PS: Nice analogyI also don't do math just for the sake of it, but I found myself having to compute a RC filter having a specific impedance while in a train with nothing else than a paper and pencil and I just tought I'd share this because I find it useful to sometime being able to go back to this. (Even tough when I learned that at uni I wasn't convinced of the usefulness

author: slateraptor
author_rank: Frequent Contributor
timestamp: December 04, 2011, 01:33:04 pm
content: Quote from: tnt on December 04, 2011, 12:10:23 pmSee attached pic for circuit, just to be sure we're on the correct page. For simplicity of analysis, we'll denote R1/C1 as 1st-stage components and R2/C2 as 2nd-stage.Output impedance of the 1st stage:Input impedance of the 2nd stage:Since both expressions are functions of omega, evaluate at the limits.At DC, viz. w = 0:And at the other end of the spectrum:So it's clear that the stages are impedance matched. Of course, this assumes that the output impedance of the uC pin providing the PWM signal and input impedance of the non-inverting input of the buffer are very small and very large, respectively (which is a reasonable assumption). QED.I think you're train of thought drifted towards transistor small-signal analysis. Attention to detail, my friend...only because you forced my hand in writing a proof.And btw, I LOVE this codecogs instant online latex business! Thanks for the indirect link!!

author: tnt
author_rank: Regular Contributor
timestamp: December 04, 2011, 01:59:30 pm
content: Quote from: slateraptor on December 04, 2011, 01:33:04 pmYes, this is what I was thinking about.Quote from: slateraptor on December 04, 2011, 01:33:04 pmMm... sorry I don't see it.I do agree that the additional term ( j w R_1 C_2 ) in m y transfer function is irrelevant at both extremes:* If w = 0 (DC) then the term is just nulled.* If w -> inf then the term is irrelevant compared to the quadratic term w^2But in the transition region, the term has "some" influence. (it doesn't change drastically the response, but it's there nonetheless). So yes, if you're just drawing the bodeplot by hand for a quick check you can ignore it. But in the analytical solution, it must be present. If you're ok with an approximate solution, you might as well drop all the linear terms and just keep the constant one and the quadratic one.The first stage if you consider it connected to a non-negligible load :Which clearly shows the "extra" term and later on simplifies itself to (j w R_1 C_2).Quote from: slateraptor on December 04, 2011, 01:33:04 pmYes, the stuff is just awesome :pNot sure if they really like hotlinking to it but meh ...

author: jahonen
author_rank: Super Contributor
timestamp: December 04, 2011, 02:01:51 pm
content: I don't think one can just ignore the input impedance of the second stage. Here is a simulation and comparison to a transfer functions represented here. They match perfectly for each case and shows that if one puts ideal buffer (SPICE E-component, or VCVS) between stages, then the direct cascade assumption holds.I think that math is a good thing in general but I like application oriented way, so that when I get a mathematical description of the problem done (this can't be easily done by a computer), I'd prefer to use brute force of CAS to solve it, just to avoid page(s) full of just dummy algebraic manipulations which are quite error prone and I hate discovering stupid error three pages later...Edit: It seems that I mistyped the frequency in Maple, but not a great amount.Regards,Janne

author: slateraptor
author_rank: Frequent Contributor
timestamp: December 04, 2011, 02:32:39 pm
content: Quote from: tnt on December 04, 2011, 01:59:30 pmAhh, yes. I see where you're coming from and rescind my argument. Indeed, I was approximating way too much. Good show on putting me in my place.@jahonen: Simulated and got the same results. But I see exactly where tnt is coming from now and he's without a doubt correct.

author: leniwiec
author_rank: Contributor
timestamp: December 04, 2011, 02:43:29 pm
content: Quote from: ejeffrey on December 04, 2011, 09:55:14 amYes, I am currently using DAC (r2r), but I just wondering, because theoretically we can calculate it from 1 signal period... only hardware implementation of this may be very hard.Quote from: ejeffrey on December 04, 2011, 09:55:14 amUh, so they really not so much symmetrical

author: ivan747
author_rank: Super Contributor
timestamp: December 04, 2011, 02:58:58 pm
content: Quote from: EEVblog on December 03, 2011, 09:40:45 amYup. I took an old stereo apart just to get that part. It's not a stepper motor, though; just a common DC one. There is no electronic feedback because you choose when to stop, so you are part of the feedback system, actually. There must be some current limiter for the DC motor on that circuit, though.

author: jahonen
author_rank: Super Contributor
timestamp: December 04, 2011, 03:19:31 pm
content: I have wondered why there are no delta-sigma modulators in a MCU for DA conversion, it would be easier to filter than a PWM (as the noise would be at higher frequency), and further, the noise would be random noise, instead of discrete tone + harmonics that of PWM. All 1-bit audio DACs work with this principle (I'm listening one as I write this via my headphones and it works great!).But anyway, if the noise performance is a great concern, I'd go to a DAC solution (I think that it is not _that_ expensive) without any hesitation as it makes much easier to get rid of the supply induced noise in the MCU (output logic voltages are not clean even if fed from voltage reference) due to ground bounce/VCC droop in ground/VCC bond wires etc.Regards,Janne

author: RJSC
author_rank: Regular Contributor
timestamp: December 04, 2011, 11:26:22 pm
content: Quote from: george graves on December 04, 2011, 11:33:31 amI was thinking about it to.Any reason we shouldn't?A supply only with one pot would be more suitable to mod.One problem on modding an off the shelf supply could be that I don't know of any digital pot that can be floatting (MCU ground and one terminal of the POT must be tied, because of the internal CMOS switch).

author: george graves
author_rank: Super Contributor
timestamp: December 05, 2011, 04:43:56 am
content: Quote from: RJSC on December 04, 2011, 11:26:22 pmDave mentioned in the Constant current dummy load video, that it's often done with two pots in series. So, you might be able to replace both with a single digital pot?Quote from: RJSC on December 04, 2011, 11:26:22 pmHmmmm - I'm a noob - and have only played with digital pots - but something like this can't be used?http://www.maxim-ic.com/datasheet/index.mvp/id/2676That chip is only 256 values....but I'd assume there would be a 10-bit type digital pot?I could see adding a few rotary encoders, an character LCD and a keypad to make a poor-man's, single channel version of something like this:Based around an arduino, and something like this:The goal (for me) would be to have a power supply that I could store a few values in and press a button to recall them. Also the ability to "type" in a value quickly. "3.3v" or "10.111v" - I think it would be very hand to have to simulate sensor outputs and quickly calibrate a device based on two different voltages- quickly switching between a few voltages - rather then having to manually dial in a voltage over and over again.

author: IanJ
author_rank: Unknown
timestamp: December 07, 2011, 06:55:38 pm
content: Quote from: ivan747 on December 04, 2011, 02:58:58 pmI converted an old analogue Denon amplifier by using DC motor and a small H-bridge circuit driven via an Arduino. Input via a small IR detector that picks up the VOL UP/DN on my remote.Current limiting is done at the supply to the H-bridge taking into consideration FET RDS(on).......everything set up safe so that in the event say both FETs on left side of the H-bridge turn on at same (say the Arduino crashes!) then then nothing is overdriven.......no smoke!I use it every day.Ian.

author: JimmyM
author_rank: Regular Contributor
timestamp: December 08, 2011, 05:41:06 pm
content: I really enjoyed the 4 part series. I like the design a lot. I may start going through the design process to see if I could build something similar with a slightly larger range.One thing did bother me though. Using pots is fine to adjust because you move the pot until the output reads what you want. However, the uC doesn't know if the output is really what you want it to be. But you could have a calibration procedure. The uC can read the output via ADC and adjust an internal calibration matrix so that when it says to output 3.3V worth of PWM, the output is actually 3.3V.One thing though. 12-bit PWM using the internal 8MHz oscillator in an AVR will only do 8MHz/4096 ~= 1.9kHz. So even with an external 16MHz crystal, you can only get 3.8 kHz PWM at 12-bits. So an external DAC would be needed to get a clean DC signal without a lot of extra filtering. DACs aren't all that expensive. Some even have an internal reference. the price difference between 12-bit and 16-bit DACs is small, so why not go for a 16-bit SPI or I2C driven DAC and be able to get fine control and calibration of the output.Just thinking out loud.

author: Frant
author_rank: Regular Contributor
timestamp: December 12, 2011, 01:09:21 am
content: Quote from: slateraptor on December 04, 2011, 02:32:39 pmThe two stages of the filter obviously interact with each other, which is inherent to this topology. What can be done is to choose the component values differently in order to minimize the loading of the first stage. For instance, in the second stage the values can be R=100k and C=10n. If you run your simulation with these values, you'll see the improvement.

author: ejeffrey
author_rank: Super Contributor
timestamp: December 12, 2011, 09:53:01 am
content: Quote from: jahonen on December 04, 2011, 03:19:31 pmA few MCUs do have true DACs. Some of the PIC line have general purpose D/A converters, and analog devices has a few as well. In the SOC class of embedded processors onboard audio DACs are pretty standard. They are not always suitable for control applications, but as long as they can be DC coupled they should be OK for providing an operating set point.Anyway, if you are desperate to save a few cents, but PWM isn't good enough, you can actually make a 1st order sigma-delta modulator in software. You just set the PWM resolution for (say) 8 bits at a higher frequency, but keep a 12 bit control word. Then keep a software error accumulator that keeps track of the quantization error and updates the PWM width every cycle. You will still see low frequency ripple because this is a 1st order modulator, but most of the noise power will be pushed up into the higher frequencies and be easier to filter, and the response time will be much faster. IMHO, not really worth it compared to just putting in a cheap DAC.

author: EEVblog
author_rank: Unknown
timestamp: December 12, 2011, 12:15:51 pm
content: Quote from: george graves on December 05, 2011, 04:43:56 amThe most common type is 256 step, but you can get 1024 step ones. IIRC I have never sen higher.Digital pots also have a low max supply voltage, mostly TTL type range, only a few have say 12V or greater.No problem in my circuit configuration because one of the advantages of it is the ground referenced control voltage design. But harder to use digital pots in higher voltage designs where sometime the pot isn't ground referenced.QuoteSounds exactly like my designPart 5 coming soon...Dave.

author: JimmyM
author_rank: Regular Contributor
timestamp: December 12, 2011, 12:34:08 pm
content: Quote from: EEVblog on December 12, 2011, 12:15:51 pmAnxiously awaiting.

author: ivan747
author_rank: Super Contributor
timestamp: December 12, 2011, 03:45:28 pm
content: Quote from: JimmyM on December 12, 2011, 12:34:08 pmLooking forward to watching it. Is is going to be about the user interface and the MCU?

author: JimmyM
author_rank: Regular Contributor
timestamp: December 12, 2011, 05:18:17 pm
content: I am SO building one of these. A couple of ADC connections from the Current amplifier and the Vout can calculate Wattage on an LCD.

author: EEVblog
author_rank: Unknown
timestamp: December 12, 2011, 09:53:41 pm
content: Quote from: ivan747 on December 12, 2011, 03:45:28 pmNext video will probably be a few additions to the schematic, like the micro, ADC/DAC (yes, no PWM), and various current measurement stuff, and likely more datasheet and component selection stuff.I just laid out the board and have a time lapse video of that, so I'll add some commentary and make a video.Then there will likely be another on the system design and layout etcPlus still another trick up my sleeve.Plenty of videos to do yet I think...Dave.

author: baljemmett
author_rank: Unknown
timestamp: December 12, 2011, 10:34:57 pm
content: Quote from: EEVblog on December 12, 2011, 09:53:41 pmExcellent news -- I get the impression you're really enjoying this project!

author: firewalker
author_rank: Super Contributor
timestamp: December 12, 2011, 10:36:57 pm
content: I am hoping for DIP packages...Alexander.

author: IanB
author_rank: Super Contributor
timestamp: December 12, 2011, 11:52:55 pm
content: Quote from: firewalker on December 12, 2011, 10:36:57 pmBut some of us need an excuse to practice SMD soldering

author: EEVblog
author_rank: Unknown
timestamp: December 13, 2011, 01:36:21 am
content: Quote from: IanB on December 12, 2011, 11:52:55 pmThen you will both get your wish!As mentioned on today's AmpHour, the PSU project is mostly through-hole, but a few SMD parts were unavoidable.Dave.

author: caroper
author_rank: Regular Contributor
timestamp: December 22, 2011, 01:03:53 pm
content: If I may add to the wish list.Will the final design allow them to be connected in Series / paralleled / cascade configurations to provide more current, more voltage or a tracking +/- Supply?It is often stated that it is cheaper to buy a good bench supply than to make one, but the joy of building it and understanding exactly how it works, thanks to your tutorials, is priceless. I would love to build this just for the practical experience and my power requirements, for the foreseeable future, are low. 12V at 500mA is more than I envisage needing, but if the PSU's are isolated then 2 could possibly give +/-12V at 500mA or 12V at ~1Amps or 24V at 500mA.This will be a step up from my Velleman LAB1 PSU and a great addition to any hobby lab.Any chance of releasing it in Kit form?Good on you Mate.I look forward to Part 5.CheersChris

author: JimmyM
author_rank: Regular Contributor
timestamp: December 22, 2011, 01:19:03 pm
content: I'm hoping for an AVR based design instead of PIC. Just a personal preference. I have more experience with AVRs. But if it is with a PIC, I can certainly substitute an AVR in my version. I'm envisioning a few buttons, a rotary encoder, and a small LCD. What say you, Dave? Will you be doing an LCD?

author: firewalker
author_rank: Super Contributor
timestamp: December 22, 2011, 01:27:14 pm
content: I am also hoping for a AVR design. Not because I don't like PICs. Because PIC programming under GNU/Linux...Either way it would be trivial to "cross platform it".Alexander.

author: RJSC
author_rank: Regular Contributor
timestamp: December 22, 2011, 01:55:34 pm
content: Quote from: caroper on December 22, 2011, 01:03:53 pmIf you write your own MCU firmware, tracking will be easy:Build 2 identical floating PSUs and add an optoisolator to the microcontroller (use standard serial ASCII characters over the UART or custom protocol if you want) and send the current voltage from the master supply, and the slave should receive the data and track the master accordingly.If you leave an optoisolated serial interface for computer control (useful for automated tests or extremely low frequency function generator) you can just connect the 2 supplies directly to one another and the master supply will issue commands as if it were the computer.Or if you leave them connected to the computer, the computer can read the voltage from the master supply and send it to the slave, or you can have both a dedicated computer interface and tracking interface.The key is the optical isolation on the communication so that you can connect the ground of one supply to the positive of another.Now the difficult is to choose between all of this communication methods.(I'm not a native english speaker, so, if it sounds confuse, feel free to ask for clarification)

author: RJSC
author_rank: Regular Contributor
timestamp: December 22, 2011, 01:59:50 pm
content: Quote from: firewalker on December 22, 2011, 01:27:14 pmWell, there's good news for you!Quote

author: firewalker
author_rank: Super Contributor
timestamp: December 22, 2011, 02:01:27 pm
content: NICE!!!Alexander.Quote from: RJSC on December 22, 2011, 01:59:50 pm

author: shebu18
author_rank: Frequent Contributor
timestamp: December 22, 2011, 03:03:04 pm
content: I still hope for a AVR version too. I also think that if it will be PIC someone with experience will write a code for AVR.

author: McMonster
author_rank: Frequent Contributor
timestamp: December 22, 2011, 05:03:26 pm
content: Or maybe Dave will surprise us and choose less or next to not known MCU or even small ARM, they're dirt cheap nowdays (and a bit overkill for this application). I'd actually be happy if this was the less known micro, AVRs and PICs are used in all kind of hobby projects and it's a bit boring.As for the code, a block diagram or pseudocode would be nice.

author: firewalker
author_rank: Super Contributor
timestamp: December 22, 2011, 05:17:16 pm
content: Dave said it will be PID-28 packet. This narrows it down...Alexander.

author: JimmyM
author_rank: Regular Contributor
timestamp: December 22, 2011, 07:26:19 pm
content: Quote from: firewalker on December 22, 2011, 05:17:16 pmUmmm. What's a PID-28 Packet?

author: caroper
author_rank: Regular Contributor
timestamp: December 22, 2011, 07:37:26 pm
content: Well the new low pin count, dip packaged, PIC32MX, MIPS core chips from Microchip were released into production this month. Lots of peripherals, including 16 bit PWM and 10 bit ADC's that can run at 1Meg samples per second, all clocked at 80Mhz, it has a lot of processing power. It could be ideal for this sort of operation.

author: JimmyM
author_rank: Regular Contributor
timestamp: December 22, 2011, 07:59:21 pm
content: Quote from: caroper on December 22, 2011, 07:37:26 pmWow. That sounds cool. I may just have to look that thing up. I have no idea what I'm going to do with 80MHz of processor, but I should be able to come up with SOMETHING!

author: firewalker
author_rank: Super Contributor
timestamp: December 22, 2011, 09:12:41 pm
content: Quote from: JimmyM on December 22, 2011, 07:26:19 pmYea, I meant DIP.Alexander.

author: McMonster
author_rank: Frequent Contributor
timestamp: December 22, 2011, 11:03:22 pm
content: Quote from: caroper on December 22, 2011, 07:37:26 pmSounds interesting. I think I'll give them a try before DIP/SO/TSSOP ARMs become available.

author: EEVblog
author_rank: Unknown
timestamp: December 23, 2011, 02:00:29 am
content: Nothing exotic, it's a bog standard AVR Atmega48, with separate 12bit Microchip ADC and DAC.I considered a 12bit ADC PIC in DIP (basically the only brand micro with DIP 12bit ADC).I decided to Guild the Lilly over the integrated 10bit solution.Dave.

author: firewalker
author_rank: Super Contributor
timestamp: December 23, 2011, 10:42:34 am
content: When you mentioned DIP-28 I said to my self "If he chooses AVR, I bet it would be ATmega8".Alexander.Quote from: EEVblog on December 23, 2011, 02:00:29 am

author: jstkatz
author_rank: Newbie
timestamp: December 25, 2011, 07:39:49 am
content: Any plans on making this availible as a kit? I'm guessing there would be demand for it and it seems to have much better performance than other electronics power supplies.

author: EEVblog
author_rank: Unknown
timestamp: December 25, 2011, 11:04:08 am
content: Quote from: jstkatz on December 25, 2011, 07:39:49 amYes, that is the plan, hence the through-hole parts.Dave.

author: McMonster
author_rank: Frequent Contributor
timestamp: December 25, 2011, 11:56:24 am
content: Quote from: EEVblog on December 25, 2011, 11:04:08 amWill there be an option for soldering multiple regulators on the PCB for more current?

author: JimmyM
author_rank: Regular Contributor
timestamp: December 25, 2011, 12:04:51 pm
content: Quote from: EEVblog on December 25, 2011, 11:04:08 amDave, a kit would we awesome. But I do have a request. Would it be possible to make the uC on a plug in board? To allow us to use a different controller. Your board could just use a DIP-40 foot print for the controller. Then nearly any controller could be used. I'm not saying that you should provide the different daughter boards. Just the one for the chip you choose. But we could build a customer one if we choose. That would ROCK.

author: shebu18
author_rank: Frequent Contributor
timestamp: December 25, 2011, 12:06:21 pm
content: If we will have the schematics we can implement any uC. There is no need for a plug in board.

author: McMonster
author_rank: Frequent Contributor
timestamp: December 25, 2011, 12:14:26 pm
content: Quote from: JimmyM on December 25, 2011, 12:04:51 pmDifferent micros have different pinouts, you can't just stick DIP-40 footprint and hope AVR's supply, ADC etc. pins will match those on different controllers. It won't even work on all AVRs with the same pin count. It would require having some kind of connections like goldpins on development boards to be connected using jumper wires and this would be very ugly for such a device. A pluggable daughter board would make more sense, but is it worth it?

author: shebu18
author_rank: Frequent Contributor
timestamp: December 25, 2011, 02:07:13 pm
content: What he wanted to say is that wanted to change the dip40, on which not all pins are used with another micro that has the same pinout made by the plug in board. It' kind of like the arduino and its shields.

author: JimmyM
author_rank: Regular Contributor
timestamp: December 25, 2011, 10:29:02 pm
content: What I was suggesting was that just about any controller could be mounted to a daughter board that has a 40DIP footprint. Like a mega168 TQFP smd chip on a small pcb with 2 row of 20 pins. See what I'm getting at.

author: EEVblog
author_rank: Unknown
timestamp: December 25, 2011, 10:43:39 pm
content: Quote from: JimmyM on December 25, 2011, 12:04:51 pmSorry, the board is already done, DIP28 AVR.This is an open source kit, so the idea is that people can build upon the existing code and share etc. If you have everyone using a different processor then it kinda makes a mess of the whole concept. If you really want to use your own processor, then you can lay out your own board, or hack on an adapter board.IMO it's better to pick a processor and lock it in, than try and provide such a flexibility that few people will actually take advantage of.Dave.

author: Unknown
author_rank: Unknown
timestamp: December 25, 2011, 10:54:34 pm
content: Designing a daughter board with a DIP-28 connector shouldn't be much harder than DIP-40. The majority of the customers will probably use the MCU firmware as-is, and many of the people that will hack it will probably use the standard AVR, so the daughter board would unnecessarily increase the price for many people.

author: JimmyM
author_rank: Regular Contributor
timestamp: December 26, 2011, 12:07:18 am
content: Ok then. Just a thought. Still very much looking forward to the rest of this project.

author: Greg J
author_rank: Regular Contributor
timestamp: December 29, 2011, 01:59:57 am
content: Software is softwareThe only options with uC there is things like resolution of D/A , unless you still want to carry on with PWM.It would be nice to have usb or serial port on it tho, and uC that has as many as possible pin driven interrupts. Otherwise you have to writethe pathetic sort of code with while loops and sleeps. The worse kind ever, but it is pretty much a norm in open source/open hardware world. (see arduino modules).

author: Nick Gammon
author_rank: Contributor
timestamp: December 31, 2011, 04:20:21 am
content: I've been experimenting with doing PWM from an Arduino to the power supply breadboard.I connected pin D3 (a PWM pin) of the Arduino Uno to the pin 3 of the voltage-sensing op-amp (+) via a 10K resistor, and with a 10 uF capacitor for filtering (between pin 3 of the op-amp and Gnd).By experimentation, it turned out that multiplying the required voltage by 23 gave the correct output from the power supply.Code:const byte voltagePin = 3;const float adjust = 23.0;void setup () { }void loop (){for (float voltage = 0; voltage <= 5.5; voltage += 0.5){analogWrite (voltagePin, voltage * adjust);delay (3000);}} // end of loopJudging by my meter, the output is accurate to about 1 percent. Measured readings (volts):Code:0.0310.4921.0141.4942.0172.4963.0193.4994.0224.5005.0215.498

author: JimmyM
author_rank: Regular Contributor
timestamp: December 31, 2011, 04:28:17 am
content: An Arduino might be good for experimentation. But you wouldn't use one in a finished unit. Would you? I mean why use a $30 Arduino in place of a $2 uC.

author: amspire
author_rank: Super Contributor
timestamp: December 31, 2011, 04:42:10 am
content: Quote from: JimmyM on December 31, 2011, 04:28:17 amAtmega168 ICs starts off at a one-off price of about $2.50 on Digikey and under $2 for 1000, and the Atmega328 starts off at under $4 for one off quantities or $2.20 for 2000 off quantities. You only use the $30 Arduino for development, but for a final application, you can usually replace the Arduino board with the processor chip and a few cheap components.So it is a $2 IC, and an Arduino project can be used in a finished product.Richard.

author: Nick Gammon
author_rank: Contributor
timestamp: December 31, 2011, 04:44:30 am
content: Quote from: JimmyM on December 31, 2011, 04:28:17 amNo I wouldn't. But it is good for getting the theory right. And I like to understand what I am doing.Besides, it sounds like Dave is going to use an Atmega. The basic chip will be the same (similar, anyway). The Atmega48 is basically the same as in the Arduino, but with less program memory, RAM and EEPROM.

author: JimmyM
author_rank: Regular Contributor
timestamp: December 31, 2011, 05:06:04 am
content: Gotcha. So you could use the arduino bootloader and program in the finished project. Not the entire Arduino board. I think I see what you mean.I still need to look at the schematic when it's released. I might use a different chip on a daughter board to allow me to connect things like LCDs or whatever else I might want to add. It shouldn't be that hard to build a daughter board for a mega324/644 that plugs into a DIP-28 socket. That is, of course, if Dave hasn't already thought of that sort of thing.

author: Nick Gammon
author_rank: Contributor
timestamp: December 31, 2011, 05:15:02 am
content: Absolutely. In fact the Arduino IDE can be used to program "bare bones" boards. I did an example here:http://www.gammon.com.au/forum/?id=11109Just the chip, a couple of decoupling caps, and a resonator. And if you don't care too much for accuracy you could just use the internal clock.You don't have to use the bootloader, although it simplifies downloading new programs a bit. You can use an FTDI cable through the ICSP interface (basically the SPI pins).(edit) I got that wrong. You use the FTDI cable to program through the serial pins (effectively it is a USB to serial converter). To use the ISCP interface (the SPI pins) you need a programmer like the USBtinyISP.The FTDI cable, example for around $20:http://www.adafruit.com/products/70The USBtinyISP ($22):http://www.adafruit.com/products/46With the USBtinyISP (or similar) programmer you don't have to waste program memory on a bootloader, although the Optiboot one is only 512 bytes.

author: amspire
author_rank: Super Contributor
timestamp: December 31, 2011, 05:22:48 am
content: Quote from: JimmyM on December 31, 2011, 05:06:04 amYes. I don't like to loose the easy Arduino programming, so you take the pins that normally do the RS232/USB chip and take them to a header instead. Then use a $3 Nokia clone CA-42 cable (with a slight rewiring) to do the USB to the RS232 header. Works fine. If you need to change the crystal frequency of an Arduino-based project, it is just a matter of editing boards.txt in hardware/Aduino folder in the Aduino folder in Program Files.

author: JimmyM
author_rank: Regular Contributor
timestamp: December 31, 2011, 05:26:46 am
content: I'll have to look into the Nokia cable trick. I haven't used PC to AVR via USB yet.

author: amspire
author_rank: Super Contributor
timestamp: December 31, 2011, 05:35:15 am
content: Quote from: Nick Gammon on December 31, 2011, 05:15:02 amIf there is no need for accurate time measurement, why not use the internal oscillators?There is the calibrated 8MHz internal clock, but even the uncalibrated 128KHz internal clock may be all that a power supply needs.Richard.

author: Unknown
author_rank: Unknown
timestamp: December 31, 2011, 05:39:51 am
content: A UART bootloader would require a stable clock source.

author: amspire
author_rank: Super Contributor
timestamp: December 31, 2011, 05:42:45 am
content: The internal 8MHz clock is accurate enough for the UART comms, as long at you don't erase the calibration bits.Edit: Maybe not. I just looked it up and the factory calibrated 8MHz is only accurate to 10%. Not really good enough, so scrap the internal clock idea. User calibrated, it is accurate to 1% over the full temperature range but if you are going to add a calibration step, why not buy a crystal or resonator instead ?

author: Unknown
author_rank: Unknown
timestamp: December 31, 2011, 06:05:15 am
content: The typical graphs in the ATmega328PA datasheet show about +/- 2-3% change over temperature or voltage, +/- 5% over both. AVR140 claims than the max. deviation over temp/voltage is 10%, and calibration accuracy is +/- 2%. It might work with RS-232 after calibration if you don't need the whole temp/voltage range, but it's more hassle than it's worth in my opinion. The only reason might be power usage, but then a 32 kHz crystal for calibration might be a better solution.

author: EEVblog
author_rank: Unknown
timestamp: December 31, 2011, 06:05:28 am
content: I maxed out the pins on my 28pin ATmega so had to use the internal oscillator.Arduino compatibility seemed a bit overkill, but recently I'm starting to think it wouldn't be such a bad idea, just to ease people having a go at modding it.But the proto PCB is in the post...Yes, there is a serial interface capability on the final design.Dave.

author: firewalker
author_rank: Super Contributor
timestamp: December 31, 2011, 11:31:38 am
content: There are cheaper boards for usb<->serial communication. PL2303 ones cost about 4 USD. I am using those for some time now and had no complaints. The only trap is that some boards doesn't use original Prolific chips. Not a problem though if you order from a reliable source.Alexander.

author: JimmyM
author_rank: Regular Contributor
timestamp: December 31, 2011, 12:08:36 pm
content: Quote from: EEVblog on December 31, 2011, 06:05:28 amLooking forward to getting a look at it.

author: shebu18
author_rank: Frequent Contributor
timestamp: December 31, 2011, 12:22:21 pm
content: Quote from: firewalker on December 31, 2011, 11:31:38 amI have a nokia dongle which a wanted to use for usb<->uart but i had problems with the drivers from prolific. Tried on XP and 7, still the same problem. So i recommend only FTDI as an convertor, or maybe the avr chip arduino is using now.

author: EEVblog
author_rank: Unknown
timestamp: December 31, 2011, 12:41:08 pm
content: Anyone actually had any practical experience with Arduino serial comms using the internal oscillator?Looks like I could make my current project Arduino compatible as-is, the only issue is the use of the internal oscillator.Otherwise it's a re-spin or daughterboard using a larger SMD based Arduino MEGA compatible device and the external crystal.Or a design re-spin trying to gain an extra 2 pins somewhere (input switches most likely)Dave.

author: firewalker
author_rank: Super Contributor
timestamp: December 31, 2011, 01:08:10 pm
content: Quote from: EEVblog on December 31, 2011, 12:41:08 pmI think that everything in Arduino is tweaked for 16 MHz Xtal though. I will try in an ATmega8 the UART comm with the internal osc.Alexander.

author: Blue
author_rank: Regular Contributor
timestamp: December 31, 2011, 01:45:11 pm
content: Hi Dave,I'd like to congratulate you on your awsome video blogs. I like it a lot.About your usart0:Using the internal clock: 8 MHz.Looking at table 20.5 from the datasheet: you can use: 9600, 19.2k or 38.4k baud by setting the UBRRn register according to the table.Well there you have it...Have fun,Nick

author: Bored@Work
author_rank: Super Contributor
timestamp: December 31, 2011, 02:01:09 pm
content: Quote from: EEVblog on December 31, 2011, 12:41:08 pmNot with the Arduino, but with the atmega MCUs, which should be the same. The short answer is, it is a gamble.The internal oscillator comes out of the factory calibrated for +/- 10% at a certain temperature. While one atmega coming from the factory might be good enough for the USART, the next might not be.You can then individually calibrate each atmega. The first problem is of course doing the calibration (Atmels Studio 4 comes with support for it, and there is an appl. note about it). The second problem is that the oscillator is still temperature dependent. If you calibrate at the wrong temperature you still end up with the wrong frequency.For a kit, or anything supposed to go out to Arduino users I don't think individual calibration is an option, but without it it is a gamble.QuoteWe need to see the schematic to figure out if there is an easy way. Or you could think about expanding the ports with a cheap 74HC595 on the SPI interface.Dave.

author: firewalker
author_rank: Super Contributor
timestamp: December 31, 2011, 02:09:25 pm
content: I believe that if the frequency shifting causes a baud error less than 1% at a given baud rate it will work with no major issues.Alexander.

author: amspire
author_rank: Super Contributor
timestamp: December 31, 2011, 02:13:13 pm
content: Quote from: EEVblog on December 31, 2011, 12:41:08 pmI haven't actually tried using the internal oscillator, but the Arduino does provide support for the internal clock for atmega168 and 328 chips.If you have a chip with a working bootloader, you will need to replace the bootloader, change the fuse settings for internal clock use, and let Arduino know the new clock speed.Here how it is done. You need to add a new boards.txt entry. This can be done in two places - adding it to the boards.txt file in hardware/arduino in the Arduino program folder, or adding it to a "hardware\arduino" folder in your sketchbook folder (not your sketch folder - that is a different thing). You find out where the sketchbook folder is by running Arduino and going to Files->preferences. If there is a boards.txt file in hardware/arduino in the sketchbook folder, it will use that and totally ignore the one in Arduino program folder. If you add it to Arduino program folder, the added board may get lost in a future update. Don't like either option. Ideally, they should allow a hardware/arduino folder in the sketch folder, but they don't.I would probably add the single entry boards.txt file to my sketchbook, with another copy plus a readme.txt file with instructions in the sketch folder. When you finish this job, delete the entry from the sketchbook folder, so it does not mess up the next arduino project. If all the above sounds confusing, just do it, and you will see what the problem is.Anyway if you are using a atmega328 chip, you need a boards.txt file containing this in one of the two locations:Code:##############################################################atmega328ic.name=ATmega328 8 MHz internal clockatmega328ic.upload.protocol=stk500atmega328ic.upload.maximum_size=30720atmega328ic.upload.speed=57600atmega328ic.bootloader.low_fuses=0xE2atmega328ic.bootloader.high_fuses=0xDAatmega328ic.bootloader.extended_fuses=0x05atmega328ic.bootloader.path=arduino:atmegaatmega328ic.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hexatmega328ic.bootloader.unlock_bits=0x3Fatmega328ic.bootloader.lock_bits=0x0Fatmega328ic.build.mcu=atmega328patmega328ic.build.f_cpu=8000000Latmega328ic.build.core=arduino:arduinoThe "low_fuses" setting enables the internal clock, and the f_cpu setting sets 8MHz. The bootloader has been changed to "ATmegaBOOT_168_atmega328_pro_8MHz.hex" which is already in the hardware folder in the Arduino program folder. Everything else is the same as a standard 16MHz external clock Arduino.Then you run Arduino with the target connected.Go to tools->board and select "ATmega328 8 MHz internal clock"Go to tools->programmer and select "Arduino as ISP"Go to tools->burn_bootloaderYou now should be ready to go. The chip now has the new bootloader, and the Arduino has the new settings for the internal 8MHz clock atmega328.BoredAtWork is correct - the chip comes from the factory calibrated to 10% according to the data sheet. I do not know why it is so bad - it sounds like a very conservative figure to me as if they go to the trouble of calibrating it at the factory, I am sure they would calibrate it to 1% at the time. If it is within 5%, then the serial comms will probably work. I do not have experience, but the Arduino does go to the effort of providing the bootloader, so it might work OK.Richard.Edit: I left out one important fact. The "Arduino as ISP" option uses an Arduino board to program the bootloader onto a second board or device. Here is a tutorial describing it:http://arduino.cc/en/Tutorial/ArduinoISP

author: firewalker
author_rank: Super Contributor
timestamp: December 31, 2011, 02:15:47 pm
content: What if you don't use a xtal witch require two pins. You could use a stable external clock source (VCXO) witch need only one pin.Alexander.

author: JimmyM
author_rank: Regular Contributor
timestamp: December 31, 2011, 02:17:44 pm
content: Dave, is this going to be an arduino programming based project or are you going to write the C yourself?

author: Bored@Work
author_rank: Super Contributor
timestamp: December 31, 2011, 02:28:44 pm
content: Quote from: firewalker on December 31, 2011, 02:09:25 pmBut the atmega RC oscillator is not stable over temperature. From memory, an atmega oscillator calibrated at a temperature of 25° to 8.00 MHz oscillates with approx. 8.50 MHz at 85°. That is > 4%.Quote from: firewalker on December 31, 2011, 02:15:47 pmDo you think it is a god idea to require from the Arduino crowd to unsolder an (SMD) crystal and two (SMD) caps from an Arduino board? I mean, these people picked the Arduino for a reason.

author: amspire
author_rank: Super Contributor
timestamp: December 31, 2011, 02:31:15 pm
content: Quote from: firewalker on December 31, 2011, 02:15:47 pmThis is a good idea, and if you do, you still need a new boards.txt but only the frequency will be changed to the external crystal frequency. As an example, for a 10MHz external oscillator, you would need this boards.txt file:Code:##############################################################atmega328ex.name=ATmega328 10 MHz external clockatmega328ex.upload.protocol=arduinoatmega328ex.upload.maximum_size=30720atmega328ex.upload.speed=57600atmega328ex.bootloader.low_fuses=0xFFatmega328ex.bootloader.high_fuses=0xDAatmega328ex.bootloader.extended_fuses=0x05atmega328ex.bootloader.path=atmegaatmega328ex.bootloader.file=ATmegaBOOT_168_atmega328.hexatmega328ex.bootloader.unlock_bits=0x3Fatmega328ex.bootloader.lock_bits=0x0Fatmega328ex.build.mcu=atmega328patmega328ex.build.f_cpu=10000000Latmega328ex.build.core=arduinoatmega328ex.build.variant=standard

author: IvoS
author_rank: Frequent Contributor
timestamp: December 31, 2011, 02:53:52 pm
content: Hi, is there a schematic somewhere out there for very low noise adjustable power supply? Something like Walt Jung super regulator (but adjustable) with only a few microV output noise?

author: Bored@Work
author_rank: Super Contributor
timestamp: December 31, 2011, 04:49:52 pm
content: Quote from: IvoS on December 31, 2011, 02:53:52 pmYou get good results with two LM317, one configured as a tracking preregulator, forcing a constant voltage (something like 4 V) over the second regulator. The principle is in the LM317 datasheet, but you need to add the parts for the "improved ripple rejection" (also in the datasheet) to both of the regulators. You could even think about adding LC filtering to both regulators.Another way is to follow a normal regulator with a clean-up shunt regulator. See e.g.http://eetimes.com/design/automotive-design/4009607/Feedforward-noise-cancellation-rejects-supply-noiseThey blow the concept a little bit out of proportion, calling it a "feed-forward noise cancellation technique", yeah sure. It is an active shunt regulator, if you ask me.

author: Nick Gammon
author_rank: Contributor
timestamp: December 31, 2011, 07:59:52 pm
content: Quote from: EEVblog on December 31, 2011, 12:41:08 pmWhy do you need to do this (the serial comms)? You can use the Arduino IDE and program using the USBtinyISP via the 6 SPI pins, which you can break out or get at one way or another (even if you have to program the chip before inserting it onto the board).It's still "Arduino compatible" - you just need to be aware if you are running at 8 MHz rather than 16 (which is done by a #define in the library) in places that matter, like timing code.Quote from: JimmyM on December 31, 2011, 02:17:44 pmIf you program in the Arduino IDE you are "writing C yourself". It just saves you mucking around with a lot of configuration options, Make files etc.Dave, you should easily be able to fit your project onto the Atmega328 family of chips. Personally I would go for the top of the range: Atmega328 (sold by Element14 for $4.33 in lots of 25+) compared to the Atmega48 ($3.62). For 71 cents difference you get a lot more flash memory, RAM and EEPROM.If you are running out of interface ports, you can hook up 119 lots of I2C devices to the two I2C pins. Devices like LCD drivers, ADC, IO expanders for keypresses, etc. Even a single 16-port I2C IO expander gives you 16 extra ports which can be individually configured for input or output.

author: EEVblog
author_rank: Unknown
timestamp: December 31, 2011, 11:25:50 pm
content: Quote from: firewalker on December 31, 2011, 02:15:47 pmMakes no difference, all my pins are used, so freeing up one extra pin or two extra pins requires a board re-spin.Dave.

author: EEVblog
author_rank: Unknown
timestamp: December 31, 2011, 11:26:45 pm
content: Quote from: JimmyM on December 31, 2011, 02:17:44 pmI was going to write it myself, but now I'm thinking that Arduino compatibility might be better for people.Dave.

author: EEVblog
author_rank: Unknown
timestamp: December 31, 2011, 11:35:35 pm
content: Quote from: Nick Gammon on December 31, 2011, 07:59:52 pmBecause that's the "normal" way to program an Arduino board, is it not?QuoteI didn't know you could do that.That would work on the current board because I have the ISP header on the board.QuoteYes, easy fix.QuoteOf course.The only issue is that the board is done.If it happens to need a re-spin, then I can change things however I want, but if I want to run as-is, then I'm stuck with the internal oscillator.Might still be an issue actually because I still have that optional serial interface using the internal oscillator. I've used that no problem with PIC's factory calibrated internal osc before, but not with AVR.Dave.

author: firewalker
author_rank: Super Contributor
timestamp: December 31, 2011, 11:54:36 pm
content: Actually yes, you can use Arduino IDE to compile your program and load the hex file to the target mcu using ISP and whatever programmer you wish. With this way you can save the space the bootloader needs.The downside is that someone will need a programmer to load it.My opinion though is that if the frequency shifting doesn't produce baud error bigger than 1% it will be ok. So, now need for changes.Alexander.

author: shebu18
author_rank: Frequent Contributor
timestamp: December 31, 2011, 11:56:51 pm
content: On the 328 the bootloader takes around 2kb of memory, you still have 30k for programing. on the 48 you do not have enough memory. You could use 168 or 238 for the board. The chips are also pincompatible.

author: EEVblog
author_rank: Unknown
timestamp: January 01, 2012, 12:04:21 am
content: Quote from: firewalker on December 31, 2011, 11:54:36 pmOf course. I did know that, somewhere up thereShows how much I use ArduinoQuoteNot a huge deal I suspect. Given that the serial interface is an optional board anyway.QuoteYes, 1% is usually enough for reliable serial comms.I suspect the best solution is to simply re-spin the board and add the 16MHz crystal.With any luck I've goofed something anyway and it'll need a re-spinDave.

author: Greg J
author_rank: Regular Contributor
timestamp: January 01, 2012, 12:51:30 am
content: Will the design be physically divided into the analogue and uC part ? i.e., separate boards ?Something tells me, I could use the analogue part as learning experience - but when it comes to uC - I have few things I want to do to make it work for me, something tells me it will differ from whatever someone else will do. Even such a brilliant guy like yourself.One thing I want, is to have few buttons (3-4) with predefined voltage that I could just bring in with one touch. Likewise for current settings.Plus, having separate analogue board would mean that you could have few of them not just one

author: EEVblog
author_rank: Unknown
timestamp: January 01, 2012, 01:07:55 am
content: Quote from: Greg J on January 01, 2012, 12:51:30 amNo, one board, sorry. The serial is separate though. Yes, there are 4 buttons, two of which I was going to use for pre-defined voltages/currents.Everyone will have different needs of course, it's an open design so you can change it any way you like.Dave.

author: Blue
author_rank: Regular Contributor
timestamp: January 01, 2012, 02:07:38 am
content: Hi Guys & Dolls,I never experienced any problems with the internal clock and serial io.For those who think it is a problem just test it in your oven and deep freezer.Again, no problem on the other side of the planet...Cheers and happy new year,Nick

author: Greg J
author_rank: Regular Contributor
timestamp: January 01, 2012, 02:46:24 am
content: Dave, will the analogue part differ much from what you already designed ?And can you tell us where exactly the serial io and clocks really matter ?I thought this is strictly either PWM, or DAC (some PICs have internal DAC). I do agree that arduino makes things easier.The way I would do it, I would use arduino nano, or arduino pro - and just have pins that will accommodate it.Can't wait to see what you'll come up with - I'm sure it will be better then our best imagination

author: EEVblog
author_rank: Unknown
timestamp: January 01, 2012, 02:56:09 am
content: Quote from: Greg J on January 01, 2012, 02:46:24 amThe analog core is basically the same, but I have added real 12bit DACs and better current sensing.The serial I/O and clock only matters if I make it Arduino compatible.QuoteThat would just increase the cost over just having the micro on it's own.Dave.

author: Greg J
author_rank: Regular Contributor
timestamp: January 01, 2012, 03:24:22 am
content: Quote from: EEVblog on January 01, 2012, 02:56:09 amIndeed, but will make programming it and so on so much easier. These things come with usb port, and loader on it already.You can buy arduino nano off ebay for £8. Personally I don't own any uC programmers anymore, arduino and TI MSP LP board do things for me.Design pins for arduino pro, or nano on your board - stick it on - et voile, job done. Nice and simple.

author: JimmyM
author_rank: Regular Contributor
timestamp: January 01, 2012, 03:54:18 am
content: Sure, writing code for the arduino is C, but you have to write code for the arduino. If I can just write C and have to think about all the config options (I don't have to mess with make files with AVR Studio), I can write code for the Tiny10 up to the mega2560. Sure, if you want to hack together an experiment, an Arduino is probably a good idea. But for a finished project, an installed uC running straight code (I mean no bootloader) is, in my humble opinion, a proper solution.However, given that this going to be an open source project, I suppose considering an Arduino software environment might be better for the masses.

author: EEVblog
author_rank: Unknown
timestamp: January 01, 2012, 04:08:56 am
content: Quote from: Greg J on January 01, 2012, 03:24:22 amAU$17 vs <$4 one-off price difference.That translates to a very significant base cost increase on the kit, unless I supply the kit without the Nano or at-cost.The only difference is that anyone who wants to reprogram must have an ISP programmer of some kind instead of just straight USB. That's not a big deal I suspect. The majority won't want to play with the firmware.Dave.

author: Nick Gammon
author_rank: Contributor
timestamp: January 01, 2012, 05:57:59 am
content: Just as a general response to some of the above ...I presume your design doesn't currently have a USB interface, so to program it you either need to use a bootloader with a custom FTDI cable ($20) or via the ISCP header using a custom programmer ($22). Clearly the difference, for people that want to reprogram it, is minimal.The Optiboot loader, currently used on the Uno (Atmega328) is 512 bytes, not 2Kb. The overhead, out of 32 Kb of program memory is minimal. Particularly since you were talking about using a chip with less memory to start with. Add 70 cents to the chip price and you can afford lots more "bells and whistles" in terms of the onboard code.You don't need to muck around with hex files, I have personally programmed my "bare bones board" project just using the IDE. You edit the preferences file (once off) to tell it to use the USBtinyISP programmer rather than the bootloader, and then just hit Ctrl+U to compile and upload. Couldn't be simpler.I would be tentatively planning to go through a calibration phase (to compensate for slight differences in resistor values) and store compensation data in the EEPROM. That way each unit should be pretty accurate. You might also have default "turn on" settings.QuoteAs I said before, it's Arduino compatible even without that. In fact, if you are using the Atmega48 chip, and have an ICSP header, you would be hard-pressed to not have it Arduino-compatible. The only difference might be the way you write the software. And honestly, why not use the Arduino IDE? The compiler is g++, an industry standard. It generates tight, efficient code. The linker optimizes away stuff you don't need. You don't have to use any of their libraries if you don't want to. But things like the ports are already defined in header files. Interrupts are easy to do.

author: EEVblog
author_rank: Unknown
timestamp: January 01, 2012, 06:09:26 am
content: Quote from: Nick Gammon on January 01, 2012, 05:57:59 amYes, but if you use an external programmer then you can use that for other stuff, instead of adding $10+ to the cost of every project you do.Ifeveryonedesigned kits based around Arduino modules instead of bare chip, theneverykit and every project will be at least $10 more expensive. Do peoplereallywant that?To me it seems like a waste of cost, in this case a large chunk of the project cost that I'll have to either pass on to buyers, or eat it.QuoteYes, relax, I'm sold on making it "Arduino compatible", because I don't have to do anything extra to do that.But no one has yet convinced me that using an existing Arduino module is worth the extra cost.Dave.

author: Nick Gammon
author_rank: Contributor
timestamp: January 01, 2012, 06:29:52 am
content: Quote from: EEVblog on December 31, 2011, 11:35:35 pmI supposed it depends what you mean by "normal". There are quite a few Arduinos ...http://arduino.cc/en/Main/HardwareThe "development board" version has a USB port, so yes, it is designed to be as easy as possible for beginners. The bootloader is a program residing in upper memory which is allowed to change the flash memory (various fuse bits configure this). So one way of updating the flash is for the bootloader to kick in at reset time, check for data on the serial port, and if it passes various tests, update the main program memory.However the hardware also is designed to respond to ICSP programming (using SPI via the ICSP port), and boards like the USBtinyISP convert data from the USB port into the appropriate SPI sequences. The nice thing is that you can still use all the Arduino libraries and (so-called) sketches whether or not you use the bootloader.So really, the prototyping board is useful for quickly testing a concept, and then you can move to just the chip and whatever support components you need, but still use the development environment.Quote from: EEVblog on January 01, 2012, 06:09:26 amI think we are at cross-purposes here. I am not suggesting using the Arduino board as such. That's $30 compared to $5 for the chip. But you can test out your ideas (as I did with the power supply) by using the board. Quick and easy. But then you take the bare chip, add a resonator maybe, and a few resistors and capacitors, and you are down to a cheap and simple solution.And you are quite right, using the external programmer, you get to keep the programmer and use it for dozens of projects. That's where buying lots of Arduino "development boards" falls down. You are paying multiple times for the USB interface, which you need once.

author: EEVblog
author_rank: Unknown
timestamp: January 01, 2012, 06:54:24 am
content: Quote from: Nick Gammon on January 01, 2012, 06:29:52 amYes, "normal" means the development board version, so the user can program with a USB cable in stead of requiring an external board.QuoteThat is exactly what I have already done.In my case I have jumped straight to the final design PCB, I'm not just "testing" things, so I have designed with the bare chip with the standard ISP port. So as it stands with the boards I will get in few days, it is "arduino compatible", but you need an external programmer board to program it if you want to modify it.QuoteBingo.Greg suggested I stick on a footprint for an existing Arduino module, and that's what I can't see any sense in doing, it's an expensive solution for a little bit of extra convenience for those who want to play with the firmware.Dave.

author: Greg J
author_rank: Regular Contributor
timestamp: January 01, 2012, 03:03:45 pm
content: Quote from: JimmyM on January 01, 2012, 03:54:18 amOnly except that its c++. Yes, there's a difference.(C++ is far superior, and safer of course).

author: JimmyM
author_rank: Regular Contributor
timestamp: January 01, 2012, 03:33:00 pm
content: Quote from: Greg J on January 01, 2012, 03:03:45 pmOooo. You got me. The whole world should only use Arduino now for its safety and superiority.

author: Greg J
author_rank: Regular Contributor
timestamp: January 01, 2012, 03:38:49 pm
content: As sarcastic as your answer might, you are very rightThings such as const correctness, are not very high on C standardisation committee's agenda I'm afraid.But that's going bit off topic, so I'll stop here.

author: firewalker
author_rank: Super Contributor
timestamp: January 01, 2012, 04:07:54 pm
content: As a general rule in my programs for that involve serial communication I do something likeCode:#define BAUD 38400UL // Baud rate./* Baud rate calculations. */#define UBRR_VAL ((F_CPU+BAUD*8)/(BAUD*16)-1) // Smart roundup.#define BAUD_REAL (F_CPU/(16*(UBRR_VAL+1))) // Real Baud.#define BAUD_ERROR ((BAUD_REAL*1000)/BAUD) // Fault per 1000 parts.#if ((BAUD_ERROR<990) || (BAUD_ERROR>1010))#error Baud rate error bigger than 1%, aborting!#endifAlexander.

author: Unknown
author_rank: Unknown
timestamp: January 01, 2012, 04:32:25 pm
content: What's the point of keeping the baud error of the nominal frequency below 1% if the RC oscillator may be 10% off nominal?

author: Mechatrommer
author_rank: Super Contributor
timestamp: January 01, 2012, 04:44:57 pm
content: i hate to see this thread which shines as ee analog design to become a rather "code proned" or digital frantic thread. why dont we just wait for dave to finalize it and start modding from there? i trust digital side is not so dificcult for everybody (every idiot can count to 1) my 2cnts.

author: JimmyM
author_rank: Regular Contributor
timestamp: January 01, 2012, 07:12:31 pm
content: Quote from: Mechatrommer on January 01, 2012, 04:44:57 pmAgreed.I know this project is based on the LT3080, but LT also has the LT3083 (3A rated instead of the 1.1A of the LT3080). There shouldn't be any harm in substituting the higher current rated LT3083, right?I was looking into using a slightly different pass element (discrete TO-3 and Op-Amp for greater power handling), then I came across the LT3083.

author: slateraptor
author_rank: Frequent Contributor
timestamp: January 01, 2012, 07:38:14 pm
content: Quote from: Greg J on January 01, 2012, 03:03:45 pm*cough* Processing *cough*

author: Nick Gammon
author_rank: Contributor
timestamp: January 01, 2012, 08:25:16 pm
content: Quote from: EEVblog on January 01, 2012, 04:08:56 amBack onto the topic of Dave's gadget, there is a cheaper solution if you already have an Arduino. The Arduino development board itself (various flavours) can itself be used as an ISP programmer. There is a whole page devoted to this subject:http://arduino.cc/en/Tutorial/ArduinoISPOne presumes that "the Arduino crowd" (as someone called them) would have an Arduino. So basically you just upload the "ISP sketch" to your Arduino, connect up 6 wires to the ICSP header of your target device (reset, power, Gnd, MISO, MOSI, SCK) and then upload your sketch in the usual way, telling the IDE that your "programmer" is the "Arduino as ISP".So, a "free" programmer, if you need one.The whole power supply project is a cool and educational idea. My next test is going to be to try to read back the voltage on the power supply using the analog input (ADC converter) on the Atmega, so that I could test if, when requesting 5V output, I actually get 5V. Presumably, once calibrated, this could be used to see if current limiting had kicked in. I'm guessing that Dave's design does just that, since there are lots of ports available on the processor chip for this sort of thing.

author: Unknown
author_rank: Unknown
timestamp: January 01, 2012, 09:54:19 pm
content: QuoteI believe there's a workaround that can be found on the Arduino forum, but it's not (yet) mentioned in this tutorial.

author: Nick Gammon
author_rank: Contributor
timestamp: January 01, 2012, 10:05:49 pm
content: That comment was dated October 03, 2010.I tried recently (like a month or so ago) with my Uno without any problems.More information here:http://arduino.cc/forum/index.php?topic=82451.0

author: EEVblog
author_rank: Unknown
timestamp: January 01, 2012, 10:27:48 pm
content: Quote from: JimmyM on January 01, 2012, 07:12:31 pmCorrect.The basic kit will likely ship with the LT3080, and those who want to upgrade the current can drop in the 3083.But in my design the max current sense is 2.048AAnd for those who complain about the price and availability, you can use an LM317 and live with the 1.25V minimum (just tweak the code to subtract it out).Dave.

author: EEVblog
author_rank: Unknown
timestamp: January 01, 2012, 10:29:55 pm
content: Quote from: Nick Gammon on January 01, 2012, 08:25:16 pmYes, it can even have two displays - set voltage/current, and actual voltage/current.But I'm using external 12bit DAC and ADC.Dave.

author: JimmyM
author_rank: Regular Contributor
timestamp: January 01, 2012, 11:49:29 pm
content: Quote from: EEVblog on January 01, 2012, 10:27:48 pmThat's not too shabby either, but if the current sense resistance is halved, the current limit will be 4.096 A (resolved in 2 mA steps). Correct?Then I would have to make a few tweaks to the code so that what's displayed on the LCD is what's happening in real life.

author: RJSC
author_rank: Regular Contributor
timestamp: January 02, 2012, 12:05:30 am
content: No, with a 12 bit DAC you should have 4096 steps (2^12), so you can have 4.096A with 1mA steps.Maybe Dave's version has 0.5 mA steps.

author: EEVblog
author_rank: Unknown
timestamp: January 02, 2012, 12:11:53 am
content: Sure, you could scale it any way you like, 2.048A is just what I've chosen for my standard max range.Dave.

author: slateraptor
author_rank: Frequent Contributor
timestamp: January 02, 2012, 12:17:32 am
content: Quote from: JimmyM on January 01, 2012, 11:49:29 pmWith relatively high current draw, I suspect you're liable to encounter issues with thermal noise. 1 bit uncertainty on a 12-bit ADC is pretty ballsy as it is without paying extremely close attention to board layout.

author: Blue
author_rank: Regular Contributor
timestamp: January 02, 2012, 02:44:03 am
content: Hi Dave,In your previous thread part you mentioned that you used Altium for the pcb board design. Can you do a video about designing with Altium?Thanks,Cheers,Nick

author: joelby
author_rank: Frequent Contributor
timestamp: January 02, 2012, 03:10:44 am
content: Quote from: Blue on January 02, 2012, 02:44:03 amAltium themselves have a large range of good videos covering most aspects of the software - is there anything in particular you were after that these don't go through?

author: EEVblog
author_rank: Unknown
timestamp: January 02, 2012, 04:38:18 am
content: Quote from: Blue on January 02, 2012, 02:44:03 amThey already have plenty of videos available, I'm not going to help them outAny PCB videos I do will be as package-agnostic as possible. Otherwise you aren't lerning PCB design, you are learning a drive a specific tool.Dave.

author: firewalker
author_rank: Super Contributor
timestamp: January 02, 2012, 10:30:24 am
content: Quote from: EEVblog on January 02, 2012, 04:38:18 amI am guessing they are going to sue you because "You did it wrong".Or they could appreciate it and renew you license. Trololololol.Alexander.

author: Blue
author_rank: Regular Contributor
timestamp: January 02, 2012, 11:22:41 am
content: Dave,I really enjoyed one of your videoblog where you showed how to create a pcb (I forgot what numer is was).What I accentually wanted is a videoblog showing you how to do the pcb layout for this project. Where to place components as you did with respect to noise etc.Give some general idea's on how to layout a pcb - just as you did in your now famous document. I don't care if you do it with tool x, y or z.Cheers,Nick

author: EEVblog
author_rank: Unknown
timestamp: January 02, 2012, 11:31:36 am
content: Quote from: firewalker on January 02, 2012, 10:30:24 amThey already gave me a cease-and-desist on the use of altiumforum.comQuoteHang on while I start up my flying pigDave.

author: EEVblog
author_rank: Unknown
timestamp: January 02, 2012, 11:34:32 am
content: Quote from: Blue on January 02, 2012, 11:22:41 amAn entire multi-part PCB design tutorial video series is something I really want to, just needs some planing and time.I was thinking I'd base it around my existing document as a starter.For the PSU project I have a time-lapse video capture of me laying out the board, and I was going to do put some commentary on top of that (sped up of course).Not ideal, but fairly easy to do.Dave.

author: JimmyM
author_rank: Regular Contributor
timestamp: January 02, 2012, 04:07:49 pm
content: Quote from: RJSC on January 02, 2012, 12:05:30 amAh right. 4096. I can certainly live with 1mA steps.

author: Greg J
author_rank: Regular Contributor
timestamp: January 02, 2012, 05:41:50 pm
content: Maybe as another part, or improvement you could show us how to design it into switching power supply ?I mean, properly, not using one transistor

author: Nick Gammon
author_rank: Contributor
timestamp: January 03, 2012, 12:34:02 am
content: Quote from: EEVblog on December 25, 2011, 10:43:39 pmDave, is the schematic available in any reasonably accessible form? (even just a screenshot in PNG format)I still haven't resolved the issue of the current suddenly cutting out as you turn the pot down, and think maybe I didn't quite assemble my version to be the same as yours.

author: benemorius
author_rank: Regular Contributor
timestamp: January 03, 2012, 12:43:55 am
content: Quote from: Nick Gammon on January 03, 2012, 12:34:02 amI haven't watched it yet but the 5th video just finished uploading and looks promising if you're after a completed schematic.

author: Blue
author_rank: Regular Contributor
timestamp: January 03, 2012, 12:58:37 am
content: Quote from: EEVblog on January 02, 2012, 11:34:32 amThat would be wonderful

author: JimmyM
author_rank: Regular Contributor
timestamp: January 03, 2012, 12:29:28 pm
content: Quote from: benemorius on January 03, 2012, 12:43:55 amWhere?

author: firewalker
author_rank: Super Contributor
timestamp: January 03, 2012, 12:45:48 pm
content: Quote from: JimmyM on January 03, 2012, 12:29:28 pmhttp://www.eevblog.com/episodes/Alexander.

author: shebu18
author_rank: Frequent Contributor
timestamp: January 03, 2012, 01:00:34 pm
content: you also could try and subscribe to the youtube channel.

author: Nick Gammon
author_rank: Contributor
timestamp: January 03, 2012, 08:43:51 pm
content: "Try" is the operative word here. I subscribe, and still haven't been notified of that episode. I get notifications ... a couple of days later.

author: firewalker
author_rank: Super Contributor
timestamp: January 03, 2012, 08:59:09 pm
content: I had the same issue with another channel. Try to un-subscribe and subscribe again.Alexander.Quote from: Nick Gammon on January 03, 2012, 08:43:51 pm