Jump to content
OMRON Forums

Setting Motor[x].Pos and Kinematics


dhidas

Recommended Posts

The answer to this is probably quite simple, but is eluding me.  Basic setup here, DAC output to servo driver, feedback is a standard quad encoder.

after $$$ I want to set the motor position by hand so we issue a:

Motor[1].Pos = 10000

The we #1j/, &1#1->I (we are using very simple forward and inverse kinematics eg  KinPosAxisX = KinPosMotor1).  Everything so far is good.

The first time we run the motion program which is equivalent of X(15000) in linear abs mode "send motor #1 to 15000" (I expect the motor to go from the current 10000 to 15000) we see that the motor very quickly goes back to zero (not using the feedrate), then goes to 15000 according to the feedrate.  All program moves after this are normal.

What causes this initial move back to zero and how do I avoid it?

Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

Are you defining a forward kinematic?

In your case it would be something like:
 

open forward (1)

	KinAxisUsed = KinEnaAxisX
	KinPosAxisX = KinPosMotor1
close

The forward kinematic is used by the pmatch command to match the axes positions to motors position, in case of one of the motors has been moved.

The pmatch is implicitly called at the beginning of a motion program.  

Link to comment
Share on other sites

Alternatively, as you inverse kinematic is very simple, instead of assigning the coordinate system as

&1 #1->I

You can point directly the motor directly to the axis

&1 #1->X

For this kind of axis definition the pmatch takes care of inverting the statement, obtaining the axis position.

 

 

Link to comment
Share on other sites

We are defining both forward and inverse and they are exactly as you have typed it above (open forward.....).  We'll later make the kinematics more complicated later on so I can't use these simple definitions (#1->X, etc).  My goal is to solve this problem (misunderstanding) using this basic example with forward and inverse definitions before we move to the more complicated ones.  I think it's that I'm not understanding how to correctly set the motor position by hand and have it globally applied.  It seems like the kinematics don't see the change to Motor[x].Pos so it's calculating from 0 to 15000, when what I want is for it to see the 10000 and do the calculation from that position to 15000.  I'm guessing it's something simple, but we've tried a lot of combinations and haven't hit it yet.

Link to comment
Share on other sites

The Motor[x].Pos is not a writable element.
Are you sendin this command via the terminal? That should return error.

Why exactly do you need to set Motor[1].Pos=10000 ?
Would your system have homing routine?

If you want this as an offset, I can see to options here:
 

  • Before starting the motion program
Motor[1].HomePos= - 10000
  • At the beginning of the motion program
    pset X10000

     

Link to comment
Share on other sites

Motor[x].Pos is a writeable element.  From the SRM for Motor[x].Pos:

"""

However, with the motor disabled (“killed”), it is possible to write a value to Motor[x].Pos. This

has the same effect as reading an absolute position sensor, and can be used to force a position

value from a source not supported by the automatic position-read algorithms.

"""

Link to comment
Share on other sites

On 7/18/2024 at 5:51 AM, dhidas said:

The answer to this is probably quite simple, but is eluding me.  Basic setup here, DAC output to servo driver, feedback is a standard quad encoder.

after $$$ I want to set the motor position by hand so we issue a:

Motor[1].Pos = 10000

The we #1j/, &1#1->I (we are using very simple forward and inverse kinematics eg  KinPosAxisX = KinPosMotor1).  Everything so far is good.

The first time we run the motion program which is equivalent of X(15000) in linear abs mode "send motor #1 to 15000" (I expect the motor to go from the current 10000 to 15000) we see that the motor very quickly goes back to zero (not using the feedrate), then goes to 15000 according to the feedrate.  All program moves after this are normal.

What causes this initial move back to zero and how do I avoid it?

My tests don't have the problem you describe.

Link to comment
Share on other sites

  • 2 weeks later...

Since you want to  set the motor position by hand” … instead of writing directly to the Motor[1].Pos register, you should write to the HomePos register like this:

Motor[1].HomePos  = Motor[1].ActPos - MyOffset

Where MyOffset = 10000 in your case...

Normally, this is done automatically when the HMZ command is issued.

Edited by DaveBarnett
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...