Spindle Step/Dir servo ramp down before stop on M stop command.

More
5 years 6 months ago - 5 years 6 months ago #205374 by NoJo
Thanks for your efforts again Andy-
Its near midnight so tomorrow..
I believe the encoder is working - I have the RPM display GUI set up and it registers correctly - M03 S1000 shows 1000RPM with small variation, etc.
Not sure though if RPM uses the index or the A or B channels of the encoder?
Will verify tomorrow.

Re - the spindle count unwind or reset issue -
Is is not possible or better to just 'home' the C_axis each time you enable the C_axis mode, and then step/dir to the requested angle?, ie, Select C_axis, rotate slowly in only one direction always till index, reset angle count to zero and then G_code to desired angle from encoder count?
I can't think of machining modes where you would need to keep track of the incrementing angular counts...Any polar coordinated 3 axis motion with interceding normal spindle machining operations, with a subsequent C_axis motion would always require an angle setting relative to a known zero, or home angle.

Would be useful to see what a typical CAM package G/M code sequence set might be for such a process, eg, to machine the end of a shaft to a set diameter and then to mill, in axial, C-Axis polar mode , a hex head on that shaft (ignoring all the tool selects, etc - just the motion and selection commands..)

My CAD/CAM package can't do C_axis, but am discussing with BOB_CADCAM folk re procuring their SW and they are prepared to create a post processor for this lathe even before I purchase to assist in evaluating there software as an option, (if I get it working!) - in the meantime they sent me some sample G_Code, FANUC style - this extract to do that HEX in the end of the shaft.

Not sure how LinuxCNC would interpret this...
I would not need 'brake' etc, since the spindle brake is on while enabled ( all the time) and not in motion..
Code:
(MACHINE SETUP - 1-MILL FRONT HEX-PROFILE ROUGH) (TOOL-6 DIA- -1/2 FLAT ROUGH ENDMILL - LONG) N322 G15 (SUB 1 SPINDLE SWAP MODE OFF) N323 G54 N324 T0606 N325 M154 (ENABLE C AXIS MODE) N326 G17 N327 C90. N328 G98 P595 M133 N329 G00 Z0.2 C90. N330 G00 X3.9571 M08 N331 M15 (WORKPIECE BRAKE OFF) N332 G18 N333 G112 N334 G00 X3.9571 Y0. N335 Z0.1 N336 G01 Z-1.705 F3.3369 N337 X3.6036 Y0.1768 F6.6738 N338 G03 X2.75 Y0. I-0.1768 J-0.1768 N339 G01 Y-0.7939 N340 X0. Y-1.5877 N341 X-2.75 Y-0.7939 N342 Y0.7939 N343 X0. Y1.5877 N344 X2.75 Y0.7939 N345 Y0. N346 G03 X3.6036 Y-0.1768 I0.25 J0. N347 G01 X3.9571 Y0. N348 G00 Z0.2 N349 G113 N350 G17 N351 C90. N352 M09 N353 G28 C0.0 (OUTPUT CODE TO REWIND ROTARY AXES) N354 M135 N355 G53 X0.0 Y0.0 N356 G136 N357 M155 (DISABLE C AXIS MODE) N358 M01

Next Day....
I included your C_Axis mods Andy - the results are:
1. No C Axis appears in AXIS - no C_Axis buttons, no DRO, no reference to a C-Axis that I could find.
2. X Axis still Homes ( moves to home switch, etc, and sets DRO accordingly), and can jog via the AXIS jog screen button
3. Z Axis 'Homes', but there is no axis motion - the DRO position updates to show it is in the home position
4. Trying to jog Z axis via AXIS onscreen button results in a Joint 2 Error ( not Joint 1 , which is the z Axis..)
5 Spindle still works - spins with spindle on command.

The encoder does work -
HAL meter spindle.0.revs shows a x.yyyyz number.
The z decimal appears to increment on every encoder AB chan edge ( 4096 edges, a 1024 line encoder)
The x digit increments by 1 per encoder rotation.

I have checked the additions to INI for spelling, lost hyphens.

In the INI there is [TASK] = milltask - what does that mean? I have not yet found that explained somewhere.

Attached are INI and HAL

Thank You.
Last edit: 5 years 6 months ago by NoJo. Reason: Some typo's fixed and clarity added

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

