In message <004c01c67b86$96f46130$0300a8c0@main> olin_piclist@embedinc.com (Olin Lathrop) wrote: (PID control) > I think that is way overkill and much more difficult than necessary. I think you might well be right, Olin... > > I'm probably going to use straight linear control along the lines > > of "Vout just jumped up by 1% of full scale, so kick the duty cycle > > down by the same amount" > > This is still too complicated and may have stabilty problems. What's wrong > with the simple "out is low so I'll to another pulse, then wait a little > while and check again"? Or the method Atmel used in the "AVR450" battery charger appnote: while (not battery_charged) { read_voltage_and_current(); if (Ibatt > Itarget) { PWM_Duty --; } else if (Ibatt < Itarget) { PWM_Duty ++; } } I'll have a play around with this today - just need to find a power transistor and steal a Schottky diode from something... Does the diode in a buck converter have to be a Schottky, or will (for example) a 1N4001 be OK for testing? I did have about a dozen 1N5817s but they seem to have disappeared... In any case, I'm going to learn enough AVR assembler to figure out what the AVR450 charger is getting up to, then I'm going to see about reimplementing it on a PIC. Might try and get my "Nanoprobe" debug monitor working again, too... -- Phil. | Kitsune: Acorn RiscPC SA202 64M+6G VF+UniPod philpem@dsl.pipex.com | Cheetah: Athlon64 3200+ A8VDeluxeV2 1G+180G http://www.philpem.me.uk/ | Tiger: Toshiba SatPro4600 Celeron700 256M+40G -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist