[Home]UPDATING

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

The purpose of this page is to describe changes to update your configuration files to work with a newer version of emc.

Always back up your working configuration before making changes to it

1. Changes between 2.3.x and 2.4.x
1.1. emc.nml changes
1.2. tool table changes
1.3. hostmot2 firmware images
1.4. hal_joystick removed; use hal_input
1.5. halui: halui.tool.length_offset
2. Changes between 2.2.x and 2.3.x
2.1. Must home before MDI or Auto
2.2. Withdrawn drivers
2.3. Firmware package separation
2.4. ".comp" file changes
2.5. timedelay changes
2.6. Classicladder changes
2.7. Removal of pin 'motion.motion-inpos'
2.8. Hostmot2 GPIO pins changed name in HAL
3. Changes between 2.1.x and 2.2.x
3.1. m5i20 encoder changes
3.2. pluto_servo changes
3.3. stepgen and freqgen changes
3.4. double-linking of pins is now treated as an error
3.5. The 'counter' component is deprecated
3.6. Homing changes
3.7. connect motion.spindle-speed-in for Feed Per Revolution (G95) mode
3.8. setp requires 2 arguments, 3 given
3.9. .var file changes
3.10. Classicladder
4. Changes between 2.0.x and 2.1.x
4.1. emc.nml
4.2. kinematics
4.3. spindle control
4.4. halcmd "loadusr -W" replaces wait-for-pin and sleep
4.5. inifile units
4.6. "HAL: WARNING: blocks is deprecated, please use the subcomponents generated by 'comp' instead"
4.7. elimination of "period" from most HAL components
4.8. elimination of s8, u8, s16, u16 HAL types
4.9. hal_ppmc uses ns units for setup-time, pulse-width, and pulse-space; pins renamed
4.10. the pin axis.N.index-pulse-in has been renamed to axis.N.index-enable
4.11. the meaning of the 'comp.N.hyst' parameter has changed
4.12. the connection to the lathe's spindle encoder has changed

1. Changes between 2.3.x and 2.4.x

1.1. emc.nml changes

For configurations that have not customized emc.nml, remove the inifile line NML_FILE = emc.nml. This will cause the most up to date version of emc.nml to be used.

For configurations that have customized emc.nml, a change similar to this one is required.

Failure to do this can cause an error like "libnml/buffer/physmem.cc 143: PHYSMEM_HANDLE: Can't write 10748 bytes at offset 60 from buffer of size 10208."

1.2. tool table changes

The format of the tool table has been changed incompatibly. The documentation shows the new format. The tool table will automatically be converted to the new format.

1.3. hostmot2 firmware images

The hostmot2 firmware images are now a separate package. You can:

1.4. hal_joystick removed; use hal_input

hal_joystick was deprecated since emc2.2, did not work at all in 2.4.0, and was removed in 2.4.1. Use hal_input instead. There is no direct conversion from hal_joystick to hal_input because of the wide variety of names hal_input can give to devices, but all devices supported by the former are supported by the latter.

1.5. halui: halui.tool.length_offset

Because tool offsets can be applied on all 9 axes, the old pin halui.tool.length_offset has been removed. For the Z tool length offset, use halui.tool.length_offset.z instead.

2. Changes between 2.2.x and 2.3.x

2.1. Must home before MDI or Auto

In 2.3, you must home all axes before issuing MDI commands or running part programs. This setting can be reverted to the 2.2 behavior by the inifile setting [TRAJ]NO_FORCE_HOMING = 1. For users of the mini GUI, this setting may be required.

2.2. Withdrawn drivers

The transitional drivers m7i43_hm2, mesa7i43_gpio and hm2_5i20 are withdrawn. Use the new hostmot2 driver instead. (use hm2_pci for 5i20 cards).

hal_m5i20 will remain in 2.3, but will be removed in 2.4.

2.3. Firmware package separation

There are now separate firmware packages for each type of hostmot2 supported hardware. Depending on the hardware you own, select and install the appropriate firmware package (e.g., emc2-firmware-mesa-5i20-hostmot2)

2.4. ".comp" file changes

The declaration "license" is now mandatory. It should specify a source code license in the form accepted by the Linux kernel for taint checks. e.g.,: license "GPL";

2.5. timedelay changes

The pins, parameters, and function have been renamed to better follow the common naming convention. See the manpage for information about the new names: http://linuxcnc.org/docs/2.3/html/man/man9/timedelay.9.html

2.6. Classicladder changes

- The number of physical input and output pins default to 15 each ( it was 50 before). The idea is less clutter and most of the time people set these to what they want anyways.
- Classicladder now uses %IW and %QW variables to connect to s32in and out pins instead of mapping them onto %W variables.
The default number of s32 in and out pins is now 10 each.
Ladder programs would need to be changed if they use s32 pins.
- Old timers will use a new control pin. To make it work as before connect the C pin to the E pin.
- default number of bits is now 20 (from 500)
- default number of words is now 10 (from 100)

