For example,in a triangle,the real move is a straight line x,the pole is L,so there will be a angle θ,x=L*sinθ,when I make the x move in straight line, I want the angular velocity of θ is constant,how could I code this?
Anyone can help?

(01-08-2019, 07:56 AM)twathit Wrote: For example,in a triangle,the real move is a straight line x,the pole is L,so there will be a angle θ,x=L*sinθ,when I make the x move in straight line, I want the angular velocity of θ is constant,how could I code this?
Anyone can help?

Option 1)
This is exactly why PMAC has kinematic axis definitions available.
Look in the User Manual for the section dealing with forward and inverse kinematics. As you already understand (by asking the question), the relationship is not linear and will depend on the actual position of the mechanism at any given point in time.
So the task is to develop a non-linear relationship that will define the actuator position as a function of the desired axis position. This allows you to program desired axis motion and allow PMAC to transform into actuator motion.
Equally important is a relationship that will define the axis in terms of known actuator position. This allows PMAC to properly initialize the axis by reading the actuator position.
For a single axis as you describe, this should be fairly easy.

Option 2)
If this is a simple, single axis task you could use a linearization table (cam function) to 'correct' for the geometry changes through the range of motion. Not as good as #1 in my opinion, but with cubic interpolation turned on will do the job smoothly.

Option 3)
Again, if the application is simple.... You could even program your motion into a loop that solves the trig relationship each iteration. The 'While Loop' would need to execute fairly often. This is essentially a crude & limited way of doing #1, and not very good. Option #1 allows you to utilize all of PMAC's built in capabilities. With #3 method, your motion program will become more complex, and there will be greater error.

(01-08-2019, 07:56 AM)twathit Wrote: For example,in a triangle,the real move is a straight line x,the pole is L,so there will be a angle θ,x=L*sinθ,when I make the x move in straight line, I want the angular velocity of θ is constant,how could I code this?
Anyone can help?

Option 1)
This is exactly why PMAC has kinematic axis definitions available.
Look in the User Manual for the section dealing with forward and inverse kinematics. As you already understand (by asking the question), the relationship is not linear and will depend on the actual position of the mechanism at any given point in time.
So the task is to develop a non-linear relationship that will define the actuator position as a function of the desired axis position. This allows you to program desired axis motion and allow PMAC to transform into actuator motion.
Equally important is a relationship that will define the axis in terms of known actuator position. This allows PMAC to properly initialize the axis by reading the actuator position.
For a single axis as you describe, this should be fairly easy.

Option 2)
If this is a simple, single axis task you could use a linearization table (cam function) to 'correct' for the geometry changes through the range of motion. Not as good as #1 in my opinion, but with cubic interpolation turned on will do the job smoothly.

Option 3)
Again, if the application is simple.... You could even program your motion into a loop that solves the trig relationship each iteration. The 'While Loop' would need to execute fairly often. This is essentially a crude & limited way of doing #1, and not very good. Option #1 allows you to utilize all of PMAC's built in capabilities. With #3 method, your motion program will become more complex, and there will be greater error.

I have some program idea about option #3,in every loop calculate the next position.But I not sure how to program option #1 and #2,could you give me some example?Thanks.

I have some program idea about option #3,in every loop calculate the next position.But I not sure how to program option #1 and #2,could you give me some example?Thanks.
[/quote]

Strongly do not recommend option #3. This was the solution 25+ years ago, but not today.
If you will use the capabilities built in to PMAC all of the non-linearities become transparent and all you do in your program is tell the axis (NOT the actuator) what you want it to do. PMAC will control the actuator so that you don't have to.
Think of it this way: Any solution will require you to develop the trigonometry that defines the relationship between the actuator and axis. Using option #1 makes this totally transparent to your programs.

Just to be complete (I hesitate because I don't want to confuse you), there is an option #4. This is also a 'not recommended' method that would have limited stability. You could use dual feedback with a second encoder mounted directly on the axis. Your program commands will be relative to the 'load' encoder. This is how precision machine tools gain accuracy by using a secondary encoder directly on the table rather than inferring position from the motor. In your case though, the discrepancies will be many orders of magnitude greater and would affect stability. Tuning would need to be very conservative and thus have limited responsiveness.

Learn how to do option #1. This is the best way and takes advantage of the excellent capabilities of PMAC. The Kinematics section has a better explanation and examples than I could do here. The manuals are very good.

(01-08-2019, 07:56 AM)twathit Wrote: For example,in a triangle,the real move is a straight line x,the pole is L,so there will be a angle θ,x=L*sinθ,when I make the x move in straight line, I want the angular velocity of θ is constant,how could I code this?
Anyone can help?

Option 1)
This is exactly why PMAC has kinematic axis definitions available.
Look in the User Manual for the section dealing with forward and inverse kinematics. As you already understand (by asking the question), the relationship is not linear and will depend on the actual position of the mechanism at any given point in time.
So the task is to develop a non-linear relationship that will define the actuator position as a function of the desired axis position. This allows you to program desired axis motion and allow PMAC to transform into actuator motion.
Equally important is a relationship that will define the axis in terms of known actuator position. This allows PMAC to properly initialize the axis by reading the actuator position.
For a single axis as you describe, this should be fairly easy.

Option 2)
If this is a simple, single axis task you could use a linearization table (cam function) to 'correct' for the geometry changes through the range of motion. Not as good as #1 in my opinion, but with cubic interpolation turned on will do the job smoothly.

Option 3)
Again, if the application is simple.... You could even program your motion into a loop that solves the trig relationship each iteration. The 'While Loop' would need to execute fairly often. This is essentially a crude & limited way of doing #1, and not very good. Option #1 allows you to utilize all of PMAC's built in capabilities. With #3 method, your motion program will become more complex, and there will be greater error.

I have some program idea about option #3,in every loop calculate the next position.But I not sure how to program option #1 and #2,could you give me some example?Thanks.

I tried to put together an example that is based on your application. It is bare-bones & likely has some mistakes. Hopefully it is good enough to help explain the concept of using the Kinematic approach. Perhaps this will help you understand the explanation and example in the User Manual and between the two it will make sense.
Being only one axis, your application is a great way to learn this method.
Best regards and hope your application is a great success.