boost converter project using AVR-0 series

Go To Last Post
31 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Hi All,

I posted in the "show off your 2020 project" thread about my boost converter project using ATmega4809.  The post was getting some responses so I thought I'd start a new thread with updates.

This year I upgraded my AVR CPU simulator to simulate the AVR-0 series (w/ separate register file) and added  TCB and ADC peripherals.   I wanted to work more on my boost converter project so I integrated the simulator with a SPICE tool.

The circuit appears below.  I changed the diode to Schottky as suggested by DocJC.

I threw R1 in there to help the SPICE sim, which has been getting stuck at times.   I'm still learning the art of SPICE.  I'm not sure if that can or should stay in the hardware implementation.

My goal is to have good noise rejection, in which case the open loop transfer function should hug the gain/phase margin boundary in the Nichols chart.  Here is my 90 deg design using a 4th order feedback.

 

 

I the meantime I have retreated to a simple P feedback instead of the 4th order.   Here is the code in current form.

#include <stdint.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>

volatile uint8_t t_rdy = 0;
volatile uint16_t n_err = 0;

ISR(TCB0_INT_vect) {
  TCB0.INTFLAGS = TCB_CAPT_bm;
  t_rdy = 1;
}

void iter(float ref) {
  float err;				/* feedback error */
  float dcf;				/* duty cycle fraction */
  uint8_t dcc;				/* duty cycle count */

  /* read input */
  if ((ADC0.INTFLAGS & ADC_RESRDY_bm) == 0) {
    n_err++;
    return;
  }
  err = ref - 5.0*ADC0.RES/1024.0;	/* feedback error */

  dcf = 100*err + 0.50;			/* duty cycle fraction */

  if (dcf > 1.0) {
    dcc = 255;
  } else if (dcf < 0.0) {
    dcc = 0;
  } else {
    dcc = (uint8_t)(256*dcf);
  }
  if (dcc > 200) dcc = 200;
  if (dcc < 20) dcc = 20;

  /* update duty cycle */
  TCB1.CCMPH = dcc;

  /* start next voltage read */
  ADC0.COMMAND |= ADC_STCONV_bm;
}

int main(void) {
  TCB1.EVCTRL = 0;
  TCB1.CTRLB = TCB_CNTMODE_PWM8_gc | TCB_CCMPEN_bm; /* => PA3 */
  TCB1.CCMPL = 255;			/* period = 0.0768 ms */
  TCB1.CCMPH = 100;			/* high-time */
  TCB1.INTCTRL = 0;
  TCB1.CTRLA = TCB_CLKSEL_CLKDIV1_gc | TCB_ENABLE_bm;

  TCB0.EVCTRL = 0;
  TCB0.CTRLB = TCB_CNTMODE_INT_gc;
  TCB0.CCMP = 6660;			/* period = 2 ms */
  TCB0.INTCTRL = TCB_CAPT_bm;
  TCB0.CTRLA = TCB_CLKSEL_CLKDIV1_gc | TCB_ENABLE_bm;

  ADC0.CTRLA = ADC_RESSEL_8BIT_gc;
  ADC0.CTRLB = ADC_SAMPNUM_ACC1_gc;
  ADC0.CTRLC = ADC_PRESC_DIV2_gc | ADC_REFSEL_INTREF_gc ;
  ADC0.MUXPOS = ADC_MUXPOS_AIN0_gc;	/* AIN0 = PD0 */
  ADC0.CTRLA |= ADC_ENABLE_bm;

  ADC0.COMMAND |= ADC_STCONV_bm;

  sei();

  while (1) {
    if (t_rdy == 1) {
      t_rdy = 0;
      iter(2.0);
    }
  }
}

 

And here is the SPICE model, with updated diode.  Not sure it's the right one.

boost5.cir
* boost converter with DAC/ADC i/f to digital simulator

* boost circuit
L1 02 22 330.0uH

Q1 21 11 1 QBC337
RQ 1 0 1.0Ohm
RS B0 11 50kOhm

D1 22 42 dschtt
C1 42 0 1.0uF
R1 22 21 12.0Ohm

R2 42 61 500.0kOhm
R3 61 0 100.0kOhm

* source
Vi 02 0 DC 5.0v

