Hi Tom,
So in the SimpleHomeIndexFunctionTest.c example it uses Opto in bit 138 for Z axis. So i dont use the Differential Encoder inputs? And instead use the Opto in?
Troy
Hi Tom,
So in the SimpleHomeIndexFunctionTest.c example it uses Opto in bit 138 for Z axis. So i dont use the Differential Encoder inputs? And instead use the Opto in?
Troy
You use the differential input. In terms of the C program, just think of it as a standard input, that just so happens to take a differential input.
So if you're using the inputs of JP2, they connect the KFlop JP5 (8 pin RJ connector), which are bits 36-43 (KFLOP Connectors - scroll to the very bottom).
Opto in 138 is just an example, which you can change it to whatever input bit you are using.
However, just checking those examples, they're relying on using the limit switches for homing, then backing up until the index pulse is seen.
Are you using the limit switches, or separate homing switches?
Hi Troy,
You are confusing me a bit with terms 'Z axis' and 'Z index'. Most encoders that support an index pulse often refer to the AB quadrature signals and the Index pulse as A B Z. This Z doesn't necessarily have anything to do with Z motor Axis.
Also you seem to be confusing 'Home Switch Inputs' with 'Index Pulse Inputs'. Index pulses can provide a very accurate means of determining absolute machine position, but they occur every encoder revolution and therefore are likely to occur at multiple machine positions without a means of knowing which one it is. So the normal method is to first move to a limit or home switch to know an approximate position and then move to find the first Index pulse. So 2 inputs are required one for the Limit/Home switch and one for the index pulse.
The IO 138 as parameter #4 in the SimpleHomeIndexFunctionTest.c example is for the Limit Bit. The #7 parameter in the example is set to -1 to indicate there is not any Index pulse available. Change this to your Differential Input. The 8 differential inputs on Kanalog J2 end up driving KFLOP Inputs 36-43
HTHCode:result = SimpleHomeIndexFunction(2, // axis number to home 1000.0, // speed to move toward home -1, // direction to move toward home (+1 or -1) 138, // limit bit number to watch for 0, // limit polarity to wait for (1 or 0) 100.0, // speed to move while searching for index -1, // index bit number to watch for (use -1 for none) 1, // index polarity to wait for (1 or 0) 5000); // amount to move inside limits
TK
http://dynomotion.com
I was thinking of using a visual mark to get close then use the Z index pulse of encoder to home machine.Similar to the old Fadals. There will be a limit switch on tail stock to stop Z axis when it is commanded to move past current position of tail stock.
I wasnt referring to the Z index as if it was related to Z axis, i was referring to what you explained about the once per revolution mark on encoder. Sorry if i didnt make it clear. But you still interpreted what i was talking about.
If i am remembering correctly, a few years ago you said that a Z index mark of an encoder could be used with a physical mark on axis table to accurately home axis. Is this correct? This would be much easier if i could do this with lathe, as tail stock might be in the way from where a dog would be mounted for Ref/Limit switch of Z axis. Would also simplify wiring.
Thanks again,
Troy
Hi Troy,
I assume you mean a mark that you could Jog to manually by eye? Is so then yes. You might just call the SimpleHomeIndexFunction() and specify the Index bit as the limitbit and specify none for the index bit. In this case it will simply move to the first Index, stop, and zero. Note the visual mark should position the encoder not very close to any index pulse. In this way the starting position will always be on the same side of a particular index pulse and the routine will always find the same index pulse and not sometimes one and sometimes the next.If i am remembering correctly, a few years ago you said that a Z index mark of an encoder could be used with a physical mark on axis table to accurately home axis. Is this correct?
HTH
TK
http://dynomotion.com
So, had to take a little detour from the electronics and do some more mechanical. After i started tuning the VFD i realized that the spindle was in rough shape. Was kind of expecting it tho. Ended up replacing all bearings. And found out that someone else had been in there before and used the wrong bearings and other incorrect practices. Here is some pics of the mess....
But as of tonight its all back together and running nice. Spindle housing just gets warm,VFD amps are where they should be and DB level no longer sounds like a rabid dog biting itself.
Next on the list is locating an encoder for the spindle and start building my C codes for KMCNC. Which reminds me, any suggestions on type and resolution of encoder being used for spindle feedback on a lathe?
Thanks
Troy
First indicator was the sealed China bearings. Sealed bearings that size typically have a much lower rpm do to heat of seal.
Then I used the number on bearing and checked with a good manufacturer on specs for same bearing number is.
And the bearings in front where mounted back to face instead of back to back or face to face. The blueprint I have on machine shows how they should be mounted also.
Troy
Hay Tom,
Iam looking at a US Digital encoder for spindle feedback on my lathe. The max RPM of spindle will be 4000.And encoder is connected to spindle by a 1:1 ratio timing belt setup.
This is the encoder iam looking at....
https://www.usdigital.com/products/e...llow-bore/HB5M
The configuration of encoder would be ...
CPR: 2048 (or 2500,4000,4096,5000)
Index
Differential
Would there be any advantage with a higher CPR and if so which one do you recommend?
Thanks,
Troy
Hi Troy,
2500 cycles/rev should be a good choice.
2500 x 4 x 4000 / 60 = 666667 counts/sec
Which is under the limit of 1 million counts/sec
Of course choose differential output.
TK
http://dynomotion.com
Hi Tom,
First thanks for the encoder info.
Right now iam working on my main init code. I started by using my Main Init program from my mill and removed the timer function for the way lube pump. Everything but the servo motors setting and a couple I/O bits are the same between the mill and lathe. But, of course i broke something in the C code
I think the c program is not running past the For ever loop. Because none of my Drive Error windows or Emergency Stop pop up window are working.Can you check it out or school me once again ?
Thanks,
Troy
You had the close bracket for the For loop in the wrong place. You also had two sets of curly brackets for the For loop.
I've deleted the extra set, and moved the close bracket to where it needs to be.
I've also fixed the indentation. Indentation is key when programming, as it helps you understand where you are in various loops (for/if/else/do/while loops).
Whenever you have an open bracket "{", indent a tab, and then whenever there's a close bracket "}" cancel a tab indent. The text editor used in KMotion mostly does this for you when typing, however an badly timed cursor move/return key press can cause the auto-indentation to get it wrong.
It can also be worth adding a comment after a close bracket, saying what's it's closing. On short bits of code it's not really necessary, but on longer blocks it helps you understand the flow without having to scroll up and find the corresponding open bracket.
HI Troy,
Well yes, anything after a forever loop will only execute after forever - which is never.
That code needs to be inside the forever loop for it to be continuously executed.
TK
http://dynomotion.com
Now iam moving on to wiring my control panel. (Physical buttons and switches.)
Currently am looking for a way to jog axis with momentary switches/levers. There will be one for each axis. And would be connected to the Konnect board. But, i need a way to set the mode of these switches. Mode1 would be continues Jog and mode2 would be step Jog. Mode1 would get the feed rate from my feed box i have on my Manual screen(see attached). And Mode2 would use the step size selected on Manual screen. Which brings up another question. Can a physical button be used to toggle through the Step size radio buttons on KmotionCNC?
Troy
Now that I have a working control panel. I made some test cuts and all looks good so far. Need to do some more VFD tuning. But still works good. Next iam making a Press Brake attachment to make my axis way guards. Then will be getting some ball screw covers for Z axis. After this, more sheet metal work for machine enclosure. Then some clips of it making chips.
Something else concerning operating KMCNC Lathe is setting tools and offsets. What is the procedure for this?
Currently I have been testing with a turning/facing tool by touching tool on od of material, zero X axis, move the amount of part OD toward center of spindle and then zero X again.
Lathes I have ran in the past I would take a test cut, measure OD, and then enter the measured amount into a DRO for that tool.
Also does or will KMCNC lathe support canned cycles like for Rough OD/ID turning and Facing?
Troy
Pick a location for Z zero, then it's a case of touching off to set Z zero. You can then rely on work/global/temporary offsets to set the Z zero for parts. Z zero can be wherever is convenient. Some use the spindle face (with no chuck mounted), some use the surface of the chuck, and I still use 30mm from the chuck jaws (all my parts seem to revolve around that length, and I know it's poor form on my part not to follow an established convention, but it works for me).
For X offsets, I do it as you say. Take a test cut, and measure.
I've got a couple C programs that ask for the measurement, then calculate the offset, before updating the tool table.
Not that I know off, but then all my current part programs I originally created with Mach 3 wizards, and I've had no need to generate any completely new programs for a while.Also does or will KMCNC lathe support canned cycles like for Rough OD/ID turning and Facing?
Hi m_c,
For Z axis i usually just set zero at end or face of part.
Can you share these programs or is there an example i could look at to attempt to make my own?For X offsets, I do it as you say. Take a test cut, and measure.
I've got a couple C programs that ask for the measurement, then calculate the offset, before updating the tool table.
Thanks,
Troy
Hi Troy,
You should be able to do this. Instead of Zeroing use the "SetX" button and enter the measured diameter.Lathes I have ran in the past I would take a test cut, measure OD, and then enter the measured amount into a DRO for that tool.
I don't believe there are any such canned cycles. What specifically would they do? Of course you could always use a subroutine. Morays Conversational approach might be another option.Also does or will KMCNC lathe support canned cycles like for Rough OD/ID turning and Facing?
TK
http://dynomotion.com