|
This page is a place for users to contribute HAL components and other LinuxCNC/HAL-related information in the hope that they will be useful to others. |
|
This page is a place for users to contribute HAL components and other LinuxCNC/HAL-related information in the hope that they will be useful to others. |
|
**LinuxCNC versions 2.6.n and earlier: |
|
**LinuxCNC versions 2.6.n and earlier: |
|
**LinuxCNC versions 2.7.0 onwards |
|
**LinuxCNC versions 2.7.0 onwards |
|
**LinuxCNC versions 2.6.n and earlier: |
|
**LinuxCNC versions 2.6.n and earlier: |
|
**LinuxCNC versions 2.7.0 onwards: |
|
**LinuxCNC versions 2.7.0 onwards: |
|
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. |
|
Clearly label each submission with its license. Submissions hosted on linuxcnc.org must be as free or freer than </nowiki>LinuxCNC</nowiki>. 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 ".comp" components compatible with EMC2.1 and later, also specify MODULE_LICENSE("...");. *For ".comp" components compatible with EMC2.2 and later, also specify license "..."; |
|
*For ".comp" components compatible with LinuxCNC (EMC2.1 and later), also specify MODULE_LICENSE("...");. *For ".comp" components compatible with LinuxCNC (EMC2.2 and later), also specify license "..."; |
|
[upload:testpanel.tar.gz] |
|
[upload:testpanel.tar.gz] |
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
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.
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
A variation of the original millkins file. Instead of just being able to correct one axis due to mechanical issues (skew), you can now adjust the Y axis as before, but with the addition of Z axis correction. This is used in case your Z axis does not move perpendicular to the XY plane (imagine drilling a hole with the drill straight up and down while moving at an angle downwards). This will not correct issues with the spindle not being perpendicular to your XY plane. It only corrects your Z axis not going straight up and down in relation to the XY plane.
Adjustments are for the Y, XZ and YZ planes. You will have 3 seperate entries in your HAL file. See below.
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).
Compile & install millkins_xyz.c: sudo comp --install ~/linuxcnc/configs/my-mill/millkins_xyz.c
Change 'loadrt trivkins' to 'loadrt millkins_xyz' in hal file
Add a 'setp millkins_xyz.skew_y #.###' to set the amount of correction to apply in "Y"
Add a 'setp millkins_xyz.skew_xz #.###' to set the amount of correction to apply in "XZ plane"
Add a 'setp millkins_xyz.skew_yz #.###' to set the amount of correction to apply in "YZ plane"
'#.### is unitless and derived from mm/mm of skew or in/in of skew
upload:skew%20instructions.txt
upload:millkins_xyz.c
License: GPL
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
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.
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.
http://www.anderswallin.net/2008/04/idb-inverse-deadband-component-for-emc2/
useful for setting things like coolant from a momentary-on pushbutton.
http://www.anderswallin.net/2008/04/toggle2nist/
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-dirComponent 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
""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)
Component to generate a sine sweep. This may be used to find mechanical resonances in the LinuxCNC-controlled machine so they can be actively dampened. Example HAL snippets to use this:
# Load component, setup parameters. Be careful with the amplitude; a resonating machine loadrt sinesweep addf sinesweep.0 servo-thread setp sinesweep.0.start-freq 10.0 setp sinesweep.0.end-freq 500.0 setp sinesweep.0.sweep-duration 30.0 setp sinesweep.0.log-sweep 1 setp sinesweep.0.amplitude 1.0
# inject sine signal into a servo loop. Injecting it as torque or current directly into a servo amp would be great, but velocity or position works too. net sweep-inject sinesweep.0.output => servo_pid.bias
When the component is setup, start halscope and add traces on sinesweep.0.start, sinesweep.0.curr-freq and the velocity signal coming from the servo encoder. Setup triggering on sinesweep.0.start rising edge. Now, go to a terminal and execute the command 'halcmd setp sinesweep.0.start 1'. Halscope triggers and plots the response for you. The locations in the plot where there are significant peaks in the velocity signal from the servo are likely resonances. Dampening of these resonances can be done either mechanically or partially electrically by using 'biquad' components in notch mode.
A more powerful method of plotting and evaluating the results of a sine sweep would be to use 'sampler' and 'halsampler' to log the data to a file, and parse that file using your favorite data processing application (MatLab?, Octave, Excel, Calc, etc.)
Component to generate white noise. Useful for finding system resonances or to reduce servo hunting by adding a tiny bit of noise to the servo signal.
See http://axis.unpy.net/01198594294 for more information and to download the driver.
See http://www.franksworkshop.com.au/EMC/hidcomp/hidcomp.htm for more information and to download the applications.
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 .
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
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.
See http://git.mah.priv.at/gitweb/emc2-dev.git/shortlog/refs/heads/altivar-vfd-comp .
Controls a Danfoss VLT5000 series VFD through an RS485 link using the Danfoss FC Protocol.
Documentation:
Compile the documentation using 'comp --document vlt5000_vfd.comp'.
The resulting manpage (vlt5000_vfd.9) can be viewed with 'man ./vlt5000_vfd.9' or copied to a standard location.
Installation: comp --install vlt5000_vfd.comp
Usage: loadusr -W vlt5000_vfd --device=<yourserialport>
This component is tested using a Danfoss VLT5008 VFD, an FTDI USB-COM485-PLUS1 USB->RS485 converter module and LinuxCNC 2.7.0~pre
The basic functionality of starting/stopping the motor and setting the reference speed probably also works on other VLT drives. Extended functionality such as reading the actual motor power probably doesn't.
If you use this component successfully on other VLT drives, please let me know (dabit weird A character icecoldcomputing littlepoint com)
For a complete write-up, see http://www.shafferhouse.org/linuxcnc/LinuxCNCShiftRegisters.pdf
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.
https://forum.linuxcnc.org/media/kunena//attachments/legacy/files/sensors.txt
This userspace component will generate up to 1000 (0 - 999) 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=NNN s=NNN b=NNN filename=xxxxxxx onstart=0/1 onexit=0/1
See man page (paramsaver.9) in zip for full details
Licence: GPL