hm2_modbus pktuart, probably a firmware request?

  • jtrantow
  • Away
  • Premium Member
  • Premium Member
More
22 Feb 2026 05:54 - 23 Feb 2026 04:04 #343288 by jtrantow
I have three machines (lathe, mill, router) that I'd like to update from vfd communication (one GS2, two CommanderSK VFDs). They all work with user mode RS232/RS485 idrivers but I implemented Andy's automatic gear detection on the mill and lathe and the vfd motor speed doesn't update fast enough to track the gear ratio during acclel and decel. 

All three machines are running LCNC 2.9.8.

Lathe uses a 7i96 with 7i85S and a G540 - 7i96p1_7i85dsdi.bit
Mill uses a 7i92 with 7i85S and 7i75 daughtercards, 7i92_7i85sx1sdid.bit 
Router uses a 7i92T with a 7i75 and a G540 7i92t_g540d.bin

I believe the Mill and Lathe are custom built firmware, The router is stock. I don't sse any mention of pktuart in any of the --readhmid files?

My understanding is the 7i96 on the lathe should be RS485 compatible? Hoping this is just a firmware update?
Can I use the Mill's 7i85S RS422 with a RS485 VFD?  Ok if I need to use a TTL/RS485.
Can I use gpio with a TTL/RS485 adapter (solution for Mill and Router).


After initialization, I only need to write 2 registers and read 3 registers and I could block these up. Looks like hm2_modbus would be perfect for what I need if the hardware I have supports it.

 

File Attachment:

File Name: lathe_readhmid.txt
File Size:7 KB

File Attachment:

File Name: Mill_readhmid.txt
File Size:5 KB

File Attachment:

File Name: router_readhmid.txt
File Size:5 KB
Attachments:
Last edit: 23 Feb 2026 04:04 by jtrantow. Reason: correct 7i95S to 7i85S, typos

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

  • jtrantow
  • Away
  • Premium Member
  • Premium Member
More
23 Feb 2026 19:06 - 23 Feb 2026 19:08 #343356 by jtrantow
I'm making some progress with pktuart approach. I updated my lathe firmware with 7i96_pktv3d.bit and I can see the pkuart pin assignments on the 7i96.

