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.