Profile Position in CanOpen and change set immediatly
I have an application in CanOpen Profile Position Mode where I need to change the velocity at a precise point.
For example, go to 40000 counts (in absolute) at Speed X, then go to 48000 counts at a diffrent speed (without a stop between the 2 moves).
On the CanOpen manual, we could read that with bit 5 (change set immediatly), the AKD could process the new data AFTER the previous one was reached .
When I try to implement this, it seems that the drive processes new data immediatly !!!
This is my sequence :
- write position data through 607A, 6081, 6083 & 6084 (40000 in 607A in my case)
- Start motion with 0x3F in 6040
- Wait that bit 10 of 6041 = 0
- Set 6040 to 0x2F
- Wait bit 12 of 6041 = 0
- Write new position data in 607A and 6081 (48000 in 607A in my case)
- Wait bit 12 of 6041 = 1
- Set 6040 to 0x3F
What is the problem in this sequence ?
Thanks for your help.
Comments & Answers
toddevans01 said ...
3F is 111111 in binary which means you are telling the drive to expect to set immediate because bit 5 is set in the control word in this case.
2F is 101111 in binary which means you are still telling the drive to expect to set immediate because bit 5 is still set.
Bit 5 has to be OFF ( 0 ) for single setpoints ( not immediate ) before you trigger the new setpoint bit 4.
Refer to pages 130 and 131 in the AKD CANopen Communications manual to review the sequence and bit descriptions
toddevans01 said ...
I was able to replicate your issue and the second set of values ( position velocity accel decel ) take effect as soon as the rising edge of bit 4 ( new setpoint )
is processed; not when the first move or values is done.
I have not seen an implementation nor have sample code that shows using MT.x parameters to create and use motion tasks instead of motion task 0 which the new setpoint mechanism uses.
The drive is capable of having 2 predefined motion tasks setup by Workbench where one blends into the other.
If your controller supports interpolated position mode you may want to consider that instead of profile position mode. That way your master can do the profiling on the fly.
I hope this helps!