Hello Guest it is May 04, 2024, 10:56:28 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 »
2931
Mach4 General Discussion / Re: GoToWorkZero
« on: March 10, 2019, 04:24:16 PM »
Hi,
then use the screen load function GoToWorkZero().

I have made three suggestions and you have ignored all of them......

Craig

2932
Modbus / Re: My experiments with Mach3 ModBus and Arduino, Part I
« on: March 10, 2019, 04:21:17 PM »
Hi,
Modbus is a serial communication protocol, there is no way it can send accurately timed Step/Direction pulses
they are way to fast.

Craig

2933
Mach4 General Discussion / Re: GoToWorkZero
« on: March 10, 2019, 04:02:48 PM »
Hi,
apologies, have just noticed a typo in the code, it should read:

Code: [Select]
local rc=mc.mcCntlGotoZero(inst)
if (rc== -18) then
        wx.wxMessageBox('Machine not in idle state')
        do return end
end

I have had another thought, the API you are using calls a standard Mach Action which is programmed in the core and you can't
view or edit it. If it calls for an A axis move you will encounter the same fault, namely that the machine attempts to move
the A axis to zero despite you not having an A axis defined.

If that is the case you will HAVE to use the modified GoToWorkZero() function in the sceern load script as I originally
suggested.

Craig

2934
Mach4 General Discussion / Re: GoToWorkZero
« on: March 10, 2019, 03:51:28 PM »
Hi,
you should attempt to use the signal library instead.

If you wish to use the PLC script it will still work.

Have a close look at the API you are using:

Quote
LUA Syntax:
rc = mc.mcCntlGotoZero(
      number mInst)

Description:
Move the X,Y,A,B,C and then the Z axis to zero of the current fixture offset.

Parameters: Parameter Description
mInst The controller instance.


Returns: Return Code Description
MERROR_NOERROR No Error.
MERROR_INVALID_INSTANCE The mInst parameter was out of range.
MERROR_NOT_NOW The operation could not be completed at this time.

Note in particular the return codes. Alter you code to test the return code. I will almost guarantee that the machine
is not in 'idle' state and cannot therefore GoToWorkZero because its busy.

Code: [Select]
local rc=mc.mcCntlGotoZero(inst)
if (rc== -180 then
        wx.wxMessageBox('Machine not in idle state')
        do return end
end

Note that if you use the SigLib{} approach you avoid this difficulty because the GoToWorkZero() function is
in the Screen script and does not have to switch chunks as your approach does.

Try wx4.set, it is way more complete/developed.

Craig


2935
Mach4 General Discussion / Re: GoToWorkZero
« on: March 10, 2019, 03:27:53 PM »
Hi,
I notice that you have made your own screenset? You have very few Tabs to call on.

May I suggest loading wx4.set and see all those additional screens.....including diagnostics, probing  etc.
Then make a copy of it and THEN customize it. Its all very well making a new set from scratch but is there any need
to do without all those features that NFS has laboriously programmed into Mach?

Craig

2936
Mach4 General Discussion / Re: GoToWorkZero
« on: March 10, 2019, 03:23:12 PM »
Hi,
looking at the code I would guess you have that in the PLC script?
That works, but is not efficient. The PLC script runs many times a second, and your code will therefore
run many times per second. This type of input is called 'polling' and is common in Mach3.

With Mach4 however there is another way. Whenever a signal (input or output or even an internal Mach signal)
changes state the Signal Script runs, and the signal script looks into the Signal Library (SigLib{}) in the ScreenLoad
script for an entry corresponding to the signal which has changed. If it finds an entry it executes the inline function
defined there. If it doesn't find an entry, ie we are not interested in that signal then it returns without doing anything.

It sounds complicated and it certainly takes some effort to understand at first but thereafter is  very elegant
and programmatically efficient.

Craig


2937
Mach4 General Discussion / Re: GoToWorkZero
« on: March 10, 2019, 03:05:07 PM »
Hi,
if you only want  the screen button to work then edit the GoToWorkZero() function as I have
suggested and ignore the signal library addition.

Craig

2938
Hi,

Quote
I'm still learning the nuances of the Mach 4 control structure. But it does make sense.

When we say ' we are trying to learn Lua', its not really correct. The real challenge is learning how the different
parts of Mach interact and the vagaries of Machs API not Lua at all.

Craig

2939
Mach4 General Discussion / Re: GoToWorkZero
« on: March 10, 2019, 02:39:41 PM »
Hi,
open the screen editor and open the screen load script. Scan down through the file till about line 225
until you find the GoToWorkZero function:

Code: [Select]
---------------------------------------------------------------
-- Go To Work Zero() function.
---------------------------------------------------------------
function GoToWorkZero()
    --mc.mcCntlMdiExecute(inst, "G00 X0 Y0 A0")--Without Z moves
    mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0 A0\nG00 Z0")--With Z moves
end

Note that the active line (mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0 A0\nG00 Z)) has an A axis move.
I'm guessing that you don't have an A axis defined in your machine. So either edit the line to delete the A axis
reference or comment it out and add this line instead:

Code: [Select]
mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0 \nG00 Z)

To add a physical button....define a pin on your controller as an input, say ISIG_INPUT10 and then put this in the
SigLib{} in the screen load script:

Code: [Select]
[mc.ISIG_INPUT10]=function(state)
if state==1 then
      GoToWorkZero()
end
end,

Note that this is an entry in the signal library table and the second 'end' statement concludes the in line function definition
and the trailing ',' (comma) concludes the table entry. Don't forget the trailing comma!

Craig

2940
Mach4 General Discussion / Re: CNC drive AXBB-E
« on: March 09, 2019, 07:54:24 PM »
Hi,
yes 'potentially' is indeed the keyword.

Take an AC Step/Direction servo. A stream of pulses, let say 10,000 pulses per second are applied to a servo with a
10,000 count per revolution encoder. The servo will turn one revolution per second. Should the servo be loaded
it will slow somewhat, but the servo drive recognizes that its slipping behind and drives the servo to catch up.

Modern servos can maintain angular position and/or angular speed to within very small fractions of 1%, in the case of the
servo I described above to within 2 parts in 10,000 or so, or 0.02%. More modern servos with 20 bit encoders are very
much better again.

There are limits of course, if the load exceeds the torque the servo can produce it will slip behind and cannot catch up,
a servo would fault 'following error'.

Excluding the situation where the servo is overloaded the ability of the servo to accurately follow its commanded position
(or speed) is determined by the frequency at which it can correct itself. Modern servos (and VFDs) have typically 'refresh
rates' of 5-10kHz. This results in a closed loop servo bandwidth of 500Hz to 1kHz. Such a servo can respond and correct
a fluctuation in position (or speed) with 1/500th-1/1000th of a second, pretty damn good.

The ESS PID refresh rate is approximately 1kHz for a servo bandwidth of 100Hz. About 10th thats available by
an AC servo but still INFINITELY better than open loop. That is what ESS spindle PID does, it makes a feedback servo
of an ordinary spindle motor, albeit with somewhat reduced bandwidth.

You will certainly recall conversations on the forum where the concept of Mach enacting feedback has been discussed.
The communication delays preclude Mach itself from doing a good job. External motion controllers like the Hicon and CSMIO/A
can do so by adding a PID controlled analogue voltage to an analogue servo drive. They add that ability at considerable
cost. The ESS has enacted a similar feature but with one motor only ( the spindle) at no extra cost.

Thus the 'potential' is in fact 'ACTUAL' within the exception of overload, for which PID feedback cant fix, nor any other means either.

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 »