2.7. Removal of pin 'motion.motion-inpos'

Change any use of 'motion.motion-inpos' to 'motion.in-position'.

2.8. Hostmot2 GPIO pins changed name in HAL

In 2.2.x hm2 gpio pins had HAL names that included the connector name. In 2.3.x this was changed to "hm2_<BoardType?>.<BoardNum?>.gpio.<IONum>". IONum is a three-digit number. The mapping from IONum to connector and pin-on-that-connector is written to the syslog when the driver loads, and itís documented in Mesaís manual for the Anything I/O boards.

3. Changes between 2.1.x and 2.2.x

3.1. m5i20 encoder changes

The m5i20 "encoder" pins now match the HAL canonical encoder interface. The -cnt-latch, -pos-latch, -idx-latch, and -latch-index pins have been removed. The standard encoder pin -index-enable has been added. The behavior of the -position and -count pins now match the HAL canonical interface.

3.2. pluto_servo changes

Most pins and parameters on pluto-servo were changed to use dots instead of dashes, in accordance with the HAL canonical naming conventions. For example, 'pluto-servo.encoder-0-velocity' has been renamed to 'pluto-servo.encoder.0.velocity' and 'pluto-servo.dout-00-invert' has been renamed to 'pluto-servo.dout.00-invert'.

3.3. stepgen and freqgen changes

The units for steplen, stepspace, dirsetup, and dirhold have been changed from BASE_PERIOD units to nanosecond units. Internally, the values given are rounded up to a multiple of BASE_PERIOD, and at runtime the parameters are changed to display the rounded up value.

Freqgen has been deprecated and replaced by stepgen, which now has an additional command line argument 'ctrl_mode', which can be used to specify position mode (the default) or velocity mode. Position mode is the default, and works the same as before. Velocity mode accepts a velocity command, and works like freqgen.

In step modes 0 and 1, setting stepspace to 0 will allow "step" (or "up/down") to be asserted on every invocation of make-pulses. Use a stepspace value of 1 to signify "the smallest nonzero stepspace".

3.4. double-linking of pins is now treated as an error

halcmd and hal_link() now refuse to link an already-linked pin. This immediately diagnoses configuration errors of the form
    net limit-switch parport.0.pin-26-in => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in
    net home-switch  parport.0.pin-26-in => axis.0.home-sw-in
which have the effect of leaving no pin driving the limit switch inputs. If the "re-link" behavior is truly desired, add "unlinkp" commands before the new link. It is still permitted for "unlinkp" to be used on an unconnected pin.

3.5. The 'counter' component is deprecated

The 'counter' component is deprecated. For a one-phase, unidirectional counter, use the 'encoder' component with encoder.X.counter-mode=TRUE. The version in 'encoder' has superior velocity estimation.

3.6. Homing changes

The homing algorithm has been changed to be "level sensitive" instead of "edge sensitive". This eliminates some possible "miss the switch and go to the end of travel" errors on machines with flakey switches. However, it will cause homing to fail on some machines that might have worked before. This can happen if the following conditions are true:

    1. The home switch does not remain on from the point that it trips till the end of axis travel
    2. Homing speed is high and/or decel rate is low, so that the machine will overshoot the switch when it hits it during homing.

If the machine ends up on the far side of the switch during homing, it will stop with an error message.

Machines that can wind up "on the far side" of the home switch are considered to have defective switches. If you ever attempt to home while on the wrong side of the switch, it will run to the end of the axis. There is NO possible software solution to that scenario - the proper solution is a home switch that remains on all the way to the end of the axis. With such a switch, EMC-2's homing algorithm will always work.

3.7. connect motion.spindle-speed-in for Feed Per Revolution (G95) mode

The new pin motion.spindle-speed-in must be connected for Feed Per Revolution (G95) to work. The value connected must be a revolutions per second value. Depending on the machine, this can be a feedback velocity from the encoder or a commanded velocity loopback. If using a loopback, the output value which is in revolutions per minute must be multiplied by .0167 with a gain component to convert to RPS.

3.8. setp requires 2 arguments, 3 given

Additional error checking is now done in halcmd, so that giving too many arguments causes an error message to be printed. In 2.1 and earlier, these extra arguments were ignored.

Note that this is the number of arguments that are present after the expansion of inifile references, such as

    setp example.scale [AXIS_0]INPUT_SCALE
which might expand to to
    setp example.scale 32000 0
in this case, the fix is to modify the inifile to remove the second number "0" from the INPUT_SCALE. This second value is no longer used anywhere in emc2.

3.9. .var file changes

The .var file has been extended to require coordinate system offsets for U, V and W axes. In version 2.2.1 and above, the required additions to the .var file are automatically made, and no user intervention is required.

3.10. Classicladder

when loading classicladder user program, only load it once with or without --nogui option. loading it twice will cause the symbols window to not work properly, though the ladder program will run fine.

