Hello Guest it is April 26, 2024, 02:53:05 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 »
1891
General Mach Discussion / Re: How do you resume after a flame-out?
« on: December 07, 2019, 01:17:28 AM »
Hi,
as I said the RFH feature is about the most confusing and frustrating feature of Mach3. If I'm not mistaken Mach will not traverse
a Gcode program which contains sub-routines and maybe even macros. Its been over four years since I last used Mach3....I don't
now recall all the details.

I've never had much difficulty with Mach4. Unless there is a specific reason not to I would recommend you look closely at Mach4.
Several months ago NFS released a script based THC feature for Mach4.

As you know script (software) THC solutions have never worked with Mach3 by virtue of communication delays and buffering delays
inherent in Mach3. THC requires real-time hardware or near real-time motion controller like Machs parallel port.
Thus for Mach4 to have a script solution for THC is a major advantage over Mach3. It must be said the best THC is still done
by a real-time motion controller but the script option is very welcome.

Craig

1892
Hi,
your welcome.

You'll need this link open when you start coding for real:

https://www.lua.org/manual/5.3/

It lives on my desktop 27/7 when I'm coding.

Craig

1893
Hi,
sorry misclicked and posted before I was ready....(my missus says that all the time????)

When you wish to run the code in the editor the function must be called......but what program or device is there to do the calling?
There isn't a parent program to do it and that's where that little bit of extra code at the end of just about every macro in Mach4
comes in.

It says that.....IF Mach is in Editor Mode......THEN call the function m101() (please...)
So that little bit of code formally calls you macro function code so you can run/debug it. The extra code has no revelance to
your Gcode program as Mach is not in Editor mode at that time so the call is ignored.

Ok....we now have a structure for your first macro, but what is your macro to do?
You want a text box that has to be cleared by the operator. That's easy. Mach4, or rather Lua which underpins it, makes
very liberal use of wxWidgets, which does amongst other things (a very VERY VERY GREAT number of other things)
a textbox called wx.MessageBox.

wxWidgets is one of those steep learning curves that you will encounter....its written and composed by computer geeks for computer
geeks, and from what my mother told me its a wonder that they are not all blind!

Fortunately wxMessage box is easy enough that it doesn't risk your eyesight.

Code: [Select]
function m102()
local inst=mc.mcGetInstance()
wx.wxMessageBox('OK, clear the bloody box you plonker!')
end
if (mc.mcInEditor()==1) then
m102()
end

Note that I called and save the macro as m102() as I already had an m101() which I did not wish to overwrite.
You might ask what is the:
Quote
local inst=mc.mcGetInstance()
line all about?
Firstly Lua is a self memory managed language. When a variable is created it will stay in memory until its 'garbage collected'
by Lua. When you specify 'local' it means that its safe for Lua to garbage collect the variable when it goes out of scope. If you
don't declare your variable as local then it will be global and clog up your PC. The rule in Lua is that all variables should be
local UNLESS there is some specific and overriding need to do otherwise.

Secondly, Mach is intended, not as yet implemented, but will be one day, to run in multiple instances on one PC, referring to different
machines or perhaps different sections of one large production machine. As such when addressing Mach you need to specify
which 'instance' you are referring to. While its not required here...I put it there so you get used to seeing it, you will need it in
times to come.

Craig

1894
Hi,
Ok....so what to write?

All Mach4 macros start with an 'm'. Note here I use lowercase deliberately, uppercase works but fails occasionally which I will
explain later.

I follow the tradition set by Mach3 that any user macros should be numbered m100 or higher. Mach4 has some macros you don't
and should not overwrite, like m5 or m30. You can in fact overwrite them but that might also break your machine. Unless you
deliberately and especially wish to overwrite one of Machs core macros then chose to name your macros m100 or higher.
One small exception is m162 and m163. Those macros ship with Mach4 and are for laser ops, I would not by choice overwrite
them, despite me not having a laser.

All macros in Mach are functions and are called by a Gcode program by writing m101 for instance.

In your macros folder is where the function is stored:

function m101()
......
......
.....function body
.....
.....
end
if (mc.mcInEditor()==1) then
      m101()
end

So the function, in Lua is m101(). Then what is the deal with the:
Quote
if (mc.mcInEditor()==1) then
      m101()
end

1895
Hi,
yes, that is easy stuff for Mach4.

There is a steep learning curve to Mach4 with respect to customizing it, first there's Lua, then there is Machs API and then
Machs structure. Many feel that its too tough but those who have made the effort to climb the curve are rewarded with an
endlessly flexible CNC solution.

Writing macros in Mach4 is a breathe of fresh air after Mach3.

First open either the Edit/Debug Scripts OR Open Script Editor from the Operator tab.
I have chosen to open the script editor, called Zero Brane, because its more general and shows a comprehensive file tree
which in turn alludes to how Mach is structured.

