rpoet
Member
Hi All,
I'm having a mental block when it comes to some analog math:
Using a DL-06 PLC from AutomationDirect with a 12-bit analog combo input/output card (0-4095).
I have a joystick connected to the input that reads ~2045 when centered, ~220 when full left, and ~3960 when full right. I need to scale the signal so that when the joystick is moved off center, I get a 0-4095 output on my analog output, no matter the direction of the joystick. 0-4095 output either full left or full right.
(full left) 220 ------ 2045 ----- 3960 (full right)
joystick
center
(full left) 4095 ------- 0 ----- 4095 (full right)
analog
output
I will handle joystick direction (and thus, motor direction) with comparative contacts.
I've done plenty of scaling when going from 0-4095 to engineering units, but this midpoint application has me stumped.
EDIT:
I've found this app note from AD, and I think it may help with the joystick-to-the-left math, but I'm still stuck:
http://www.automationdirect.com/static/manuals/t1krsssm/appxb.pdf
Thanks,
-rpoet
I'm having a mental block when it comes to some analog math:
Using a DL-06 PLC from AutomationDirect with a 12-bit analog combo input/output card (0-4095).
I have a joystick connected to the input that reads ~2045 when centered, ~220 when full left, and ~3960 when full right. I need to scale the signal so that when the joystick is moved off center, I get a 0-4095 output on my analog output, no matter the direction of the joystick. 0-4095 output either full left or full right.
(full left) 220 ------ 2045 ----- 3960 (full right)
joystick
center
(full left) 4095 ------- 0 ----- 4095 (full right)
analog
output
I will handle joystick direction (and thus, motor direction) with comparative contacts.
I've done plenty of scaling when going from 0-4095 to engineering units, but this midpoint application has me stumped.
EDIT:
I've found this app note from AD, and I think it may help with the joystick-to-the-left math, but I'm still stuck:
http://www.automationdirect.com/static/manuals/t1krsssm/appxb.pdf
Thanks,
-rpoet