Modbus input for absolute encoder position?

More
6 years 10 months ago #152138 by Mike_Eitel
My 5 cents.
Modbus RTU 9600 Baud:
ca 1000 Hex signs per second.
Normal shortes telegram f.x 03 needs at least 8 digits for request plus 7 for answer plus waits. Say 20 hex digits a ca 1ms = 50 one word answers at 9600.
Yes you can use higher serial speeds.....
But don't forget Linux semaphore handling, vfd small processor, if rs485 hw direction switching....
...
Mike

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

More
6 years 10 months ago #152140 by 0x2102
Thanks Andy. Food for thought. I will play with it this weekend.

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

More
6 years 10 months ago #152141 by andypugh
I just realised. I changed my mind half-way through.

sample-hold takes S32 data, so you need to latch while the data is still in that form. So you can use two of them, latch the register reads, then pass the output of both to the type conversion. Both can be latched by the same input signal.

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

More
6 years 10 months ago #152442 by 0x2102
I didn't made much progress on this, as MB2HAL just randomly stops working for me. I open LinuxCNC, PIN are created and updating and then it just stops a few minutes after.

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

More
6 years 10 months ago #152594 by 0x2102
Made some progress. Still need to set this up and test but I think I figured out why MB2HAL randomly stops working for me. Long story short, I upgraded libmodbus from 3.0.6-2 to the latest release 3.1.6 - which was the reason.

I upgraded libmodbus to see if that would solve another issue I am having with MB2HAL. I am trying to read my servo motor load and while tools like modpoll report the correct values e.g 200 / -200 depending on motor load and direction, MB2HAL pins show only positive number 200 / 65336 (65536 - 200).

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

More
6 years 10 months ago #152603 by andypugh
Are the HAL pins set as signed?

Can you adjust the range?

65536 is a very recognizable but unexpected number for 16bit data.
The following user(s) said Thank You: besriworld

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

Time to create page: 0.247 seconds
Powered by Kunena Forum