Like most methods of transportation that are started by a battery (such as cars / locomotives) DMUs have a self-charging system built in to regenerate the cells when the vehicle is being used ready for the next time it has to be started, the time when the biggest demand is put on the battery.
Most vehicles were originally delivered with dynamos. On powered cars these were generally driven by a pulley on the output side of the gearbox, on non-powered cars by a pulley on an inner axle. As the output of the gearbox would only turn when the vehicle was in gear, it meant that the dynamo charging system only operated when the vehicles were moving, and the system only kicked in above a speed of about 19 mph.
Later power cars had alternators fitted from new, and many power cars were converted from dynamos to alternators in later years. The alternators were driven by pulleys on the input side to the gearbox (as were the exhausters) meaning that as long as the engine was running the drive shaft (freewheel) to the gearbox was turning and so there'd always be a charge generated (although minimal at idling).
Vehicles would have either one dynamo, or two alternators.
This is a pair of gearboxes from a dynamo car. The closest one shows the output end and the pulleys for the dynamo. The far one shows the input end with the pulley for the exhauster only.
A dynamo (on the left) fitted to a vehicle (engine top), with the belts driving it from the rear (output) of the gearbox, the belts from the gearbox input driving the exhauster (right).
This is the input shaft of a 'box with the additional pulley bolted on for the alternator belts. It was designed so that the gearbox didn't have to be moved when this was added, the larger diameter overlapped the exhauster drive which only needed two belts which ran between the alternator pulley and the gearbox.
An alternator pulley fitted to a vehicle. The alternator can be seen under the hardy-spicer joint of the freewheel with it's adjuster for tensioning the belts, and the two belts on the smaller diameter pulley for driving the exhauster.
A1002 - The Lamp Resistance
D1001 - Train Lighting Introduction
D1009 - Control Panel Description
E1016 - Panel, Enclosure - Open
E1018 - Panel, Totally Enclosed
P1002 - "Liliput" Regulator
P1006 - Tonum Control Panel
W1009 - Control Panel Diagrams