* load
*RL 42 0 12.0kOhm
RL 42 0 48.0kOhm

* controller
YDAC DAC1 B0 0 simpDAC
YADC ADC1 61 0 simpADC
.measure tran Vout EQN v(42)
.measure tran A0 EQN v(61)

* execution mode
.tran 0.1us 10.0s

* models

* fix: this should be Schottky
.model dmod1 D (is=1e-13 bv=50)

* HBAT-540x
.model dschtt D (BV=40.0 CJO=3.0e-12 EG=0.55 IBV=10.0e-4 IS=1.0e-7 N=1.0
+                RS=2.0 PB=0.6 PT=2 M=0.5)

.model QBC337 NPN(IS=4.13E-14 NF=0.9822 ISE=3.534E-15 NE=1.35 BF=292.4 IKF=0.9
+                 VAF=145.7 NR=0.982 ISC=1.957E-13 NC=1.3 BR=23.68 IKR=0.1
+                 VAR=20 RB=60 IRB=0.0002 RBM=8 RE=0.1129 RC=0.25 XTB=0 EG=1.11
+                 XTI=3 CJE=3.799E-11 VJE=0.6752 MJE=0.3488 TF=5.4E-10 XTF=4
+                 VTF=4.448 ITF=0.665 PTF=90 CJC=1.355E-11 VJC=0.3523 MJC=0.3831
+                 XCJC=0.455 TR=3E-08 CJS=0 VJS=0.75 MJS=0.333 FC=0.643)

.model simpADC ADC(settlingtime=5ns uppervoltagelimit=5 lowervoltagelimit=0)

.model simpDAC DAC(tr=5e-9 tf=5e-9)

.end

 

Here are some results from my last simulation.  I have been running into issues where the SPICE sim locks up.   With the schottky it seems to have run through (the first time).  Plots are of output at A0 and Vout, respectively.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MattRW wrote:
I threw R1 in there to help the SPICE sim,
When R1 is on the emitter then can easily current sense; some SMPS sense that to limit peak inductor current (avoid inductor saturation)

Emitter resistance appears on the base by hFE so can better impedance match with the mega4809 and RS.

Consider a Q1 base-emitter resistor as the mega4809 will leak more at elevated temperature (leakage * Q1.hFE may cause excessive quiescent current draining the cell)

MattRW wrote:
I have been running into issues where the SPICE sim locks up.   With the schottky it seems to have run through (the first time).
Schottky diodes leak some; a hint at use of non-ideal models for some crucial circuit elements.

L1 will not be ideal (leaks a "wee" bit, definitely internal resistance, a bit of shunt capacitance)

Resistors have 0.5pF typical (order of magnitude less for microwave resistors); usually don't need to model that though when frustrated can try a 5pF shunt.

Some SPICE are better than others for SMPS.

 

Cool project!

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You should be using a mosfet, not an NPN transistor, you are already ruining your converter efficiency.

The size of the inductor will impact thow clean the signal is---a larger inductor will smooth any incoming noise further.  Also, the output cap size & it's ESR will affect how much ripple you see on the output.  

How much noise are you seeing on the output?  What does your source (power supply) signal look like?   

 

Have you considered adding a second stage LC output filter?...that can have a great effect on cleaning up any output noise.  How clean do you need it  

It is easiest to simply place the LC after the feedback point pickup at the final output. If you want to include it in the overall loop, some extra components are needed (such as a series RC to gnd ahead of the LC filter).

 

If the output need is low current, you can instead add an RC stage, and just suffer the efficiency losses.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
You should be using a mosfet, not an NPN transistor, you are already ruining your converter efficiency.
Bipolar transistors can work well up to some voltage and/or current though do have the second breakdown effect; IGBT can pickup where MOSFET are no longer a fit.

avrcandies wrote:
If the output need is low current, you can instead add an RC stage, and just suffer the efficiency losses.
Add an NPN with a bit of base impedance for a capacitance multiplier.

 


The Art of Electronics 3rd Edition | by Horowitz and Hill

Download a sample chapter

[page 14]

8.15 Power-supply noise 578

8.15.1 Capacitance multiplier 578

[page 57, bottom of right column]

A. Second breakdown

