Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Motor[X].HomeOffset sometimes does not work
#6
It sounds like you want to first move in the positive direction to reach the home flag. Then you want to home to the index in the negative direction.

The jog move in your PLC may go too far before stopping. You might try changing it to a triggered jog move like this. Note that a triggered jog move needs a size, so I went with 100. If your motor is in counts you will probably need to extend this.

Code:
open plc HomePLC

// First triggered jog move to home flag
Motor[1].CaptureMode=0
Gate3[0].Chan[0].CaptCtrl=2
Gate3[0].Chan[0].CaptFlagSel=0
Motor[1].CaptPosLeftShift=4

JOG1=100^0
CALL Timer.msec(100)
WHILE(Motor[1].InPos == 0) {}

// Second homing move to home index
Motor[1].CaptureMode=0
Gate3[0].Chan[0].CaptCtrl=1
Motor[1].HomeVel=-327680
Motor[1].HomeOffset=-32768000
Motor[1].CaptPosLeftShift=4

HOME 1
CALL Timer.msec(100)
WHILE(Motor[1].InPos == 0) {}

DISABLE PLC HomePLC
close

This assumes you have the timer that is added to new projects in the latest IDE. You may have to change the timer call.
If you don't have the in position function set up, you can change the while loops to:
Code:
WHILE(Motor[1].DesVelZero == 0) {}
Reply


Messages In This Thread
RE: Motor[X].HomeOffset sometimes does not work - Eric Hotchkiss - Yesterday, 02:14 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)