Hello Guest it is May 08, 2024, 12:42:34 AM

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 »
961
Hi,

Quote
that the only automated way to really return to a point is setting up limit switches.

Correct. However I would not call them Limit switches, these switches set the HOME position, they don't have to be at the limits. It is common to put them at the end or nearly the end of an axis but you don't have to.

For many years I ran my mini-mill without limit switches, but I did have Home switches, which were indeed a few mm from the ends of the axes. They were the best single addition I've ever made to my
machine. It meant that I could reliably start my machine and pick up from where I left off yesterday and also that Soft Limits worked properly. Given that I didn't have Limit switches having reliable
Soft Limits saved my bacon many many times.

My new build mill has six limit switches, one for each end of the three axes, and another three Home switches, close to the ends but not at the ends. They all have separate inputs, so if a switch activates
I know exactly which switch.

I can live without Limits but you really need Home switches.

Craig

962
Mach4 General Discussion / Re: Stupid LUA question
« on: December 14, 2021, 07:45:46 PM »
Hi,

Quote
local XAxisSelectSwitchInput = mc.ISIG_INPUT4

That is not illegal but it does not gain you anything. mc.ISIG_INPUT4 is just a number, I think in this case the number is 3. Its called an ENUM. It means that you do not have
to remember that Machs #4 input has the numeric equivalent of three.

What you really want to do is have the handles assigned to a variable. This is problematic. Lua is a self-memory manged language. When a variable goes out of scope then it will
be 'Garbage Collected'. If you wish it to stay permanent then you have to use a global variable....but that means that Lua has to stop and resolve the address of the variable each and every time
its required.....poor programming.

A handle is effectively a memory address of the variable concerned. What happens when the whole Lua chunk goes out of scope? The variable gets garbage collected. When that chunk is read back into the
CPU when its required some time later that variable will be assigned anew....with a new address, aka handle. Lua makes use of stacks, and these stacks contain data variables that are in use at the moment,
but these stacks can and do shift around. So if you had a global variable that pointed to a specific memory address you're going to have trouble because that memory address is not the variable that you thought
it was....it may be another variable or piece of instruction code altogether and really screw things up.

I make it a habit to use a variable only if its handle is calculated/resolved WITHIN the same scope. I'm not sure that is strictly necessary....but on the other hand I know it works. I would say that having
handles all over the place is the price you pay for having  dynamically allocated memory and autonomous garbage collection.

Craig

963
Hi,

Quote
. and we drive to the center of our workpiece and set all axis to zero... then we hit <ref all>... shutdown mach3, restart mach3... it should come up with mach3 displaying zero for all 3 axis?

No, as I said earlier Mach cannot save its position between sessions, or at least not directly.

For users who have a defined and repeatable home position, it works. If you have home switches then at each and every start-up you <Ref All> and that would drive to the home
switches and set the MACHINE COORDINATES to zero. You would now jog to the centre of the part and <Zero> each axis . Now the WORK COORDINATES would display zero and the G54 data
would reflect where the Work Zero is relative to the Machine zero. If you shut down properly the G54 should be saved on exit.

At the next session you power up and <Ref All> per normal, ie your machine drives to its exactly and repeatably defined Home location. Now you can MDI, using G54, to the Work Zero.
That would put the machine exactly back at the workpiece zero position. But note this requires the the machine be able to UNIQUELY and REPEATABLY go to its home position

You can see that all this absolutely requires that you can drive the machine, either manually by jogging or by using Home switches, to a defined location. If you can't do that you're screwed.
There are a couple of workarounds that will do what you want, but they are a distinct procedure. I used to do it myself years ago, and if you followed the procedure perfectly it worked,
forget even one step and it fails.

Then I fitted good Home switches and I've never had a problem since. Also with a good homing procedure, ie Home switches, then Soft Limits work properly and they have saved my ass countless times before,
and still do.

The procedure is:
1) Drive to the Work Zero point of the part in the vice.
2) <Ref All>, with Home in Place set on each axis
3) <Zero> each axis in turn. This should set G54 as 0,0,0. That is to say that prior to shutdown the Machine Zero is exactly coincident with the Work Zero, and therefore G54=0,0,0
4) Depower the machine.

At the next session:
1) Power up and Enable
2) WITHOUT JOGGING OR ANY OTHER MOTION <Ref All>. This, provided the machine has not moved at all since the last session, will put the Machine Zero exactly where you left off last time.
3) Either <Zero> each axis, this will put the Machine Zero coincident with the Work Zero. You could use G54, but if you followed the shut-down procedure then G54 should be 0,0,0, the two methods should
result in the exact same thing.

Craig

964
Hi,

Quote
You are saying that if I set home in place is an option somewhere and it will default to zero on startup if I'm reading that right

Not quite, but close. If you set Home in Place for all three axes then as the name suggests the if you <Ref All> the machine coordinates will all zero themselves
at the machines current location rather than driving all around looking for Home switches.

So the procedure is:
1) Power the machine up and Enable
2) <Ref All>
So this will mean that the machine coordinates are all now at zero at the machines current location. You now have to set the Work Coordinates, either using a previously saved G54
or by <Zero> for each axis. This last method assumes that the location at which you <Ref All>, ie machine coordinate zero, IS ALSO THE WORK COORDINATE ZERO.