4. Changes between 2.0.x and 2.1.x

There is an [experimental script] for automatic conversion of emc2.0 configuration files. It fixes items 1, 2, 3, 8, and 9 below.

4.1. emc.nml

The emc.nml file has been heavily revised. Unless you made your own changes to emc.nml, simply make a fresh copy. If you made your own changes, then you'll have to apply them to emc.nml manually. The diff is [here]

4.2. kinematics

Now a separate kinematics module must be loaded before MOTMOD, as shown in [this diff].

4.3. spindle control

The HAL pins for spindle control have been renamed to reflect the fact that they are controlled by the realtime 'motion' component, and not by the userspace 'iocontrol' component, as shown in [this diff].

4.4. halcmd "loadusr -W" replaces wait-for-pin and sleep

In 2.0 there was no way to wait for a userspace component to create its pins. The "wait-for-pin" program (which took a pin name as an argument) was added and then removed during the 2.1 development cycle. Now, the correct way to wait for a userspace component is "loadusr -W ...". This requires that the component call hal_ready() after it has created all its pins and is ready for use. If the executable name and the component name differ, use "halcmd loadusr -W -n component-name".

[Replacement of 'sleep' with 'loadusr -W']

[Replacement of 'wait-for-pin' with 'loadusr -W'; use of 'loaduser -Wn']

4.5. inifile units

Instead of specifying [AXIS_*]UNITS as a decimal number, specify [TRAJ]LINEAR_UNITS and [TRAJ]ANGULAR_UNITS as unit names, including "inch", "mm", "degree", and "radian". The old [AXIS_*]UNITS syntax is still supported, however. [diff]

4.6. "HAL: WARNING: blocks is deprecated, please use the subcomponents generated by 'comp' instead"

In emc 2.1, a new tool called "[comp]" makes it easy to create HAL components. All the items that are in the 'blocks' module have been broken into separate modules such as 'ddt', 'wcomp', and so on.

No corrective action is needed at this time, because 'blocks' will still be present in the 2.1 series. However, it may be removed in the 2.2 series, and changes to HAL files will be required at that time.

If you wish to silence this warning, then change a line like

 loadrt blocks ddt=6 wcomp=6
to
 loadrt ddt count=6
 loadrt wcomp count=6

[Replacement of 'blocks' with individual components]

4.7. elimination of "period" from most HAL components

In version 2.0.x, many HAL components would accept a command line argument "period" (or "periodfp", or other variations on that theme). When "period" was specified, the component would create a realtime thread running at the specified period. This capability was _not_ used in normal EMC configurations; it was mostly used for testing. (In a normal EMC configuration, the servo and base periods are passed to motmod and it creates the threads.)

In version 2.1, the period argument has been removed from all HAL components. 'motmod' still creates the threads for EMC, and none of the sample configurations should need to be changed. For other applications such as testing, etc., there is now a component called "threads" which can create up to three threads. To create a thread, use "loadrt threads name1=<name-of-thread> period1=<period-in-ns>". To create more than one, use name2, period2, and name3, period3. By default, "threads" creates floating point capable threads. If you don't need floating point, you can specify "fp1=0" (or fp2=0 or fp3=0) to turn off floating point support for one or more threads. Disabling floating point support might save a microsecond or so, and is commonly done for the "fast" thread for software encoder counting and step pulse or PWM generation.

4.8. elimination of s8, u8, s16, u16 HAL types

The number of HAL types has been reduced. "newsig" commands which formerly used one of those types should be converted to the corresponding 32-bit type, s32 or u32.

4.9. hal_ppmc uses ns units for setup-time, pulse-width, and pulse-space; pins renamed

Instead of being specified in units of 100ns, these values (now named setup-time-ns, etc) are in units of 1ns. [Changes to the sample USC configuration file]

4.10. the pin axis.N.index-pulse-in has been renamed to axis.N.index-enable

The name of the pin used for indexing (homing to index pulse) has been changed to be more descriptive. [Changes to the sample motenc configuration file]

4.11. the meaning of the 'comp.N.hyst' parameter has changed

In emc 2.0.x, the output of the comparator would not change until the difference between the inputs exceeded the hysteresis parameter, giving an effective hysteresis of double the parameter. Now, the output will change when the difference exceeds hyst/2. This more closely matches the [usual definition of hysteresis]. Existing users of the 'comp' block must change (double) the value of the 'comp.N.hyst' parameter. [Changes to the sample sim configuration file]

4.12. the connection to the lathe's spindle encoder has changed

In the preliminary lathe threading support in 2.0 versions, a "not" block was needed to connect the motion controller to the spindle encoder's index-enable pin. This is no longer necessary (and will not work). [changes to the sim/lathe.hal file]

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited June 6, 2010 6:07 am by JeffEpler (diff)
Search:
Published under a Creative Commons License