Machsupport Forum

Mach Discussion => Brains Development => Topic started by: matttargett4 on December 27, 2008, 01:07:54 PM

Title: can i make an axis move?
Post by: matttargett4 on December 27, 2008, 01:07:54 PM
hi all,

ive been looking at the list of options for lobe termination to try to find an option that will move an axis and i cant find it, it may be obvious so i thought i would ask the people who know, if it cant be done could i do it with a macro pump or vb script, forgive me im not too familiar with them since ihave concentrated on brains up to now.

Thanks in advance

matt
Title: Re: can i make an axis move?
Post by: Overloaded on December 27, 2008, 01:23:10 PM
HI Matt,
 You can terminate a Brain with a Button Press that can move an axis...like "Homing" an axis or "Go to Safe Z".
I know little about it but you might need to give more specific information about what you are wanting to do.

Regards,
RC
Title: Re: can i make an axis move?
Post by: matttargett4 on December 27, 2008, 05:12:46 PM
ok so a few more details,

i was looking to make an axis move with a proportional response to an input, ideally id like to implement a pid loop with adjustable gain through dros, that part is no trouble since i can read oem dros into a lobe and write the pid loop into the function box which gives me an output value but i cant work out how to make the axis move in response to this value, i would be a start if it were just one way for posative and the other for negative rather than a proportional response.
not sure if you have any ideas?

thanks
matt
Title: Re: can i make an axis move?
Post by: Overloaded on December 27, 2008, 05:25:37 PM
I'm certain the additional details will help but I'm afraid its a bit over my head.
There are others here that can help I'm sure.
PoppaBear is great with this stuff. Did you see his Brains tutorial in the Members Docs. section ?
Wish you good luck,
RC
Title: Re: can i make an axis move?
Post by: poppabear on December 27, 2008, 07:40:17 PM
The question in my mind would be this: Would you be be pulling in the Current Axis DRO position then using that as a base input value, run it through the equation of your PID, then add that value as a positive of negative value and have the axis move to that adjusted position??

scott
Title: Re: can i make an axis move?
Post by: matttargett4 on December 28, 2008, 02:11:27 AM
yes thats what im looking to do or a variation on it!
Title: Re: can i make an axis move?
Post by: poppabear on December 28, 2008, 01:36:43 PM
you will need to post up here your PID equation, plus your dead band if you have one, also the scaling factor that your PID is controlling over.
How your PID value is coming in? i.e. on Analog input over the modbus?

is this something like a Plazma machine in where you are constantly changing the Z ht., depending on the Arc Current as the machine tavels?
Need some operational details to see if you want can be done this way or not.

scott
Title: Re: can i make an axis move?
Post by: matttargett4 on December 28, 2008, 02:53:51 PM
yes this is for a plasma z axis

the anaologue input is coming in from a pokeys device on modbus address 125

not bothered to work out the exact scaling factors yet, i was messing about to see if it could be done, i simlply have a pot connected at the mo to try to make a simple program that will make the axis respond to the pot position forgetting the pid loop for a minute

i have been trying bits and pieces it currently does this relyably

reads the value (Mod 125)

divides by 5

writes it to userdro 1001

Compares user dro1001 to user dro1002 (user entered value in the mach screen)

Here is where i stumble

I have tried writing this value to the z position dro but it wont seem to let me, any user dro is ok but not z position

ive also tried setting a crude threshold value and jogging the axis one way or the other depending on the value relative to the threshold, this works ok until a program is running then the g code seems to over rule it

ive also tried feeding this back into the thc up and down inputs, i can make the led slight but again has no affect on the axis, maybe there is some other criteria i must satisfy for these inputs to work, conicedently what do i do if i want to trigger an input from a brain, i guess i must enable it in the ports/pin window, is that it or do i have to specify a port or pin?

im in the process of trying to get the brain to write g code to move the axis through a macro - simple if the value is above the threshold then write one code and another if it is below the threshold but need to brush up on my scripting etc first.

Id be interested to see how you could do it, clearly reading the forum you are very capable with brains so i thank you for your help

matt
Title: Re: can i make an axis move?
Post by: poppabear on December 29, 2008, 12:04:44 AM
Matt,

    if your are running G Code you cannot Jog Mach3......  and that is that..............