More
5 years 6 months ago #205420 by pippin88

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

More
5 years 6 months ago - 5 years 6 months ago #205425 by NoJo
Thanks Pippin88.
I did see your solution some days ago already - I was not to keen on doing it with delays - does not really keep pace with different spindle speeds and inertial masses fitted to the spindle, ie, a heavier chuck spins longer, etc...So I did not go that route.

The solution provided by Andy is excellent - it works very well, and is very simple.
I am happy!
Joe
Last edit: 5 years 6 months ago by NoJo. Reason: fix typo's

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

More
5 years 6 months ago - 5 years 5 months ago #205483 by andypugh

NoJo wrote: Re - the spindle count unwind or reset issue -
Is is not possible or better to just 'home' the C_axis each time you enable the C_axis mode, and then step/dir to the requested angle?, ie, Select C_axis, rotate slowly in only one direction always till index, reset angle count to zero and then G_code to desired angle from encoder count?


It might feel like that is the easy way, but the spindle stepgen is set up in velocity mode. It is possible to switch, but I don't know what happens if you do it "live"

You might be surprised to learn that the axes are set up in velocity mode too. It is possible to run the Mesa steppers in position mode, and we did that for years, but then it was found that the resilience to latency in the servo thread was better in velocity mode with a PID component to convert position error to velocity command.

The debate that PCW and I are having is whether it is best to use the stepgen position feedback or the encoder feedback.

Not sure how LinuxCNC would interpret this...


It uses a number of G and M codes that LinuxCNC does not understand.

N322 G15 (SUB 1 SPINDLE SWAP MODE OFF) - LinuxCNC does not have a G15. But it could be created by remap.

N324 T0606 - This is a lathe-style toolchange. LinuxCNC expects an M6 by default.Change to T6 M6 G43 [1]
N325 M154 (ENABLE C AXIS MODE) - Conveniently this is in the M100-M199 range where a simple script would be called
N331 M15 (WORKPIECE BRAKE OFF) - Not needed, as you noted.
N333 G112 - Mystery G-code. www.haascnc.com/service/codes-settings.t...athe.value=G112.html
N349 G113 - See above
N353 G28 C0.0 (OUTPUT CODE TO REWIND ROTARY AXES) - not supported / necessary
N354 M135 - Live tool off, in the M100-M199 range so easy to emulate
N356 G136 - www.haascnc.com/service/codes-settings.t...mill.value=G136.html ????
N357 M155 (DISABLE C AXIS MODE) - We can make that work.

1. No C Axis appears in AXIS - no C_Axis buttons, no DRO, no reference to a C-Axis that I could find.

Possibly because when I said
Code:
[TRAJ] COORDINATES = XZ

I meant to say
Code:
[TRAJ] COORDINATES = XZC
But forgot to edit the text after pasting.

The encoder does work

Good.

In the INI there is [TASK] = milltask - what does that mean? I have not yet found that explained somewhere.


In theory LinuxCNC supports many "task" modules. In practice nothing yet has been different enough from milltask to need one.
Plasma would be a candidate, but lathes are enough like mills for milltask to be correct.


[1] There are ways to switch to having a tool change happen with just a T-command. And it might even be a built-in option according to something I found for the first time a couple of weeks ago. But, for the moment, sticking with TN M6 G43 is one less thing to worry about
Last edit: 5 years 5 months ago by andypugh.

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

More
5 years 6 months ago - 5 years 6 months ago #205516 by NoJo
1. No C Axis appears in AXIS - no C_Axis buttons, no DRO, no reference to a C-Axis that I could find.
Possibly because when I said
Code:
[TRAJ] COORDINATES = XZ

I meant to say
Code:
[TRAJ] COORDINATES = XZC
But forgot to edit the text after pasting.

I did see that and wonder about it, but only a little...I know too little still to know that I should have known...
Same wondering that took place as to why a milltask is in a lathe setup...

Fixed that and now the C_axis is present in AXIS.

Joe
Last edit: 5 years 6 months ago by NoJo.

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

More
5 years 6 months ago #205573 by andypugh
That's a good start.

I was going to try to make the changes to configure the C axis, but I spent all day trying to get my 1921 motorcycle running.

Do you need the C axis urgently, or is it on the "nice to have this month" list?

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

Time to create page: 0.252 seconds
Powered by Kunena Forum