Hello Guest it is April 18, 2024, 08:46:54 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 »
81
Mach4 General Discussion / Re: access denied - Machine.ini
« on: May 01, 2023, 09:29:50 PM »
Hi,

Quote
It would just be nice not to have to fight the copy/paste directory/file situation as often as I do, but I guess Mach4 is what it is, and I'll have to live with it  :)

I have found situations rather like that where I might wish Mach4 had more the characteristics of a good IDE......but it doesn't and that's the end of it. Several hours later when
you've been making parts and Mach has done a great job....that's when you realise that Mach4 is doing EXCATLY as its meant to. Whenever I feel some frustration coming on
when I'm trying to code something I try to remember this. After using Mach4 for about eight years now I can go months at a time when I never invoke the editor or write
so much as a line of code.

I spend hours with Fusion 360 generating and simulating Gcode and my machine just consumes it. The biggest issue I have to worry about is 'did I touch off to that surface
or was it that surface?', or 'did I allow for that clamp?' or something along those lines, I never really have to consider how Mach works, it just does, and 99.999% of the time seamlessly.

Craig

82
Mach4 General Discussion / Re: Step increment cycling issue
« on: May 01, 2023, 09:14:31 PM »
Hi,
I filled all increment slots.

I used to have 1mm and 0.5mm as the largest increments but both caused 'after-run' where the machine would carry on even once I had stopped spinning the MPG.
This was because the increments were 'stacking up' faster than the machine could consume them. Reducing the maximum increment to 0.1mm solved it, now I can spin the
MPG as fast as I like WITHOUT suffering any, or at least any major, after-run.

This left the quandry, what do I do with those other increments? As you can see I filled them with the same numbers, just repeats. It works.

I notice that most people,and for many years that included me, would have increments spaced by a factor of ten eg 1, 0.1,0.01,0.001,0.0001.
I found those steps to coarse. If I was touching off, 0.1mm was a bit coarse and I could not define an edge with the level of accuracy that I would like, however
if I went to 0.01mm touching off seemed to take an age. A five fold increase in resolution, or even a doubling in resolution is more practical in my opinion.

Craig

83
Mach4 General Discussion / Re: access denied - Machine.ini
« on: May 01, 2023, 03:39:20 PM »
Hi,

Quote
From what I understand (I may be wrong here) Lua relies on the application program (ie Mach4) to take care of error handling, and Mach4 hasn't done a great job.

Lua has very basic error handling where it has any at all, you get a stack dump and thats about it.

Lua is a scripting language, it takes your Lua instructions and generates what amounts to C code. As you know C is very good, but it has to be in every
way perfect to run, all the data types must match exactly, any and all data structures must match perfectly and so on. Lua is a great way to generate
simple but useful code BUT DOES NOT require the level of perfection and expertise that C code demands.

Amongst the things that simplify Lua is being essentially type free....however it is also one of the areas that cause the most grief. If you feel that simplification comes
at too greater cost then write your code in C.

All Lua code should be written and tested in a sandbox. It must be compiled on its own and then tested by single stepping through it with Zero Brane. Only once its
written, tested and de-bugged should you commit it to being combined with all the other code and compiled into the Screen Script. If you write code and introduce it
into the screen script without de-bugging it first you are asking for trouble.

Mach4 is a CNC software, it primary purpose is a Gcode interpreter and trajectory planner. It has a GUI to assist and a scripting program to assist users
to generate their own code.......but its not a software development environment. If you expect all the bells and whistles of an IDE like MSStudio you'll be disappointed.
Your wife is right, have you noticed they always are, you need to start making chips. Mach4 is largely complete and does not require any additions in order for you to
make parts.

When I started with Mach4 I too wrote a suite of additional code......almost all of it has since been deleted....I just don't need it, I thought I did but practical machining
showed me that I did not. I have maybe four macros that I use day in and day out and could not work/make a living without them....all the rest is just time
wasting.

Craig

84
Mach4 General Discussion / Re: access denied - Machine.ini
« on: May 01, 2023, 12:38:58 AM »
Hi,
there are two, maybe three chunks of code when Mach is running. If you crash one chunk often times the GUI chunk will carry on running.
In that circumstance its necessary to use the Windows Task Manager to close the remaining chunk that is still running so that you can fire up a fresh instance
of Mach.

When you are coding you work on only a small part. When you want to run that code it gets combined with all the other fragments of code, many hundreds of chunks and they
are compiled into one mega chunk, variously called the 'Screen Script'. If that script fails to compile because of an error in anyone of those code fragments then Mach will fail also.

You are correct, if you are coding and not going too well you can often bugger up Mach, but if you correct, or delete the offending piece of code everything comes back to normal.
I have not encountered any file corruption, other than of my making, in the eight or so years I've been running Mach. To my knowledge Machs file handling is robust but a particularly
clever operator can always screw it up no matter how robust Mach is! ;D....I've done it plenty!

Craig

85
Hi,
this post should be on the Mach4 General Discussion board, no doubt Tweakie will shift it in due course.

