Internet PLC Forum

General => Technical support => Topic started by: Gerard Hebert on November 24, 2002, 04:43:00 PM

Title: Joystick Control
Post by: Gerard Hebert on November 24, 2002, 04:43:00 PM
Hi,

I'm looking for any programming information or example for using a T100MD1616+ to control stepper motors by providing input from a joystick. My preference would be to have the joystick connected to a computer but this may be too ambitious.

Thanks
Title: Re: Joystick Control
Post by: support on November 25, 2002, 06:47:38 AM
You can connect the two potentiometer of a joystick to two 0-5V ADC channel in the T100MD+ PLC (ADC 3 and 4 for MD1616), then you can read the position of the joystick to decide how much to move the stepper motor. The value read from the ADC can be scaled into number of steps that the stepper is needed to move and you just have to use the STEPMOVE command to move the stepper by that amount. You can also use the joystick to implement absolute coordinates so the stepper move to where your joystick is.  The STEPMOVEABS command make moving to absolute coordinates a breeze. Since the ADCs are 10-bit resolution you have up to 1024x1024 = 1 million coordinates that you can move within ;D.