Author Topic: EEVblog #240 - Power Supply Design Part 8  (Read 13876 times)

0 Members and 1 Guest are viewing this topic.

alm

  • Guest
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #30 on: January 30, 2012, 11:06:44 AM »
Yup, order of magnitude worse than hardware...
I wonder if anyone if foolish enough to do a software coding video blog?
Probably, though I haven't bothered to look. Screencasts about software development seemed fairly popular a few years ago. Software doesn't lend itself as much to the video blog format, though. Seeing someone typing gets boring really fast, and the added value of seeing someone type it compared to just the code plus a description is quite limited. There are plenty of regular blogs though.

I utterly HATE software religion wars. One simple SPI routine has turned into a war of optimisation, readability, what optimisation "really" means, what compiler is "best" and cock waving comparisons. This is why I prefer to stick with hardware.
I'd have to agree with BaW and wonder whether you've actually read this thread.

Move on guys. If it works, it works. If you want to rewrite it to please your particular software God, then feel free but don't drag everyone else into it. Linux only got anywhere because one person was in charge.
Yes, lets get back to the regular scheduled arguments about which micro is the best, which one Dave should use for his own projects and which brand of test equipment is the best. Not to forget comparing DMM sizes. ;)

Online IanB

  • Super Contributor
  • ***
  • Posts: 5208
  • Country: us
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #31 on: January 30, 2012, 12:05:03 PM »
I'd have to agree with BaW and wonder whether you've actually read this thread.

What else is the, "Ooh, you did it wrong, you should have used a loop!" argument all about?  ::)

Dave's a big boy now, he's been around the block a few times, it's not like he's never heard of for loops. If he wants to do it that way it's his business.

One reason software blogs in the net are so unproductive is because people perpetually get bogged down over the same questions that have been done to death a thousand times before. Such pointless time wasting is a sign of bad engineering. If it is readable, easy to edit, does the right thing in all cases, runs fast enough and fits in the available memory then it's good code. Look how easy it was for Dave to shift the two null bits from the end to the beginning. In hardware, shaving the component count might save you some costs in production; removing a couple of lines in software, not so much.
I'm not an EE--what am I doing here?

alm

  • Guest
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #32 on: January 30, 2012, 12:30:00 PM »
What else is the, "Ooh, you did it wrong, you should have used a loop!" argument all about?  ::)
You consider this a religious war?

One reason software blogs in the net are so unproductive is because people perpetually get bogged down over the same questions that have been done to death a thousand times before.
Citation needed. I come across plenty of software blogs when searching for stuff, and they rarely seem unproductive to me. Joel Spolsky's blog is the most recent one that comes to mind. Sure, there's plenty of repetition, but it's not like there aren't a thousand blogs discussing how to connect a LED to an Arduino.

Online IanB

  • Super Contributor
  • ***
  • Posts: 5208
  • Country: us
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #33 on: January 30, 2012, 01:01:29 PM »
Citation needed.

I really meant the comments/discussion part. There are certainly people out there with interesting things to blog about on software development (even if Joel Spolsky ran out of fresh material a long time ago).
I'm not an EE--what am I doing here?

Online EEVblog

  • Administrator
  • *****
  • Posts: 13168
  • Country: au
    • EEVblog
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #34 on: January 30, 2012, 01:23:15 PM »
Look how easy it was for Dave to shift the two null bits from the end to the beginning.

Bingo.
When writing something like this bit-bang routine, the last thing I give a damn about is wanting to optimise things for code space in a for loop.
With in-line rolled-out code like I did, when it doesn't work, I can simply hack individual bits very easily for troubleshooting purposes without dicking around with stupid loops.
There is method to my madness.

Dave.

Offline PeteInTexas

  • Frequent Contributor
  • **
  • Posts: 344
  • Country: us
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #35 on: January 30, 2012, 03:04:17 PM »
How did I know the SMOP monster was going to rear its ugly head when those chips starting populating the board   ::)

Offline PeteInTexas

  • Frequent Contributor
  • **
  • Posts: 344
  • Country: us
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #36 on: January 30, 2012, 03:08:57 PM »
Citation needed.

I really meant the comments/discussion part. There are certainly people out there with interesting things to blog about on software development (even if Joel Spolsky ran out of fresh material a long time ago).

Except for the straight forward "how-tos" and tutorial, software blogs tend to be a rant of one level or another.  It gets old fast.

Offline Lightages

  • Supporter
  • ****
  • Posts: 1865
  • Country: cl
  • Canadian po
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #37 on: January 30, 2012, 05:57:59 PM »
Dave:

In the last coupe of videos, not only did the brightness change, but so did the colour balance. To my eye it is very jolting but you already know I am a video producer and camera man. Perhaps you might want to set the colour balance to a fixed value instead of auto, if you haven't already.

Secondly, the power supply looks to be a nice small package with many benefits. I just might buy one!

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 1802
  • Country: au
  • Question Everything... Except This Statement
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #38 on: January 30, 2012, 06:23:14 PM »
to try and break away from the software discussion,

i assume you havent had time to start with the adc yet, as you said it was the companion one, i now fear that even 10 bit accuracy may have been thrown out of the window :/