[page 87]

Figure 9.74. An inexpensive 5 W flyback converter, powered from 115 Vac line voltage, ... [5V 1A]

e2 PowerEdgeTM Economic Energy using Low VCEsat BJT’s (ON Semiconductor)

[page 7]

Pass Element in Buck / Boost converter

+5v to +12v converter by Roman Black

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bipolar transistors can work well up to some voltage

There's no concern about voltage (unless this is some high voltage circuit).   When the is inductor is pulled to gnd you want that high current right at gnd...example-- say 5 amps flowing through a fet to gnd is a lot less lossy than flowing through an NPN.  You can easily get a 8 mohm fet, so the static loss is 0.20 W, the bipolar loss would be watts.   Of course, 5W might be extreme, but usually the fet wins.

 

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


I did some digging and found an example converter in ngspice.  I'm also using Xyce linked to my CPU simulator, so I want to get something that works with both SPICE incarnations.

I started with a IRF510 but couldn't get that configure for Xyce, so backed off to a more generic FET model.   I moved R1 to RL1 and added a RC1, both less than 1 Ohm to help spice numerics.  In the diagram below RL (the load) is 100 Ohms.   Here is my new circuit.

And here is the updated spice model. 

boost7x.cir

* boost circuit
L1 21 22 330.0uH
RL1 22 23 0.125Ohm

M1 23 PD0 0 0 fet1 L=100u W=100u

D1 23 Vo MBRS340
C1 Vo 14 33.0uF
RC1 14 0 0.025Ohm

R2 Vo PA0 100.0kOhm
R3 PA0 0 27.0kOhm

* source
Vi 21 0 DC 5.0v

* load
RL Vo 0 100.0Ohm

* controller
*Vc PD0 0 PULSE(0.0 5.0 0.0 1.0ns 1.0ns 12.0us 20.0us)
YDAC DAC1 PD0 0 simpDAC
YADC ADC1 PA0 0 simpADC

* execution mode
*.tran 0.01us 0.010s
.tran 0.01us 1.0s
.measure tran Vout EQN v(Vo)
.measure tran Vpin EQN v(PA0)
*.print tran v(Vo)
*.print tran v(PA0)

* models

.model fet1 NMOS LEVEL=1
+		L=100u W=100u 
+		VTO=1.99 LAMBDA=0 KP=21.272 CGSO=4.18e-6 CGDO=8.57e-8

.model MBRS340 D(Is=22.6u Rs=.042 N=1.094 Cjo=480p M=.61 Eg=.69 Xti=2)

.model simpADC ADC(settlingtime=5ns uppervoltagelimit=5 lowervoltagelimit=0)

.model simpDAC DAC(tr=5e-9 tf=5e-9)

.end

My controller running on the ATmega4809 (simulator) is not quite working.  I'm just using a constant duty cycle of 125/256 but the circuit is boosting the voltage (so progress!).   This plot shows voltage at Vo and PA0 (which is fed to the ATmega ADC pin).  My next steps will be to work the simulator to extract values for my C variables from the controller code.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just a lame update: I found that there is an error in computing floating point in my CPU simulator, so I've gone off and started working on a test suite that runs sets of tests against each CPU instruction and compares my simulator (configured for arch > 100 - e.g., 4809) with running the code on an actual 4809.   I already found one bug.   It will be a few weeks before I can return to this.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

 

  It will be a few weeks before I can return to this.

 

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


So I found bugs in my simulator, fixed NEG and INC commands.  Now I have it working with simple P control and my 4th order.   Will work at tuning next .

Below are shown initial transients for startup.  The orange is the A0 input, where I have a 2 V set point.  There is some significant hang-off error.  I will be working that next.

 

 

 

Code fragment for P control:

float mea;				/* measurement */
float err;				/* fb error */
float dcf;				/* duty cycle fraction */
uint8_t dcc;
uint16_t res;
float mea1;				/* measurement */

