MONSTER - A learning experience... pyVCP machine

More
11 years 11 months ago #53259 by Askjerry
The PROBE - Bouncing is bad.

I started to use the probe... which for now is a piece of wire sticking down... hey, it's just for testing.
I have a switch on the desk in my office to test my routine... and it works great. But then I take the same code and put it on the big machine in the garage... and it is not too happy. I start getting an error something like "Probe tripped during a non-MDI command" Or basically... it is getting a noisy signal and counting multiple hits instead of a single contact. The fix is to tell it after the initial reading... ignore it for a period of time. That's called DEBOUNCE.

I pulled up the HAL Manual, section 9.6 Debounce and started reading... I was only getting about 30% of what it said... very confusing. Then I read other threads and started to piece it together. The manual has...

halcmd: loadrt debounce cfg=<config-string>


Which means... load debounce, configure it for some number of filters.... in my case... I only need one.
Code:
loadrt debounce cfg=1

Okay... that loads it... but next I need to configure it, then assign it to a pin or signal... that gets a bit interesting. And the manual... well... not very friendly...

(s32) debounce.<G>.delay


I had to kludge it together from different posts... but here is what I got...
I was connecting my probe to pin #15 of the parallel port... and I wanted it inverted... so internally that is called parport.0.pin-15-in-not by the system. I needed to filter that signal... point it to the input of the debounce routine. Then... the actual probe signal (now debounced) gets sent to motion.probe-input.

Um... yeah... ok... here is the original code in my custom_postgui.hal file...
Code:
#----------------------------------------------------------------------------------- # connect the REAL probe to the parallel port inverted pin. net real-probe parport.0.pin-15-in-not => motion.probe-input # Connect the probe image bit net probe-image parport.0.pin-15-in => pyvcp.probe-image #-----------------------------------------------------------------------------------

And this is the code after modification... with a filter of 100 threads... there is a bunch of math to calculate actual time... but 100 is a nice round number... so I'm gonna try it. B)
Code:
#----------------------------------------------------------------------------------- # Install a DEBOUNCE filter for the probe loadrt debounce cfg=1 addf debounce.0 base-thread setp debounce.0.delay 100 net probe-raw parport.0.pin-15-in-not debounce.0.0.in # connect the REAL probe to the parallel port inverted pin after debounce. net real-probe debounce.0.0.out => motion.probe-input # Connect the probe image bit net probe-image parport.0.pin-15-in => pyvcp.probe-image #-----------------------------------------------------------------------------------

It works on my bench... and at 5:09 AM... I'm going to wait until daylight to try it on the actual machine.
So fingers crossed... and hoping to have MONSTER V7 to upload shortly.

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago - 11 years 11 months ago #53283 by Askjerry
MONSTER V7.0

Well... I tried the probe with the modifications above... tested it 12 times... 12 out of 12 it zeroed the probe perfectly!

I was going to program an offset... so I would have a touch-plate that you would place on the piece... then it would account for the thickness... but for now... I have it setting Z at 0.0 (ZERO).

The tip is at Z0.0 when touching the work piece.
I have the delay set to 100... might be too much, might not be enough... but it works perfectly so I'm leaving it for now. (Comments?)

Version MONSTER 7 ZIP file is below.

I also made file the paths retaliative in location... so now (in theory) you don't have to replace "askjerry" with the name of your mill.
This should make it more useful to people new to all of this. Now simply unzip and place these files in the CONFIG folder inside the linuxcnc folder.

If you want to tinker... edit the file cmd-02.ngc inside the ROUTINES folder.
Code:
(cmd-02.ngc) O <cmd-02> sub (Idea Stolen from Pete Mills http://petemills.blogspot.com/2014/04/diy-pick-and-place-machine-part-2.html ) (The process is that you have a touch plate of a known thickness, in this case 0.5 inch that you drive down to.) (Then you set zero as your current location minus the plate thickness... so Z0 will actually be the part.) G10 L20 P1 Z0.00 (Set current Z position to ZERO so that we always move down.) G38.2 Z-2.0 F5 (Move quickly downward to detect the surface.) G91 (Switch to retaliative coordinate mode.) G0 Z0.05 (Up just a little bit.) G38.2 Z-0.2 F0.5 (Probe down nice and slow.) G10 L20 P1 Z-0.0 (Presumes touching workpiece for now. Reset Z as needed.) G90 (Absolute coordinate mode.) G0 z1.0 (In theory... we are now 1 inch above the actual surface.) O <cmd-02> endsub M2

For more on the probe... be sure to check out Pete Mills BLOG .

Jerry
Last edit: 11 years 11 months ago by Askjerry.

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #54741 by Askjerry
I made some major progress on the Monster Mill project this week... and I thought I would mention it here for those following the thread.

I finally got the HOME sensors installed on the mill... and now I can really see how the TOUCH OFF and offsets work. I was surprised at just how well it all worked...rather than type a lot... I'll just show you. Watch the video below.

Once I get the code cleaned up a bit more, I'll post the Monster V8 zip file here for those who want to learn from it.



The video shows how the magnetic sensors work.

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago - 11 years 9 months ago #55379 by Askjerry
I have made major revisions to the mill at this time... the panel now has 4 tabs... mostly PROBE functions.

I'll be posting more shortly... but for now I wanted to pass along some of what is going on with the probe. If you set up a machine with a NO (Normally Open) input to the probe... it's ok when nothing is attached... but a probe is a NC (Normally Closed) device. And... if you set up the machine as a NC input... then it always shows a probe triggered unless you install a shorting block when not in use.

My workaround? use a relay to reverse the probe... take a look.


I'll have more information shortly when I begin testing and get the routines all functional.
Last edit: 11 years 9 months ago by Askjerry. Reason: Insert video link properly.

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #55417 by andypugh
It looks like you solved the problem, though I have never seen it as a problem as you get one "probe tripped" message when you disconnect and that's it, I think.
(You can simply use the inverted input option to make an NC probe go positive for break)

However, one alternative that occurred to me would be the standard DC power sockets that radios used to have that have a set of contacts that close when the plug is removed:

uk.rs-online.com/web/p/dc-power-sockets/0487842/
The following user(s) said Thank You: eFalegname

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago - 11 years 9 months ago #55420 by Askjerry
Yes, I could have changed the pin... it would have then shown as contacted any time the probe was removed... I didn't think about the self-contacting part of the jack. And oddly enough... the jack I'm using has that feature. :blush:

It is working well... and as an added bonus, the setup makes an audible "CLICK" and has the LED color change when it makes contact... so that feature makes it easy for troubleshooting. I had wanted to use a NO input so that I could make a sensor from a piece of PC board as I had seen elsewhere... the tool contacts the upper surface and you offset by the known thickness of the piece. Can't do that now however... it would be opposite of how the probe works.

I need to build a tool setting device... a NC switch in a small container... then have the tool come down into contact with it... knowing the height of the device, I can then reset the Z-Axis so that when I issue a G0 Z0 command, the tool will just come into contact with the part. I also have more probe routines to write... I never knew how useful a probe could be until I started designing my panels.

I'm putting my progress all in one place for anyone interested, just posted the video of the probe testing.
Last edit: 11 years 9 months ago by Askjerry.

Please Log in or Create an account to join the conversation.

Time to create page: 0.491 seconds
Powered by Kunena Forum