Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Erichtg on August 11, 2007, 05:34:57 AM

Title: Frustration! Accurate homing? Encoder index pulse?
Post by: Erichtg on August 11, 2007, 05:34:57 AM
Hey there, this is, in part, a "Hi" post after a long hiatus. I've been using Mach2 for ~2.5 years now on my converted Bridgeport.
(1979 CNC model with ball screws and pumpkin steppers)

I've had an on-going issue with homing my machine. I'd like to home with +/-0.001" or better accuracy.
My conclusion is that mechanical switches just don't cut it.

This is an issue because re-homing the machine in the middle of a setup is a fact of life for various reasons:
 - Many of setups span several days and the machine gets power-cycled
 - E-stop doesn't do a controlled stop.
 - Things happen.

I'm considering adding glass scale encoders to the table but I'm wondering what Mach2 actually does with the encoder inputs.
- Are the inputs purely for operator DRO feedback?
- I know Mach doesn't do motor loop feedback but I'd think that an "expected" vs "actual" count error check would have surfaced by now.
- Are there homing routines out there written to locate an encoder's index pulse?
- Are Mach's encoder DRO counters interrupted by E-stop too?

I have to admit that I'm getting a little frustrated. I've scrapped a lot of work due to homing issues. All professional CNC machines that I've used simply never loose home (even after running into limits or hitting the E-stop button). I recognize this is an inherent drawback of open-loop control but on a sub-system level, all machines (open or closed loop) have to deal with this issue in some way.

I plan to eventually swap the steppers for servos. At least then the servo drives can provide an error feedback. But accurate homing is still required.

Suggestions?

Thanks, Ted

Ps, Would anyone be interested in a separate thread about my super-simple hall sensor spindle index?
Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: Hood on August 11, 2007, 06:05:20 AM
CNC Building Blocks sell the Acustep breakout board, http://www.cncbuildingblocks.com/breakout.html  it uses an index pulse from an encoder to home, sounds just what you are wanting. Of course you would need encoders hooked up to your setup and unless your glass scales have an index pulse they will not work.

