Introduction

Most of the frustration caused by applying the EMC to a machine is generated by the fact that this darned [INI] file had to be hand edited. There have been a couple of attempts at making graphical configuration systems but these work only for fairly standard machines. If your device is unique, as most of our machines are, you will need to study and modify the [INI] so that EMC knows what to do with your machine.

Parts of an ini file

A typical ini file is a rather daunting thing. It is made up of about 340 lines of text. For those of you used to word processing you need to understand that a line of text in the ini file has an end line character that works a lot like a paragraph in other programs. The line may appear to wrap to the next line if your chosen editor is set narrower than the line of text. You may also trash a perfectly good text file if word wrap is set on and the editor takes all the long lines and puts a end of line character someplace in the middle. You might start an editor on a blank page and try typing a few lines of different lengths and see what happens when you change the width of the editor or press the enter key in the middle of a line. You will want automatic line wrap turned off while you edit the EMC files.

These lines can be divided by the role that they play when the ini file is read during startup or written when EMC shuts down properly. These roles are; *comment *section heading *variable name and value assignment *other possible value assignments. You can recognize these parts because they use simple stylized text markup. A line that is commented begins with a (;) semicolon. As long as the line starts with (;) and ends with a newline character it will be ignored by EMC. A section heading is a bracketed [] capital name. [TRAJ] is what the heading of the trajectory section looks like. A variable name and value assignment looks like CYCLE_TIME = 0.05. Some variables have a limited number of possible values. The standard ini files that come with the EMC will list most of these possible values and comment all but the default value.

Detail

first

SETUP_TIME and HOLD_TIME are not documented. setup time is how many periods emc waits after a direction change, before outputting a step pulse hold_time is how many periods the step is kept active

PID and Stepper Motors

: From posts by Doug Goff and Jon Elson

Doug Goff wrote:

Can someone (Jon - you answer a lot of these!) help clarify the role of the PID loops in an open-loop control situation, as I have with steppers. I understand when servos are involved, with encoder feedback.

I installed BDI 4.38, used the emc.ini file as it was installed, changed the INPUT_SCALE, OUTPUT_SCALE, and homing direction, limit polarity, etc. to suit my controller (HobbyCNC) and generally the steppers jog fairly well. I am curious, though, that the system faults for following error when in fact there can't be any error without encoder feedback. I expected the as-shipped tuning parameters to provide a reasonably responsive system, and tuning would be necessary if the steppers were losing steps or barfing.

I'm certain I'm missing something here, anyone care to explain??

Jon wrote:

This is a virtual servo. Software clocked at the PERIOD rate emulates the movement of a servo, and so the P,I, D and FFx parameters are used to control that "motion". P is the most important. If you get following errors, increase P until you don't get errors any more. The movement of the virtual servo produces the step pulses at the needed rate. Since everybody is building a different system with different performance levels, different tuning is needed to adjust for that.

If your steppers "hunt" when they should be at rest, you can turn up the D term, and/or set up a deadband value equal to at least one half of a step.