I did wire an incremental 250 PPR quadrature encoder (A,B,Z) on the UC300Eth // port #1 pins 2,3,4.
Then i did set the parameters for it in the UC300ETH plugin setup screen. I did use 250 PPR, the right Pins for A and B, and Index Prescale = 1.
I did set the parameter for Z Index inside Mach3 input pins setup screen. (i was surprise to see that this setting was inside Mach3, not in the UC300Eth plugin, seems like the index is not managed physically by the UC300Eth controller. This mean probably that Mach3 receive this signal and send the "start sync mode" information to the plugin from there. This mean that there is possibly an inconsistent delay because communication between Mach3 and the Plugin through Ethernet is asynchronous, resulting in a different start phase if the same Tapping is redo. But let's forget this secondary problem for now).
I did check that A,B, and Z signals where fully ok (electrical shapes and levels using a scope, and checks in the plugin input states slowly turning the encoder by hand).
I did check as well that the Index signal was properly received by Mach3.
Everything was ok.
Next, starting the tests, i did face 4 problems :
1) The most important one, and strangest, is that the plugin did not want to switch to "Sync. Thread" mode using the CNCDrive mach3 Rigid Tapping macro, M84.m1s :
- Code: Select all
SetUserDRO(1200, Param1()) 'P parameter = Z end
SetUserDRO(1201, Param2()) 'Q parameter = pitch
NotifyPlugins(10200) 'Load parameter
SetUserDRO(1202, 0) 'Start Rigid tapping
While(GetUserDRO(1202) = 0) 'Wait for finish rigid tapping
Sleep(50)
NotifyPlugins(10201)
Wend
For testing, i did use P=-3, Q=1. And was starting the macro with Z axis at 0 position.
After many tries, i was not able to get the sync mode. Then i had the idea to perform a Mach3 G84 rigid tapping cycle, and boom ! Surprisingly, after executing this (and cancelling it with a G80), the sync mode on the UC300Eth was available for the M84 macro.
Seems like the plugin never switch to sync thread mode, except if a G84 Rigid Tapping cycle has not been started before.
I had now a working sync Thread Sync mode on the UC300Eth.
The solution for this problem : perform a Rigid Tapping cycle G84, followed by a G80 to cancel it, after each Mach3 restart, to enable Sync mode availability on the UC300Eth.
2) The Pitch is for times the requested pitch :
When requesting M84 P-3 Q1, i should get 1mm of travel on the Z axis for one encoder turn. But strangely i get 4mm travel. As said before, i'm using a 250 PPR encoder, and the UC300 plugin is set to 250 PPR.
Seems like the UC300 is behaving like if there was a 1000 PPR connected encoder.
Then i did recheck my encoder output, measuring the count of pulses for each turn, and i can confirm that for each A and B channel, the count is 250 pulses, like indicated on the encoder label.
Seems like the UC300 is counting rising and falling fronts on each channel for more precision, (something that is doable inside a FPGA counter). The result is that with a 250 PPR setting inside the plugin, i get 4 times the requested pitch.
The solution was to divide by 4 the requested pitch inside the M84 macro :
- Code: Select all
SetUserDRO(1201, Param2() / 4) 'Q parameter = pitch
Another better solution would have been to use 1000 PPR in the UC300 plugin setup screen, but this is not possible, the maximum value is 999 PPR.
3) The reported Spindle Speed inside Mach3 is for times the real speed.
This problem is linked to the precedent one. The UC300 plugin is counting each rising and each falling front of each A and B encoder channels, resulting in for times the encoder channel frequency.
The solution here is quite simple, in the UC300 plugin Setup screen, put an Index Prescale = 4.
4) More importantly the P parameter does not seem to work.
Regardless what i try, the P parameter does not seem to have any effect. Then i did check that the macro did receive correctly this parameter, displaying it with a MsgBox command from the macro, that was ok.
I suppose that with P=-3, the plugin should stop and reverse the spindle at Z=-3. But that never happen.
In fact the UC300 plugin does not seem to control the spindle ?
I suppose that this is a bug, the spindle stop, CW and CCW commands should be managed from the plugin when a M84 macro is performed, if not there is no usefulness for the P parameter.
As a side note, i did try to run the M84 macro with a previously rotating spindle, but that does not help, spindle reverse at Z=-3 never occur.
I'm really interested to know what other Mach3 users (or CNCDrive testers), using Rigid Tapping and the UC300 1.022 plugin did find during their tests and if they were able to get a working Rigid Tapping macro.
Thanks for helping.