Hello Guest it is April 26, 2024, 07:16:43 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - joeaverage

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 »
2951
Mach4 General Discussion / Re: pay for help
« on: March 06, 2019, 01:06:33 PM »
Hi,
what controller? Is it a motion controller?

Mach4, very much like Mach3, is an application that runs in the foreground. There would be a plugin
that translates Machs instructions into whatever format the controller required to enact them.

I'm not sure that you could 'run Mach4 in the background'. What you need is a plugin for your controller
to talk to Mach4. It would (probably) be possible for Mach to instruct your controller to execute certain functions including
programmed routines. That is to say that Mach would be supervisor but your existing controller would retain its motion control
status.

Craig

2952
Mach4 General Discussion / Re: macro problem
« on: March 06, 2019, 12:42:19 PM »
Hi,
you need to get into the habit of calling macros by their lowercase names, m220() not M220().
It will throw up errors from time to time which can be very hard to understand.

In Mach3 all M codes above M100 were considered user codes whereas any below that number were
reserved for Mach. I suspect m22() would work (in Mach4) but my preference is name it in such a manner that
there is no ambiguity.

Quote
Because you told me in the other thread on here that the code is sometimes different I will stop trying to use that for testing and just type in the MDI to test the M220 macro.

It not so much that the code is different but rather it is in two different locations. As Mach runs it is going from the GUI
chunk to the GCode interpreter chunk and back again all the time. What I have suggested is that if you want some particular
machine behavior that is the same in both chunks then code it in two places. With such simple code this is easy. If
the code were complex it would be best placed in a module. The module could then be accessed by either the GUI OR
the GCode interpreter but the code would not have to be repeated in both chunks.

Craig

2953
Mach4 General Discussion / Re: macro problem
« on: March 06, 2019, 11:57:53 AM »
Hi,
you are confusing a macro and a button script. Try writing them a two distinctly different pieces of code.

Next thing is don't call it m22(). All your macros should be named m100() or higher, avoiding m162 and m163
as they are also used by Mach for Laser Operations.


Try saving this as your macro, note that I renamed it m220():
Code: [Select]
function m220()
local inst=mc.mcGetInstance()
local sigHandle=mc.mcSignalGetHandle(inst,mc.OSIG_OUTPUT2)
mc.mcSignalSetState(sigHandle,1)
end
if (mc.mcInEditor()==1) then
m220()
end

For the button script use this:
Code: [Select]
local inst=mc.mcGetInstance()
local sigHandle=mc.mcSignalGetHandle(inst,mc.OSIG_OUTPUT2)
mc.mcSignalSetState(sigHandle,1)

You could as Chas has suggested call the macro with the mcCntlMDIExecute() API. When you press the button
the GUI chunk is running. Its actionis to execeute a macro which is in a different chunk, ie Mach has to switch from
one chunk to another. It can and does this all the time, but in this case is unnecessary, just repeat the functional code
in the button script and it will be compiled and contained within the GUI chunk and have no need of a context switch
to execute.

2954
Mach4 General Discussion / Re: last line not executing
« on: March 06, 2019, 11:31:12 AM »
Hi,

Quote
right now it is in a button but it will need to be in a macro

You need to make up your mind either way.......they are not the same. If its in a button the code ends up in one chunk
but if it's in a macro it ends up in another.

Quote
int mInst = 0

That comes from the usage example and its in C++, disregard it. That's not how its used in Lua.

Quote
What is the "BOOL" and why is it needed?

BOOL means Boolean, so it is a variable type, either True or False, again its applicable to C++, C and C++ are very
strongly typed languages whereas Lua is not. It does not mean you can disregard it but its less important.

Quote
And the last and biggest how do I put this in a loop to keep looking until it is false.
I tried but I keep getting errors.

As I have posted and ordinary counting type loop wont work. You need to use a timer to generate a delay. Further
the timer or delay can place no burden on Mach because you are waiting for Mach to complete an API function, you
can't tell it to 'count to 1000' and expect it to complete its API call at the same time.
Have you looked at Daz's video? Have you coded a wxTimer? Where did you put the code?
Depending on how you wish this code to be used will alter where the code is placed and how its accessed, thus
I need to know if its a button OR a macro before I can help.

