2-speed spindle configuration - help

More
05 Apr 2021 13:30 #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
sudo apt-get install build-essential
The following user(s) said Thank You: RotarySMP, foxington

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

More
05 Apr 2021 13:42 - 05 Apr 2021 13:44 #204901 by foxington
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...
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"
cnc@cnc:~/linuxcnc/configs/vturn_410$ sudo halcompile --install gearchange.comp
Last edit: 05 Apr 2021 13:44 by foxington.

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

More
07 Apr 2021 19:33 #205282 by foxington
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
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.
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
07 Apr 2021 19:50 #205284 by andypugh

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: foxington

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

More
08 Apr 2021 19:06 #205345 by foxington

If it is added to the servo thread it runs every 1mS.


i probably something missing but for 3 days I am looking for how should I correctly identify if is G96 or G97 shifted for next executing the program. But without any success. Do you know any right way where I can find this "information" or any temp for next using, which mode is actual for custom component please that what we talked about above?

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

More
08 Apr 2021 19:30 #205349 by andypugh
I don't know if you can tell.

Why do you need to know?

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

More
09 Apr 2021 15:54 - 09 Apr 2021 16:00 #205441 by foxington
Just information if program will run in G96 or G97 for right gearchange at my lathe before I will turn on spindle

need to identify if is CSS or if is Constant RPMs. but in pin section of HAL configuration I can find any variable for it.
Last edit: 09 Apr 2021 16:00 by foxington.

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

More
09 Apr 2021 17:40 #205451 by andypugh
I don't think that knowing CSS or not helps with gear choice, as you can't really tell if the G-code will be turning an OD or boring a hole.

Can your gearbox change gears "on the fly"? On my lathe I have electromagnetic clutches, and I allow a gear-shift during a G0 move.

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

More
10 Apr 2021 07:37 #205509 by foxington
Let we start from beginning for better explanation.

I have converted lathe to cnc by mach3 and I have a lot of system fails and crashes from nothing. Then I discovered world of lcnc which looks to me better for every side.

I have lathe with gearbox with 2 speeds. 1st has gear ratio 1/6 and 2nd has gear ratio 1/1. Gearbox has not any clutch just manual lever in front panel with 3 stable position/0-500/Neutral/500-3000/... which you have to shift before spindle will turn on.

It is powered by vfd(0-10V) signal by 5.5kw asynchronous motor. It has not too much torque in low speeds below 300 rpms and if it will go in G96 mode in roughing cycle with high depth of cut I am afraid of it will stopped and I will crash the machine.

Old system does not give me any chance to change the gear during program running and therefore I had to shift right speed before program stared.

I found some rules of controlling, It was controlled by next rules:
1. program run in G96 mode runs only in gear ratio 1/1
2. program run in G97 S0-500 mode runs only in gear ratio 1/6
3. program run in G97 S500-3000 mode runs only in gear ratio 1/1

Command tells system : "G96 S120 /*buddy, there we have CSS, shift gear 1/1*/"

But in lcnc is possible other better way then was my old, I do not know if I am at right way and my solution is possible in lcnc.

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

More
10 Apr 2021 09:52 #205514 by andypugh
Firstly, I have a system much like yours. I have a manual override on the gearbox control switch, so I can lock it in high or low.
You don't need that. Can you trust the operator to know when to ignore the request to change gear?

G-code can read back the mode: linuxcnc.org/docs/2.8/html/gcode/overvie...ub:system-parameters
As can Python: linuxcnc.org/docs/2.8/html/config/python...xcnc_stat_attributes (see the "gcodes" attribute)

If you want the mode as a HAL pin, then you can probably use Gstat to create it, see the first example here:
linuxcnc.org/docs/2.8/html/gui/GStat.html
And the "css-mode"callback.

I am not 100% sure that the GStat HAL pin and the change in S would be synchronised.

What might work better would be to remap the S command to call a Python script. This could look at the speed command and the css mode and set things accordingly.
linuxcnc.org/docs/2.8/html/remap/remap.h...ng_codes_s_m0_m1_m60
(Remapping is a big and complex subject, however)

What should also work is a modified version of hal_manualtoolchange that is triggered by the spindle turning on, and which looks at the G-codes status before deciding which message to display.

So, in summary I can think of at least 5 ways to do what you ask, and I am not sure which would work best for you.

At this point I would suggest separating the messaging from the motor speed calculation. Leave the HAL component as it is, just calculating motor speed based on lever position.

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

Time to create page: 0.087 seconds
Powered by Kunena Forum