Search Results (Searched for: )

  • kwanlokto
03 Nov 2025 16:01
Replied by kwanlokto on topic Pathpilot Reset Functionality
I wish it did print something out. I added a bunch of error logging to print to the system logs and It seems to be crash at different lines (which I find to be odd).

I have the two computers on the same network and I'm hitting those endpoints via HTTP.

If it helps here's the code that I've added to the tormach_mill_ui.py:

def ss_reset_route(self):
"""
/reset
Reset the machine after an emergency stop was pressed.
Note: This function is the same as on_reset_button_clicked()
"""
self.hal["pp-estop-fault"] = 0 # clear any existing pp software estops
self.halt_world_flag = False # note issues with halt world. Do we lock it out during reset
# and then check or reset this at end of on_reset_button_clicked
self.clear_message_line_text()
self.hide_m01_image()
self.unlock_enclosure_door()

# turn off air blast off rack tool changer
if self.machineconfig.rack_tool_changer_supported() and self.rack_tool_changer:
self.rack_tool_changer.stop_air_blast()

if self.hal["mesa-watchdog-has-bit"]:
# since resetting the mesa card io_error parameter is more involved now with ethernet,
# only do this if we really did see a watchdog bite.

# clear Mesa IO errors (if any). this must be done PRIOR to setting the mesa-watchdog-has-bit pin low.
clear_hostmot2_board_io_error(self.inifile)

# clear Mesa card watchdog
self.hal["mesa-watchdog-has-bit"] = 0
self.mesa_watchdog_has_bit_seen = False

# give it a second to re-establish IO link before jamming commands at it.
time.sleep(1.0)
self.poll()

# did the watchdog re-bite already? If so, re-establishing the IO link didn't work.
# leave us in e-stop.
if self.hal["mesa-watchdog-has-bit"]:
self.mesa_watchdog_has_bit_seen = True
self.error_handler.write(
"Machine interface error. Check cabling and power to machine and then press RESET.",
ALARM_LEVEL_MEDIUM,
)
self.call_ui_hook("reset_button")
return Server_Response_Factory.create_server_response(400, "Failed IO Link")

# Configure the A axis hardware
# This happens in the reset handler because __init__ is too early, and the change to traj.max_angular_ vel is ignored
a_axis = self.machineconfig.a_axis.selected()
if a_axis:
self.configure_a_axis(a_axis)

# order of these is important. Answer queries first, then check for random stop/reset presses
if self.set_response_cancel():
return Server_Response_Factory.create_server_response(
400, "Outstanding Prompts"
) # check for outstanding prompts and cancel,True is message answered

if self.atc.worker_thread_busy.is_set():
self.atc.stop_reset.set() # only if atc thread in progress
self.atc.feed_hold_clear.set() # signal that any feed holds are cleared

# RACK_QUESTION what about router pdb on and rack disabled?
if self.rack_tool_changer:
if self.rack_tool_changer.worker_thread_busy.is_set():
self.rack_tool_changer.stop_reset.set() # only if rack atc thread in progress
self.rack_tool_changer.feed_hold_clear.set() # signal that any feed holds are cleared
self.set_image("feedhold_image", "Feedhold-Black.jpg")

# clear feedhold
self.clear_feedhold()

# reset e-stop
if self.status.task_state != linuxcnc.STATE_ESTOP_RESET:
# this actually ends up doing a linuxcnc command abort internally
# and that will run any on_abort ngc code.
self.command.state(linuxcnc.STATE_ESTOP_RESET)
self.command.wait_complete()
self.poll()
if self.status.task_state not in [linuxcnc.STATE_ESTOP_RESET, linuxcnc.STATE_ON]:
self.error_handler.write(
"Failed to bring machine out of E-stop. Please check machine power, limit switches, and communication cable from the controller to the machine."
)
self.call_ui_hook("reset_button")
return Server_Response_Factory.create_server_response(
400, "Failed to bring machine out of E-stop"
)

# clear alarm
self.estop_alarm = False
self.display_estop_msg = True

# Prevent coming out of Reset if a limit switch is active.
if self.status.limit[0] != 0:
error_msg = "X limit switch active."
self.error_handler.write(error_msg, ALARM_LEVEL_MEDIUM)
if self.status.limit[1] != 0:
error_msg = "Y limit switch active."
self.error_handler.write(error_msg, ALARM_LEVEL_MEDIUM)
if self.status.limit[2] != 0:
error_msg = "Z limit switch active."
self.error_handler.write(error_msg, ALARM_LEVEL_MEDIUM)
if (self.status.limit[0] != 0) or (self.status.limit[1] != 0) or (self.status.limit[2] != 0):
error_msg = "Disable limit switches in Settings, then push Reset, then carefully jog off limit switch, then re-enable limit switches in Settings."
self.error_handler.write(error_msg, ALARM_LEVEL_MEDIUM)
self.call_ui_hook("reset_button")
return Server_Response_Factory.create_server_response(400, "Disable limit switches in Settings")

