Alternative method to Trajectory in Position control mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Alternative method to Trajectory in Position control mode

Jump to solution
1,778 Views
sergigomis
Contributor III

Hi again.

I try to control the motor position using the actual system of PaP motors.
I have an external clock.  And every input clock, I need to move "x" degrees.

The problem is that when I initiate a trajectory with user variables "user.command.posStepInt_mrev" and "user.command.posStepFrac_mrev" and start the trajectory with "user.command.runTrajectory=1" this flag take much time to reset  for initiate a new movement.

Now, at every while() loop, I read the numbers of externals clock interrupts I received and I convert this number to complete and partial revolutions to update the trajectory.

If I have elevated external clocks, and this result is for examples 3 complete revolutions, the motor make a start/stop every trajectory doing a notable vibration in motor (and current peaks).

I'm working with motor limits of speed and acceleration (speed rate=3000rpm, acceleration/desacceleration=15000rpm, Jerk=200000) and Trapezoidal trajectory.  This is the faster way.

My question is .....
Exist any other method to control the position without using a trajectory method?

Thank you.

Sergi.

Labels (1)
0 Kudos
1 Solution
1,379 Views
linestream-adam
Senior Contributor I

Sergi,

Gotcha, sorry I didn't clarify where in the KMS API you should modify these values.  

The outputs of your reference generator should be provided to the POSITION block.  So in the drv.c file the function call POSITION_run should have the trajpos pieces replaced by your trajectory generator.

KMS moves the motor because the runTrajectory command tells the reference generator to start, so you will be going around this by modifying the code to replace the reference generator.

View solution in original post

0 Kudos
4 Replies
1,379 Views
linestream-adam
Senior Contributor I

Sergi,

The position profile generator included with KMS is designed for relative point-to-point position moves only.  It does not support extending the profile or otherwise updating the profile at run-time.

You could replace the position profile generator with your own.  The main consideration you would need to keep in mind is that the entire KMS position system is windowed.  So this means that if the motor rotates in one direction continuously, the position signal will not increase to infinity.

2017-03-14 12_31_03-SpinTAC_Position_Move_Rollover.pdf - Adobe Acrobat.png

For example in the above image, I told the profile generator to rotate 130 mechanical revolutions.  As you can see each time the mechanical revolution became larger than 10, it rolled over to -10 immediately and the position rollover counter increased.  

I think the simplest path for you to avoid the large number of start/stop cycles would be for you to create your own profile generator that will generate a position reference signal according to the above image & description that will increase (or decrease) the position reference based receiving external clock interrupts.

You should be able to avoid creating the velocity, acceleration, & jerk references since they are only used for feedforward.  Obviously, if you did create them the performance of your system would be better.

Regards,

Adam

0 Kudos
1,379 Views
sergigomis
Contributor III

Hi Adam.

I don't know if I undestand that you explaint me.

Ok. I calculate my position reference acording my inputs..... But I don't understand how set this reference with KMS variables.

How I create my own profile?

How I tell you to KMS API to move to motor without use a "runTrajectory"?

Sorry..... Can you explain me again?

0 Kudos
1,380 Views
linestream-adam
Senior Contributor I

Sergi,

Gotcha, sorry I didn't clarify where in the KMS API you should modify these values.  

The outputs of your reference generator should be provided to the POSITION block.  So in the drv.c file the function call POSITION_run should have the trajpos pieces replaced by your trajectory generator.

KMS moves the motor because the runTrajectory command tells the reference generator to start, so you will be going around this by modifying the code to replace the reference generator.

0 Kudos
1,379 Views
sergigomis
Contributor III

Hi Adam.

Thank you. Now is clear.

I try to modify the profile.

Thank's

0 Kudos