I'm trying to find a simple way to convert a 0-5 V output from a joystick hall effect sensor to +2.5 -- 0 -- +2.5 V. Here's how I want the response to look:
The output voltage will be sent to a frequency converter and on to a stepper motor driver. I want to have the same voltage at both extremes so the frequency (motor speed) is the same regardless of the positive or negative direction of the joystick. I intend to use a comparator at the zero point (with an appropriate deadband) to reverse the direction of the stepper driver.
I've thought of a few ways to accomplish this, but none seem to be particularly straightforward:
- Create a second, inverted output from the sensor and switch the input source (via comparator and mux) to the frequency converter at the 2.5 V midpoint. This would provide 2.5-0 V from the inverted output and 0-2.5 V from the original output.
- Shift the 0-5 V range to -2.5-2.5 V and then use an absolute value circuit to invert the negative portion of the output.
- Generate a bias voltage, based on joystick position, and add/subtract it from the sensor output.
Ideally, I'd like to have a single input to the frequency converter instead of trying to switch it to another source, such as an inverted output. The second idea above would satisfy that preference, but it would require a negative voltage source. Also, I'm trying to use discrete components in this design, so a microprocessor isn't an option for me.
Is there an easier way to accomplish this task? The problem seems fairly straightforward, but I'm having trouble coming up with a simpler solution. I appreciate the help.