also, is there any tricks to trimming in a voltage reference?

and to finish on a good note, good video as always dave, shows the use of a DSO with a one shot trigger

Offline darrenb

  • Contributor
  • Posts: 24
  • Country: au
  • Airline pilot, C programmer, learning electronics.
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #39 on: January 30, 2012, 09:33:32 PM »
I can't understand why Dave moved the zero bits from the end of the bit banging sequence to the front?

From the look of the data sheet it appeared the bits at the end (least significant bits, the right hand end) were the ones that didn't matter?  So they appeared to be correctly being sent at the end initially.


Offline hans

  • Frequent Contributor
  • **
  • Posts: 383
  • Country: nl
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #40 on: January 30, 2012, 10:06:32 PM »
Let's talk over more pressing matters, software is like.. it works as is, and quick enough? Good, moving on.

I wonder if the analog parts of MicroChip aren't inherently 'bad'.  As you mentoined, ADC's and DAC's in micro's are not as good as an external one. I don't know on what design they are making the external converters, but if it's the same as the micro's, you're still back to where we were.

They also make like 22-bit ADC's with a claim of 18+ ENOB. I have no idea whether they will meet this specification. I have some of these lying around (MCP3551), but I really wonder whether these are spot on as well. Maybe they have a terrible offset of +100 counts if both inputs tied to GND hard.. not sure.

I'd resort to another manufacturer, probably, for analog parts from seeing this. Well, they meet their specifications, but +/- 12 LSB is quite horrible (0.3% right there). Am I right in saying that the worst case situation, the output voltages could be off by 2-3% (voltage reference +/- 0.25%, FSR output +/-1%, linearity +/-0.3%, unwanted offsets)? Kinda a pity of all the precision resistors and current sense amplifiers, etc. I would probably pick a more precise DAC from AD or TI.

Ah well, the given resolution was way better than required anyway :) Furthermore, if you really want a 'DC accurate' measurement, I think calibration is inevitable. A better resolution is ofcourse nicer because you can more precisely vary steps (only for that reason I'd smack in a overkill ADC or DAC for my hobby power supply which is probably a one or twice off).
« Last Edit: January 30, 2012, 10:25:07 PM by hans »

Online EEVblog

  • Administrator
  • *****
  • Posts: 13168
  • Country: au
    • EEVblog
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #41 on: January 30, 2012, 10:21:41 PM »
I can't understand why Dave moved the zero bits from the end of the bit banging sequence to the front?

From the formula in the datasheet, the output voltage would have been too high. I wanted 1mV/mA output.

Dave.

Offline darrenb

  • Contributor
  • Posts: 24
  • Country: au
  • Airline pilot, C programmer, learning electronics.
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #42 on: January 30, 2012, 10:49:15 PM »
I can't understand why Dave moved the zero bits from the end of the bit banging sequence to the front?

From the formula in the datasheet, the output voltage would have been too high. I wanted 1mV/mA output.

Dave.

Hi Dave,

But you're throwing away bits aren't you.  Lets say for 10 bits of data being sent to the ADC the data sheet says to send it 16 bits, the first four bits being the configuration bits, the next 10 being the data bits and the last two being thrown away.

Using 'C' for config bits, 'D' for data you want to send and 'X' for stuff it will throw away I think it said to send as;
CCCCDDDD DDDDDDXX.

But after the programming change it's now being sent as;
CCCCXXDD DDDDDDXX where you're throwing away the two bits at the front and the ADC is throwing away the two bits at the end.

I haven't done the math to figure out what the consequences of this would be but it doesn't seem right.  Maybe this will fix the error you were seeing?  Or maybe I'm missing something (happens all the time).


Online EEVblog

  • Administrator
  • *****
  • Posts: 13168
  • Country: au
    • EEVblog
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #43 on: January 30, 2012, 11:19:38 PM »
The error I am seeing has nothing to do with this.
I want and need 1mV/bit output, because that is what matches my current sense amp output. And to get that with the 2.048V reference and 12 bits I need to use the lower 10 bits with the x2 amp.

Dave.

Offline darrenb

  • Contributor
  • Posts: 24
  • Country: au
  • Airline pilot, C programmer, learning electronics.
Re: EEVblog #240 - Power Supply Design Part 8
« Reply #44 on: January 30, 2012, 11:55:40 PM »
The error I am seeing has nothing to do with this.
I want and need 1mV/bit output, because that is what matches my current sense amp output. And to get that with the 2.048V reference and 12 bits I need to use the lower 10 bits with the x2 amp.

Dave.

Gudday again Dave,

Yes you're right - forget the error it's probably not related and it's most likely not even an error in the first place.

But..  Are you sure you're not just sending 8 bits to the ADC.  The ADC wants two bytes or 16 bits.  The first four bits are config bits so you're left with twelve.  You're sending two zeros (discard bits) at the front and then 10 bits of data but the last two are being dropped by the ADC.  12 - 2 (at the front) - 2 (at the end) = 8 bits of significant data being sent.

Based on the blog at 20:03 maybe the discard bits should be back at the end after the data bits instead of in front?



Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf