Modbus input for absolute encoder position?
I recently purchased servo drives with multiturn / absolute encoders. I am able to read the required registers via MB2HAL.
Multiturn Count: 0 - 65536
Pulses per Turn: 0 - 65536
I was wondering if anybody was able to get this to work in LCNC as PCW/andypugh described? ModBus absolute position read at startup and then incremental encoders for realtime feedback.
Regards,
Markus
Please Log in or Create an account to join the conversation.
0x2102 wrote: Multiturn Count: 0 - 65536
Pulses per Turn: 0 - 65536
I was wondering if anybody was able to get this to work in LCNC as PCW/andypugh described? ModBus absolute position read at startup and then incremental encoders for realtime feedback.
I think it might be simpler than you think. You should be able to just add the numbers together in HAL and use directly.
Note that the sum2 HAL component has separate gains for the two inputs, so you can scale one for distance-per-turn and the other for distance-per-pulse.
You might need to convert from signed integer (S32) to Floating point, but that, plus specifying absolute encoder homing should be all that you need.
(This assumes you are reading the Modbus in a realtime thread, of course)
Please Log in or Create an account to join the conversation.
Still learning LinuxCNC - so I might ask stupid questions.
I set up LinuxCNC in closed loop (velocity mode). The incremental encoders are driving the PID for the axis. That is working fine.
The ModBus reading would be too slow to drive the PID.
Does your example this still apply?
Regards,
Markus
Please Log in or Create an account to join the conversation.
The PID updates once per mS. Modbus can transfer hundreds of registers in that time.0x2102 wrote: The ModBus reading would be too slow to drive the PID.
But I think that you are correct, in that both modbus2hal and Classic Ladder modbus implementations run in user space.
What is the actual servo drive?
With modifications, probably. You would need to add together all three numbers (incremental encoder counter float position, mutli-turn and single turn)Does your example this still apply?
That would need two sum2 components per axis, or you could make a simple HAL component as a 3-way adder with scaling / number conversion. This might be needed if the modbus register are likely to change during operation, you would want to latch the initial numbers if you are also using the incrmental output.
Please Log in or Create an account to join the conversation.
www.jmc-motor.com/product/903.html
www.jmc-motor.com/file/1806085008.pdf
I guess it would be a nice to have feature, but it's not really that critical.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.

Currently I have a 7i95 on my test bench that I planned on using for this setup.
I also have a 7i76e and 7i92+7i76+7i77 available.
Please Log in or Create an account to join the conversation.
- Weiler810T
-
- Offline
- User is blocked
-
- Posts: 89
- Thank you received: 5

greeting Siggi
Please Log in or Create an account to join the conversation.
Henk
Please Log in or Create an account to join the conversation.
You should, I think, be able to connect all the drives to one serial port, including the one on the 7i76e.
I think it might be relatively easy to write a .comp that loads like:
[/code]loadrt mesa_modbus uart="hm2_7i76.0.uart.0" addr="151,151,152", regs="55,65"[/code]
It might be better to have something like the format used for absolute encoders :
ssi_chan_0=error%1bposition%24g
Possibly using all the same code, in fact.
This is one existing implementation of a driver for the Mesa UART:
github.com/LinuxCNC/linuxcnc/blob/master...ivers/mesa_uart.comp
Please Log in or Create an account to join the conversation.