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

More
08 Apr 2021 21:25 #205370 by andypugh

Note that hostmot2 in master supports clearing the stepgen position
and also supports index on the stepgen


I think that we will probably end up ignoring stepgen counts and position, but time will tell.

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

More
08 Apr 2021 21:30 #205372 by PCW
You can do that (using encoder feedback only) but it may compromise
the servo response somewhat.

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

More
08 Apr 2021 21:35 - 09 Apr 2021 07:54 #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..
(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.
Attachments:
Last edit: 09 Apr 2021 07:54 by NoJo. Reason: Some typo's fixed and clarity added

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

More
09 Apr 2021 10:48 #205420 by pippin88

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

More
09 Apr 2021 12:10 - 09 Apr 2021 14:20 #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: 09 Apr 2021 14:20 by NoJo. Reason: fix typo's

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

More
09 Apr 2021 21:53 - 03 May 2021 10:11 #205483 by andypugh

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
[TRAJ]
COORDINATES =  XZ

I meant to say
[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: 03 May 2021 10:11 by andypugh.

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

More
10 Apr 2021 10:51 - 10 Apr 2021 12:38 #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
[TRAJ]
COORDINATES =  XZ

I meant to say
[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: 10 Apr 2021 12:38 by NoJo.

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

More
10 Apr 2021 21:54 #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.

More
11 Apr 2021 06:44 - 11 Apr 2021 06:48 #205602 by NoJo
What Motorcycle is that? A pic maybe>>

Andy, This lathe has been a project in my mind for 6 years till November last year - So what you saw in the photos occurred between November 2020 and now - The aim was (is?) to have a C_axis with a single milling spindle as a live tool, fixed in axial or radial horizontal plain. I like building machines - these machines end up building more machines, and not much else gets made! During this Lathe build, I built an 'electronic' Gear Hobber, A PCB Engraver ( just a small very rigid 3 axis mill with a 25KRPM spindle using an RC plane outrunner motor) an ELS for my EMCO V10 lathe and for my EMCO 14D lathe...etc. All the controllers are ARM cpu based, with all the software in C, done by my Wife..
Also busy converting an EMCO FB2 mill ( I have 3.. yes, I like and have a number of EMCO machines..) from stepper to Clearpath motors at the moment ( with UCCNC...sorry - I have a spare MESA 7i76E, so maybe later. )

- it's all a hobby, I enjoy the challenge, and it it takes another week, a month, or 6 ..there is always some project on the go.

My good wife and I are also heavily involved in a Lion Human/Wildlife conflict management program and we have to go fit some SAT tracking collars on some lions in the next week or three, so my projects simply remain a constant in life's background.

Please do not be pressured on my behalf - I am very grateful that you are taking your own time to help me - I feel quite lost in this while learning and become not a little depressed with it, so your assistance is hugely appreciated.
I also like bikes...
Joe
Last edit: 11 Apr 2021 06:48 by NoJo. Reason: Typos/syntax

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

More
11 Apr 2021 08:37 #205614 by pippin88
One day I will get around to using near to determine when spindle is stopped / nearly stopped.

For now I use time delay and 5 seconds (from memory). It is more than enough time for the spindle to stop even with a heavy chuck.

In my case I want to be able to spin the chuck by hand, e.g. for indicating a 4 jaw.

I see that you want the spindle on / held at rest, so different needs.

LinuxCNC can be a bit frustrating when starting out with this stuff. But it it very versatile.

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

Time to create page: 0.375 seconds
Powered by Kunena Forum