How is "braking power" controlled with a regenerative braking set up?
A motor functions simultaneously as a generator. In normal operation, this "back EMF" serves to limit the current being drawn by the motor.

If you disconnect the power from a spinning motor, you can measure this back EMF directly.

If you allow this EMF to drive a current through a load, the motor will experience a braking effect, converting mechanical energy into electrical energy.

The problem with regeneration is that the voltage produced by the motor during braking is less than the battery voltage &mdash; and it drops as the motor slows down. Therefore, you need to use a boost converter (switchmode) to raise the voltage. The input to this converter is the "load" that the motor sees, and the output charges the battery.

You control the amount of current that the converter draws from the motor &mdash; the amount of braking &mdash; by changing the duty cycle of the switch in the converter. This duty cycle also needs to change as a function of the input and output voltages, so the control logic can be fairly complex.

If you're very clever, you can reuse the same switching elements that you use to drive the motor, along with the self-inductance of the motor itself, to create the regenerative braking function. In other words, you have a battery, one or more H-bridge drivers, and a motor, and you can control whether the motor is accelerating or regeneratively braking by simply changing the timing of the pulses driving the H-bridge(s).

By ignoring all of the secondary issues that can complicate the design, I hope I've created an explanation that is easy to follow.