time.sleep(0.25) # TODO: Added time.sleep()
# must be turned on again after being reset from estop
if self.status.task_state != linuxcnc.STATE_ON:
# this actually ends up doing a linuxcnc command abort internally
# and that will run any on_abort ngc code.
self.command.state(linuxcnc.STATE_ON)
self.command.wait_complete()
self.poll()
if self.status.task_state != linuxcnc.STATE_ON:
err_msg = "Failed to bring machine out of E-stop. Please check machine power, limit switches, and communication cable from the controller to the machine."
self.error_handler.write(err_msg)
return Server_Response_Factory.create_server_response(400, err_msg)

# saw a rare case where the ATC stuff above times out after taking 5 long seconds and during that
# time, the operator presses the e-stop button. So just check again to be sure before we start
# running commands. If it is e-stopped, the periodics will take appropriate action.
if self.hal["machine-ok"] == False:
return Server_Response_Factory.create_server_response(400, "Failed to bring machine out of E-stop")

# stop motion
self.command.abort()
self.command.wait_complete()

# reset/rewind program
if (self.status.limit[0] == 0) and (self.status.limit[1] == 0) and (self.status.limit[2] == 0):
# HACK manually decrement the part counters by one since M30 increments them
# if this ever becomes optional, then make sure not to do this if M30 incrementing is disabled
self.issue_mdi("#5650 = [#5650 - 1] #5651 = [#5651 - 1]")
self.command.wait_complete()
self.issue_mdi("M30")
self.command.wait_complete()

# clear SB status
self.single_block_active = False
self.single_block_button.set_led_state(self.single_block_active)

# clear live plotter
self.gremlin.clear_live_plotter()

# refresh work offsets
self.refresh_work_offset_liststore()

# rewind program listing and set starting line
if self.is_gcode_program_loaded:
self.set_start_settings_and_mark(1)

# some folks got confused because their program ended, the M30 reset current line to 0 and
# the 50ms periodic auto-scrolled back up to the start line. But then they managed to scroll
# around in the view and then press the Reset button and they expect it to auto-scroll to the
# top again. The 50ms periodic doesn't do anything because the current line hasn't 'changed'
# from 0 so we need this here to always smack the display back to the start line.
self.scroll_sourceview_to_mark("start")

self.call_ui_hook("reset_button")

self.do_first_run_setup()

self.axis_motor_command(0, MOTOR_CMD_NORMAL)
self.axis_motor_command(1, MOTOR_CMD_NORMAL)
self.axis_motor_command(2, MOTOR_CMD_NORMAL)

# Make sure the override sliders are enabled. The ATC code disables them and tries to restore them, but
# in certain aborted situations, they can get stuck off.
self.command.set_feed_override(True)
self.command.set_spindle_override(True)

# g21 and machineconfig need to be accurate before setting scaled jog increment
# self.update_gui_for_units(self.g21) # TODO: this seems to breaking some things, need to figure why

# self.start_loop_recording() # TODO: this seems to breaking some things, need to figure why

return Server_Response_Factory.create_server_response(200, "Mill has been reset")
  • vmihalca
03 Nov 2025 15:51
Hi guys,
I need to cut some internal oil grooves in the 8 shape figure. It would also help for external grooves but not at this point.
The spindle encoder is hooked up and working correctly. 
If anyone has achieved this, please give me some hints.
Thx!
  • PCW
03 Nov 2025 15:43
I would probably add a series resistor so so if you accidentally ground the ALM- output you do not damage the optocoupler

so:

+12V --> 1K resistor --> ALM+
ALM- --> 7I76EU input
  • PCW
03 Nov 2025 15:06
Yes, you can use a 7I76U with  a 7I96S  by using 7i96s_7i76d.bin firmware
and connecting the 7I76U to the 7I96S's P1 expansion connector.
 
  • tommylight
03 Nov 2025 14:20 - 03 Nov 2025 14:21
Mesa 7i84 has 32 inputs and 16 outputs, it easily wires to 7i96S with a cut down LAN/network cable, CAT5 or CAT6 will do just fine.
Did you try
store.mesanet.com
and
www.mesaus.com
mesaus.com/product/7i96s/
has 29 in stock.
  • kwanlokto
03 Nov 2025 14:06
Pathpilot Reset Functionality was created by kwanlokto
I'm working on creating a new Reset Function that will clear the machine's E-STOP state. I'd like to implement this as an API route so that I can control the mill's functionality remotely from another computer.Currently, my route is based on the
Code:
on_reset_button_clicked()
function from
Code:
/home/{my_user}/tmc/python/tormach_mill_ui.py
. However, PathPilot crashes approximately 1 out of every 5 times when I call this endpoint.Does anyone have any ideas what could be causing this intermittent crashing issue?
  • MusicCityMfg
03 Nov 2025 13:06
I read the  Which Mesa Card Should I Buy?  post and it was super helpful.

I wanted to buy a Mesa 7i76EU card today but they are out of stock. They are also out of stock on the 7i77 daughter card.

So, I hope to buy a  7i96S today, but I need to know what daughter board I can use to increase the number of inputs an outputs?

Can I use the  7i76U ?

