Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Derivative Sample Period

I'm having trouble understanding the Td parameter in the list of PID parameters using a PCI-7342 with FlexMotion.  My understanding is that for the derivative term, the output would be 20V/65536*Kd*(Derivative).  (Derivative) is supposed to be the position error at the present time minus the position error at some previous time, specifically Td+1 samples ago.  However I do not think this is the case.  If I set my PID parameters to (Kp, Ki, Kd) = (0,0,1), and give the control card a step input without connecting a motor, and examine the output using an oscilloscope, I would expect to see a pulse with a certain width dependent on Kd and Ts (the PID sample time).  If I start with a Td of 50, and then reduce Td to 25, the width of my pulse output should be cut in half.  When I run this test, the pulse is much wider than expected, and although it does change as I change Td, it does so at an unexpected rate.  Could you please let me know if I'm missing something here, or where my reasoning breaks down?
 
Thanks,
Mark Leusink
0 Kudos
Message 1 of 3
(3,341 Views)

Mark,

If you set Td to 50, this means that your dervative constant will only be calculated every 50 iterations of your PID loop.  So... if you change Td while running your loop you will have to wait until the next multiple of your new Td value for the Kd value to be updated.

I don't know if this is what is causing the behavior you are seeing, but it might be.  I am going to look into this a bit further and try to give you a more detailed explaination.

Lorne Hengst
Application Engineer
National Instruments

0 Kudos
Message 2 of 3
(3,328 Views)

Lorne,

Thanks for your help.  I have actually already discovered the problem with my test.  It turns out I was giving a step command that was too large, so even though I set the maximum acceleration and velocity to be large, the trajectory generator in the motion control card was smoothing out my step command, causing the derivative pulse to be larger than expected, with additional smaller steps near the edges of the main pulse.  When I decreased the amplitude of the square wave that I was using to generate a step command, the width of the derivative pulse reacted exactly as expected.  So thank you for your willingness to check into this for me, and sorry for bothering you about this.

Mark Leusink

0 Kudos
Message 3 of 3
(3,325 Views)