Using Spindle and Axis C commands simultaneously

More
19 Dec 2020 19:09 #192469 by chris@cnc
One way could be write subroutine with G28 for homing und M101. It's possible to make pyvcp button. Ask google for subprogram linuxcnc button. I never do it before but it must be working.

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

More
20 Dec 2020 20:12 - 20 Dec 2020 20:13 #192570 by chris@cnc
Hi Rick, did it work? One question, how did you switch the speed and position mode. I'm also trying to switch my A-axis between speed and position mode but it doesn't work. Do you have an example. Can I also e.g. A1000 M3 programming?
Last edit: 20 Dec 2020 20:13 by chris@cnc.

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

More
21 Dec 2020 01:42 - 21 Dec 2020 01:44 #192594 by RBC
Not completely. It still does not work when I run M101 after a M102.
It works in M101 or M102.
Most likely because there is a value left in the Mesa board feedback. User PCW said he added a reset feature to the stepgen in hostmot2. This way I should be able to reset after a spindle mode and run angle mode. Should be released soon to master.
It may also be possible to use offset class to zero out the value.
In my case, I would like to turn the A axis to 0 degrees after a spindle run, so I can keep the correct orientation for A axis mode.

I will work on it more tomorrow. I will paste what I have so far for M101 and M102 tomorrow.

It would be very cool if this can be done though. Lathe with live tools.
Last edit: 21 Dec 2020 01:44 by RBC. Reason: typo

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

More
21 Dec 2020 03:25 - 21 Dec 2020 03:25 #192604 by PCW
The position reset change has been pushed so the stepgen now has a position-reset pin
that zeros the position feedback. Note that you would always use velocity mode for the
steppgen, with the stepgens velocity command coming from the spindle speed in spindle
mode and from the PID component in C mode.
Last edit: 21 Dec 2020 03:25 by PCW. Reason: reformat a bit
The following user(s) said Thank You: tommylight, chris@cnc, RBC

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

More
22 Dec 2020 21:15 #192861 by chris@cnc
Hi Rick,
with remap is it possible to run a subprogram behind a M-Code. So could it possible to call M103 and this call subprogram turning.ngc.
And in this could go home before switch M101 to turning mode.
O<turning> sub

G0 
G91
G28 C0
M101
G90

O<turning> endsub

M2
Unfortnetly i am not able to get this remap running or switch my spindle generally from truning to angle mode.

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

More
30 Dec 2020 16:22 #193558 by RBC
Hi Chris-
I tried running G91, G28 C0, and M101 in MDI mode. However, the position feedback from MESA is still pushed to the position-fb and joint error pops up.
So I will need to use PCW s new reset pin.
I don't have any experience how to use the new hostmot2 from master.
Do you know how to do this?
I am pretty sure, it will work after this. The only thing left would be to rotate the C to 0 after a spindle run. So you can switch between spindle and angle multiple times without loosing position.

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

More
30 Dec 2020 18:32 - 30 Dec 2020 18:35 #193570 by chris@cnc
I've tried but the new module doesn't work. I suspect that I'm doing something wrong when compiling.
My way
First package git and build-essential install
sudo apt-get install git
sudo apt-get install build-essential
then with
git clone https://github.com/LinuxCNC/linuxcnc/
load the source.

In the directory ~. / linuxcnc / src / hal / drivers / mesa-hostmot2
I've already found the new source.
compile
  halcompile --compile hostmot2.c

Works, but the file is a lot smaller than the original in
/ usr / lib / linuxcnc / modules / and now I get an error message
hostmot2: dlopen: /usr/lib/linuxcnc/modules/hostmot2.so: undefined symbol: hm2_pwmgen_print_module
./1-ini.hal:4: waitpid failed /usr/bin/rtapi_app hostmot2
./1-ini.hal:4: /usr/bin/rtapi_app exited without becoming ready
./1-ini.hal:4: insmod for hostmot2 failed, returned -1
6685

Maybe someone can help and tell how to compile the new hostmot2.c.
Last edit: 30 Dec 2020 18:35 by chris@cnc.

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

More
30 Dec 2020 18:56 - 30 Dec 2020 20:40 #193578 by RBC
I did the same as you did just now, the hostmot2.so file is around 139kB, the original was 151Kb, and it gave me a pwmgen error. I have tried this on 2.9.0.pre0-241-g92d5600e6.
Last edit: 30 Dec 2020 20:40 by RBC. Reason: typo

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

More
30 Dec 2020 23:20 #193592 by chris@cnc

The position reset change has been pushed so the stepgen now has a position-reset pin
that zeros the position feedback. Note that you would always use velocity mode for the
steppgen, with the stepgens velocity command coming from the spindle speed in spindle
mode and from the PID component in C mode.


can you give us a little push. I think we only forgot one file when compiling.

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

More
30 Dec 2020 23:29 - 30 Dec 2020 23:51 #193593 by PCW
You do not compile the driver with halcompile,
you recompile the LinuxCNC master source
(or fetch a master binary from the buildbot)
Last edit: 30 Dec 2020 23:51 by PCW.

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

Time to create page: 0.160 seconds
Powered by Kunena Forum