I am doing a manual lathe CNC conversion. I'm eventually going to be adding a 12 tool ATC turret.

I have not finalized all the required I/O yet, so I wanna make sure that I have enough I/O for future updates to the lathe.

If I can use the  7i76U , I think I will have plenty of I/O for future updates, that may include​ ...
  • a third MPG
  • an encoder on the ATC turret for tool location/identification,
  • a "Y" axis, three motor, four gang live tool option with an MPG (this last addition is way in the future if at all). 
Thanks,
Chris​​​​​​
  • JT
03 Nov 2025 11:26 - 03 Nov 2025 11:28
The Flex GUI is the best interface for this because you can have as little or as much as you want. Also it's based on PyQt6 which is the latest so it will be supported for a long time. All the rest of the GUI's assume you have a standard mill or lathe and are based on the now retired PyQt5. Flex GUI assumes nothing. If you want a GUI with two jog buttons it's rather simple.

gnipsel.com/linuxcnc/flexgui/index.html

On Libera.Chat #flex-dev or #linuxcnc you can get rapid help for Flex GUI usually.

FYI
Standard support for Qt 5.15 LTS (the last release of the Qt 5 series) ended on May 26, 2023. This means that open-source users no longer receive community updates or security patches for Qt 5.

JT
  • newbynobi
03 Nov 2025 09:54
Replied by newbynobi on topic Gmoccapy 3.5.1

Control panel connections :

net matrix_r2c2 matrix_kb.0.key.r2c2 => halui.spindle.0.stop
net matrix_r2c1 matrix_kb.0.key.r2c1 => halui.spindle.0.forward
net matrix_r2c3 matrix_kb.0.key.r2c3 => halui.spindle.0.reverse
Why do you use the halui pin?
you could use 
Code:
gmoccapy.h-button.button-2 for start as documentated here : 
linuxcnc.org/docs/html/gui/gmoccapy.html..._bottom_button_lists

Norbert
 
  • unknown
03 Nov 2025 09:03
Replied by unknown on topic Motor Driver Electrical Question


Ignore all other advice you have been given by others and just do it!


 

Yeah I'd second that.
  • 2tinker
03 Nov 2025 08:23
Replied by 2tinker on topic MESA 7i76eu – I/O - Spannungsversorgung
@PCW, @tommylight,
vielen Dank für die Tipps.
Wenn ich meine 12V direkt auf den Alarm des Motors geben kann, wäre das natürlich das einfachste.

@PCW
In der Beschreibung des Schrittmotores habe ich nun auch die richtige Stelle gefunden.
 
Was meinst du, ist der Vorwiederstand bereits im Motor verbaut, oder sollte ich da einen vorsetzen?

Danke und Grüße,
2tinker
  • conman
03 Nov 2025 07:47
Hello Hakan, thank you very much for your help so far!
Yes I have a realtek adapter on my MSI B650M motherboard.

Let me install the drivers and get back to you.
  • Hakan
03 Nov 2025 07:16
The interface has a manual mode where you can jog to an angle.
Or enter G0 X-40 in the MDI for it to go to -40 degrees.
  • rodw
03 Nov 2025 07:05
Its not very hard to do this with an Arduino (even for me) and there are several such indexers available. Sorry but I don't think I have the code anymore.
  • rodw
03 Nov 2025 06:45
Replied by rodw on topic Motor Driver Electrical Question
Don't overcomplicate this. The motor is good for 4.2 amps. Set the driver to give it 3.8 amps which is the closest you can go without going past the motor rating. 48 volts will be fine. I've driven similar motors at 90 volts. CNC does not drive motors at peak load for long periods.

Look at the motor's full data sheet  www.omc-stepperonline.com/download/23HS45-4204S.pdf
The insulation is rated for 130 deg C so don't let it get hot enough for it to melt as that will destroy your drive. 
The maximum temperature rise permissable is 80 deg C. Add that to 30 deg ambient temp (heck its been up to 39 degrees C here the last week or so). So 80+30 = 110 deg C which is hot enough to burn you but not melt the insulation. If the motor misses steps and it will only do that if it gets too hot (it will then let you know that its missing steps in a spectacular way).

If the drivers have a fault output, connect it to joint.N.fault-in. This will trigger if the motor gets too hot and stop Linuxcnc
If the drive misses steps or faults, reduce the curent to the next lower setting.

Don't be concerned about lowering the current if you need to. The actual current required for a given application may be well below the rated current if you do do a full design. eg one of my 2 amp motors only needs 1 amp to achieve 60 m/min rapids and > 5 m/sec/sec acceleration (tested to 8 m/sec/sec)

Typically, the Chinese drivers are rated based on peak voltage. Some Drivers (eg Lam Technologies) are rated for RMS so a 6 amp driver of theirs will give 6 amp RMS, enough to melt the average Chinese motor. So a 4.2 amp motor is probably run at 2-3 amps with Lam. This is why Tommy suggests a more conservative approach than me!

Ignore all other advice you have been given by others and just do it!

 
Displaying 11896 - 11910 out of 11916 results.
Time to create page: 0.456 seconds
Powered by Kunena Forum