Hello Guest it is August 25, 2019, 10:35:11 AM

Author Topic: Very Accurate Homing (No, It's not like all other Homing posts)  (Read 4160 times)

0 Members and 1 Guest are viewing this topic.

Hey Everyone! Yes this is my first post but I like to think I've searched the forum high and low for an answer with no luck. If I'm mistaken, my apologies.

So I have inductive proximity sensors on my machine along with very high count digital encoders with a zero pulse. What I'd like to do for homing is have the machine move until it triggers the proximity sensor and then reverses direction until the next zero pulse is triggered and then call that position home. I've been working the VB script editor with a few ideas I had to do so but I'm not real confident in them. I'm not too familiar with computer programming, but i'm also not completely useless at it.

What I would like to work (paraphrased pseudo code):

' Move Z incrementally up until proximity sensor is hit
While (proximity switch off)
     code("G91 G01 Z10. F20")
Wend

While (zero pulse input not active)
     code("G91 G01 Z-.05 F.01")
Wend
DoButton(24) 'define as home position


My biggest concern is that in the first while statement it won't continue checking to see the if switch is hit or not. Has anybody tried this? Next weekend I should be able to try it but it'd be nice to know a little more before just hoping it doesn't crash.

The other thing I considered was making the incremental axis move very small so it keeps outputting a new move while the switch is not hit, but that seems to very reliably crash Mach3....

I know the ActivateSignal() command but as far as i can tell that doesn't work for motors.. Does anybody know of a method to move a motor through a script command and not gcode? Or does anybody know a better approach to this? I am certainly willing to accept the possibility i'm overcomplicating this.

Any help is much appreciated! Thanks in advance!
Re: Very Accurate Homing (No, It's not like all other Homing posts)
« Reply #1 on: July 27, 2014, 07:02:27 PM »
Also, the code shown above causes mach3 to crash. consistently. After the the z begins moving up, it throws 3336 error and quits. So I tried doubling the incremental move feedrate and sure enough, it crashed roughly twice as far as it did with half feed. So i'm thinking the scripts have like a timeout parameter or something, not sure though.
Re: Very Accurate Homing (No, It's not like all other Homing posts)
« Reply #2 on: July 27, 2014, 11:47:22 PM »
So an update: I've made more progress in that instead of trying to use gcode to move the axes I'm calling oem code jog buttons. (Wish I'd thought of that first..) But it's behaving oddly and I was hoping someone might be able to help. The code I'm using for one axis:

' First home Z

While Not IsActive(INPUT4)    ' proximity sensor off?
   DoOEMButton(311)       ' jog toward proximity sensor
Wend
While Not IsActive(INPUT3)    ' look at zero pulse and jog reverse direction toward it
   DoOEMButton(312)
Wend
DoButton(24)                       ' Set home


The odd behavior is that it seems to work if I hit run from the VB script editor but pressing the refhome button doesn't seem to do anything at all. For me, it's quite the mystery.. Please help!

Also, I imagine I'll have to add more to the code to change jog rate as it goes toward zero pulse of the encoder, but i'm not that far yet!

Offline Jeff_Birt

*
  •  1,107 1,107
    • View Profile
    • Soigeneris
Re: Very Accurate Homing (No, It's not like all other Homing posts)
« Reply #3 on: July 28, 2014, 07:00:16 AM »
The inputs and scripts are far to slow for what your trying to do. Homing and probing work because they are done by the motion controller, i.e. parallel port driver or external motion control. You could use some simple logic gates to try and do what your doing.
Happy machining , Jeff Birt
 

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: Very Accurate Homing (No, It's not like all other Homing posts)
« Reply #4 on: July 28, 2014, 07:18:28 AM »
About 5-7 years ago, someone made a board to do what you want. It worked by doing everything in hardware, and sending a single signal to Mach3, so that Mach3 thought it was homing to a single switch.

As Jeff says, what you're trying to do won't work.
Some motion controllers, like the CS Labs controllers, can do what you want.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Very Accurate Homing (No, It's not like all other Homing posts)
« Reply #5 on: July 28, 2014, 10:08:43 AM »
Not real great news... but thanks guys, I appreciate the help.

Any chance somebody posted documentation of there board from 5-7 years ago? Haha.. Custom electronics aren't really my strongest topic but that should be a relatively simple logic board I suppose and it's a good excuse to learn some new stuff!
Re: Very Accurate Homing (No, It's not like all other Homing posts)
« Reply #6 on: July 30, 2014, 04:05:15 AM »
I am currently designing a similar board and would be making it open source. Anyone keen on helping is most welcome to do so. If you could wait about a week maybe, i should have a design tested and proven.
Re: Very Accurate Homing (No, It's not like all other Homing posts)
« Reply #7 on: July 30, 2014, 05:23:08 PM »
Cool! I'd love to hear how that goes for you.

Offline Hood

*
  •  25,849 25,849
  • Carnoustie, Scotland
    • View Profile
Re: Very Accurate Homing (No, It's not like all other Homing posts)
« Reply #8 on: August 01, 2014, 05:52:53 PM »
The boards Ger is talking about were made by Ed Gilbert. There were two versions, one just a stand alone board and if I recall it just used the Index pulse. The other had the Index homing integrated onto a breakout board and also took the full encoder signals. That meant you could set a count to continue after the Index if required. 

I have the breakout board type on my big lathe but dont use the Index homing feature on it now as my servo drives support Index homing, so I use them.

I may have the manuals as pdf if anyone wants them, dont think there is any schematics in them so maybe not much use.

Hood
Re: Very Accurate Homing (No, It's not like all other Homing posts)
« Reply #9 on: August 01, 2014, 05:55:49 PM »
I'd sure appreciate an email of the pdfs!