New ethercat / probe basic control for minimonster

  • ihavenofish
  • Away
  • Platinum Member
  • Platinum Member
More
29 Oct 2025 09:56 #337389 by ihavenofish
Replied by ihavenofish on topic New ethercat / probe basic control for minimonster
I tried to ask chat gpt and white it did give me some insights... its just maddeningly stupid and useless. Its pulling info and syntax form 100 different versions, and keeps changing syntax every time to ask.

What i have found for sure is i have addresses from 2048 to 2102, and seemingly nothing at the "expected" 2000/2001 address for turning the spindle on. Except that it did go into run mode at one point.

blah!

Please Log in or Create an account to join the conversation.

  • ihavenofish
  • Away
  • Platinum Member
  • Platinum Member
More
29 Oct 2025 17:28 #337401 by ihavenofish
Replied by ihavenofish on topic New ethercat / probe basic control for minimonster
so modpoll can talk to the drive... mb2hal cannot. all settings seem to be correct.
what could be missing/wrong?

I've played with various timeouts and other things, i get the same transaction failure whether the drive is turned on or off, so its not even sending the message.

Please Log in or Create an account to join the conversation.

  • ihavenofish
  • Away
  • Platinum Member
  • Platinum Member
More
29 Oct 2025 18:53 #337402 by ihavenofish
Replied by ihavenofish on topic New ethercat / probe basic control for minimonster
So function 3 and 4 in modpoll are reversed from mb2hal. Because of course it is. So I need function 3 vs 4 in modpoll. And I need to specify the hex number (2100 for example), and not the decimal 8448. NOW it is reading.

I know I have registers from 2048 to 2102 but I don't know what they do. apparently what little instructions I had about the drive are incorrect.

Have not tried writing yet cause I don't want to write something incorrect

Thoughts on how to map the registers in a logical way?

Please Log in or Create an account to join the conversation.

  • Hakan
  • Away
  • Platinum Member
  • Platinum Member
More
29 Oct 2025 20:21 #337404 by Hakan
I don't know what a logical way is to you, but it sounds like normal Modbus.
Didn't see a problem with byte order yet? Maybe that will come, maybe maybe not :)

If you now go back to my example snippets, you may see how the function code and register address
are mapped into a hal pin.
Didn't include the port setup guess it is different everywhere
I would start writing with write to a harmless register, perhaps something that switches on a led, I don't know what is available.

Please Log in or Create an account to join the conversation.

  • ihavenofish
  • Away
  • Platinum Member
  • Platinum Member
More
29 Oct 2025 20:30 #337406 by ihavenofish
Replied by ihavenofish on topic New ethercat / probe basic control for minimonster
ah yes. ill try you thing again. chat gpt has begun feeding me a loop of trash now. haha.

The main thing l get is "pin does not exist". ill try yours now and see if i get the same.

Please Log in or Create an account to join the conversation.

  • ihavenofish
  • Away
  • Platinum Member
  • Platinum Member
More
29 Oct 2025 20:37 - 29 Oct 2025 20:39 #337407 by ihavenofish
Replied by ihavenofish on topic New ethercat / probe basic control for minimonster
yes. pin does not exist on yours too. (i changed the names of course to match). it post this before the parsing of the ini... which seems wrong. it should parse first right? I think it was before.

not typing from the same machine so i cant copy paste, but im using your hal snippet but with my names (mb2hal.00.start_stop) etc.
# Load mb2hal for modbus operation of the sinusM vfd
loadusr -Wn sinusM mb2hal config=sinusM_spindle.ini

...

# Set max limit rpm for spindle
#
net spindle-max-freq       sinusM.05.read-max-freq.float spindlemax.max         # Max frequency(rps) for motor
net  spindle-speed-scale   spindle.0.speed-out-rps-abs   sinusM.01.set-freq     # Just the principle

net spindle-vel-positive    mux4.0.sel0           abs.spindle-speed.sign
net spindle-enable          mux4.0.sel1
net spindle-cmd-out         mux4.0.out            sinusM.04.run-command  # Stop/fwd/rev
Last edit: 29 Oct 2025 20:39 by ihavenofish.

Please Log in or Create an account to join the conversation.

  • ihavenofish
  • Away
  • Platinum Member
  • Platinum Member
More
29 Oct 2025 20:46 #337409 by ihavenofish
Replied by ihavenofish on topic New ethercat / probe basic control for minimonster
alright on the same machine now

