Hello Guest it is April 16, 2024, 09:29:28 AM

Author Topic: Control planer with MACH3  (Read 6438 times)

0 Members and 1 Guest are viewing this topic.

Control planer with MACH3
« on: September 17, 2009, 09:08:18 AM »
Gentlemen,
I was reading through a bunch of posts, but did not find any similar question, so I hope some of you may have some good ideas regarding my issue.

My first challenge is this one:
I need to process a gcode-file step per step, depending on an input signal.
The content of the file only controls the z-axis while a sensor mounted to the x axis delivers the pulses.
This does not have to happen very fast.

The second challenge:
These pulses come in constantly, but the code shall not be executed constantly. What needs to happen is this:
I want to push a button (lpt input), after that the gcode of file 1 shall be executed (depending on the pulses, step per step, line by line) unless I push the button again.
Now MACH shall place x at a certain point and load another file.
At this point I will move the workpiece around manually.
When I push the button again, the show shall repeat.

Has anyone ideas ?

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Control planer with MACH3
« Reply #1 on: September 17, 2009, 10:11:53 AM »
Please re-explain what you want, it is NOT clear, you need a step by step, sequence of events explaination.

Look in the wiki:

you can put mach3 into single step, and use the Macro pump to grab your pulse with a formul and add 1 to it the have the "single step" button pushed via the macro. for loading and unloading new files, again look at the button codes, LED codes and DRO codes, plus Mach specific funtions to do the sequence you want.

scott
fun times
Re: Control planer with MACH3
« Reply #2 on: September 17, 2009, 11:15:50 AM »
OK, sorry, thought it was clear enough, so lets better do this step by step

I have a workpiece which is constantly moved in direction of the x-axis through my machine by a motor. Actually a wood-planer which simply pulls a piece of wood through.
Each time the motor turns around the workpiece will move forward 10mm's.
Each time the motor turns around it injects a signal to an input (lpt) of Mach3.
So each time the motor turns around, inputX goes from 0 to 1 and back.
Each time the signal goes from low to high, I want to have a loaded gcode jump forward by 1 line.

Hope this is undestandable. Thanks for any ideas so far

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Control planer with MACH3
« Reply #3 on: September 17, 2009, 06:01:56 PM »
What code do you want to do?
Hood
Re: Control planer with MACH3
« Reply #4 on: September 18, 2009, 01:45:21 AM »
I have written a VC program which creates those g-code files for planing a profile into wood planks.
This has to happen in multiple passes and carefully as the wood gets planned very thin at both ends.
Also, the traktor can only handle a small difference of thinkness per pass.
The outcome is woodcores for skis.

Question from my side:
I read about singlestepping with #INPUT4.
Is #INPUT4 kind of reserved for singlestepping by default ? And would it successfully handle the input signal edges (simply asked: will it step at a 0to1 signal edge?) And will it only do that if MACH is in single step mode ?
Than my issue would be a piece of cake: Put Mach in singlestep, INPUT4 steps through the code. Take it out of singlestep stops. a.s.o

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Control planer with MACH3
« Reply #5 on: September 18, 2009, 02:37:14 AM »
For single step I would think all you need is to have an input set up to an OEM Trigger and set that OEM Trigger as cycle start.
Where I think your problem is going to be is you are sending a signal each revolution of your motor and you are wanting the code to do a line on each signal, how long will it be between signals and how long will it take to do a line of code?
Hood
Re: Control planer with MACH3
« Reply #6 on: September 18, 2009, 03:28:46 AM »
Thanks for answering Hood,
I guess (and pray...) that this is in my case not going to happen.
The motor does a turn each half of a second. The stepper to control the z axis only has to make 5 or 6 steps and only at each 4th or 5th turn.

What I did not understand properly is the "trigger".

If let say INPUTx gets the high or low signal, then signal will approximately be high for let say 250ms and low for let say 250ms.
If the input goes to high, it triggers a short script which only takes 10ms to execute.
After that the Input signal would still be 'high'.
Will this high-condition fire the script again, or is it definitely just the low/high edge of the signal which triggers the script ?

Thanks for your help again...I am getting close :-)

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Control planer with MACH3
« Reply #7 on: September 18, 2009, 03:40:30 AM »
The signal will basically press the cycle start and so progress to the next line of code, however if the previous line has not completed then it will have no effect. The line has to be completed before the next input can start the following line, this is where I think your problem will be.
Hood
Re: Control planer with MACH3
« Reply #8 on: September 18, 2009, 04:09:29 AM »
I understood but as I said, I guess there wont be an issue.
My question was concerning the other way round:

The input signal comes in and will stay for a while. What if the script executes faster than that ? The input would still stay at high-level and has not gone through low at this point.
Would this case trigger the script again ?

Or, question simplified: If I would manually, by switch, keep the input level at high. How often would the script be triggerd ? Just once ? Or again and again as long as the level is at high ?

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Control planer with MACH3
« Reply #9 on: September 18, 2009, 04:55:18 AM »
Just once I think.

Hood