I have a very basic understanding of switched mode power supplies and know that this is a simple buck converter suitable to e.g. charge a 12 V car battery from an input of, say, 24 V, with a dc current that may have some ripple:
The voltage on the battery resp. the charging current can be controlled with the duty cycle on the switch.
My problem is to find a similar schematic for discharging the battery with a controlled current. The purpose is to measure the discharge process in order to find the capacity of the battery. This is a schematic with the disadvantage that the discharge current goes on and off, instead of having just a little ripple:
All I find on the Internet are schematics that regulate the output voltage / current over the resistor, but in my project I need to regulate the current in the battery instead, and want a dc current with just a little ripple.