let's focus on current control.
here's how I understood how the control works: (picture below)
Basically I feed my PID with a reference current minus the measured current (i.e. I have a negative feedback in current), the PID provides a control voltage to the pwm (so that pwm exit is 0 if the triangular waveform that characterizes it is more than this control voltage) that gives the H bridge a signal characterized by its duty cycle that then makes the H bridge output the driving voltage for my motor.
my question is: why can't I feed the motor with the output from my PID? what's the point in having the pwm and H-bridge, if in the end all it does is giving the motor a voltage signal that has its average value where my PID decides?
my only guess is that there's something going on with ''per unit'' values. Like if my PID can output voltages between 0-5V but I want to drive my motor with -100,100V then it's up to the pwm and H bridge (which has a battery, of course) to ''transform'' the voltage information in the PID signal to the actual voltage that the motor wants.
What am I getting wrong? Why do I need those two elements?