void iter(float ref) {

  /* read input */
  if ((ADC0.INTFLAGS & ADC_RESRDY_bm) == 0) {
    n_err++;
    return;
  }

  res = ADC0.RES;
  mea1 = 5.0*res;
  mea = mea1/1024.0;
  err = ref - mea;			/* feedback error */

  dcf = 0.01*err + 0.50;		/* duty cycle fraction */

  if (dcf > 1.0) {
    dcc = 255;
  } else if (dcf < 0.0) {
    dcc = 0;
  } else {
    dcc = (uint8_t)(256*dcf);
  }
  if (dcc > 200) dcc = 200;

  /* update duty cycle */
  TCB1.CCMPL = dcc;
  
  /* start next voltage read */
  ADC0.COMMAND |= ADC_STCONV_bm;
}

Code fragment for 4th order:

 

static float ypax(float y, float *a, float *x) { return y + (*a)*(*x); }

void __attribute__((noinline))
mul_Ax(uint8_t n, uint8_t q, float *xn, float *a, float *xp) {
  uint8_t ax, px, qx;
  uint8_t i, j;

  ax = 0; px = 0; qx = q + 1;
  for (i = 0; i < n; i++) {
    xn[i] = 0.0;
    for (j = px; j < qx; j++) {
      xn[i] = ypax(xn[i], &a[ax++], &xp[j]);
    }
    if (i > 0) px++;
    if (qx < n) qx++;
  }
}


#define nc 4
#define qc 3
float av[] = {
  -0.0001256, +0.0214401, +0.0000000, +0.0000000, +0.0000000, -1.2022974, 
  -1.6119438, +0.5018648, +0.0000000, -1.4851728, +0.7586875, -0.4565842, 
  -1.0470269, 
};
float bv[] = {
  -1.1005587, +0.0124358, +0.0120048, +0.0101036, 
};
float cv[] = {
  +0.0003732, -0.0615034, +0.7568580, -0.6506759, 
};

float x1[nc], x2[nc], *xn, *xp;

float y_ss = 2.0;		      /* A0 steady state voltage */
float u_ss = 0.50;		      /* duty cycle operating point guess */

void init() {
  for (uint8_t i = 0; i < nc; i++) {
    x1[i] = 0.0;
  }
  xp = x1;
  xn = x2;
  x1[0] = 2.0;
}

float mea;				/* measurement */
float err;				/* fb error */
float dcf;				/* duty cycle fraction */
uint8_t dcc;

void iter(float ref) {
  uint8_t i;
  float *xt, u, val;
  uint16_t res;

  /* read input */
  if ((ADC0.INTFLAGS & ADC_RESRDY_bm) == 0) {
    n_err++;
    return;
  }
  res = ADC0.RES;
  mea = 5.0*res/1024.0;
  err = ref - val;

  /* control law */
  xt = xn; xp = xn; xn = xt;
  mul_Ax(nc, qc, xn, av, xp);
  for (i = 0; i < nc; i++) xn[i] += bv[i]*err;
  for (dcf = 0.5, i = 0; i < nc; i++) dcf += cv[i]*xn[i];

  /* duty cycle: */
  if (dcf > 1.0) {
    dcc = 255;
  } else if (dcf < 0.0) {
    dcc = 0;
  } else {
    dcc = (uint8_t)(256*dcf);
  }
  if (dcc > 200) dcc = 200;		/* starting out */

  /* update duty cycle */
  TCB1.CCMPL = dcc;
  
  /* start next voltage read */
  ADC0.COMMAND |= ADC_STCONV_bm;
}

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What does you output voltage look like?  Have you built up & measured how much ripple you are seeing? 

By adjusting (tuning) your filter you may find the "sweet spot" that minimizes it, while responding well to transients on the input.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The top blue plot is the output voltage.   The orange is the feedback measurement (via voltage divider).

I think I want to check/fix the hangoff first.

Last Edited: Wed. Dec 9, 2020 - 01:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was asking have you actually measured the output of an actual circuit?   Some of the fine details can easily be different than the sim, if they depend on the parts parasitics.

Have you tried LTspice?  It allows you to simply draw a schematic, though not sure if you can interface it to your own calculations.  

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

I was asking have you actually measured the output of an actual circuit?   Some of the fine details can easily be different than the sim, if they depend on the parts parasitics.

Have you tried LTspice?  It allows you to simply draw a schematic, though not sure if you can interface it to your own calculations.  

 