I simplified my config (7i85S encoders aren't available with this firmware) and I can get my config to load. Later today I will make a connector and try it out.

I did experienced a problem with TWOPASS. When I enable TWOPASS in the GS10 example, the parameters to loadrt hm2_eth and hm2_modbus get messed up???

This problem can be duplicated by adding TWOPASS to the .ini inside gs10.zip from forum.linuxcnc.org/10-advanced-configura...20File%20Size:5%20KB.

Enabling TWOPASS with the ini variables fails if TWOPASS is enabled.
loadrt [HOSTMOT2](DRIVER) config=[HOSTMOT2](CONFIG)
loadrt hm2_modbus ports=[MODBUS](PORTS) mbccbs=[MODBUS](MBCCBS)
If I don't use the substituion, the hm_gs10 example config loads with TWOPASS.
loadrt hm2_eth board_ip="10.10.10.10" config="num_encoders=1 num_stepgens=5"
loadrt hm2_modbus ports=hm2_7i96.0.pktuart.0 mbccbs=gs10.mbccb
Last edit: 23 Feb 2026 19:08 by jtrantow. Reason: format code section

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

  • jtrantow
  • Away
  • Premium Member
  • Premium Member
More
23 Feb 2026 21:59 - 23 Feb 2026 22:35 #343370 by jtrantow
Connected CommanderSK VFD RS485 to 7i96 connector.

Docs at linuxcnc.org/docs/2.9/html/drivers/mesa_modbus.html state:6. Hardware ConnectionThe Mesa serial ports have separate pins for Tx and Tx pairs. For RS422 Modbus RTU communications these should be connected at the Mesa card Tx+ to Rx+ and Tx- to Rx-.Note that there are differing naming standards for Modbus pins. Typically Rx+ and TX+ will connect to the B- pin on the modbus device and Rx- and Tx- will connect to the A+ pin, i.e., +/- will appear reversed.

Is RS485 wired the same way?
 

My working USB/485 dongle solution connects:
RJ45                 USB Dongle
2 EIA485+          A+
3 0V                  GND
7 EIA485-          B-

So I have connected EIA485 to Mesa TX- and RX-, EIA485- to Mesa TX+ and RX+, 0V to Mesa GND.
​​​​​
I set up CommanderSK.mbccs to simply read the software version from the vfd. This fails with a "Received PDU too small, size=4"
I have tried hal_types HAL_FLOAT, HAL_U32 with the same result.

Any hints before I bring out the scope?
Attachments:
Last edit: 23 Feb 2026 22:35 by jtrantow.

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

More
23 Feb 2026 23:45 #343373 by PCW
Here's the wiring information:  (just added to 7I96 manual)

RS-485 OPERATION

For 2 wire RS-485 applications, TX+ must be connected to RX+ and TX- must be
connected to RX-. RS-485 pair wiring is TX-/RX- to A and TX+/RX+ to B.

For RS-485 applications, 7I96 cards require two biasing resistors to establish the
non-driven state of RS-485 interfaces (MODBUS etc). The first resistor should connect
between +5V and RX- and the second between GND and RX+. Suggested resistor value
is 330 Ohms.
The following user(s) said Thank You: tommylight

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

  • jtrantow
  • Away
  • Premium Member
  • Premium Member
More
24 Feb 2026 03:43 #343375 by jtrantow
Thanks, that makes sense. R's must be built into the usb adapter.
I will add termination resistors and give that a try.

I flashed 7i96_pktv3d.bit to try out the modbus with a minimal config. I assume I will need updates to run the rest of my configuration?

My lathe has a 7i96 with rs485 connector.
Can I use ptkuart with my 7i92 and 7i92T if I use a ttl to 485 adapter and firmware updates?

Lathe uses a 7i96 with 7i85S and a G540 - 7i96p1_7i85dsdi.bit
Mill uses a 7i92 with 7i85S and 7i75 daughtercards, 7i92_7i85sx1sdid.bit 
Router uses a 7i92T with a 7i75 and a G540 7i92t_g540d.bin
 

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

  • jtrantow
  • Away
  • Premium Member
  • Premium Member
More
24 Feb 2026 21:06 #343431 by jtrantow
I added the RS485 termination resistors and I'm successfully talking to the VFD.

When I get new firmware I will retry automatic gear detection with a faster update of the motor frequency.

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

More
24 Feb 2026 21:24 #343432 by PCW
I'll try and get to the 7I96 configuration later today or tomorrow

but note you need a  RS-485 interface, and that's only available on the 7I96 configuration.
The 7I92 configs  would need to add a RS-485 chip or a daughtercard with a RS-485 interface.


 

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

More
25 Feb 2026 17:24 #343481 by PCW
This should be close

 

File Attachment:

File Name: 7i96d_7i85p_pktv3.zip
File Size:128 KB



Note that I had to reduce the number of sserial channels to 3 to fit
(the are also renumbered so channels 0,1,2 are on 7i85 channels 0,1,2)
Attachments:

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

  • jtrantow
  • Away
  • Premium Member
  • Premium Member
More
25 Feb 2026 18:29 #343486 by jtrantow
That should work!

Do you need to assign the pktuart pins when you build the firmware?

If yes, the Mill with 7i92 has open connectors on the 7i85S TB1 TX6, TX7 SRX0, STX0 and all the odd I/O on the 7i75.

The Router with 7i92T supports a spindle, laser, and bunch of pins reserved for plasma.
P1 and P2 are both configured as G540 but P1 is actually connected to 7i75 card.
The pins I have unassigned are P1 gpio.029, .031, and 0.033.
The router is working fine and won't gain any functionality so an update is much lower priority. Really just a wiring cleanup so let's wait before putting new firmware in that.

I will try to get the  7i96d_7i85p_pktv3  installed today, otherwise it may be a week before I get back to it. 

Thanks!

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

  • jtrantow
  • Away
  • Premium Member
  • Premium Member
More
25 Feb 2026 20:08 #343498 by jtrantow
That should work!

Do you need to assign the pktuart pins when you build the firmware?

If yes, the Mill with 7i92 has open connectors on the 7i85S TB1 TX6, TX7 SRX0, STX0 and all the odd I/O on the 7i75.

The Router with 7i92T supports a spindle, laser, and bunch of pins reserved for plasma.
P1 and P2 are both configured as G540 but P1 is actually connected to 7i75 card.
The pins I have unassigned are P1 gpio.029, .031, and 0.033.
The router is working fine and won't gain any functionality so an update is much lower priority. Really just a wiring cleanup so let's wait before putting new firmware in that.

I will try to get the  7i96d_7i85p_pktv3 installed today, otherwise it may be a week before I get back to it. 

Thanks!

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

Moderators: PCWjmelson
Time to create page: 0.153 seconds
Powered by Kunena Forum