The first thing to realize is that macros are stored in the Macros folder of EACH profile. If you have two profiles, lets say an
engraving profile, and another mill profile for when you want to cut brass say.....then EACH profile will have a distinct
Macros folder. If you write a macro for one profile but decide that its applicable to the other profile as well you'll have
to copy it to that profile Macros folder as well. There is a better way....called modules.....but lets not muddy the waters just yet!

You can see that I navigated the tree to my profile, C:\Mach4Hobby\Profiles\ESSMill\Macros...... and there is the list of my own
macros on my laptop.

You may note that the same macro m101 has several different versions, m101.lua, m101.mcs, and m101.mcc
The version we are interested in is the .mcs file, (macro code source). The .mcc is the compiled code and is gibberish to us,
its generated when the .mcs file is compiled. The .lua file is extraneous but Zero Brane generates .lua files by default where we
really want .mcs files to populate our macros folder.

With the Zero Brane editor now open you can write a macro at will. You can save it where you want by navigating the file tree,
but you'll naturally want to save it to your current profile Macros folder.

The Zero Brane editor allows you to write and debug ( by running the code) Lua. It has quite a few features that you would expect
for an editor designed for writing computer code, things like auto complete, various breakpoint devices plus all the usual Find
and Replace text editing commands.

Craig



1896
General Mach Discussion / Re: How do you resume after a flame-out?
« on: December 06, 2019, 03:25:57 AM »
Hi,
is called 'Run From Here' (RFH) and its problematic and given more grief and caused more crashes and gouged work
than any other feature of Mach3. The good news is that if you study it hard enough and practice with it....it will make sense
and is entirely useable.

I'm not sure that ALL of this applies to a plasma table but much will be in common with any mill program.

At any given point in time during a Gcode program your machine will be in a mode, it might be a G1 mode with a feed rate of F,
or it might be in incremental mode with a G51 scale factor and a G68 rotation in action. If you direct Mach to start at any
random Gcode line how is Mach to interpret the Gcode without knowledge of how it got there and what state or mode its in?

When you <Run From Here> Mach will traverse through the program without motion until it arrives at your nominated start
line and thereby have learned what state and mode it is supposed to be in. The next thing it does is a preparatory move
to the location immediately prior to your nominated start point. Mach will move in a direct linear interpolation to that point.
If that point is within the stock volume then its entirely probable you will gouge your work. You are advised to break the preparatory
move into two, first move to the XY location with the tool above the work (safe Z height), THEN move Z to its cutting position
below the work surface.

As I say this applies to a mill but I suspect that much of the thinking behind the procedure is identical to plasma.

Craig

1897
General Mach Discussion / Re: Wrong sizes
« on: December 05, 2019, 12:55:33 PM »
Hi,

Quote
I have no idea what microstep regime is?

If you don't know you need to find out. How did you set the <steps per unit> value in Mach motor tuning pages WITHOUT
knowing?

The microstepping regime is the number of pulses required to cause the stepper to rotate 1 turn. Most normal two phase steppers
require 200 pulses, this is called fullstep. If the drive is set to half step it would require 400 pulses. 1/4 step 800 pluses and so on.
A good middle of the road setting is 8 microsteps per fullstep or 1600 pulses per rev. You need to set the microswitches on your drive
to do that.

Craig

1898
General Mach Discussion / Re: Wrong sizes
« on: December 05, 2019, 12:39:04 PM »
Hi,
you have calculated the <steps per unit> value incorrectly.

You say you have 8TPI leadscrews, are they two start?
Are your steppers direct coupled to the lead screw or do you have a gear or belt reduction?
What microstepping regime are you using?

With these numbers it possiblt to calculate the required <steps per unit>.

Craig

1899
Mach4 General Discussion / Re: Mach4 with XHC ethernet motion card
« on: December 05, 2019, 12:32:17 PM »
Hi,

Quote
If I was to replace the card I currently have Ethernet SmoothStepper would it be possible with the rest of the equipment I have.

Yes it is possible. Note the SmoothStepper and the UC300 both require a breakout board(s) A breakout board is just an
amplifier/buffer and allows you to attach wires with screw terminals.

Simple breakout boards like the C10 are $23 each right up to the MB3 for $180 depending on the sophistication and features you want.

Craig

1900
Mach4 General Discussion / Re: Mach4 with XHC ethernet motion card
« on: December 05, 2019, 10:14:09 AM »
Hi,
XHC produce Mach3 an Mach4 capable boards, that one is an example of a Mach3 board.

The XHC Mach4 board plugin is that buggy that to my knowledge no-one uses it....and the company seem to have no inclination
to fix it.

Lack of product support is a recurring theme with Chinese made boards and XHC in particular. I would recommend a US or
European made board like an Ethernet SmoothStepper or UC300.

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 »