BUT!!!
You DO have another option, you can have a standard Analog Motor drive your Tourch offset ht. (you can still have an overall Z axis move the entire head up and down, but have a DC motor move the tourch it self up and down by a screw or somthing. You can then have your PID loop control the up/down of the tourch by your current sensor, Purhaps putting a "Slider Resistor" on the tourch so that you can have a resistance to reference for  start ht. then have the pid adjust off of that or something according to the current amount.

NOTE: The Update Loop of Mach is 1/10th of a second, you would probably have better luck having something with a faster scan time adjust your PID like a PLC.

scott
Title: Re: can i make an axis move?
Post by: vmax549 on January 03, 2009, 11:51:16 PM
HIYA SCOTT, I thought mach could adjust z on the fly as a plasma mode????

Just a thought, (;-) TP
Title: Re: can i make an axis move?
Post by: matttargett4 on January 04, 2009, 02:21:45 AM
hi,

ive been fidddling a bit more and yes you can, the only trouble is to do it you have to use the torch up and down inputs, Found in the input signals config page and these are simply on or off so there is no way of implementing the pid loop, unless you could control the duration they are on and off for, pwm in other words but i cant see how to do this with a brain so im trying it with just the on/ off commands. Ive not had much time to mess lately but im havent got pat the thing where once you have told a brain to press a button then youve got to tell it to stop pressing it at the end of the brain or it just runs on endlessly, have been looking at some of scotss counting examples etc and i think the answer is in there but i just havent got to doing it yet. Let me know if you have any thoughts

matt
Title: Re: can i make an axis move?
Post by: poppabear on January 04, 2009, 11:37:21 AM
VMax,

     Here is my understanding (which can obvioulsy be wrong), but, It is my understanding with out a Plug in, then the "Z" is controlled up and down by an analog motor in relation to the Plazma current draw.

So, you would have a "Z" axis that is controlled UP and Down by Mach (the standard Z), and then another "Z-Head " that is controlled up and down by an analog motor that is driven through a PID loop that is in a PLC, or Plazma Controller, or from a "Plug in for Plazma", or some combination of the above.

It is my understanding that when "G-Code" is actually running in Mach3, The "Index" and "Head" of the Buffer are NOT together, and when they are NOT together, that disables any type of "Jogging" in standard Mach. BUT, if you write a Plug in, in which you CAN have direct control over jogging, then you CAN override this behavior. It is NOT wize to do so, and it will cause you problems. (Found out the hard way, when I started writing my Jog Plug ins).

I think Mach give Tourch/Plazma control signals that you can work with, but they are not step and direction signals.  Most of the stuff, and I think
Brian wrote an "Analog PID Loop" Plug in just for the above issues.  I think that Bob Cambel and that crowd that sell Plazma Boxes, all use some type of Current Adjusted Z-Head that is controlled as an analog PID loop somewhere.

scott
Title: Re: can i make an axis move?
Post by: vmax549 on January 04, 2009, 12:23:51 PM
HIYA Scott I may be wrong as well but I do remember it being discussed over at Yahoo.

Hello,
They only axis that you can change on the fly is the Z axis... The THC
is a very special case and is not available to the X and Y axis :(
Thanks
Brian


Hi:

No, while programmed motion is in control, no joggign is possible, the THC
correction is a special case in the code, any other axis would be ignored..
Also not a good idea to change the offsets as it runs. unknown what teh
effects woudl be, but not good I suspect.,.


Thanks,
Art


Just a thought, (;-) TP



Title: Re: can i make an axis move?
Post by: poppabear on January 04, 2009, 06:24:13 PM
Food for thought it appears..........   I personally am not running a Plazma table or doing a control at this time, so I have no way to explore this further.
Perhaps some one is in the "Current know", can respond to this with more updated experiences than mine.
I was Unaware that Brian changed the Z for the THC stuff, so that being the case, I would like to know what combination of parameters, and steps are needed to do the above.............

scott
Title: Re: can i make an axis move?
Post by: matttargett4 on January 05, 2009, 02:27:14 PM
scott,

i have made the z adjust on the fly using the following "fast and dirty" method.

If you open the plasma profile that is with the standard download of mach 3, go to the config inputs page and scroll down the list, there are 3 inputs called "thc on" "thc up" and "thc down", i have assigned hot keys to these inputs to test its operation.

Back on the program run screen in one of the lower boxes where tool info or something appears in mach 3 mill there are some plasma controls, there is a thc on button ans a couple of other things.

In order to allow the axis to be moved up and down using the hotkeys assigned this button must be clicked on and the "thc on" input must be activted ( this is normally connected to the plasma cutter and recives a signal after the arc has pierced the metal and is ready to move, mach normally waits for this signal before executing the next command, just ensures the arc is stable and any voltgae/current spikes have settled after the pierce) then the hotkeys will move the axis up and down.

The only other thing is im not sure if you need to be in plasma mode in the general config window, i propably am in it if it wont work.

Im currently working on getting the brain to react to an analogue input and activate these inputs so it all works but have been a bit busy.

My description probably stinks so shout if you are unsure, the other thing i wondered is i assume when you refer to "brian" you mean brian barker? Just asking since there is a thc plugin authored by brian barker which i have looked at and appears to do something similar to what i am talking about and i wondered if this wasthe man to ask about how to use / manipulate it?

Thanks alot, hope this is turning out to be interesting for a few people

matt
Title: Re: can i make an axis move?
Post by: poppabear on January 05, 2009, 06:55:20 PM
Yes, Brian is Brian Barker, he made a PID loop plug in, for plazma.

and thank you for your input, will file that tidbit in the old noodle..........

scott
Title: Re: can i make an axis move?
Post by: matttargett4 on January 06, 2009, 02:25:05 AM
scott,

glad i could help in some way, where do you think would be the best place to post try to speak to brian about his plugin? there was thread i found when searching the site about this that recieved no replies but nothing else?

thanks

matt