I kind of got that, but I'm not in the position to try hardware circuit yet.   This is against SPICE sim, hooked up to a uC sim.  The netlist appears in comment #6.   I have not dug into the parasitics yet.   I wanted to get my hands around a reasonable controller implemention first.

Last Edited: Wed. Dec 9, 2020 - 06:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


I found a few more programming bugs, but have a control design, from PA0 to PD0, and all else working to where I think I'm ready to tweak with the circuit (i.e., netlist).  Here is the circuit diagram.   R2 and R3 are 100.0 kOhm and 27.0 kOhm, respectively.  R_L1 and R_C1 are 0.125 Ohm and 0.025 Ohm, respectively.  R_L is 100 Ohm.  The set-point for PA0 is 2.551181 V, giving target Vo of 12.0 V.

 

The controller is 5th order, implemented as state-space ABCD.  The gain and phase margin are generous: I will need to tune it more later.   The predicted hangoff error is 0.1 V.  The simulation shows a hangoff of about 0.5 V.  Here is the Nichols chart:

There are no real performance goals right now.  I'm trying to get my hands around the design of switching converters (e.g., circuit gotchas, the control issues) and the tools (e.g., using SPICE).  I want to eventually put together the tools to desgn converters driven by a MCU, say ATmega402, where one can reprogram the parameters -- control gains, operating points, etc -- via I2C.

Here is the netlist:

boost7x.cir

* boost circuit
L1 21 22 330.0uH
RL1 22 23 0.125Ohm

M1 23 PD0 0 0 fet1 L=100u W=100u

D1 23 Vo MBRS340
C1 Vo 14 33.0uF
RC1 14 0 0.025Ohm

R2 Vo PA0 100.0kOhm
R3 PA0 0 27.0kOhm

* source
Vi 21 0 DC 5.0v

* load
RL Vo 0 100.0Ohm

* controller
YDAC DAC1 PD0 0 simpDAC
YADC ADC1 PA0 0 simpADC

* execution mode
.tran 0.01us 1.0s
.measure tran Vout EQN v(Vo)
.measure tran Vpin EQN v(PA0)

* models

.model fet1 NMOS LEVEL=1
+		L=100u W=100u
+		VTO=1.99 LAMBDA=0 KP=21.272 CGSO=4.18e-6 CGDO=8.57e-8

.model MBRS340 D(Is=22.6u Rs=.042 N=1.094 Cjo=480p M=.61 Eg=.69 Xti=2)

.model simpADC ADC(settlingtime=5ns uppervoltagelimit=5 lowervoltagelimit=0)

.model simpDAC DAC(tr=5e-9 tf=5e-9)

.end

I'm not going to post the code unless you want to see it.  I'm running the closed-loop control every 2 ms and the period of the PWM is 0.0768 ms (about 13 kHz).  I use TCB1 to run the PWM (CNTMODE_PWM8) and use TBC0 to trigger the controller computation (CNTMODE_INT): the interrupt sets a volatile flag and main executed a while loop waiting for the flag.

Here is the initial transient response:

Here is the steady state ripple at Vout:

 

(Sorry about the axis label: the entire plot covers 1 ms.)

Next step may be to look into parameter variation studies.  I'm using Xyce for my SPICE tool and looking to hook in Dakota with that. 

Comments welcome. 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are no real performance goals right now.

Neither the startup, nor ripple seems too impressive, no better than just applying an RC tuning.  When you start talking state space, 5th order compensation, etc, you'd hope to have  diamond-level performance.  Maybe some transient rejection plots would  help to show it really compensating for perturbations.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

There are no real performance goals right now.

Neither the startup, nor ripple seems too impressive, no better than just applying an RC tuning.  When you start talking state space, 5th order compensation, etc, you'd hope to have  diamond-level performance.  Maybe some transient rejection plots would  help to show it really compensating for perturbations.

 

Well the bandwidth is < 100 Hz.   The ripple is > 1000 Hz, so the controller can't do anything.  It's purpose is to reject load dynamics < 100 Hz.

 

The ripple would need to be removed by hardware, I think.  I have not ready much about that, but a linear regulator on the output would help.   That is an active solution; are there passive solutions?  Just add more capacitors?

