It seems like how regen actually works is something that always confuses people.So I've got the UQM-160 motor and controller that has the regenerative braking enabled. I have now confused myself with any hardware that is specifically needed to enable this feature. Do I need a bidirectional DC to DC converter, or a bidirectional onboard charger, or special contators or something other components that I haven't thought of?
Or is it all just CAN enabled and ran by the VCU?
Consider a motor from a toy. It'll have two magnets forming a tube, and a rotor with three coils around an axle. Brushes make sure that only two coils are connected at a time, and the current through the coils produce a magnetic field that "wants" to align with the permanent magnets, causing it to rotate enough that a different set of coils get connected.
Now, during "regen", you would spin this, and it'll generate a pulsating DC on the two terminals. Connect this through a diode to the battery and you have yourself a generator.
Next step up is a brushless motor, where you move the magnets to the rotor and have the coils in the tube surrounding it (stator). If you spin this, you generate typically threephase AC, which can again be sent through a diode rectifier direct to the battery. This is an alternator (basically. it has slip rings and a coil instead of the permanent magnets in the rotor, but same different).
So, if ALL you wanted was regen (not a motor, but a generator, all you need is a bridge rectifier connected to coils spinning in a magnetic field and you're charging the battery).
But to also work as a motor, you need a way to give it a three phase supply, and that's what the motor controller does. It takes in the DC from the battery, switches around so that the three motor wires see different voltages in relation to each other, and uses this to spin the magnetic field. But if you stop applying the field and keep spinning the motor, it again works as a generator as long as those diodes are there. And fortunately for you, an IGBT or a MOSFET used for motor control will always have a reverse protection diode (to avoid this generated voltage burning up the transistor) so that's already pretty much done.
For a squirrel cage (induction, asynchronous) motor, there's no magnet in the rotor, instead there's a coil which acts like the secondary coil of a transformer. You put a varying voltage on the stator which induces a related (I won't say proportional, because it's not linear) voltage in the rotor, and there's a degree of time delay, called slip. If you slow the motor down, the current and torque increases, to keep it at a pretty much constant rotational speed. So it doesn't use a lot of power just spinning idle, but if you try to brake it, it'll draw current and perform a lot of work. Now, if instead you slow down the spinning magnetic field (release the accelerator) and force the rotor to keep spinning (the tires are still rolling on the road) then the slip, the current and the torque becomes negative, and the motor will brake the wheels by putting energy into the battery. But again, for a direct DC connection like a battery, this doesn't require any extra components. Of course, you don't want to lock up the wheels going 150km/h or so, so you don't completely stop generating a field. You tune the brake torque by slowing the field down gradually
So for automotive controllers, all you need is to tell it how much positive or negative torque you want, and that speeds you up or slow you down. Or how much speed you want, positive or negative. The UQM-160 should support both torque and speed control.
For industrial drives (controllers) regen or DC braking is usually an extra module, because there is no battery to dump the energy into. So if you allow regen, the DC voltage inside the controller (between rectifier diodes and output transistors) would increase until the unit burns up. Therefore you'll find a LOT of things online about regen modules, DC busses and DC brakes, the first being a reversible rectifier so the energy can go back to the grid, the second is a sharing on the DC side, so multiple motors can share the energy. If one is braking, maybe another is speeding up, so the energy has a place to go. The third is a resistive dump load in case noone needs the energy, to avoid burning up.
I sincerely hope that this, while initially is rather confusing, will become clearer over time. I realize I might not have helped lower the confusion much ;-)