2-speed spindle configuration - help

More
08 Mar 2021 17:17 #201450 by Jaro
Yes , 2 speed transsmision is working nice.

File Attachment:

File Name: schaublin_...3-08.ini
File Size:4 KB

File Attachment:

File Name: schaublin_...3-08.hal
File Size:20 KB
Attachments:
The following user(s) said Thank You: J Green

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

More
08 Mar 2021 18:03 #201454 by J Green
Thank You very much
Glad you got it working . Your latest HAL an INI files will help many others in coming up with a solution a for 2 speed transmission . Saving the constantly reinventing of a wheel..
Bob

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

More
09 Mar 2021 08:04 - 04 Apr 2021 16:29 #201522 by RotarySMP
Jaro, I would love to see some pictures of your machine and conversion.
Mark
Last edit: 04 Apr 2021 16:29 by RotarySMP.

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

More
03 Apr 2021 11:51 #204612 by foxington
Hello folks,

excuse me - I am new here. I need some brain stroming for gearchange for project of turn retrofit which I am doing now(pic below). It is my first real machine retrofit if we will not count alu profiles mills etc...

It has manual gearchange lever in from panel. It has 3 static position at gearbox 1st gear-neutral-2nd gear.
1st and 2nd gear have sensors if it is shifted NO character when shifted. Neutral has no signal both are opened. These signals I have connected to digital ins at 7i76e unit.
1st gear has 1/1 gear ratio which is "something less" - 3000 rpms. 2nd gear has 1/6 gear ratio which is 0 - 500 rpms.

I read tons of topic about this problematic. I do not know if I am right if I am wrong please make it clear to me.
I need to create some program (I am familiar with C/C++) which should be started via spindle cw or ccw command.
I should create some component file which it will have name something like "my_custom_gearchange.comp" which I will include to .hal file. I will add them to real time "loadrt " and to servothread task.

Then I need to read some variabiles for my custom component like are:
spindle_on;
spindle_cw;
spindle_ccw;
g96_on;
g97_on;
input_signal_1st_gear shifted;
input_signal_2nd_gear shifted;
spindle_speed_comand;
spinde_at_speed; ... these guys I will take from .hall file?

after these steps C magic happend and I will have nice stabile working gearchange please?

regards Foxind
Attachments:

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

More
03 Apr 2021 13:12 #204619 by andypugh
You shouldn't need a custom component. What you have should be easily managed by an existing component.
linuxcnc.org/docs/2.8/html/man/man9/gearchange.9.html
Is probably all you need. The system can treat neutral and gear 1 the same with little penalty. Unless you want to have specific behaviour in neutral?

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

More
04 Apr 2021 08:23 - 04 Apr 2021 08:33 #204719 by foxington
Thanks, I will save default gearchange.comp at safe place. where I will find gearchange.comp please? I need next functions from gearchange.comp program.

In neutral not turn on spinle at all and tell user about issue. telegram neutral shifted

In MDI mode I need to avoid run spindle at wrong gear with wrong speed. if it will be wrong gear or neutral it will abort program and it will tell you shift right gear. I need to show user telegram about what happpend and what issue is here.

in automatic run I need to G96 run only with 1/1 gear ratio and in G97 I need to run with both gears.
if will be wrong gear or neautal it will abort program and it will tell you shift right gear.
Last edit: 04 Apr 2021 08:33 by foxington.

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

More
04 Apr 2021 10:10 #204726 by andypugh
OK, that's slightly more complicated and will need a custom (or at least customised) .comp file.

One option is to create a number of extra (bit) outputs from the .comp that go to a "message" component .
Or you could just use rtapi_print_msg directly, but the message .comp has already got the logic set up. Also, if you decide that you want something more graphical it is easier to substitute it in (look at hal_manualtoolchange for how to pop up a dialog box on a hal pin input)
If you want to actually abort the program, then you will also need another bit output to net to halui .program.stop.

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

More
04 Apr 2021 11:34 #204738 by foxington
yes it is little bit complicated and messy to me becouse I am just plc && hardware guy not clear developer. Need to avoid human issuing factor from automatic process and it is everytime difficult process.

name of my machine from pncconfig is "my_lathe"

If I am undestand right, to dos next things - in config directory/my_lathe/ will create empty component named "my_gearchange_subrutine.comp"; and in same directory will create "message_popup.comp" for telegrams to user.

next I will add to "my_lathe.hal" file :

loadrt my_gearchange_subrutine
loadrt message_popup

addf my_gearchange_subrutine.0 servo-thread
addf message_popup.0 servo-thread

This steps will add custom components to .hal, after startup lcnc it will add everything else and my custom component to servothread loop which is runs every "xy ms" time?

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

More
04 Apr 2021 11:45 #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: foxington

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

More
05 Apr 2021 13:20 #204895 by foxington
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
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
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
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
https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/components/gearchange.comp
and then I tried
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.

Time to create page: 0.101 seconds
Powered by Kunena Forum