Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Katoh on October 02, 2011, 09:07:44 AM

Title: Need Extra Inputs
Post by: Katoh on October 02, 2011, 09:07:44 AM
Colleagues
I am getting close to finally putting this lathe together, stand is built and the electrical boxes are in, now its the main wiring and then just the placement of the lathe on the stand. As I accumulated parts for this retrofit, I was given a very nice little panel that came of a commercial machine. This panel has a light switch an e-stop and 4 push buttons on it for jogging the the two accesses. I would really like to incorporate it into the build.
The problem I see is I dont have enough input pins, I'm using just the one parallel port and a Homman BOB. The way I see it I would need  Spindle feedback (1) Limits & E-stop can be put into one (2) Jog Z+(3) Jog Z-(4) Jog Y+(5) Jog Y-(6) , so there is 6 input pins needed.
How can I do this without adding another BOB or going to USB?
Also incorporated in the build is a 3rd motor driver for future use as either an X axis or Turret control.
Thanks
Katoh
Title: Re: Need Extra Inputs
Post by: Hood on October 02, 2011, 10:06:27 AM
Not much you can do except add a second port or some other type of I/O such as ModBus, USB etc. There is the PMDX 126 Bob that can use 1 port but double up on the i/o but that obviously means expense. You could just use a PCI port without a BOB  if you were confident about your wiring.

Hood
Title: Re: Need Extra Inputs
Post by: Katoh on October 02, 2011, 10:28:42 AM
Hi Hood
I'm coming to the same conclusion. A standard board has 5 inputs and need 6. The only thing that crossed my mind is if I daisy chain the e-stop and the limits and instead of inputting them into the BOB, I could use them on a relay that control's the 5v power to the the BOB. If triggered the power will be cut and the lathe should stop, but will Mach recognise this as a fault and estop the program?
Could be a thought.
Cheers
Katoh
Title: Re: Need Extra Inputs
Post by: Hood on October 02, 2011, 10:48:14 AM
Ah sorry I was thinking you were needing a further 6 inputs. Still doesnt change things much. Cutting the 5v to the BOB may work but Mach will not know about it unless you have an input informing Mach.

Oh BTW the axis on a lathe are Z and X.

Hood
Title: Re: Need Extra Inputs
Post by: Katoh on October 02, 2011, 10:55:54 AM
Quote
Oh BTW the axis on a lathe are Z and X.
Apologies mind was elsewhere when typing.
Looks like a second port is the only quick and correct solution. If i g down that track is there a way to control jog speed with say a potentiometer, or some other sort manual control on the panel?
I am very confident of wiring so a BOB will not be necessary, I think.
Cheers
Katoh
Title: Re: Need Extra Inputs
Post by: Hood on October 02, 2011, 11:03:39 AM
You need analogue inputs to use a pot for such things as Feed Override or Spindle Override. May be worth your while looking at the PoKeys, bit of an expense but will give you the analogue inputs as well as a load of other I/O capability.
Hood
Title: Re: Need Extra Inputs
Post by: Katoh on October 02, 2011, 11:15:06 AM
The Funny thing is I was looking at looking at that but was not certain exactly what it did. I cant see 50 odd euro as too expensive if its going to do what I want. I will have another look into them and send the seller an email with some question, may enlighten me on the subject a lot. If its good I could have all sorts buttons, Start, home, ect maybe a good thing.
Many Thanks Hood.
Cheers
Katoh
Title: Re: Need Extra Inputs
Post by: Hood on October 02, 2011, 11:49:01 AM
The PoKeys gives you 55 low voltage I/O which you can define as you wish (either Inputs or Outputs) You can also use 3 (I think, been a while) of them as analogue inputs and you can also use some of them for MPG inputs if you wish. The MPG inputs didnt work that great when I first tried the PoKeys a few years back  but I believe now they work very well.
My preference would probably be for the Ethernet version over the USB one but the USB did work well when I tested it out.
Hood
Title: Re: Need Extra Inputs
Post by: Katoh on October 04, 2011, 07:35:41 AM
Hood
I have inquired and really for my needs I'm better of going down the 2nd Port option, far less complex than the other.
Can you input a MPG with the second port? if so how would you do it?
Cheers
Katoh
Title: Re: Need Extra Inputs
Post by: Hood on October 04, 2011, 08:39:55 AM
Pokeys is or at least at the time I used it very simple but to answer your question, yes MPG is no probs, just tell Mach which pins and port the A and B pulses are on.
When I was using the parallel port on the Bridgeport I had a second port with the MPG on it, I powered the MPG from a cut down USB cable and just input direct to the port without a breakout board, worked fine.

Hood
Title: Re: Need Extra Inputs
Post by: Katoh on October 04, 2011, 08:47:54 AM
Many thanks again Hood
I was just planing to wire straight of the port as you described, 5v is not an issue as the machine has a separate 5v supply.
Any ideas on how you set-up a jog speed controller?
Cheers
Katoh
Title: Re: Need Extra Inputs
Post by: Hood on October 04, 2011, 09:10:38 AM
Reaso n I used the USB for the power was that it would be referenced to the smame 0v as the PP is.
Jog speed controller? You meaning FRO buttons or?
Hood
Title: Re: Need Extra Inputs
Post by: Katoh on October 04, 2011, 06:29:41 PM
Hood
Sorry the late response, I see what you mean about taken the power from the USB. How would do that?
what I mean by Jog speed controller, is a button or switch so I control jog speed on my push buttons on the panel.
FRO buttons not really sure what they are? Like on your pendants there is a switch for jog speed X1 X10 X100 basically want the same sort of thing.
Cheers
Katoh
Title: Re: Need Extra Inputs
Post by: Hood on October 04, 2011, 07:00:32 PM
I use rotary switches for that and its easy enough to do, just need an input for each change you want and then have a brain do what you want.

