miss_step Routine
- Jeff_in_Wa
- Offline
- Senior Member
Less
More
- Posts: 68
- Thank you received: 5
12 Jun 2021 21:26 #211896
by Jeff_in_Wa
miss_step Routine was created by Jeff_in_Wa
I've been spending way too much time tracking down my lost steps and found this set of threads from andypugh
www.forum.linuxcnc.org/38-general-linuxc...50-lost-step-counter
I have it running, but I'm certain, not the way it is supposed to
When I home the machine, I get a window that shows me the missed steps message as the miss_step file is calling it to do
But when I jog the machine, I get a missed step message and the machine just keeps moving in the same direction I jogged it in
Hitting the E stop in between getting numerous messages stops the free for all
I have not changed the original miss_step routine from Andy's original post
Here is what I have in the postgui.hal file
# -- AndyPugh zero checker connections
net check0 miss_step.axis.0.pos-cmd axis.x.pos-cmd
net Xpos miss_step.axis.0.motor-pos-cmd
Here is the miss_step file
#!/usr/bin/python
import hal, time
import sys
from Tkinter import *
import tkMessageBox
root = Tk()
root.withdraw()
h = hal.component("miss_step")
count = 1
for opt in sys.argv[1:]:
(dummy, count) = opt.split("=")
if dummy != "count":
count = 1
pins = []
for i in range(int(count)):
p1 = "axis.%i.pos-cmd" %i
p2 = "axis.%i.motor-pos-cmd" %i
d = 0
t = [p1, p2, d]
pins.append(t)
h.newpin(p1, hal.HAL_FLOAT, hal.HAL_IN)
h.newpin(p2, hal.HAL_FLOAT, hal.HAL_IN)
h.ready()
try:
flag = False
while 1:
time.sleep (1)
for t in pins:
if h[t[0]]-h[t[1]] != t[2]:
flag = True
t[2] = h[t[0]]-h[t[1]]
if flag == True:
flag = False
message = ""
for t in pins:
message = message + t[0] + " = %f\n"%t[2]
ret = tkMessageBox._show("Homing Position Differs",
message,
tkMessageBox.QUESTION, tkMessageBox.OK)
root.update()
except KeyboardInterrupt:
raise SystemExit
Here is the line in the custom.hal file
loadusr -W /home/jeff/Desktop/Mauer-Mill/miss_step count=3
I'm not sure what is causing the machine to just take off on it's own with this code.
And I'm not sure this code really helps me as I don't think I can look at the separate Y pins with this code
This code works with X
net check0 miss_step.axis.0.pos-cmd axis.x.pos-cmd
But I don't think there is a axis.y1 or axis y2.pos-cmd pin
The goal is to compare the two Y motors at the end of a gcode run. I need to see which motor is missing steps. Or both.
I can't get the X or Z to fail. Just these two.
Thanks much for the help
www.forum.linuxcnc.org/38-general-linuxc...50-lost-step-counter
I have it running, but I'm certain, not the way it is supposed to
When I home the machine, I get a window that shows me the missed steps message as the miss_step file is calling it to do
But when I jog the machine, I get a missed step message and the machine just keeps moving in the same direction I jogged it in
Hitting the E stop in between getting numerous messages stops the free for all
I have not changed the original miss_step routine from Andy's original post
Here is what I have in the postgui.hal file
# -- AndyPugh zero checker connections
net check0 miss_step.axis.0.pos-cmd axis.x.pos-cmd
net Xpos miss_step.axis.0.motor-pos-cmd
Here is the miss_step file
#!/usr/bin/python
import hal, time
import sys
from Tkinter import *
import tkMessageBox
root = Tk()
root.withdraw()
h = hal.component("miss_step")
count = 1
for opt in sys.argv[1:]:
(dummy, count) = opt.split("=")
if dummy != "count":
count = 1
pins = []
for i in range(int(count)):
p1 = "axis.%i.pos-cmd" %i
p2 = "axis.%i.motor-pos-cmd" %i
d = 0
t = [p1, p2, d]
pins.append(t)
h.newpin(p1, hal.HAL_FLOAT, hal.HAL_IN)
h.newpin(p2, hal.HAL_FLOAT, hal.HAL_IN)
h.ready()
try:
flag = False
while 1:
time.sleep (1)
for t in pins:
if h[t[0]]-h[t[1]] != t[2]:
flag = True
t[2] = h[t[0]]-h[t[1]]
if flag == True:
flag = False
message = ""
for t in pins:
message = message + t[0] + " = %f\n"%t[2]
ret = tkMessageBox._show("Homing Position Differs",
message,
tkMessageBox.QUESTION, tkMessageBox.OK)
root.update()
except KeyboardInterrupt:
raise SystemExit
Here is the line in the custom.hal file
loadusr -W /home/jeff/Desktop/Mauer-Mill/miss_step count=3
I'm not sure what is causing the machine to just take off on it's own with this code.
And I'm not sure this code really helps me as I don't think I can look at the separate Y pins with this code
This code works with X
net check0 miss_step.axis.0.pos-cmd axis.x.pos-cmd
But I don't think there is a axis.y1 or axis y2.pos-cmd pin
The goal is to compare the two Y motors at the end of a gcode run. I need to see which motor is missing steps. Or both.
I can't get the X or Z to fail. Just these two.
Thanks much for the help
Please Log in or Create an account to join the conversation.
- newbynobi
- Offline
- Moderator
Less
More
- Posts: 2075
- Thank you received: 406
14 Jun 2021 20:26 #212055
by newbynobi
Replied by newbynobi on topic miss_step Routine
What is the part of gmoccapy on this?
Please Log in or Create an account to join the conversation.
- tommylight
- Offline
- Moderator
Less
More
- Posts: 19412
- Thank you received: 6508
14 Jun 2021 22:27 #212065
by tommylight
Replied by tommylight on topic miss_step Routine
Waiting for OP to reply before moving it to "general" section.
Please Log in or Create an account to join the conversation.
- BeagleBrainz
- Visitor
15 Jun 2021 00:34 #212078
by BeagleBrainz
Replied by BeagleBrainz on topic miss_step Routine
Isn't this basically a 2nd thread on the same issue ?
Please Log in or Create an account to join the conversation.
- Jeff_in_Wa
- Offline
- Senior Member
Less
More
- Posts: 68
- Thank you received: 5
15 Jun 2021 00:37 #212079
by Jeff_in_Wa
Replied by Jeff_in_Wa on topic miss_step Routine
Sorry, I'm using gmoccapy. Thought it might be a compatibility issue. Happy to do whatever is needed.
Please Log in or Create an account to join the conversation.
- Jeff_in_Wa
- Offline
- Senior Member
Less
More
- Posts: 68
- Thank you received: 5
15 Jun 2021 00:38 #212080
by Jeff_in_Wa
Replied by Jeff_in_Wa on topic miss_step Routine
I will move over to that old thread and try getting help there. Thanks
Please Log in or Create an account to join the conversation.
- BeagleBrainz
- Visitor
15 Jun 2021 00:57 #212083
by BeagleBrainz
Replied by BeagleBrainz on topic miss_step Routine
I think you need to look at joints. Do you have a line such as
This was take from a configs/sim.gmoccapy.non_trivial_kinematics.Gantry
# loop position commands back to motion module feedback
net Xpos joint.0.motor-pos-cmd => joint.0.motor-pos-fb
net Ypos joint.1.motor-pos-cmd => joint.1.motor-pos-fb
net Y2pos joint.2.motor-pos-cmd => joint.2.motor-pos-fb
net Zpos joint.3.motor-pos-cmd => joint.3.motor-pos-fb
This was take from a configs/sim.gmoccapy.non_trivial_kinematics.Gantry
Attachments:
Please Log in or Create an account to join the conversation.
Moderators: newbynobi, HansU
Time to create page: 0.082 seconds