# I can now run EMC2 and it kind of "works"

<snip>

Do you understand PID loops?
P - Proportional I - Integral D - Derivative
Proportion is proportional to the error. If you set your cruise control for 60MPH and you are only going 55MPH then you have an error of 5MPH. There is a proportional gain Kp, this determines how much of the proportional error goes in the equation, if Kp is 2 then 10 goes into the equation to calculate the output.
Derivative is the rate of change, If your cruise control is set for 60MPH and you're going 55, you have 5MPH proportional error. But if you're 5MPH too slow but catching up fast, you may need to ease up on the throttle or you'll overshoot 60MPH. Likewise if your 5MPH too slow and slowing down (maybe a steep hill) you can stomp the throttle more. Derivative gain, Kd, determines how much effect the rate of change in error has to do with the output.
Integral is the error over time. If you have your PID cruise control set for 60MPH it will never get there without Integral because it takes some throttle (output) to get the car to 60MPH. Let's say you're driving 60MPH, hit the cruise control, Proportional error is zero, Derivative is zero, guess what, the output is zero! You'll slow down until there is enough error to hold the throttle at some speed below the setpoint. Integral integrates the error over time and causes the output required to achieve zero error, it is needed when an output is needed for zero error, such as the cruise control or often a temperature control, or even a motion control in a vertical application or under a load.
Though not the scientific method, I raise proportional gain until it becomes unstable, then back it off a bit. Then I do the same with Derivative, then re-do proportional, back an forth a couple times until I have P and D controlling but well into the stable region. Then I work on I gain. One way is to put a little torque on the shaft to see some error, turn up I gain until it gets rid of disturbances on the shaft as fast as possible without oscillation.
For my lathe with tach feedback, I have D gain set to 0, the amp does enough that any D gain in the control seems to make it oscillate.
Hope this helps!
RogerN
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
[ ... ]

What inches-per-minute are those -- 20 and 10 inches per minute? At 20 IPM, that would be 100 motor revolutions in a minute, or 400K pulses per second (PPM) -- 6666 PPS. That is 150 uS per pulse. Have you looked at the pulse waveform with a scope to see what the rise time is? And whether there is overshoot or undershoot from an impedance mismatch?
Anything which loses you index pulses will cause errors of this sort. Get there with a scope, monitor the waveform at the board which is counting the pulses, and see what the waveform looks like -- then increase speed by about 10% at a time and see what the waveform looks like when the errors start to appear.
Yes -- you do need to tune the servo amps -- but not until you get the belts on so you are moving the cast iron.
Good Luck,         DoN.
--
Email: < snipped-for-privacy@d-and-d.com> | Voice (all times): (703) 938-4564
(too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Ignoramus2398 wrote:

What, you were powering up the servos and spinning the motor while not even in the same building????

I sure wouldn't worry about it. I think we figured out you have 4000 x 5 = 20,000 counts/inch. (Maybe I am neglecting a belt ratio there.) So, that is .00005" per encoder count. If it is holding position to +/- .0001", that is only two encoder counts! VERY good.

Well, once the servo is holding position without runaways, you can just hook it all up, as long as you have at least a manual E-stop that is easy to get to.
Jon
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

Isn't this close to the minimum resolution of your encoders?
Let's see -- 4000 PPR, and 0.200"/R with the ball screws you have (I think), which means that you have 0.000050" per pulse. There has to be a little back and forth as long as the axis is active. Remember that drift with no input control signal? This will move the axis until the encoder tells the system about it, at which the system will command a very slow motion in the other direction and it will drift through the desired point until it overshoots in the other direction.
However -- I don't think that you will be able to measure 50 uInch on your system anyway. Have you checked what backlash is in your ballscrews?

Absolutely. You will need to be physically present for that, however -- you can't push the limit switches with ssh from rooms or miles away. :-)

Great,         DoN.
--
Email: < snipped-for-privacy@d-and-d.com> | Voice (all times): (703) 938-4564
(too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
DoN, I got that jitter fixed, there is none any more. I changed a couple of settings. Now the mill finds a "position" quite accurately.
i
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

Great! Settings in the servo amp, or in the EMC configuration file?
--
Email: < snipped-for-privacy@d-and-d.com> | Voice (all times): (703) 938-4564
(too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

Mostly EMC file, bit I fiddled with gain on the amplifier also.
i
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

Smart thinking. I haven't used emc to to control anything yet but initial tests of drives on anything I've built is watch the motor, not connected to anything do it's tricks.

You have a net cam pointing at the motor? You could be having a blast at work on breaks, breaks, yah, just breaks. Maybe make up for coding stuff for work at home. ;)

Don't forget, easy to want to move to the next step skipping this one until later.
Wes -- "Additionally as a security officer, I carry a gun to protect government officials but my life isn't worth protecting at home in their eyes." Dick Anthony Heller
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
On 7/14/2010 1:58 PM, Wes wrote:
(...)

Um. (Cough.) [Stares at feet] Yes.
--Winston
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

And might end up with a broken mill.
i
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

I see you understand the big picture. Have fun and keep reporting. I sure am enjoying your progress in a vicarious fashion.
Wes
-- "Additionally as a security officer, I carry a gun to protect government officials but my life isn't worth protecting at home in their eyes." Dick Anthony Heller
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
wrote:

Indeed..as am I
Gunner, OmniTurn CNC field tech
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

It is a fun project, if it was only not as warm in the garage. As of now, I feel that things are under control.
i
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
On Thu, 15 Jul 2010 08:19:35 -0500, Ignoramus12838

Surely you could find a window air conditioner and install it in the sho^H^H^Hgarage, Ig. It would also help reduce humidity in there, preventing rust on your tools and equipment. (wifely sales point)
--

EXPLETIVE: A balm, usually applied verbally in hindsight,
which somehow eases those pains and indignities following