Jump to content
OMRON Forums

Finding hardstop


Recommended Posts

I have a homing plc routine that I'm converting to the Power PMAC from the Turbo PMAC (identical hardware; identical motor tuning parameters after conversion).


Somehow I'm not quite getting to the hardstop. After it stops, if I servo off I can still easily manually move it 1 degree before hitting the hardstop.


My code is:


Motor[4].HomeVel = 10


call Timer.msec(500); // delay for motor to start moving

PLC14_TIMER1 = 30 + Sys.Time // set timer to 30 sec

while (Motor[4].DesVelZero == 0 && Motor[4].AmpEna == 1 && PLC14_TIMER1 > Sys.Time && Abs(Motor[4].ActVel) > Abs(Motor[4].HomeVel*0.25)) // wait for end or amp killed or Timeout



one difference with the Turbo PMAC version (motor number has switched from 2 to 4 but that doesn't matter):

The turbo pmac code has I24 = I224 | $400000 right before the jog with a comment 'jog to a stall condition'. What's the the PowerPMAC equivalent of this? I know I224 is Motor[2].Ctrl. Later in the routine it sets it back: I224 = I224 & $BFFFFF



Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

I see a number of problems with your approach as shown.


Why are you not just using the native home command?

It manages some of the things it looks like you are attempting with your plc code.


Some of the things which can complicate hard stop homing are:


1) compliance in the mechanism

2) too narrow safety margins on FFE

3) improper setting of motor[*].WarnFeLimit


I've had the best luck with a homing routine structure like this:

(almost identical to the user manual recommendation)



Motor[*].CaptureMode = 2 // use WarnFE as trig

Motor[*].WarnFeLimit = ??? // smaller than Motor[*].FatalFELimit but large enough to not false trigger



home 1; // start homing move

call Timer(0.05) // 50ms to mask possible race condition


while (Motor[1].HomeInProgress == 0) {} // wait till homing starts..

while (Motor[1].DesVelZero == 0) {} // wait for move to zero complete

Link to comment
Share on other sites

Jeff, to look up Ixx24 use the Turbo PMAC Software Reference Manual Available here.


It looks like setting bit 22=1 and bit21=0 means kill only this motor on Amp Fault.


The differing behavior could be due to how often the PLC runs to check the input and how far the killed motor drifts in that time.


I would definitely suggest using hard stop homing as Dave suggests. In theory it's pretty simple to set up. Once Motor[4].CaptureMode = 2, the #4home command will cause PMAC to move at Motor[x].HomeVel (signed) until following error is above Motor[x].WarnFeLimit, where it will move by Motor[1].HomeOffset, then stop and set position to zero, maintaining closed loop the whole time.


Complications arise from how easy it can be to trip a fatal following error. It might require a gentle touch. Suggestions include setting Motor[1].Servo.SwZvInt = 1 (to stop the integrator from building while the motor rams the hardstop), a low home velocity, carefully looking at Motor[4].JogTa/JogTs and Setting Motor[1].HomeOffset to the opposite sign of HomeVel to move away from the hard stop at the end.

Link to comment
Share on other sites

Thanks Dave, Eric,


Using David's suggested hardstop homing method seems to work, but part of the home procedure involves going from the negative hardstop to the positive hardstop and verifying the range. How can I best do that using the native home method? I assume I can subtract my HomeOffset from 0 to get the negative hardstop position but if I call home a second time I will lose the relative position because it will zero the axis on the positive side.


Also, is there any difference between waiting for HomeComplete vs waiting for DesVelZero? I worry if I start the home routine at the hardstop I may miss the DesVelZero.

Link to comment
Share on other sites

Fortunately, the homing procedure is not destructive. In other words, the Motor[*].Pos register (pre-offsets) is left undisturbed, and only the home offset is stored in the Motor[*].HomePos register. AFAIK, Delta Tau is the only mfg that works this way.


So, you can run home operations repeatedly (fwd and rev if you have two hard stops to capture...) and just observe the *.HomePos each time.


'Hope this makes sense.

Link to comment
Share on other sites

Since it looks like Dave and Eric addressed the first question fairly well, i just wanted to chime in for your second question.


HomeComplete and DesVelZero really do address two different things. For DesVelZero to go true, the motor must be trying to hold position OR be in open loop and not moving. For HomeComplete, the motor can actually still be moving, all it means is that a home command was issued and successfully found the trigger location. You may actually want to wait until both HomeComplete and DesVelZero (or HomeComplete and InPos would be even better, that way we know the motor is in closed loop and within the parameters of Motor[x].InPosBand/Motor[x].InPosTime) go true to be sure that the full home move is completed.


The training materials we have in the file depot aren't our most up-to-date resources, but the Triggered Move section may help explain this a bit. I've attached one of the slides that shows a bit about when these flags go true.


Link to comment
Share on other sites

Pos/ActPos contain the current motor position relative to power on. In homing PMAC moves HomeOffset motor units from the trigger and sets HomePos=ActPos at this position. (Your displayed position is ActPos-HomePos.) If you change HomeOffset between homing moves you will have to do slightly more than subtract HomePos values to find the distance.
Link to comment
Share on other sites

Thanks to the plethora of good advice, I was able to greatly simplify a couple of homing routines that have been around for almost 15 years in hundreds of machines. Initially I had some issue because I was only waiting for HomeComplete, which as mentioned, signals when the hardstop is found, not when the move to HomeOffset is complete. After using the InPos flag (which includes DesVelZero), everything works as expected.

Thanks again

Link to comment
Share on other sites

This topic is now closed to further replies.

  • Create New...