Messed up program access

Moderators: TomKerekes, dynomotion

User avatar
TomKerekes
Posts: 984
Joined: Mon Dec 04, 2017 1:49 am

Re: Messed up program access

Post by TomKerekes » Wed Jan 08, 2020 6:36 pm

Hi Scott,

I think the issue is that the GCode Origin needs to be set at the time G96 is executed. The GCode Origin should not be changed without issuing a new G96. Executing G96 code sends all the information to KFLOP so it can control speed based on raw X position assuming a specified origin.

Your program issues the G96 first before the origin is even defined.

It then uses G92 to set/change the origin to make the DROs zero

It then moves to X=1 then calls the subroutine

The subroutine then uses G92 to change the origin 1 inch to make the DROs zero again

It then moves X back and forth, returns, moves to x = -1

The GCode shouldn't turn on the Spindle and enter CSS mode until the origin is defined and X is moved to some specified radius. Otherwise the commanded Spindle speed will be indeterminate.

Also remember for troubleshooting purposes we changed the update time to 2 seconds in order not to flood the Console Screen with diagnostic messages. So you will want to test with X movements taking many seconds in order to make sense of the results. I calculate 3 seconds for the movements which might be marginal and confusing.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

Scott Pancheau
Posts: 26
Joined: Sat Dec 28, 2019 10:52 pm

Re: Messed up program access

Post by Scott Pancheau » Thu Jan 09, 2020 2:36 pm

Hi Tom,
You have done it again. The CSS works perfect when you know what your doing. Thank you so much for all your help and your patience. I will now back things up and make myself notes to hopefully be in better shape if something happens to the systems again. I will then try to tackle the Mach 3 plug in and will likely have to lean on you again for that. While trying to tune the motor output I am getting sudden jerky moves that are not requested. I will try to get as far as I can before I bug you again. I feel much better now about retrofitting my big Mazak with Dynomotion.
Thank You Tom.
Scott

User avatar
TomKerekes
Posts: 984
Joined: Mon Dec 04, 2017 1:49 am

Re: Messed up program access

Post by TomKerekes » Thu Jan 09, 2020 5:01 pm

That's great progress Scott. Thank you for your attitude and patience.
Regards,

Tom Kerekes
Dynomotion, Inc.

Scott Pancheau
Posts: 26
Joined: Sat Dec 28, 2019 10:52 pm

Re: Messed up program access

Post by Scott Pancheau » Tue Jan 14, 2020 2:51 pm

Hi Tom,
I have gone as far as I know to do with Mach Turn. I have something set wrong for the spindle. I can home to the limit switches as per your settings. The X and Z axis seem to work properly for travel. They are tuned to give exact movement per the KMotion encoder readings for travel commanded. The spindle starts when commanded somtimes, but not always. The spindle speed is never at the command called, but I can get close by adjusting the percentage adjustment. Threading looks like it is working, but when actually tested it is not starting the thread at the same rotation each time. I did install the license file hoping that was the problem, but no change. Can you see a wrong setting?
Thanks,
Scott
Attachments
TURN SETUP USER SETTINGS.PNG
TURN SETUP OUTPUTS 1-13-20.PNG
TURN SETUP CONFIG CHECK 1-13-20.PNG
TURN SETUP 1-13-20.PNG

User avatar
TomKerekes
Posts: 984
Joined: Mon Dec 04, 2017 1:49 am

Re: Messed up program access

Post by TomKerekes » Tue Jan 14, 2020 4:32 pm

Hi Scott,

I think your Spindle Encoder is 2000 counts/rev not 1024 counts/rev as you have in the Mach3 Plugin Config. That would explain Threading not working.

Also Mach3 has this concept of "pulleys". So you would need to set which pulley is in use and set the max RPM for that pulley appropriately. Then make sure the Spindle C Program commands that speed when told to go 100% full speed by Mach3.

Not sure why the Spindle doesn't always start. You would need to troubleshoot it. The next time it fails look to why it isn't running. Is the Axis disabled? Anything printed on the Console?
Regards,

Tom Kerekes
Dynomotion, Inc.

Scott Pancheau
Posts: 26
Joined: Sat Dec 28, 2019 10:52 pm

Re: Messed up program access

Post by Scott Pancheau » Sun Jan 19, 2020 5:18 pm