attached the ini and hal and here is the debug info
Found file(REL): ./cia402.hal
note: MAXV     max: 700.000 units/sec 42000.000 units/min
note: LJOG     max: 700.000 units/sec 42000.000 units/min
note: LJOG default: 20.000 units/sec 1200.000 units/min
note: jog_order='XYZ'
note: jog_invert=set()
custom.hal:9: Pin 'mb2hal.01.spindle_speed_set' does not exist
mb2hal parse_common_section DEBUG: [MB2HAL_INIT] [INIT_DEBUG] [6]
mb2hal parse_common_section DEBUG: [MB2HAL_INIT] [VERSION] [1001]
mb2hal parse_common_section DEBUG: [MB2HAL_INIT] [HAL_MODULE_NAME] [mb2hal]
mb2hal parse_common_section DEBUG: [MB2HAL_INIT] [SLOWDOWN] [0.000]
mb2hal parse_common_section DEBUG: [MB2HAL_INIT] [TOTAL_TRANSACTIONS] [3]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_00] [LINK_TYPE] [serial] [0]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_00] [SERIAL_PORT] [/dev/ttyUSB0]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_00] [SERIAL_BAUD] [9600]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_00] [SERIAL_BITS] [8]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_00] [SERIAL_PARITY] [none]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_00] [SERIAL_STOP] [1]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_00] [SERIAL_DELAY_MS] [10]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_00] [MB_SLAVE_ID] [1]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_00] [FIRST_ELEMENT] [2048]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_00] [PIN_NAMES] [spindle_start_stop]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_00] [NELEMENTS] [1]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_00] [MAX_UPDATE_RATE] [0.000]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_00] [MB_RESPONSE_TIMEOUT_MS] [400]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_00] [MB_BYTE_TIMEOUT_MS] [500]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_00] [DEBUG] [3]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_00] [MB_TX_CODE] [fnct_06_write_single_register] [4]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_00] [HAL_TX_NAME] [00]
mb2hal parse_ini_file OK: parse_transaction_section 0 OK
mb2hal parse_transaction_section DEBUG: [TRANSACTION_01] [LINK_TYPE] [serial] [0]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_01] [SERIAL_PORT] [/dev/ttyUSB0]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_01] [SERIAL_BAUD] [9600]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_01] [SERIAL_BITS] [8]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_01] [SERIAL_PARITY] [none]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_01] [SERIAL_STOP] [1]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_01] [SERIAL_DELAY_MS] [10]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_01] [MB_SLAVE_ID] [1]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_01] [FIRST_ELEMENT] [2049]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_01] [PIN_NAMES] [spindle_speed_set]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_01] [NELEMENTS] [1]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_01] [MAX_UPDATE_RATE] [0.000]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_01] [MB_RESPONSE_TIMEOUT_MS] [400]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_01] [MB_BYTE_TIMEOUT_MS] [500]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_01] [DEBUG] [3]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_01] [MB_TX_CODE] [fnct_06_write_single_register] [4]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_01] [HAL_TX_NAME] [01]
mb2hal parse_ini_file OK: parse_transaction_section 1 OK
mb2hal parse_transaction_section DEBUG: [TRANSACTION_02] [LINK_TYPE] [serial] [0]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_02] [SERIAL_PORT] [/dev/ttyUSB0]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_02] [SERIAL_BAUD] [9600]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_02] [SERIAL_BITS] [8]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_02] [SERIAL_PARITY] [none]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_02] [SERIAL_STOP] [1]
mb2hal parse_serial_subsection DEBUG: [TRANSACTION_02] [SERIAL_DELAY_MS] [10]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_02] [MB_SLAVE_ID] [1]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_02] [FIRST_ELEMENT] [2100]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_02] [PIN_NAMES] [spindle_feedback]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_02] [NELEMENTS] [1]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_02] [MAX_UPDATE_RATE] [0.000]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_02] [MB_RESPONSE_TIMEOUT_MS] [400]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_02] [MB_BYTE_TIMEOUT_MS] [500]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_02] [DEBUG] [3]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_02] [MB_TX_CODE] [fnct_03_read_holding_registers] [2]
mb2hal parse_transaction_section DEBUG: [TRANSACTION_02] [HAL_TX_NAME] [02]
mb2hal parse_ini_file OK: parse_transaction_section 2 OK
mb2hal main OK: parse_ini_file done OK
mb2hal init_mb_links DEBUG: LINK 0 (RTU) link_type[0] device[/dev/ttyUSB0] baud[9600] data[8] parity[N] stop[1] fd[-1]
mb2hal main OK: init_gbl.mb_link done OK
mb2hal init_mb_tx DEBUG: MB_TX 0 lk_n[0] tx_n[0] cfg_dbg[3] lk_dbg[1] t_inc[0.000] nxt_t[0.000]
mb2hal init_mb_tx DEBUG: MB_TX 1 lk_n[0] tx_n[1] cfg_dbg[3] lk_dbg[1] t_inc[0.000] nxt_t[0.000]
mb2hal init_mb_tx DEBUG: MB_TX 2 lk_n[0] tx_n[2] cfg_dbg[3] lk_dbg[1] t_inc[0.000] nxt_t[0.000]
mb2hal main OK: init_gbl.mb_tx done OK
mb2hal create_each_mb_tx_hal_pins DEBUG: mb_tx_num [0] pin_name [mb2hal.00.num_errors]
mb2hal create_each_mb_tx_hal_pins DEBUG: mb_tx_num [0] pin_name [mb2hal.00.spindle_start_stop]
mb2hal create_each_mb_tx_hal_pins DEBUG: mb_tx_num [1] pin_name [mb2hal.01.num_errors]
mb2hal create_each_mb_tx_hal_pins DEBUG: mb_tx_num [1] pin_name [mb2hal.01.spindle_speed_set]
mb2hal create_each_mb_tx_hal_pins DEBUG: mb_tx_num [2] pin_name [mb2hal.02.num_errors]
mb2hal create_each_mb_tx_hal_pins DEBUG: mb_tx_num [2] pin_name [mb2hal.02.spindle_feedback]
mb2hal main OK: HAL components created OK
mb2hal main OK: Link thread loop and logic 0 created OK
mb2hal main OK: mb2hal is running
mb2hal fnct_06_write_single_register DEBUG: mb_tx[0] mb_links[0] slave[1] fd[6] 1st_addr[2048] nelem[1]
[01][06][08][00][00][00][8B][AA]
Waiting for a confirmation...
<01><06><08><00><00><00><8B><AA>
mb2hal link_loop_and_logic OK: mb_tx_num[0] mb_links[0] thread[0] fd[6] transaction OK, update_HZ[0.000]
mb2hal link_loop_and_logic DEBUG: mb_tx_num[0] mb_links[0] thread[0] fd[6] SERIAL_DELAY_MS activated [10]
mb2hal fnct_06_write_single_register DEBUG: mb_tx[1] mb_links[0] slave[1] fd[6] 1st_addr[2049] nelem[1]
[01][06][08][01][00][00][DA][6A]
Waiting for a confirmation...
<01><06><08><01><00><00><DA><6A>
mb2hal link_loop_and_logic OK: mb_tx_num[1] mb_links[0] thread[0] fd[6] transaction OK, update_HZ[0.000]
mb2hal link_loop_and_logic DEBUG: mb_tx_num[1] mb_links[0] thread[0] fd[6] SERIAL_DELAY_MS activated [10]
mb2hal fnct_03_read_holding_registers DEBUG: mb_tx[2] mb_links[0] slave[1] fd[6] 1st_addr[2100] nelem[1]
[01][03][08][34][00][01][C7][A4]
Waiting for a confirmation...
Shutting down and cleaning up LinuxCNC...
<01><03><02><00><00><B8><44>
mb2hal link_loop_and_logic OK: mb_tx_num[2] mb_links[0] thread[0] fd[6] transaction OK, update_HZ[0.000]
mb2hal link_loop_and_logic DEBUG: mb_tx_num[2] mb_links[0] thread[0] fd[6] SERIAL_DELAY_MS activated [10]
mb2hal fnct_06_write_single_register DEBUG: mb_tx[0] mb_links[0] slave[1] fd[6] 1st_addr[2048] nelem[1]
[01][06][08][00][00][00][8B][AA]
Waiting for a confirmation...
<01><06><08><00><00><00><8B><AA>
mb2hal link_loop_and_logic OK: mb_tx_num[0] mb_links[0] thread[0] fd[6] transaction OK, update_HZ[6.947]
mb2hal link_loop_and_logic DEBUG: mb_tx_num[0] mb_links[0] thread[0] fd[6] SERIAL_DELAY_MS activated [10]
Attachments:

Please Log in or Create an account to join the conversation.

  • ihavenofish
  • Away
  • Platinum Member
  • Platinum Member
More
29 Oct 2025 20:51 #337410 by ihavenofish
Replied by ihavenofish on topic New ethercat / probe basic control for minimonster
aha
linuxcnc starts up wiith this and no errors

getting somewhere

#loadusr modbus
loadusr mb2hal config="mb2hal_config.ini"

loadrt mux4 names=mux4.spindle_mode
addf mux4.spindle_mode servo-thread

setp mux4.spindle_mode.in0 1     # Stop
setp mux4.spindle_mode.in1 34    # Reverse
setp mux4.spindle_mode.in2 1     # Stop
setp mux4.spindle_mode.in3 18    # Forward

net spindle-enable          mux4.spindle_mode.sel0                
net spindle-cw              mux4.spindle_mode.sel1                
net spindle-runmode            mux4.spindle_mode.out        mb2hal.00.spindle_start_stop.float

Please Log in or Create an account to join the conversation.

  • ihavenofish
  • Away
  • Platinum Member
  • Platinum Member
More
29 Oct 2025 21:14 #337413 by ihavenofish
Replied by ihavenofish on topic New ethercat / probe basic control for minimonster
So i can change those pins in halshow, but they do nothing. So I expect they are not the correct pins for start/stop freq etc. Sound right?

Hmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
Do I just go one by one and set them to 1/0 and see if the drive turns on? I guess that makes plausible sense. there only 54 of them

Please Log in or Create an account to join the conversation.

  • ihavenofish
  • Away
  • Platinum Member
  • Platinum Member
More
29 Oct 2025 21:28 #337414 by ihavenofish
Replied by ihavenofish on topic New ethercat / probe basic control for minimonster
all pins / registers in halshow
Component Pins:
Owner   Type  Dir         Value  Name
    57  float OUT             0  mb2hal.00.00.float
    57  s32   OUT             0  mb2hal.00.00.int
    57  float OUT             0  mb2hal.00.01.float
    57  s32   OUT             0  mb2hal.00.01.int
    57  float OUT             0  mb2hal.00.02.float
    57  s32   OUT             0  mb2hal.00.02.int
    57  float OUT           200  mb2hal.00.03.float
    57  s32   OUT           200  mb2hal.00.03.int
    57  float OUT           200  mb2hal.00.04.float
    57  s32   OUT           200  mb2hal.00.04.int
    57  float OUT           200  mb2hal.00.05.float
    57  s32   OUT           200  mb2hal.00.05.int
    57  float OUT           200  mb2hal.00.06.float
    57  s32   OUT           200  mb2hal.00.06.int
    57  float OUT           200  mb2hal.00.07.float
    57  s32   OUT           200  mb2hal.00.07.int
    57  float OUT           200  mb2hal.00.08.float
    57  s32   OUT           200  mb2hal.00.08.int
    57  float OUT             0  mb2hal.00.09.float
    57  s32   OUT             0  mb2hal.00.09.int
    57  u32   OUT    0x00000000  mb2hal.00.num_errors
    57  float OUT             0  mb2hal.01.00.float
    57  s32   OUT             0  mb2hal.01.00.int
    57  float OUT             0  mb2hal.01.01.float
    57  s32   OUT             0  mb2hal.01.01.int
    57  float OUT             0  mb2hal.01.02.float
    57  s32   OUT             0  mb2hal.01.02.int
    57  float OUT             0  mb2hal.01.03.float
    57  s32   OUT             0  mb2hal.01.03.int
    57  float OUT             0  mb2hal.01.04.float
    57  s32   OUT             0  mb2hal.01.04.int
    57  float OUT             0  mb2hal.01.05.float
    57  s32   OUT             0  mb2hal.01.05.int
    57  float OUT             0  mb2hal.01.06.float
    57  s32   OUT             0  mb2hal.01.06.int
    57  float OUT             0  mb2hal.01.07.float
    57  s32   OUT             0  mb2hal.01.07.int
    57  float OUT             0  mb2hal.01.08.float
    57  s32   OUT             0  mb2hal.01.08.int
    57  float OUT          5000  mb2hal.01.09.float
    57  s32   OUT          5000  mb2hal.01.09.int
    57  u32   OUT    0x00000000  mb2hal.01.num_errors
    57  float OUT            50  mb2hal.02.00.float
    57  s32   OUT            50  mb2hal.02.00.int
    57  float OUT             0  mb2hal.02.01.float
    57  s32   OUT             0  mb2hal.02.01.int
    57  float OUT             0  mb2hal.02.02.float
    57  s32   OUT             0  mb2hal.02.02.int
    57  float OUT             0  mb2hal.02.03.float
    57  s32   OUT             0  mb2hal.02.03.int
    57  float OUT             0  mb2hal.02.04.float
    57  s32   OUT             0  mb2hal.02.04.int
    57  float OUT             0  mb2hal.02.05.float
    57  s32   OUT             0  mb2hal.02.05.int
    57  float OUT             0  mb2hal.02.06.float
    57  s32   OUT             0  mb2hal.02.06.int
    57  float OUT             0  mb2hal.02.07.float
    57  s32   OUT             0  mb2hal.02.07.int
    57  float OUT          5000  mb2hal.02.08.float
    57  s32   OUT          5000  mb2hal.02.08.int
    57  float OUT            50  mb2hal.02.09.float
    57  s32   OUT            50  mb2hal.02.09.int
    57  u32   OUT    0x00000000  mb2hal.02.num_errors
    57  float OUT          5000  mb2hal.03.00.float
    57  s32   OUT          5000  mb2hal.03.00.int
    57  float OUT             0  mb2hal.03.01.float
    57  s32   OUT             0  mb2hal.03.01.int
    57  float OUT          5000  mb2hal.03.02.float
    57  s32   OUT          5000  mb2hal.03.02.int
    57  float OUT             0  mb2hal.03.03.float
    57  s32   OUT             0  mb2hal.03.03.int
    57  float OUT            50  mb2hal.03.04.float
    57  s32   OUT            50  mb2hal.03.04.int
    57  float OUT            10  mb2hal.03.05.float
    57  s32   OUT            10  mb2hal.03.05.int
    57  float OUT          2000  mb2hal.03.06.float
    57  s32   OUT          2000  mb2hal.03.06.int
    57  float OUT             0  mb2hal.03.07.float
    57  s32   OUT             0  mb2hal.03.07.int
    57  float OUT          1000  mb2hal.03.08.float
    57  s32   OUT          1000  mb2hal.03.08.int
    57  float OUT             0  mb2hal.03.09.float
    57  s32   OUT             0  mb2hal.03.09.int
    57  u32   OUT    0x00000000  mb2hal.03.num_errors
    57  float OUT          1000  mb2hal.04.00.float
    57  s32   OUT          1000  mb2hal.04.00.int
    57  float OUT             0  mb2hal.04.01.float
    57  s32   OUT             0  mb2hal.04.01.int
    57  float OUT             0  mb2hal.04.02.float
    57  s32   OUT             0  mb2hal.04.02.int
    57  float OUT             0  mb2hal.04.03.float
    57  s32   OUT             0  mb2hal.04.03.int
    57  float OUT             0  mb2hal.04.04.float
    57  s32   OUT             0  mb2hal.04.04.int
    57  float OUT           310  mb2hal.04.05.float
    57  s32   OUT           310  mb2hal.04.05.int
    57  float OUT           680  mb2hal.04.06.float
    57  s32   OUT           680  mb2hal.04.06.int
    57  float OUT            75  mb2hal.04.07.float
    57  s32   OUT            75  mb2hal.04.07.int
    57  float OUT             0  mb2hal.04.08.float
    57  s32   OUT             0  mb2hal.04.08.int
    57  float OUT             0  mb2hal.04.09.float
    57  s32   OUT             0  mb2hal.04.09.int
    57  u32   OUT    0x00000000  mb2hal.04.num_errors
    57  float OUT             0  mb2hal.05.00.float
    57  s32   OUT             0  mb2hal.05.00.int
    57  float OUT             0  mb2hal.05.01.float
    57  s32   OUT             0  mb2hal.05.01.int
    57  float OUT             0  mb2hal.05.02.float
    57  s32   OUT             0  mb2hal.05.02.int
    57  float OUT             0  mb2hal.05.03.float
    57  s32   OUT             0  mb2hal.05.03.int
    57  float OUT          1000  mb2hal.05.04.float
    57  s32   OUT          1000  mb2hal.05.04.int
    57  u32   OUT    0x00000000  mb2hal.05.num_errors


Please Log in or Create an account to join the conversation.

Time to create page: 0.101 seconds
Powered by Kunena Forum