Sebastian Kuzminsky wrote: > That's the right file. It's in the > hm2_encoder_instance_process_tram_read() function. That function gets > run for each encoder channel, every time through the servo loop. The > comment on line 832 introduces the fix to the "velocity spike when > reversing direction" problem. > > The solution that Peter suggested, that I implemented, is to report > velocity=0 for the edge that signals a direction reversal. > It took me a couple tries the get this right. My first cut was to compare the last delta to the current move, if the signs were opposite, that was a reversal. But, of course, that's not what you said, as it fails to notice the condition of move +, no move, move -. So, I had to record the sign of the last non-zero move.
Thanks for the hint! And, thanks Jeff, for the additions to PID. I connected the velocity out of my new ppmc encoder version to the feedback-deriv input of the new PID, and it seems to be working! The X looks SO GOOD that at first I thought the pid error output was broken! I had to blow it up tremendously to see the remaining error. But, that axis has the really good Pittman brushless motor on it. I may have cooked my Y axis motor or the servo amp running spirals or something at the CNC Workshop, it is acting a bit sluggish. But, I observed I could turn up the D term WAY higher than before without getting those nasty grinding noises. So, I really think this is a significant improvement, especially for drives without any other form of velocity control. It is probably much less important with real velocity servo amps, for instance. Jon ------------------------------------------------------------------------------ Achieve Improved Network Security with IP and DNS Reputation. Defend against bad network traffic, including botnets, malware, phishing sites, and compromised hosts - saving your company time, money, and embarrassment. Learn More! http://p.sf.net/sfu/hpdev2dev-nov _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers