Hello Guest it is March 29, 2024, 05:14:02 AM

Author Topic: reference Script  (Read 8929 times)

0 Members and 1 Guest are viewing this topic.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: reference Script
« Reply #10 on: April 24, 2013, 06:36:30 AM »
It looks to me like you're correct - there's a problem with the plugin. The homing behavior you describe in your first post is wrong. It should set machine zero AFTER it's backed off the switch AND come to a stop.

Try replacing your while isMoving construct with this:

Code: [Select]
while isMoving() and (X < 100)
  X = X + 1
  sleep 100
wend

This will release the while loop after 10 seconds regardless.

This is NOT a fix for the homing problem - it will just show that homing is not finishing and therefore Mach is not releasing the isMoving semaphore.

Ian

Offline 1hxo

*
  •  20 20
    • View Profile
Re: reference Script
« Reply #11 on: April 24, 2013, 08:00:05 AM »
When i replace the script part with yours:
 dobutton(22)
 While isMoving() And (X < 100)
   X = X + 1
   sleep 100
 Wend
 code "g0 x10"
Then the script do a x ref then hangs 10 seconds then release the hang.
But it dont execute the following command and it dont hang.
I know its not a fix for my problem.
But it release mach3 without push stop button
I have seen written an email to the developer times whether there is a solution for.
Maybe give an another solution for this problem?

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: reference Script
« Reply #12 on: April 24, 2013, 08:21:44 AM »
The code "g0 x10" won't get executed because Mach is still waiting for the movement queue to empty before it will execute it. All the script does is show that VB is NOT hung and that it is isMoving that is not releasing. That more or less proves (to me at least) that the homing sequence is not only not working as it should but that it is NOT returning control to Mach either.

Ian

Offline 1hxo

*
  •  20 20
    • View Profile
Re: reference Script
« Reply #13 on: April 28, 2013, 07:36:03 PM »
Yes your are right.
Its an error with the pokeys plugin.
I have now connect my stepdriver to the lpt port to see how it should run normally.And when i use LPT port as controller and the pokeys as IO board all works very well.
and i must not write a script because mach3 makes all.
Also the softlimit function runs fine.with pokeys plugin not.

thanks for the food for thought

Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: reference Script
« Reply #14 on: March 17, 2014, 03:19:47 AM »
Just some clarification after receiving a question about a similar problem to e-mail...

The isMoving() bug should have been solved in one of the last year's updates.

Regarding homing procedure and why machine is stopped at location not equal to zero: homing procedure is there not for positioning the machine itself to zero, but solely for the control system to know where the zero position is. Since connection between PoKeys and Mach3 does not allow high speed operation as in case of LPT port, PoKeys device does homing and probing operations by itself (as any other external motion controller). PoKeys does it this way:
- return towards home switch until switch is hit
- slowly back-off the switch until switch is released
- in the exact moment when the switch is released, the position of the machine is saved (reset) and machine is commanded to a stop. Since the velocity of the machine at this point is greater than 0, it can not be stopped instantaneously, but moves a few ticks away from home position.
So, internal position counters are precisely reset at home position although the machine stops out of it. It might be different from Mach3's own homing, but the procedure above was proved to be very reliable and accurate on different machines.

Regarding the need for the latest Mach3 version: due to bugs, there have been changes to the internal structures that Mach3 exposes to plugins. As Mach3 plugins require the exact same memory alignment as it was used when compiling the plugin, the latest Mach3 version is required for PoKeys plugin. As certain PoKeys plugin functions require the new bug-free version of Mach3, we can not simply compile it agains an older SDK as it would break the plugin functionality.
« Last Edit: March 17, 2014, 03:25:42 AM by NeoTO »
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope