Calling subroutine from mdi?

More
26 Nov 2016 22:59 #83352 by Hakan
I have tested to call a subroutine from the mdi and get a result I didn't expect.
I don't seem to be able to use constant surface speed when calling the subroutine
from the mdi, instead a constant rpm is selected for the spindle, from the S parameter.
When I write the very same line in a file.ngc and run that, the CSS works,
the spindle speed up and down as expected when moving in X.

That's how it is for me in gmoccapy in 2.7.6 and also in master. In axis, css works.

I attach the ngc file with the subroutine. I call it with
o<test4321> call [20] [200] [1] [0.1] [-10] [5] [0] [1]

I did take screenshots when running from mdi and from file.
I attach them as well. I can see that there are differences.

File Attachment:

File Name: test4321.ngc
File Size:1 KB


Attachments:

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

More
28 Nov 2016 16:00 #83395 by andypugh
at 200 m/min surface speed and D = 2000 is it possible you are just bouncing off the top spindle speed at 10mm radius?

2000 rpm and 200m/min is 16mm radius, 32mm dia (by my calculations)

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

More
28 Nov 2016 21:14 #83404 by newbynobi
I am surprised, that you did mot get an error, as you start a G96 move and you turn on the spindle after that move!

G96 Example Line

G96 D2500 S250 (set CSS with a max rpm of 2500 and a surface speed of 250)

It is an error if:

S is not specified with G96

A feed move is specified in G96 mode while the spindle is not turning

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

More
29 Nov 2016 09:28 #83419 by Hakan
Replied by Hakan on topic Calling subroutine from mdi?
Andy, perhaps you recognize the code snippets, it comes from your excellent lathemacro package. I can't make it work in gmoccapy. Under Axis it works though. I like colors a lot so I want to run it under gmoccapy. Do you know if your macros work under gmoccapy?
I have tried to make the example a bit cleaner and removed stuff I didn't fully understand.

The movement I have put in there is just a relative move + and - 10 mm from the position shown in the screen dumps, so I can hear the spindle speed change. In the mdi case, the spindle speed is constant at 200 rpm. In the file.ngc case, the spindle speed is perhaps 1000 rpm and changes as the X axis moves - like it should.

newbynobi: I am for sure not an expert of G code, but I thought G96 just specified how the spindle speed should behave. On the following line the spindle is started and some lines further on there is actual movements. There are no error messages.

I have tried to trace the command, and in the lathemacros case the command is executed by EMC_Action_MDI from glade, which is a more or less unknown environment to me.

It could of course be my configuration, but how should I start to investigate this?

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

More
29 Nov 2016 09:41 #83420 by andypugh

Andy, perhaps you recognize the code snippets, it comes from your excellent lathemacro package.

Yes, I did recognise some of the comments in the code :-)

It could of course be my configuration, but how should I start to investigate this?


The first thing I would test is a lower surface speed. The macros assume metric (though you could, of course, change this) and 200 m/min @ 10mm radius will definitely be pegging the spindle against the max speed limit set in the G-code (D 2000)

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

More
30 Nov 2016 08:32 #83477 by Hakan
Replied by Hakan on topic Calling subroutine from mdi?
I am 100% sure that Constant surface speed works as such. I can do manual facing and turning and the spindle speed adjusts perfectly, well inside the limits of the Huanyang vfd. Threading also works fine and includes small changes to the spindle rpm.

I am focusing in the observation that there are different results when calling the subroutine from gmoccapy MDI. Or from a file.ngc. That is what puzzles me and prevents me from using the lathemacros in gmoccapy. As mentioned, when I switch the one line in the ini file to use Axis instead, then all tabs in lathemacros works fine, they are tested. But it is in Axis of course.

I see that me screen dumps were fails. I intended to catch them in the middle of the motion, but both are obviously taken at the end of the move. Oh well.

I'll have to wait with actual tests for a week. The gearbox is dismounted and will get sealings against oil leakage.

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

More
30 Nov 2016 16:57 #83491 by newbynobi
Hallo Hakan,

sorry for the late reply, I am very bussy theese days.

What happen if you enter in the MDI window something like
G0 X 100
S 275 M3
G96 D2500 S250
G1 X10

Does the spindle speed change like it should?

I do not understand, why it works in Axis and not in gmoccapy, as both GUI uses the same interpreter and IMHO do handle the MDI commands in a identical way.

Norbert

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

More
30 Nov 2016 21:56 #83510 by Hakan
Replied by Hakan on topic Calling subroutine from mdi?
Yes this works as expected.
Then I wrote the commands as a subroutine and called that. Didn't work. Constant speed.
But I found out what is going on. I put in a G4 P10 after the static rpm command
to read out the rpm from the vfd - and after that the subroutine worked!?

Can it be that the spindle must be up to speed when the G96 command comes.
Why it isn't I don't know. There is a spindle-vfd.at-speed connected to motion.spindle-at-speed
in custom.hal. Perhaps that is not enough?
When I run the small command suite as a subroutine call in the MDI the speedup fails every time.
When I run it as a regular file it works every time.
When I run command by hand in MDI, the spindle speeds up as expected.
I put in a G4 P30 in the MDI and had time to enter the small command suite.
Result: Spindle didn't speedup as it should.
My assumption is the commands where then executed immediately after the G4.
So there is something with timing of commands, or many commands in a row.
Or spindle-at-speed?
Tried again with Axis - worked fine also with G4 P30.

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

More
01 Dec 2016 18:38 #83533 by newbynobi
Hallo Hakan,

I found the bug!
It is related with the spindle speed label, I found a solution, but it is only a work around.
I will push as soon as possible.

Norbert

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

More
01 Dec 2016 19:07 #83534 by newbynobi
Solved with gmoccapy 2.1.6.1,

Just pushed to master.

Solutions for 2.6 and 2.7 branch will follow soon!

Norbert

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

Moderators: newbynobiHansU
Time to create page: 0.264 seconds
Powered by Kunena Forum