-
- 1. About this page
-
-
- 1.1. Purpose
-
- 1.2. How to add your component
-
- 1.3. How to compile and install a component
-
- 1.4. Legal
-
2. User Contributed Components
-
-
- 2.1. Realtime Components
-
-
- 2.1.1. Hardware Drivers
-
-
- 2.1.1.1. EtherCAT Digital I/O
-
- 2.1.1.2. CandCNC UBOB breakout board drivers and sample config
-
- 2.1.1.3. Mesa 7i32 micro-stepping motor driver
-
2.1.2. Kinematics
-
-
- 2.1.2.1. millkins -- trivial kinematics extended by XY skew correction
-
2.1.3. Other Components
-
-
- 2.1.3.1. linear8 -- Piecewise Linear interpolation with up to 8 data points
-
- 2.1.3.2. PRBS (Pseudo-Random Binary Sequence) signal generator
-
- 2.1.3.3. idb -- Inverse Deadband
-
- 2.1.3.4. toggle2nist -- Toggle button to nist logic
-
- 2.1.3.5. modmath -- Modmath functions, only mod_dir so far
-
2.2. Userspace Components
-
-
- 2.2.1. Userspace Hardware Drivers
-
-
- 2.2.1.1. Arduino: ADC, PWM, and digital I/O
-
- 2.2.1.2. USB HID device interface - hidcomp
-
- 2.2.1.3. Toshiba VF-S11 VFD driver - vfs11_vfd
-
2.2.2. Other Userspace Components
-
2.3. Other
-
-
- 2.3.1. Ladder Logic
-
- 2.3.2. Virtual Control Panel (pyvcp and halvcp)
-
1. About this page
1.1. Purpose
This page is a place for users to contribute HAL components and other EMC2/HAL-related information in the hope that they will be useful to others.
See also:
ContributedHalFiles
1.2. How to add your component
Follow the
BasicSteps so that you can edit the wiki. Use the "Upload" link at the top of this page to upload your component as a .c, .py, .comp, or .tar.gz file. Then add a new section to this page with a short description of your component and a link to the file you uploaded.
1.3. How to compile and install a component
First, install the
emc2-dev (sudo apt-get install emc2-dev) and
build-essential packages (sudo apt-get install build-essential). If the component does not provide specific installation instructions, then try these general instructions:
- If a file called 'Makefile' is included:
- make && sudo make install
- Userspace component ending in .py:
- chmod 755 component.py && sudo cp component.py /usr/local/bin/component
- Userspace component ending in .comp or .c:
- sudo comp --install --userspace component.comp
- Realtime component ending in .comp or .c:
- sudo comp --install component.comp
1.4. Legal
Clearly label each submission with its license. Submissions hosted on linuxcnc.org must be as free or freer than emc2. This means approximately that they have a license accepted under the
[Debian Free Software Guidelines]. GPL and LGPL are two examples of permitted licenses. "Free For Noncommercial Use" is an example of a non-permitted license.
- For all types of file, include the standard license block indicated by the license being used.
- For ".c" components, also specify MODULE_LICENSE("...");.
- For ".comp" components compatible with EMC2.1 and later, also specify MODULE_LICENSE("...");.
- For ".comp" components compatible with EMC2.2 and later, also specify license "...";
2. User Contributed Components
2.1. Realtime Components
2.1.1. Hardware Drivers
2.1.1.1. EtherCAT? Digital I/O
upload:emc2_ethercat.tar.gz.tar
License: GPL
This component uses the IGH [EtherCAT Master library] to talk to a EtherCAT? connected [DigIO Terminal].
2.1.1.2. CandCNC? UBOB breakout board drivers and sample config
upload:candcnc_ubob.tar.bz2
License: GPL
There are two components in this file and a sample config for using the [CandCNC] UBOB breakout board. The config is currently missing some important features such as using the external E-stop signal, but will show the basics needed to set up these breakout boards. The components drive the multiplexed inputs and the serialized outputs.
2.1.1.3. Mesa 7i32 micro-stepping motor driver
Component to convert step and direction signals from a step generator to current intensity for a dac that drives the 7i32 hardware.
currently does 1/2 and 1/8 micro stepping
Possible to compensate for angular error by changing the intensity ramp data
I haven't used this to move anything important -it is experimental- improve it!
Chris Morley c/o emc-developers@lists.sourceforge.net
upload:mesa7i32driver.comp
2.1.2. Kinematics
2.1.2.1. millkins -- trivial kinematics extended by XY skew correction
upload:millkins.c
License: GPL
Info from a recent IRC discussion
compile & install millkins.c as per instructions at top of page
change 'loadrt trivkins' to 'loadrt millkins' in hal file
add a 'setp millkins.skew #.###' to set the amount of correction to apply
'#.### is unitless and derived from mm/mm of skew or in/in of skew
2.1.3. Other Components
2.1.3.1. linear8 -- Piecewise Linear interpolation with up to 8 data points
upload:linear8.comp
License: GPL
This component is useful for obtaining a closer relationship between S- speed commands and spindle speed when the spindle's response to a PWM input is nonlinear.
2.1.3.2. PRBS (Pseudo-Random Binary Sequence) signal generator
upload:prbs.c
License: GPL
prbs.c is an HAL module for generating the PRBS (Pseudo-Random Binary Sequence)
signal. This signal is basically used as an excitation signal at the reference
input. PRBS is used because of its rich frequency spectrum. This "prbs.c" is
based on the algorithm provided in the following book,
Landau, Digital Control Systems,
http://landau-bookic.lag.ensieg.inpg.fr/english/index.htm
It has been used to identify to the axial dynamics in closed loop ( the book
site provide the tools). With the model, it is possible to design advanced controllers rather
than PID controllers for the axial servo drive. Thus, the positioning
and tracking accuracy of the servo drive can be improved, the final
accuracy of the parts can also be improved. But much work needs to be
done yet.
2.1.3.3. idb -- Inverse Deadband
Useful for torque-mode servo amplifiers that don't respond to DAC output in some interval around zero.
http://www.anderswallin.net/2008/04/idb-inverse-deadband-component-for-emc2/
2.1.3.4. toggle2nist -- Toggle button to nist logic
useful for setting things like coolant from a momentary-on pushbutton.
http://www.anderswallin.net/2008/04/toggle2nist/
2.1.3.5. modmath -- Modmath functions, only mod_dir so far
Useful for tool changers, especially carousels that wrap, such as when the last tool wraps to tool one, or tool one to the last.
In .hal use:
"
loadrt modmath mod_dir=N
...
addf mod-dir.0 servo-thread
...
addf mod-dir.N servo-thread
This will create these pins:
"
halcmd show pin mod-dir
Component Pins:
Owner Type Dir Value Name
8 s32 IN 0 mod-dir.0.actual
8 s32 IN 0 mod-dir.0.desired
8 bit OUT FALSE mod-dir.0.down
8 s32 I/O 15 mod-dir.0.max-num
8 s32 I/O 0 mod-dir.0.min-num
8 bit OUT TRUE mod-dir.0.on-target
8 bit OUT FALSE mod-dir.0.up
8 bit I/O TRUE mod-dir.0.wrap
"
"up", "down", and "on_target" are bit outputs that tell whether to go up, down, or nowhere. Exactly one of those will be "1" at any time.
"actual" and "desired" are integer inputs that tell where the carousel is and where you want it, respectively.
"max" and "min" are the highest and lowest tool slot numbers. Note that tool numbers actually start with 1, so you may need to fiddle with the desired/actual values and/or the requested slot output to the tool changer) to get the tool you really want.
"wrap" is a bit input which you probably want to set true, if the changer is a carousel. If set true, then it's assumed that max is next to min and you can get from min to max by going "back" one and wrapping around.
(modmath end KW 2010/03/10)
2.2. Userspace Components
2.2.1. Userspace Hardware Drivers
2.2.1.1. Arduino: ADC, PWM, and digital I/O
"Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software". The Arduino diecimila board offers 6 ADC channels, 6 PWM channels, and 6 digital I/O channels. 'arduino' is a HAL driver and associated firmware for this device.
See http://axis.unpy.net/01198594294 for more information and to download the driver.
2.2.1.2. USB HID device interface - hidcomp
hidcomp provides an interface to USB HID (Human Interface Device) devices. This includes joysticks, games pads, multimedia controlers, etc. A GUI program is used locate, test and configure the devices.
See http://www.franksworkshop.com.au/EMC/hidcomp/hidcomp.htm for more information and to download the applications.
2.2.1.3. Toshiba VF-S11 VFD driver - vfs11_vfd
vfs11_vfd controls an VF-S11 through a serial Modbus connection. See the man page at
http://mah.priv.at/src/vfs11_vfd/vfs11_vfd.html .
The VF-S11 doesnt have a standard RS-232 port - here is a little converter to connect a VF-S11 to an RS-232 port [upload:vfs11-rs232.pdf], based on a note from Toshiba support: [upload:VFS11-RJ45_e.pdf]
The current stable version can be found at http://git.mah.priv.at/gitweb/vfs11-vfd.git . An older version is archived at http://emergent.unpy.net/files/sandbox/vfs1_vfd.tar.gz.
2.2.2. Other Userspace Components
2.3. Other
2.3.1. Ladder Logic
Upload a screenshot of the ladder logic rung(s) and an explanation of the inputs and outputs. and add the .clp file
also see:
ClassicLadderExamples for other examples
2.3.2. Virtual Control Panel (pyvcp and halvcp)
A testpanel and script for the m5i20 using hostmot4 driver.
[
upload:testpanel.tar.gz]