Author Topic: Jogging with a joystick  (Read 6845 times)

Joel Moore

  • Full Member
  • Posts: 128
    • View Profile
Jogging with a joystick
« on: August 05, 2003, 01:16:55 PM »
I'm thinking about using the T100MD888+ as a 2-axis stepper controller.  I want to do this using an analog joystick.  I read this post but something about this answer bothers me.

A joystick should be controlling speed and direction,  not distance (typically).  Converting the joystick value to a distance and then plugging that into a call to STEPMOVE doesn't sound right to me.  Wouldn't you get a "stuttering" effect as the motor accelerates and decelerates repeatedly for each STEPMOVE call?  Can you call STEPSPEED on the fly to change pps?

So am I missing something?  Is it possible to use the T100MD888+ for smooth jogging using a joystick?
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re: Jogging with a joystick
« Reply #1 on: August 06, 2003, 11:29:00 AM »
It depends on what you want to do. The post you read was based on the assumption that the joy stick is used to position the coordinate of the x-y axis according to the position of the joy stick.

Your purpose is to use the position of the joy stick to command the motor to move or to stop and the speed of movement is to be proportional to the reading from the position of the joy stick. I assume that when the joy stick is in the middle position there is zero speed on both x and y direction?

In this case when you want to command the stepper motor to move, you can ask the stepper to move a large number of pulses so that the motor will turn continuously. The initial speed is low but when the joy stick move towards the left or the right you can run the STEPSPEED command while motor is turning to change the speed on the fly. When the joy stick changes direction you have to execute the step stop to stop the movement and then execute STEPMOVE again in the reverse direction to continue motion.

(Note: PLC with firmware revision before r39 does not support speed change on the fly. These are PLC manufactured before year 2001)
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS