Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Homing motors
#1
In a PLC program I want to home a motor. In PMAC it was important to first set the Home Complete bit false so that it could be monitored by the PLC to know when the trigger was found. In Power PMAC I am not allowed to write to Motor[n].HomeComplete. What is the recommended method in Power PMAC to home a motor from a PLC?
Reply
#2
brad Wrote:In a PLC program I want to home a motor. In PMAC it was important to first set the Home Complete bit false so that it could be monitored by the PLC to know when the trigger was found. In Power PMAC I am not allowed to write to Motor[n].HomeComplete. What is the recommended method in Power PMAC to home a motor from a PLC?

Here is a simple snippet of code that looks very good for commanding a homing search move from a PLC program, plus making sure it starts and finishes:

open plc 1
ldata.Coord=1 // This must be CS motor is defined in for sync var to work
ldata.Motor=1 // Necessary if want the actual home command to be motor-independent
L1=ldat.Motor // So can use as index
P1=0 // Starting condition
P1==1 // Will occur at start of homing search move
home // Acts on addressed motor (could do HOME1 if don't want addressing)
while (P1==0) P2++ // Wait for move to start (P2++ for debugging only)
while (Motor[L1].HomeComplete=0) P3++ // Wait for trigger to be found (P3++ for debugging only)
while (Motor[L1].DesVel!=0) P4++ // Wait for post-trigger move to complete (P4++ for debugging only)
close

Of course depending on your philosophy, this could be made shorter or longer. The conditions could be combined into a single compound condition, and the HomeComplete condition might not be required. On the other hand, if you wanted to handle possible errors, you would need longer and more complex logic.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)