FRO is feed override, before I had analogue inuts on the lathe I had three buttons set up and used a brain to work them. If I held the up button the feed override would increase without having to keep pressing, same with the down, the third was to reset to 100.
Hood
Title: Re: Need Extra Inputs
Post by: Katoh on October 05, 2011, 02:13:58 AM
Hood
Quote
I use rotary switches for that and its easy enough to do, just need an input for each change you want and then have a brain do what you want
That sounds absolutely perfect to me! My panel has 4 push buttons  for Z+ Z- X+ X- and one switch which I can change to multiple position, I take it these are all inputs?
Hood I think you have me on the right track now.
Just to summarise I use a second Parallel Port for the extra inputs, I use my 4 buttons as separate inputs and then tbe switch being set whatever amount to control jog, say 4 place switch 4 different jog settings. I hope I'm not confusing the issue.
Now do you need that 5v to every input to make this all work?
Thanks
Katoh
Title: Re: Need Extra Inputs
Post by: Hood on October 05, 2011, 04:31:33 AM
Yes they will all be inputs, if you have a second port you can assign pins 2-9 as inputs giving you 12 extra and you still have 1, 14, 16 and 17 available as outputs.

On my Beaver Mill and lathe I have 4 positions on the rotary switch, one for Velocity mode, one for 0.01mm step one for 0.1mm step and the last for 1mm. I have since found however I never use anything other than Velocity and 0.01mm steps so on the Bridgeport I just made the two positions available. I do all my jogging Via MPG and never use the keyboard jog buttons so have never put external jog buttons on my panel, I just find MPG so much better as you wind fast it moves fast, wind slow it moves slow, change to multistep mode and each click will move the increment selected.

You would take 5v to the common of the rotary switch.

Hood
Title: Re: Need Extra Inputs
Post by: Katoh on October 06, 2011, 09:08:57 AM
Hood
Again sorry for the late reply, You have been a great help. Ill set the the panel up and put the extra port in the computer, I hope you don't mind but Ill have to ask assistance once again for working out the brain when I get it up and running. not to far of now.
Cheers again
Katoh
Title: Re: Need Extra Inputs
Post by: Hood on October 06, 2011, 09:46:19 AM
No probs, brain is easy enough.
Hood
Title: Re: Need Extra Inputs
Post by: Hood on January 16, 2013, 08:31:13 AM
re the private message, I will answer here as I can attach an image.
You may wish to have only two positions of incremental jog on your rotary switch and save one for continuous or you may wish to have 4 positions.
However here is what the brain would look like if you wanted just the 3 positions as increments, 0.01mm, 0.1mm and 1mm

Hood
Title: Re: Need Extra Inputs
Post by: Katoh on January 16, 2013, 08:36:27 AM
Thanks Hood
Easy enough to understand, for all purposes where do I put this? Sorry if I sound vague just not sure were it goes in Mach.
Katoh
Title: Re: Need Extra Inputs
Post by: Hood on January 16, 2013, 09:45:02 AM
You go to Operator menu in Mach then Brain Editor and then click OK to the box that appears. The Editor window will open and you can then write your Brain. Once its written then go to File and Save and call it what you want, but best keep the name as one word even if you want to call it something like Increment Switch, just call it IncrementSwitch. You then save it in the Brain folder in the main Mach folder. Next step is to go back to Operator menu and click on Brain Control then when that opens click reload all brains and you should now see your new Brain in the list, click it then put a tick in the Enabled box and then finally press Reload Brain. That should now be it working and you can exit the Brain Control.
Hood
Title: Re: Need Extra Inputs
Post by: Katoh on January 16, 2013, 06:26:13 PM
Hood
Many Many Thanks!
I can definitely follow that.
Cheers
Katoh
Title: Re: Need Extra Inputs
Post by: Katoh on January 17, 2013, 09:53:46 PM
Hood I did what you said and got it working, but well there's always a but, the jog speed doesn't change with the switch its just at one constant , makes no difference's input 1 2 or 3.
Any Ideas on that one.
Cheers
Katoh
Title: Re: Need Extra Inputs
Post by: Hood on January 18, 2013, 02:52:54 AM
You need to be in incremental jog for the switch to work, that is why I suggested a 4 position switch or a 3 posswitch but one position being used as continuous.
Below is a screenshot of how you would scieve that.
Note the first input puts it in to continuous jog while the other three inputs put it into incremental whe one of them is selected and then, dependant on which one, the increment size is set.
Hood
Title: Re: Need Extra Inputs
Post by: Hood on January 18, 2013, 03:10:47 AM
Just to clarify, in the above screenshot the two Jog modes shown are different, just the Brain view doesnt show that up due to the way the text is displayed. The first one is Jog Mode Continuous and the second one is Jog Mode Increment.
Below is a better view.
Hood
Title: Re: Need Extra Inputs
Post by: Katoh on January 20, 2013, 08:39:38 AM
Hi Hood
Finally got round to doing this, could not seem to get it to work the way you showed but there is more than one way to skin a cat! Say's the Mouse ;D
Instead of commands being sent back as Increments I used jog%. So my first input , formula a*0.5 sets jog speed at 0.5% the second at 1% and the third flat out at 100%. Makes my little push button unit very user friendly.
Once again many thanks for your help, Ill get the cover made for this little beast and post some pics. Now I have to go back to welding up that boat hull,and yes I'm still at it, I  got frustrated and replaced most of the bottom plates.
Cheers
Katoh
Title: Re: Need Extra Inputs
Post by: Hood on January 20, 2013, 09:12:24 AM
;D