One other option for accurate homing is optical switches, I have these on my mill and had a DRO hooked up at the same time and the accuracy of them was amazing, I could repeat at a home to 0 99% of the time and the other 1% was 0.005mm (0.0002") I am going to use the Acustep breakout on the lathe I am retrofitting at the moment but as of yet I have not tested out the homing sequence so cant say how accurate it is but I would think it will be just as good if not better than the optical switches.

On your other question, the DRO in Mach for encoders are as you suspect purely visual for the operator. There is a board from rogersmachine.net that will use the encoders and halt mach on a folllowing error and it uses the encoder DRO for this purpose.

BTW I would recommend that you update to Mach3, it is light years ahead of Mach2

Hood
Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: Hood on August 11, 2007, 06:10:20 AM
Oh and what you waiting for, get that thread started regarding the spindle index

Hood
Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: Hood on August 11, 2007, 06:35:19 AM
Just had a look at the CNC Building Blocks site and have noticed they now sell a seperate board for Index homing so if you have a breakout already this may be the best option.   http://www.cncbuildingblocks.com/homeindex.html
Hood
Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: vmax549 on August 11, 2007, 01:08:20 PM
Ted we have found if you change out the mech switches for optical switches 99.99% of your homing problems go away.

If you are clever you can locate the new optical switch inside of your existing switch housing.(;-) No swarf problems....


Another way is to locate a fixture on the bed and do a probe center of circle to accurately set the home position at startup.

(;-) TP
Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: Erichtg on August 12, 2007, 08:38:52 PM
Thanks.

The 4-axis encoder interface by CNC Building Blocks is VERY close to what I'm looking for. But upgrading to servo motors will enable a Mach system to have similar drive error feedback without any additional custom interfaces. The MPGs are appealing. I've thought of doing this myself.

So Yeah, Optical switches are the way to go. But I'd prefer to just use index pulse from an encoder. Opto-Mechanical switches that I've seen can get stuff stuck in them, even if the light path is protected, then a little grime between the dog and switch armature can be significant.

An index pulse is a kind of optical switch anyway, right? Exept no intermittent mechanical interface is required and they already exists on most decent servo motors.

Can the Mach home switch be rigged so it doesn't appear as limit? if so, then could an index be used as a Mach home switch? The homing sequence could find the limit first, then hunt for the first index pulse. Someone has to have implemented this already.

I'm confused. Given that Mach has encoder DROs, why isn't it a straight-forward subroutine to do the feeback error cheeking? Is it because the DROs are not interrupt proof ("atomic" style) and consistency is not guaranteed if an E-stop occurs?

And finally, What about the G-rex? It has index and encoder inputs. Are they implemented to maintain position consistency?

Ted





Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: poppabear on August 12, 2007, 09:39:43 PM
Ted,

   for what your talking about, you want to use Ed's board(s).  The index on an Encouder happens faster than mach can "see" it. What Eds board does is capture the index after home is hit, then it will back off of home by an amount of encouder counts that you set. It is super duper accurate.

You CAN, have a seperate Home switch if you want i.e.: a Plus and Minus limit and a home per axis if you want, all you have to have is the inputs available (second parrallel card with reversed bidirectional PP card is helpful).  Also, with Eds boards, the switch type that you use is irrelevent, it could be a really inaccurate micro swith if you wanted, since the accuracy of the homing routine is based purley off of the Index pulse of the Encoder, the switch is just a notification to the board to start looking for the Index pulse.

Scott
Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: Erichtg on August 12, 2007, 09:45:46 PM
Who is Ed?
Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: poppabear on August 12, 2007, 10:26:29 PM
Sorry, Ed is the owner of:

http://www.cncbuildingblocks.com/homeindex.html
Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: Erichtg on August 13, 2007, 12:07:00 AM
Hmm...

Reading the documentation at CNC Building Blocks, it doesn't appear the index is read at all. Furthermore, it appears like the real value (comparing Encoder feedback against pulses sent) happens in Mach, not in hardware. Do I have this right?

If the index pulse is too fast for Mach to see then the encoder pulses would be too fast also. Anyway. One one could simply add a delay (RC+Schmitt trigger) to the index pulse to make it "visible" at high speeds. Then home in on the rising edge at a super low speed.

Ted
Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: Hood on August 13, 2007, 02:20:51 AM
You got it wrong ;)
 Basically what happens is Mach goes to home, the limit is triggered but Eds board doesnt tell Mach, the Index is hit and now Eds board tells Mach the limit has been triggered, Mach reverses and then Eds board counts the distance you have set by dip switches and then tells Mach the limit is now closed, homing complete.
Hood
Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: poppabear on August 13, 2007, 03:31:54 AM
Yeap, what Hood said, it is all done in Eds board.
Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: Erichtg on August 13, 2007, 03:38:50 AM
Exactly which board is it that reads the index pin of an encoder?
The documentation I've found shows the index pin un-wired.
Searching through the PDF, the word "index" is never mentioned once. 
Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: Erichtg on August 13, 2007, 03:43:30 AM
Wait, Sorry I got hung up on the page.  Pretty sure we are "on the same page now." ;)
Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: Erichtg on August 14, 2007, 04:30:59 AM
Ok Thanks, I understand the operation of the Home Index board from http://www.cncbuildingblocks.com/homeindex.html

Theoretically, if Mach could "see" an index pulse, would it be possible to get Mach to do the hunt and seek for an index home?

(Where possible, I'm all for doing things in software vs hardware.)

THanks, Ted

Ps. Just tried loading the Mach3 demo. And I'm sorta missing some functionality of Mach2 (standard screen set anyway).
Like, Why can't I use the number pad on my keyboard on select fields???????????
Is it possible to run Mach3 with just a Keybaord? (no mouse or touchscreen).
Is the standard Mach 2 screen set available for Mach3?
The jog button behavior seems different.
Home all 3 axis at once?

Are these screen set differences or Mach2 vs 3 differences?
Title: Re: Frustration! Accurate homing? Encoder index pulse?
Post by: Hood on August 14, 2007, 02:15:53 PM
I would think they are screenset differences. You can set up hotkeys for every button on the screen in screen4 but most will have hotkeys already assigned so probably best to leave them alone and just look to see what they are.

Hood