Our new class-D amp will output a zillion amps if shorted, and we know the customer will short it. So it needs a programmable current limit.
The actual P+I control loop will be in an FPGA, so I normalized everything to +-1 volts, corresponding to doing all the math as signed
16-bit fractionals.The proportional gain is around 3, and multiplying by three within the
16-bit fractional domain is problematic. But the P signal only rails now and then, and doesn't hurt loop dynamics much when it does, so we'll just let it rail. To multiply by 3, we can do an arithmetic shift by two bits, *4, and then do a fractional multiply by a cal factor around 0.75.There will be a negative side clipper too.