You implement a PID loop to set the drive PWM given the current error. Unless you are using too low a
PWM frequency the current ripple will be relatively small - but you typically need to measure the current at a fixed
point in the PWM cycle to avoid aliasing the PWM frequency into your current measurements. Thus running the PID once per PWM cycle is a common and simple approach - drive the loop from the PWM timer interrupt perhaps? Arduino ADC is pretty slow for this though, you might need to compromise. Typical motor PWM
rates are 16kHz, 8kHz, 4kHz (lower frequency for larger motor).
Low pass filtering in a PID loop usually causes instability - don't do it!
BTW you seem to think the torque developed by the motor is different from the load torque? How can that
be if there is a single shaft between them?