2-speed spindle configuration - help

More
5 years 6 months ago #204745 by andypugh
I would start with the built-in "message" component.

And for the gearchange component, start with the existing file and modify it. github.com/LinuxCNC/linuxcnc/blob/master...ents/gearchange.comp
The syntax and install process is documented here:
linuxcnc.org/docs/2.8/html/hal/comp.html
The following user(s) said Thank You: endian

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago #204895 by endian
I do not know what i am doing wrong, i am greenhorn in lcnc thats it.. I read all HAL topics in manual and tried every example from there....
I have installed
Code:
Linux cnc 4.19.0-16-rt-amd64 #1 SMP PREEMPT RT Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux
I tried install -dev but it is already installed
Code:
Reading package lists... Done Building dependency tree Reading state information... Done linuxcnc-uspace-dev is already the newest version (1:2.8.1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
then I tried
Code:
cnc@cnc:~$ halcompile --install gearchange.comp Traceback (most recent call last): File "/usr/bin/halcompile", line 1502, in <module> main() File "/usr/bin/halcompile", line 1472, in main process(f, mode, outfile) File "/usr/bin/halcompile", line 1326, in process a, b = parse(filename) File "/usr/bin/halcompile", line 428, in parse f = open(filename).read() IOError: [Errno 2] No such file or directory: 'gearchange.comp'
then I tried create file "gearchange.comp" in lcnc configuration folder and copy and paste code from here
Code:
https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/components/gearchange.comp
and then I tried
Code:
cnc@cnc:~$ cd /home/cnc/Desktop/vturn_410/ cnc@cnc:~/Desktop/vturn_410$ ls backups custom_postgui.hal gvcp-panel.ui vturn_410.hal custom.clp gearchange.comp postgui_call_list.hal vturn_410.ini custom_gvcp.hal gvcp_call_list.hal shutdown.hal custom.hal gvcp_options.hal tool.tbl cnc@cnc:~/Desktop/vturn_410$ halcompile --install gearchange.comp sh: 1: make: not found

where am I wrong please?

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago #204898 by andypugh
The first problem was that the file didn't exist.
It needs to be in the folder that you are "in" when you type the halcompile command

The second problem seems to be that you don't have maketools installed. Try
Code:
sudo apt-get install build-essential
The following user(s) said Thank You: RotarySMP, endian

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago - 5 years 6 months ago #204901 by endian
Code:
sudo apt-get install build-essential
command i saw in one topic and it looks to me less relevat for me but has not.

I already installed them and try it again...
Code:
ls autosave.halscope Documents linuxcnc Pictures Templates Desktop Downloads Music Public Videos cnc@cnc:~$ cd linuxcnc cnc@cnc:~/linuxcnc$ ls configs nc_files cnc@cnc:~/linuxcnc$ cd configs cnc@cnc:~/linuxcnc/configs$ ls vturn_410 vturn_410.pncconf cnc@cnc:~/linuxcnc/configs$ cd vturn_410 cnc@cnc:~/linuxcnc/configs/vturn_410$ ls backups custom_postgui.hal gvcp-panel.ui vturn_410.hal custom.clp gearchange.comp postgui_call_list.hal vturn_410.ini custom_gvcp.hal gvcp_call_list.hal shutdown.hal custom.hal gvcp_options.hal tool.tbl cnc@cnc:~/linuxcnc/configs/vturn_410$ halcompile --install gearchange.comp Compiling realtime gearchange.c Linking gearchange.so cp gearchange.so /usr/lib/linuxcnc/modules/ cp: cannot create regular file '/usr/lib/linuxcnc/modules/gearchange.so': Permission denied make: *** [/usr/share/linuxcnc/Makefile.modinc:105: install] Error 1

one error above

edited *****

need to add "sudo"
Code:
cnc@cnc:~/linuxcnc/configs/vturn_410$ sudo halcompile --install gearchange.comp
Last edit: 5 years 6 months ago by endian.

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago #205282 by endian
Gearchange.comp is called every time when is M3/M4 shifted or it is running all time long at LCNC background powered by thread task? it is not fully clear to me yet.

definition from manual
Code:
Component When we talked about hardware design, we referred to the individual pieces as parts, building blocks, black boxes, etc. The HAL equivalent is a component or HAL component. (This document uses HAL component when there is likely to be confusion with other kinds of components, but normally just uses component.) A HAL component is a piece of software with well-defined inputs, outputs, and behavior, that can be installed and interconnected as needed.

and for customizing components should I use "vocabulary" of system parameters like next example for G96 and G96?

vocabulary from here - 3.5 System Parameters - linuxcnc.org/docs/2.8/html/gcode/overvie...#cha:g-code-overview

#<_spindle_rpm_mode> - Return 1 if spindle rpm mode (G97) is on, else 0.

#<_spindle_css_mode> - Return 1 if constant surface speed mode (G96) is on, else 0.
Code:
if(spindle_rpm_mode){ //some code; } else{ if(spindle_css_mode){ //some code; } else{ //error code; //exit; } }

or if not, when should I found and information which mode is selected please?

thanks

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago #205284 by andypugh

foxington wrote: Gearchange.comp is called every time when is M3/M4 shifted or it is running all time long at LCNC background powered by thread task? it is not fully clear to me yet.


If it is added to the servo thread it runs every 1mS.
The following user(s) said Thank You: endian

Please Log in or Create an account to join the conversation.

Time to create page: 0.105 seconds
Powered by Kunena Forum