I notice in another of your threads you have some code that you are trying to use in two places, one as a button
and one as a macro. I think you should consider them as distinctly different.

Craig

2955
Mach4 General Discussion / Re: last line not executing
« on: March 05, 2019, 11:48:30 PM »
Hi,
the reason I ask is because if this code is going to be attached to a button then it would be complied as part of
the GUI chunk. Therefore any wx.Timer code could go in the Screen Load script, which is of course always available
to all other code in the GUI.

If however you wish to run this code as a macro it will be complied and included in the Gcode interpreter chunk. Thus
any wx.Timer code in the screen load script (ie GUI chunk)  would not be available to it.

So I need to know how you intend to use this code in order that I can structure the code to the conditions of ude.

Craig


2956
Mach4 General Discussion / Re: Extract diagnostic values
« on: March 05, 2019, 02:16:02 AM »
Hi,
you could write a Lua program to read the encoder values, I presume they are pound variables,  and put them
into a file.

You can use this API to get a pound variable:
Code: [Select]
LUA Syntax:
value, rc = mc.mcCntlGetPoundVar(
number mInst,
number param)

Description:
Get the value of a system variable (pound variable).


I would suggest you use m400 and m401 as examples of how to open a data file, add data to it and then close it.
m400 and m401 are in Mach4Hobby/LuaExamples/ProbeToFile.

Craig

2957
Mach4 General Discussion / Re: Lua Error Code on Start up
« on: March 04, 2019, 11:58:13 PM »
Hi,
kool.

Found a video of Daz's that addresses some of the issues you faced:

https://www.machsupport.com/forum/index.php?topic=38826.0

Craig

2958
Video P*r*o*b*i*n*g / Re: 3d Probing on Granite slabs
« on: March 04, 2019, 11:27:34 PM »
Hi,

1) Yes, have been using Mach4 for a little over 2-1/2 years.

2) Yes, Mach4 can handle six coordinated axes (plus Out-of-Band axes as well up to a total of 32 motors).

3) Both Industrial AND Hobby handle probing identically.
Quote
and the industrial only having preparation for installing macros  from companies that sell probes.
I've never heard of that.
The only feature that Industrial offers that Hobby does not
is Macro B programming. It has some application in industrial programs, things like conditional Gcode and stuff like
that. Have a look at Cbyrdtoppers (Mach4 board) description of how he used it for his grinding machine. If you have
been using Mach3 and it works for you then you wont need (or miss) macro B. The real advantage of Industrial is
SUPPORT. You ring NFS and you go to the top of the queue.
I am not aware of anything that obligates you to buy
Industrial but note that the Industrial licence applies to ONE machine only. Hobby on the other hand can be used
on up to five machines. It might be worthwhile explaining your situation to NFS. It may not be unreasonable to start
with Hobby and if it goes well for you then get Industrial, maybe NFS can do some sort of upgrade?

4) With either Hobby OR Industrial you need a good controller. Remember that the controller handles ALL the realtime
functions so no matter how good Mach is (or isn't) the controller determines how the machine will behave.
I personally prefer the Ethernet Smoothstepper by Warp9 TD. It is moderately priced ($190), not the cheapest but not
the dearest either. Just recently a number of new realtime features have been added (backlash comp, lathe threading,
and encoder driven PID spindle control). The long awaited THC feature is due to be released in a few days. That makes
the ESS the most up-to-date controller in the moderate price bracket.

Other worthy contenders are the 57CNC by PoKeys, the PMDX-424 by PMDX, the UC300 by CNCDrive.
One of the more expensive ($600) offerings is the Hicon by VitalSystems. It has always enjoyed an reputation of having
well developed realtime features. Until just recently it was the only controller to offer realtime THC for instance.
Another extremely high quality offering are the motion controllers offered by Galil. For four axes they start at about $2000.

The Galil, Hicon, PMDX-424 and probably the 57CNC don't require a BoB whereas the ESS and UC300 do. I would recommend
the modestly priced ($23) C11, one only for a simple machine but two (or more) adds much more IO. You will have to make
a few simple additional circuits to 'flesh the C11 out', or buy a more expensive BoB. CNCRoom does an MB2 especially for
the ESS, all three ports are developed to be used and connected to the outside world. It is about $200.

5) I use a dual core (1.8 GHz) Atom mini-ITX board, with NO graphics card. Its a really low powered board but it works really
well. Its slow if I load really big etching files (10M plus) but once it loads and draws the toolpath it goes great guns
thereafter. The real advantage of using an external controller is that just about any 'cheap as chips' PC will work. Check
this little sucker out:

https://www.dfrobot.com/product-1585.html

$209 with 4G/64G and Windows 10 Enterpise already loaded.....hard to beat that value and less than 4 inches square!
To accommodate Mach alone Windows 10 with 4G RAM and 64G hard drive would be ample. A graphics card is recommended
but I don't have one on my machine so I hardly rate it as essential. i3 or i5 is any amount for Mach.
If you want to load CAD/CAM on the same PC  ??? then up the ante in the processor/memory/HDD/SSD/graphics to suit,
Mach doesn't require it but CAD/CAM do.

Craig



2959
Hi,
Mach4, like Mach3 which preceded it is CNC software. CNC is by and large a 'subtractive' process, that is you are
using a (typically) rotating tool to cut (grind, erode and otherwise chip away at and subtract from) a block of stock
material. It requires a machine that can position and move a tool in a precise path to create a finished path.

3D printing is an 'additive' process with material being extruded and consolidated to replicate a desired shape. 3D
printing thus requires a machine that can position and move an extrude head in a precise path to create a part.

In that regard (position and move in a precise path) both processes are the same and its logical to ask 'can one
machine do both?'. And the answer is yes. There are sufficient differences however that make such a 'one machine
fits all' approach impractical.

The principle difference is that any machine that has to hold a spindle and hold precisely in position has to resist
cutting forces and they can be very substantial. The machine must therefore be very solidly constructed and often heavy
to maintain the rigidity to control cutting forces. All that comes at a cost.

A 3D printer does not have to contain cutting forces and may therefore be very much more lightly constructed and still
retain the required precision.

If you wish to buy a 3D printer, lets say a $500 unit, but find that to have the ability to add a routing spindle ups the cost
to $2000, which are you going to buy?

Thus despite the similarities between 3D printing and CNC they tend to be regarded as separate machines. Likewise the software
which has evolved to enact each process is slightly different.

You could easily use Mach4 (and its supported Gcode) to 3D print. You would need to be a little creative to get Mach to control
the extrude head, but eminently possible.

There are however 3D printing control software solutions, many open source and free.......is there any need to use CNC software
like Mach4 to do something which can be done adequately with 3D printing software?

One area which I suspect CNC software surpasses 3D printing software is motor control. CNC software has long had to adapt
to many different motor control strategies and motion feedback. If you need and/or want that sort of control then Mach4
is highly versatile.

Craig


2960
Mach4 General Discussion / Re: last line not executing
« on: March 04, 2019, 09:45:06 PM »
Hi,
smuprh's comment and suggestion is spot on. We have to set the homing function in progress and then wait until it
completes. That could be done as smurph suggests by testing the machine state, knowing that the function has completed
and returned the machine to idle state before progressing.

I had thought of another way which achieves the same result. The API call I am thinking of is:
Code: [Select]
LUA Syntax:
homing, rc= mc.mcAxisIsHoming(
number mInst,
number axisId)

Description:
Check to see if an axis is in a home operation.

We can use this API to test whether the homing function is complete. But we need a delay in the loop.

Quote
What about some kind of counting loop.

The loop idea ties up the CPU. Additionally I would expect a counting loop to count up to 1000 in a millisecond
or so. I think a better idea is to use a wxTimer function. It is a timer  coded in wxLua but creates a Windows
function/event and so has no impact on Mach, its external to Mach. Have a look at Daz's video on wxTimers:

https://www.machsupport.com/forum/index.php?topic=32573.0

It may appear that it adds significant complexity but I think it would work well and not burden Mach with any
extra code.

This code.....where is it going? I note for example that you have not declared the 'inst' variable? Is it available
within the same scope as this code? If not then have to declare 'inst' otherwise your code will fail.

For the purposes of writing and debugging code I tend to make a function of it so I can use the debug facilities of
the Zero Brane editor.

Craig

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 »