Last Edited: Thu. Dec 17, 2020 - 03:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The bandwidth is only 12 Hz right now.  I have more work to do on the feedback design.  I will add some load transients.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MattRW wrote:
... are there passive solutions?
Yes and nearly (PolyZen is brute force)

MattRW wrote:
Just add more capacitors?
or a capacitance multiplier; a zener diode across its capacitor will limit though better is a crowbar (especially for injection current)

 


PolyZen Device Fundamentals (Littelfuse)

 

The Art of Electronics 3rd Edition | by Horowitz and Hill

...

Download a sample chapter

...

[page 49, bottom of both columns]

9.3.13 Noise and ripple filtering

...

Prefiltering

...

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's purpose is to reject load dynamics < 100 Hz.      ... The bandwidth is only 12 Hz right now.

I'd consider that rather poor...the most simplistic method can do that, with hardly any calculations at all, if any, let alone a 5th order compensation!  Faster dynamics & transients are where the need is.   Tis true you will reach an upper limit with the AVR controller, but it should be way above 100 Hz. 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Fri. Dec 18, 2020 - 01:00 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Certainly.  But in general, control design is about maximizing feedback gain in the region of interest, given gain and phase margin constraints.  Higher bandwidth is not necessarily better.  As you can see from the Nichols plot the feedback is far from maximum.   Currently my control loop sample rate is 500 Hz, limited by the controller CPU load, so I will have to stay below 50 Hz - ish.   I'm still getting my hands around getting the right rolloff rate in the crossover region.  If I can up the sample rate, I can crank the bandwidth up.  

 

BTW, to test the disturbance rejection I'm planning to add a voltage controlled current source in parallel with R_L, with the control voltage generated by the top-level simulator.  I could inject sinusoidal loads, chirps, etc.  Is this a reasonable way to go?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Currently my control loop sample rate is 500 Hz,

That seems VERy slow sampling, even for the AVR...maybe take another look at that---I'm sure you can get 5 KHz min, maybe with some optimization.  

 

you could also simulate a transient by adding a "noise/transient voltage source"  in series with yourmain supply.  for output, you can suddenly switch on various loads (or an adjustable current sink)

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

you could also simulate a transient by adding a "noise/transient voltage source"  in series with yourmain supply.  for output, you can suddenly switch on various loads (or an adjustable current sink)

 

My plan is to make a current sink by flipping over the voltage controlled current source (G card in Xyce).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Spice Sim is great for getting a general idea of how the circuit should function.

 

But at some point in time one has to step away from the computer and look at how the real-world hardware performs!

 

Although one can learn a lot with Spice and graphs and charts, one can sometimes learn even more with a soldering iron in one hand and an O'scope probe in the other! smiley

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nothing like a failed smoke test!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

You can develop a lot of theory about shooting pool.  You can develop a lot of facts actually playing it.  

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Gotcha.  I believe I have parts to put something together:

1) 330uH wire-wound donut inductor

2) IRF510N mosfet

3) 1N5819 diode

4) 33 uF electrolytic capacitor

5) assorted resistors

6) 4809 nano board

7) 5v power supply

 

I assume the 100 ohm resistor can handle the 120 mA.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


 

I assume the 100 ohm resistor can handle the 120 mA.

It seems a bit strange you ask this question, are you out of touch with electronics?.....if it is a power resistor, say 3 to 5W will do ...does it look like?

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Fri. Dec 18, 2020 - 02:13 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


haha.  Yes.  I was thinking to myself.  I have boxes of Chinese parts that are unmarked wrt power.  I'm guessing these are 1W?  (It's been 40 years since I worked on hardware.)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Those look like 1/4 or 1/8 Watt resistors to me

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Get some power resistors.  You could put a bunch of those  little guys in parallel/series but you'd need a bunch.   Plan on at least double the watts (if you need 10W , hook up 20W resistors).   Even at 1/2 power things with get toasty hot.

 

I ran 50W into a 100W resistor the other day & in 1/2 hour it was well beyond putting your hand* on it (true , I could mount it to a sheet of  aluminum or hit with a fan).   

 

 

*they can run somewhat hotter if desired

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Fri. Dec 18, 2020 - 05:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks.  I ordered a couple 50 W 100 Ohm resistors.