[Home]ContributedComponents

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Search:

Difference (from prior major revision) (no other diffs)

Added: 245a246
1.1.1.1. Parameter Saver



Added: 246a248,271
This userspace component will generate unlimited pairs of IN pins and OUT pins of each, of types float, s32 and bit.

The OUT pins can be overwritten by reading from a file, enabling components or widgets attached to those pins
to be initialised to known or saved values.

The IN pins can be connected to any suitable component pin or widget pin
The values received at the IN pins can be saved to file making settings persistent between shutdowns.

This comes into its own if you use my amended pyvcp_widgets
http://www.linuxcnc.org/index.php/english/forum/38-general-linuxcnc-questions/26427-setting-initval-of-a-spinbox-in-hal?start=27

Then you can link say the hal-pin of a spinbox to paramsaver.invalueF.00 and the new param-pin of the spinbox to paramsaver.outvalueF.00
Set paramsaver.writetrigger to true and create a file
Set paramsaver.readtrigger to true and the value will be inserted back into the spinbox.

Commandline switches:-

loadusr -W paramsaver f=NN s=NN b=NN filename=xxxxxxx onstart=0/1 onexit=0/1

See man page (paramsaver.9) in zip for full details

upload:paramsaver5.zip

Licence: GPL

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.1.4. Boxford Lathe ATC toolchanger component
2.1.1.5. Denford Orac Lathe ATC toolchanger component
2.1.1.6. Emco Turn 120 / Compact 6 Lathe ATC toolchanger component
2.1.2. Kinematics
2.1.2.1. millkins -- trivial kinematics extended by XY skew correction
2.1.2.2. XYZACkins -- 5-axis kinematics for a milling machine
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.1.3.6. enshu -- enshu toolchanger component
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.1.4. Generic component with support for multiple clients, Michael Haberler flavor
2.2.1.5. Generic component with support for multiple clients, Les Newell flavor
2.2.1.6. Altivar ATV71 VFD driver - atv
2.2.1.7. USB thermometer Microdia TEMPer1V1.2
2.2.1.8. Latching Shift Register I/O as a Port Expander
2.2.2. Other Userspace Components
2.2.2.1. Motherboard Sensors
2.2.2.2. Parameter Saver
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:

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.

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]. A Description can be found in this wiki at etherlab

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.1.4. Boxford Lathe ATC toolchanger component
Component controls 8 station ATC fitted to Boxford 240, 160 and 125
Works on degrees of movement, with ATC defined as rotary axis, so does not require index sensors.
Should be able to be adapted for any lathe using a 'rotate past pawl and reverse to lock' methodology.
Amount of rotation configurable for fine tuning, see README and notes in .comp file for details
upload:Boxford.tar.gz
License: GPL

2.1.1.5. Denford Orac Lathe ATC toolchanger component
Component controls 8 station ATC fitted to Orac lathe
Reads greyscale optical disc and compares to 3 sensor truth table to determine tool position
See header of comp file for full details and specimen hal file linkage
upload:oracchanger.comp
Licence: GPL

2.1.1.6. Emco Turn 120 / Compact 6 Lathe ATC toolchanger component
Component controls 8 station ATC fitted to Emco lathe
Reads greyscale optical disc and compares to 4 sensor truth table to determine tool position
Sample .hal file and connection pinout in file also
upload:emcochanger.txt
Licence: GPL

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.2.2. XYZACkins -- 5-axis kinematics for a milling machine

upload:XYZAC.tar.gz

Two rotary joints have been added: A around x-axis and C around z-axis. They may have offsets Y-offset and Z-offset. A vismach gui called XYZACgui is included to show actual machine movements. A sample Gcode file is included.

See README file for instructions to install and run a simulation of the Flange.ngc file

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

upload:prbs-fixed.c (the original above lacked a call to hal_ready()).
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.1.3.6. enshu -- enshu toolchanger component

upload:enshu.comp

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 .

I also wrote a utility to explore Modbus clients, which helped to write the vfs11-vfd driver. It is available at: http://git.mah.priv.at/gitweb/modio.git

Update: vfs11_vfd is now integrated into master. see src/hal/user_comps/vfs11_vfd .

2.2.1.4. Generic component with support for multiple clients, Michael Haberler flavor

This is an starting point for folks who would want a modbus driver for multiple identical modbus clients (in this case, modbus-capable servo amplififers):

http://git.mah.priv.at/gitweb/emc2-dev.git/shortlog/refs/heads/modbus-generic-driver

2.2.1.5. Generic component with support for multiple clients, Les Newell flavor

Les says:

This driver <http://www.shootspammers.org.uk/modbus.zip>; I wrote some time back will work with multiple modbus clients. They can be different or identical. You can even use multiple ports. All parameters are configured via an ini file.

upload:modbus.zip

2.2.1.6. Altivar ATV71 VFD driver - atv
This is a Modbus driver for An Altivar ATV71 VFD contributed by Martin Kaplan.

See http://git.mah.priv.at/gitweb/emc2-dev.git/shortlog/refs/heads/altivar-vfd-comp .

2.2.1.7. USB thermometer Microdia TEMPer1V1.2
This is HAL component for USB thermometer Microdia TEMPer1V1.2

upload:temper1.tar.gz

2.2.1.8. Latching Shift Register I/O as a Port Expander
This HAL component drives 74LS595 and 74LS597 latching shift registers (or equivalent) for a cheap and easy way to add I/O lines to your port. The shift registers can be daisy-chained together to provide pins in multiples of 8. As currently configured, the component will create 16 input and 16 output lines, requiring only 3 output and 1 input pin on your existing port.

For a complete write-up, see http://www.shafferhouse.org/linuxcnc/LinuxCNCShiftRegisters.pdf

upload:lsrio16.comp

2.2.2. Other Userspace Components

2.2.2.1. Motherboard Sensors

This is a python component that will extract all the sensor readings for the motherboard/CPU/fan and make them available as HAL pin values. These Temperature, RPM, Voltage readings can then be displayed in a pyVCP, or used in any other interesting manor. When the script starts up, it will parse and create the various output pin values on the fly based on what it finds in the output from the 'sensors' command.

http://www.linuxcnc.org/images/fbfiles/files/sensors.txt

2.2.2.2. Parameter Saver

This userspace component will generate unlimited pairs of IN pins and OUT pins of each, of types float, s32 and bit.

The OUT pins can be overwritten by reading from a file, enabling components or widgets attached to those pins to be initialised to known or saved values.

The IN pins can be connected to any suitable component pin or widget pin The values received at the IN pins can be saved to file making settings persistent between shutdowns.

This comes into its own if you use my amended pyvcp_widgets http://www.linuxcnc.org/index.php/english/forum/38-general-linuxcnc-questions/26427-setting-initval-of-a-spinbox-in-hal?start=27

Then you can link say the hal-pin of a spinbox to paramsaver.invalueF.00 and the new param-pin of the spinbox to paramsaver.outvalueF.00 Set paramsaver.writetrigger to true and create a file Set paramsaver.readtrigger to true and the value will be inserted back into the spinbox.

Commandline switches:-

loadusr -W paramsaver f=NN s=NN b=NN filename=xxxxxxx onstart=0/1 onexit=0/1

See man page (paramsaver.9) in zip for full details

upload:paramsaver5.zip

Licence: GPL

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]

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited May 22, 2013 7:35 am by ArcEye (diff)Published under a Creative Commons License