Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 26, 2012, 01:47:48 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
Brains Development
formulas in brains
Pages:
1
Go Down
« previous
next »
Author
Topic: formulas in brains (Read 1451 times)
0 Members and 1 Guest are viewing this topic.
Ya-Nvr-No
Active Member
Offline
Posts: 268
Scuptris 3D
formulas in brains
«
on:
May 03, 2010, 02:30:49 PM »
Attempting to write a "brain formula" that uses variables.
By swinging a rotary b & c axis head.
Something like the following:
v0=userdro(1198) 'C axis Swing Radius user inputted
v1=userdro(1199) 'B axis Swing radius tool holder face position
v2=ToolLengthOffset
v3=v0-((cos(c/180*3.1416)*v0) 'calculate the cosine of the C axis angle
v4=(sin(c/180*3.1416)*-v0 'calculate the sine of C
v5=Y Position 'get the current position
v6=X Position
v7=Z Position
v8=v3+v5 'compute for new position
v9=v4+v6
Y Position = v8 'update the dro to the new position
X position = v9
'Now drive to location
I can calculate the positions and pass them the the X and Y positions. The
screen shows the computed value after I move C axis. Seems like I could do this
in all one swing move.
Could someone pass along a reference document how these variables & formulas
work.
I can create a calculated value but cant seem to add or pass them back.
And what correlation is there to Mach3 variables?
DRO(801)=v? or y?
a b c etc... not sure if they are axis's or variables.
Seems like both.
As fast as the brains run they should be able to update positions in real time.
I looked at formulas under Functions Config but they dont seem to do anymore
than let me test the calculations. I am running 3.42.40
My lack of gray matter as I get older.
Thanks for any guidance.
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: formulas in brains
«
Reply #1 on:
May 06, 2010, 03:27:40 AM »
Brains formula
in your case above, given that you need to drive to a new calculated machine position.
Brians in this case doesnt have functions to set and do, goto some axis position function.
you would need the ability to run Motion code, so, you would need to make your above
code run in 1 of three options:
1). Macropump/(or custom macros depending on what your tyring to do)
with VB script, (you would need to decide if you want to have it run
all the time and activate it by setting an control LED), or if the above code
can be condensed into a custom Macro that you call when you need it.
2). you could use G code "Parameters/functions", mabey a subroutine.
3). do or get a plugin done.
scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Ya-Nvr-No
Active Member
Offline
Posts: 268
Scuptris 3D
Re: formulas in brains
«
Reply #2 on:
May 06, 2010, 03:05:24 PM »
Thanks for the reply
I'm working on a plugin now, I have C axis working, now to get B. I love a good matrix's
Could you still explain the variables, I'm at a loss for some examples of how to use more than one of them. Are they written to the 500 range? Kind of was looking for some documentation. But pretty limited from what I found on the NET on variable usage. They speak about using A B C also as variables but can only get A to work.
Thanks again
Craig
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: formulas in brains
«
Reply #3 on:
May 07, 2010, 03:36:45 AM »
Craig,
For "Parametric" G code variables, look in the MachMill users guide for the range.
You can access the parameters under I think MachView or mabey it was the _setup in plugins cant remember which one it was. But, from your code above, it looks like your pulling all User DROs and intrinsic mach info, nothing out of the running G code file.
scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Ya-Nvr-No
Active Member
Offline
Posts: 268
Scuptris 3D
Re: formulas in brains
«
Reply #4 on:
May 07, 2010, 05:41:22 AM »
Sorry,
I thought we we referring to Brains, were did I led you to think I was needing GCode Parametric variables? I guess maybe because I was just trying to see if there was some universal crock pot of variables that could be seen and utilized. That's why I mentioned the 500 range. I'm new to mach so be gentle. Trying to understand just what all I can do with brains, mine and mach's.
Is there a Holy Grail (documentation) on the Brain? I did find your fine article, among others, thank you. But still looking for something on brain variables. Sorry, I'm a resource glutton, love a good Library.
Thanks
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: formulas in brains
«
Reply #5 on:
May 07, 2010, 10:55:15 PM »
the "Vars" in Brians are local only for that Brian.
Brians can't do MDI style motion control, directly, you can do some indirectly, but I dont think you want to fool with that.
for motion control, it would be better to go with VB script (easier), or a C++ plugin (ALOT harder).
scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Ya-Nvr-No
Active Member
Offline
Posts: 268
Scuptris 3D
Re: formulas in brains
«
Reply #6 on:
May 07, 2010, 11:59:58 PM »
Just finished getting my C++ plugin working in both B and C axis. Now I can swing the head and it moves the XYZ axis's around the ball tip of the cutter or the center. Now to add functions to drive along vectors. Like to beable to Mill pockets and Drill at compound angles. Cuts down on setups. Guess I'll just figure out how brains work in time.
Thanks
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: formulas in brains
«
Reply #7 on:
May 08, 2010, 03:23:49 AM »
Brians do work, for IO, and several Mach functions, they just dont do motion control type stuff....
But for processing, Modbus IO, buttons, LEDs, DROs and other HMI functions of Mach and doing logic with that stuff, they are pretty good.
scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Ya-Nvr-No
Active Member
Offline
Posts: 268
Scuptris 3D
Re: formulas in brains
«
Reply #8 on:
May 08, 2010, 06:21:55 AM »
I did write a brain to move an axis, so I do know that it is possible. I just didn't like the lack of axis control. That is why I was looking for more information on brain variables. Which led me to move on to other alternatives to complete the task.
Ya-Nvr-No
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: formulas in brains
«
Reply #9 on:
May 08, 2010, 10:53:32 PM »
yes you can move an axis with Brians, that is true, but fine and intelligent control it cant do.
scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...