Craig

965
Hi,

Quote
but rather assume it is at zero on startup

Then the procedure is:

Quote
yes, <Ref All> and in the homing page set all three axes to Home In PLace.

As I posted earlier, then set your work coords via a G54 or <Zero All>. If you have not previously recorded your G54 then you may be in trouble.

Craig



966
Mach4 General Discussion / Re: How to execute MDI?
« on: December 14, 2021, 03:21:23 PM »
Hi,

Quote
I am half way through a program and trying to move the head. Cycle Start will restart the program. Is MDI only aloud while not running a program?

That is correct.

When you are running a Gcode program the Gcode interpreter/trajectory planner is assigned to the Gcode job. If you wish to use the trajectory planner to jog or MDI it
must be decoupled from the running job, and then coupled to either the jog buttons or the MDI panel.

The trajectory planner is not and cannot be schizophrenic, it can have one and only one master at a time.

You may have noted that the Lua screen script, that is the totality of the screen, alternates control with the Gcode interpreter. This allows for things like the DROs and the toolpath display
to update while a Gcode job is running, otherwise the screen would sit idle and not change until the Gcode file had completed. This is not a multi threaded process however, it uses the
Coroutines feature of Lua. Thus the control passes back and forth between the Gcode interpreter or 'chunk' and the screen script or 'chunk'.

The question that occurs to me is that 'if Mach can alternate between chunks using coroutines, could the trajectory planner alternate between Gcode and MDI?'

The first thing that comes to mind it that because Mach is buffered the trajectory planner has sent P(osition)V(elocity) over T(ime) data to the motion controller. Should you wish to jog
or MDI you would HAVE to wait until the motion buffer in the motion controller drained otherwise PVT data would be lost and Mach would lose reference.

The second issue that comes to mind is what happens to the Gcode job while its suspended?

For instance lets say that the Gcode has called a  g90 g1 move to x1,y1,z1 location. The machine moves there and the DROs reflect that location. Then you issue a jog or MDI instruction
to move an additional 20mm of the x axis. Then the Gcode job resumes but the location of the machine is not x1,y1,z1 anymore but is x1+20,y1,z1. What should be the next move?
Should it be to location x2,y2,z2.......or should it be to x2+20,y2,z2?

This later alternative is suggestive of a work coordinate shift....which sort of makes sense. But what happens if you change mode during you MDI excursion?
In the example above the movement mode is g90 g1 as established by the Gcode job, but if your MDI instruction is g91 g0 x20, now when the Gcode job resumes its motion mode is
g0 incremental, rather than g1 absolute. That's going to screw up bigtime. You need some way of reliably resetting the mode such that a clash did not occur.

The last thing that occurs to me is that the vast majority of mc.mcMotion APIs,  mc.mcMotionCyclePlanner() for example, is listed as an API but does not have any Lua syntax, it has C/C++ syntax only.
This would suggest that this is not something you can program yourself, but rather the API was and is intended for use by device plugins. You'd be a game man to get involved with that.

Craig

967
Hi,
that won't really help much with the loss of reference however.

That's what happens if Mach crashes, you Estop or the power gets turned off. When you turn Mach back on it does not know where it is, really the numbers
from the last session are of dubious value, what happens if the machine has shifted between sessions? Also if Mach crashes or the power gets turned off what are the
chances that Mach can record it current position BEFORE it crashes/stops completely?

Loss of reference is a fact of life with Mach....and in fact MOST CNC machines. Any CNC machine that is either open loop, like Mach3/open loop steppers, OR, incremental encoder, like many servos,
when the machine is powered up it has no way to know where it is. You need to 'Reference' or 'Home' the machine to some defined and exactly repeatable position at the start of every session.

If you are lucky/wealthy enough to have servos with multi-turn absolute encoders, then when the machine powers up it knows exactly where it is. But the if you're wealthy enough to have servos
like that why are you pissing about with Mach3?

Craig

968
Hi,
yes, <Ref All> and in the homing page set all three axes to Home In PLace.

Craig

969
Mach4 General Discussion / Re: Mach4 Canned Cycles
« on: December 13, 2021, 07:19:18 PM »
Hi,
to my knowledge Mach4 does not have any canned cycles. The lathe profile does however have canned cycles, and they are supplied by MachMotion not NFS.
As a consequence the code is in complied form, that is to say you cannot view/edit the source code.

I'm guessing here, but I think the two files (CannedCycles.mcc and CannedCyleImages.mcc) in Mach4Hobby/Wizards folder are in fact placeholders for the corresponding files in the Lathe
Canned Cycles sub-folder.

Crag

970
Mach4 General Discussion / Re: Mill: General question about limit switches
« on: December 12, 2021, 05:33:26 PM »
Hi,
I have six limit switches, a '++' and a '--' for each axis, and three Home switches, one for each axis.....all on their own inputs.
I have soft limits set up to trigger just inside (about 1mm) the physical limit switches. This is because if you hit the physical limits the machine
Estops and therefore loses reference whereas SoftLimits do not cause an Estop and therefore no loss of reference.

Losing reference part way through a job is a PITA

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 »