Thanks again Tom for your help. I missed seeing the incorrect count entry. I think the threading is now working correctly. In regard to the spindle not turning on all the time in Mach turn, I tried to get a better observation of the way it is acting. Once the spindle is on, changing the speed seems to always work. M05 always works. When M03 or M04 work, the console shows the actual running condition. When the command does not work, the console just shows M03 or M04. Observing the DAC output, when the spindle fails to start there is no indication of a change in output for the spindle. I know Mach is not your thing but thought this might mean somthing to you. I included a shot of the console readings.
On another subject I wanted to see if you have any reccomendation. When trying to use the CSS it works correctly - adjusting the speed down when moving away from X center and speeds up when moving back in. In the attached example the spindle starts to slow back down 4 to 5 seconds before the X travel gets to the center or 0 position of X while moving in. That of course means I get a lower speed at the point I want the highest speed. It seem like the (look ahead?) is getting way out in front of the actual X position. Is there anything I can change or adjust in the program to get the actions to work together better?
Thanks,
Scott
Attachments
G96 TEST 1-18-20.txt
(107 Bytes) Downloaded 23 times
Console Mach Turn 1-19-20.PNG

User avatar
TomKerekes
Posts: 984
Joined: Mon Dec 04, 2017 1:49 am

Re: Messed up program access

Post by TomKerekes » Sun Jan 19, 2020 7:13 pm

Hi Scott,
In regard to the spindle not turning on all the time in Mach turn, I tried to get a better observation of the way it is acting. Once the spindle is on, changing the speed seems to always work. M05 always works. When M03 or M04 work, the console shows the actual running condition. When the command does not work, the console just shows M03 or M04. Observing the DAC output, when the spindle fails to start there is no indication of a change in output for the spindle. I know Mach is not your thing but thought this might mean somthing to you. I included a shot of the console readings.
I think the issue is that the way the C Program SpindleMach3Jog.c is written the S command is ignored when issued with the Spindle Off which is good and correct. But then if an M3/M4 (by itself) is issued to turn the Spindle On, the Spindle speed is not being set and remains zero.

The attached program should command the Speed properly for a M3/M4 issued by itself.


When trying to use the CSS it works correctly - adjusting the speed down when moving away from X center and speeds up when moving back in. In the attached example the spindle starts to slow back down 4 to 5 seconds before the X travel gets to the center or 0 position of X while moving in. That of course means I get a lower speed at the point I want the highest speed. It seem like the (look ahead?) is getting way out in front of the actual X position. Is there anything I can change or adjust in the program to get the actions to work together better?
Lookahead shouldn't be a problem. KFLOP commands the spindle speed instantly based on the instantaneous X position.

I think your Spindle Axis acceleration might be too low. In CNCLathe.c I see:
ch4->Accel=10000;

So for example to change speed from zero to 1500 RPM will take:
1500 RPM / 60sec/min x 2000 counts/rev = 50,000 counts/sec

The time to accelerate (ignoring Jerk) would take:
50,000 counts/sec / 10,000 cnts/sec^2 = 5 seconds.

Command a low Spindle RPM then a high RPM (1500) and observe how long it takes the speed to change. Then try increasing the Acceleration to make it faster but not so much that it faults.

Additionally, the feedback gains are very low:
ch4->P=0.05;
ch4->I=0;
ch4->D=0;

Only P Gain = 0.05. This means it will take some time to generate a large enough error to output the needed DAC voltage to run at the desired speed. Try increasing this to get better response but not so much to have the speed become unstable.

Although these things would cause a slow, delayed, response not an opposite response as you seem to describe so possibly something else is also occurring. Please try these 2 things and see how things work.

HTH
Attachments
SpindleMach3Jog rev2.c
(1.31 KiB) Downloaded 23 times
Regards,

Tom Kerekes
Dynomotion, Inc.

Scott Pancheau
Posts: 26
Joined: Sat Dec 28, 2019 10:52 pm

Re: Messed up program access

Post by Scott Pancheau » Mon Jan 20, 2020 3:13 pm

Thanks again Tom,
I will try the new Spindle Mach 3 Jog you attached as soon as I can. I did not say so, but I do always enter a spindle speed along with the Mo3 or M04 when asking for the spindle to turn on. Thanks for the info on trying to adjust my spindle acceleration to be quicker. I will play with that. The big issue turned out to be me- as usual. I forgot about being in absolute mode and wrote for the X axis to move to -1" instead of to 0. The CSS was doing exactly what it should once it started past 0 it was slowing down again. Showing my age. Thanks so much for your patience.
Scott

Post Reply