That is a common 'problem' that you describe, I put the 'problem' in quotations because it is not actually a problem or fault with Mach at all....its doing exactly
what its supposed to do.

There are two jogging modes in Mach (3 OR 4), incremental or velocity.

The most common is incremental mode, and what you have described is what you are doing. In incremental mode the machine will advance 0.1mm or whatever 'incremental distance'
you have programmed into Mach with each button press, or wheel spin if using an MPG. The problem arise when the 'increments' stack up faster than the machine can go. Those extra 'increments'
are stored up....so after you release the button or stop spinning the MPG they will still be executed. That is called 'after-run' and that is doing exactly what you wanted. You issued
say 1000 'increments' and now it goes ahead and does them.

This results because in incremental mode with keyboard jogging when you hold a button down Windows interprets that as repeated button presses and thus by holding the button
the 'increments' get stacked up.

I used to have my max increment set to 1mm per increment. I suffered greatly from the problem you describe, I'd stop spinning the MPG (holding the button) and yet the machine would carry on until it had
consumed all those incremental moves I'd dialled up. This is essentially because the incremental distance is accumulating faster than the machine can consume them. I have reduced the max
increment to 0.1mm and now I can get the increments to stack up if I spin the MPG (hold the button) as fast as I can but mostly it never happens.

May I suggest that you try velocity mode. There the machine will advance at the programmed jog rate while you hold the button down, but stop the moment you release it.
If you are rapid jogging back and forth it is a good way to go. If you want to touch off to a part the incremental moves with a small increment is the safest and most accurate way.

Craig

86
Hi,
yes HomeInPlace is the ONLY way you can set a machine coordinate at will.

The problem arises that when you stop at a location the machine coords will be xmcymczmc and due to the work Offsets
the position of the machine is xwcywczwc, this is the position the DRO shows, but is in fact the arithmetic combination
of the applicable work offsets AND the machine coordinates.

When you turn Mach on you want the DRO to read the same....but you also want the machine coordinates to be the same. The code you have written does not set
the machine coordinates. How do you intend on setting them?

Craig

87
Hi,
I'm not so sure that will work.

In particular your use of:
mc.mcAxisSetPos(inst, mc.X_AXIS,regvalx)

will set the WorkOffset for that axis such that the DRO reports the required position relative to machine coordinates....BUT.....you've just fired up Mach......the machine
coordinates are undefined...so what does your WorkOffset mean? It traditionally and normally means a certain distance from the Home position but you have no
defined Home position when you first fire up Mach.

If you are trying to set machine coordinates to some previously saved value then your code fails.....that API does not set machine coordinates. The ONLY way to set machine coordinates
is by one of the Home procedures.

If you however Home first.....then you can set the machine to whatever you want....but why not just use G54, that is saved at shutdown and you don't have to write any code.
In fact all the WorkOffsets G54, G55, G56 etc are saved at shutdown automatically.

Just to illustrate the procedure:
Lets say I'm working on a project. The machine is Homed and I have set the G54 work coordinates to the very corner of the material in the vice. I do two of the three ops
before leaving for the night. I can shut the machine down. The next morning I'll power up the machine and FIRST thing I do is Home. This sets the machine coordinates.
My Home switches allow me to Home to the same location to better than 0.02mm every time.

I now MDI G54, being the work offset set that was in use the day before, so my machine now knows exactly where the corner of the material is and I can now hit <CycleStart> on
the third and final op to finish the part.

Craig

88
Hi,

Quote
I used scr.SetProperty("droCurrentX","Value",regval) to set the dro but as soon as I move the axis it reverts back to the original position before I changed it.
What command should I use to do this?

That is incorrect. The numeric value displayed in a DRO is just the visual artefact that results from displaying the true internal value. For instance lets assume the X axis
position is x=123.456. You come along blithely and set the DRO to 654.321, but the true and underlying value remains 123.456, and therefore at the next screen re-draw
the DRO again displays that true and underlying value.

The machine coordinates of the current location of the machine are determined by the distance from the Home point or Reference point and the machine position.
The only way to change the machine coordinates to some other value is to shift the machine......end of story. Work coordinates can be changed however.
The commonly displayed axis position  is = machine coordinate (of that axis)  - WorkOffset (of that axis). You can change the WorkOffset with Gcodes or with a script.

This concept is hard for most people to grasp......you cannot set a machine coordinates at will. The only way to set a machine coordinate is by using one of the Homing procedures.
There is s trick means of doing so by using the HomeInPLace function......but its confusing....and ultimately counterproductive. I tried using it years ago...and it worked
but actually caused me more grief than it was supposed to solve.

By the way, this API works by changing the WorkOffset....not as most people assume by changing the machine coordinate:

Code: [Select]
LUA Syntax:
rc = mc.mcAxisSetPos(
number mInst,
number axisId,
number val);

Description:
Set the Position of an axis by changing the fixture offset.

Craig

90
Hi,
there is a GotoZero button, and there is a means of having the keyboard enabled on start up, and they have been discussed at length on this board within the last month,
some searching is warranted.

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 »