Converting PWM to a Voltage

Converting PWM to a Voltage

To drive a Sabertooth 2x12 motor controller it needs a signal from 0V to 5V.

I started testing using just a PWM output from the BeagleBone Black. This was enough to prove that the PWM output would control the speed, but accuracy of speed control was lacking. This was particularly evident around the "stop" voltage of 2.5V. The motor would hunt between forwards and backwards as the average DC voltage of the PWM output floated around 2.5V.

In the end I decided it would be better to convert the 3.3V PWM signal into an analog voltage. The circuit I used is shown below.

And the output from the circuit when driven by the BeagleBone Black PWM is shown below.

  • Channel 1 (Blue) is the PWM. The duty cycle is varied from 60% to 12%, then from 60% to 98%
  • Channel 2 (Yellow) is the output from the circuit as the PWM duty cycle is varied