Author Topic: Direction of encoder  (Read 10596 times)

dbuehler

  • Newbie
  • Posts: 1
  • I love YaBB 1G - SP1!
    • View Profile
Direction of encoder
« on: May 10, 2002, 07:00:01 AM »
I am using an encoder on the T1000MD-OV1.  The encoder has 360 counts per revolution and it works great on inputs 3&4 for HSC1.  

I set the PV of HSC1 to zero when the counter = 360.  This works fine in the forward direction but I can't figure out how to set the PV to zero in the reverse direction.

I can't guarantee motor direction because in this application sometimes the user will turn on the motor to get the flywheel spinning and then shut if off so that they can jog the machine slowly.  I also have counter balance which will sometimes pull the machine in reverse for a split second in the time between the brake releasing and the clutch engaging even with the motor in the forward direction.

Is there any way to define two high speed counters using the same inputs?  I know I could jumper 3&4 to 5&6 and define HSC2 to set the PV's of both counters to 359 when it goes negative but I was hoping for another solution because I may be short on inputs.
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Direction of encoder
« Reply #1 on: May 10, 2002, 10:41:33 AM »
So I assume you have setup a Custom function so that when the PV hit 360 the CF will set PV to 0? Does it do something else?

You may want to try this: use a non-differentiated custom function to monitor the PV value continuously, if it goes negative, then execute a HSCDEF again to change the target PV to -360 and turn on a lock out relay so that it will not execute this custom function again (to prevent continuous execution of the HSCDEF statement).  Once the interrupt service routine works, set PV to zero  clear the lockout relay so that it will again monitor the PV for a possible negative value.

I haven't really tried it, but I think it should work. Call me at 1-877-689-3245 if you need more assistance.
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS