LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

More
2 months 3 days ago #349079 by meister
ok, i think i see the problem but have to check how i fix it, i never used function code 3 for bit's

Please Log in to join the conversation.

More
2 months 1 day ago #349135 by viewsat
When I use pncconf to configure the MESA7i92 card, I set the dirhold to 10us, but the actual measurement is about 1ms. It automatically increases the value when executing linuxcnc. This is why I previously mentioned it works correctly on the dm542 (dir use pc817).

mesa7i92 step/dir
 

Attachment not found


 

Attachment not found

Please Log in to join the conversation.

More
2 months 1 day ago #349144 by PCW
The Hostmot2 Stepgen/LinuxCNC does not increase the time between steps. What you are seeing is that
the actual direction change may be some distance from the step pulse  time because
the actual step direction logic depends on the sign of the velocity command and at slow speeds
this velocity change may occur at a time determined by the _fractional_ position count. The hostmot2 stepgen
hardware position is a 16.16 bit number so has a resolution of 1/65536th of an external step.

The setup and hold timings set the minimum timings, but not the maximums.
 

Please Log in to join the conversation.

More
2 months 10 hours ago #349153 by meister
@Oxbown please try dev branch, i hope it works now, have no hardware to test.
and please set the Register address to 192.

Please Log in to join the conversation.

More
2 months 8 hours ago #349154 by Oxbown
Hi Meister, I updated to the dev branch, but I don't see any difference. Is there any way to sniff the Modbus network?

Please Log in to join the conversation.

More
2 months 7 hours ago #349155 by meister
new dev update:

go to mbus plugin-config and set the new debug flag

hope that help's

Please Log in to join the conversation.

More
2 months 5 hours ago #349156 by Oxbown
I ran a couple of tests, and the raw Modbus data makes sense. The board's response is OK, and the data corresponds to the DIs that are ON.
Seems that the mistake is in the LinuxCNC HAL config.

IN1
> MODBUS_TX(mbus0): 1 3 0 192 0 2 196 55
 MODBUS_RXmbus0: 1 3 4 0 1 0 0 171 243

IN2
> MODBUS_TX(mbus0): 1 3 0 192 0 2 196 55
 MODBUS_RXmbus0: 1 3 4 0 2 0 0 91 243

IN1 + IN2
>MODBUS_TX(mbus0): 1 3 0 192 0 2 196 55
 MODBUS_RXmbus0: 1 3 4 0 3 0 0 10 51

Please Log in to join the conversation.

More
2 months 4 hours ago #349158 by meister
i think the problem is, your device returns 4 bytes, not the requested 2 ?!?!


Code:
01 03 00 192 00 02 196 55 01: The SlaveID    03: The Function Code 3 (read Analog Output Holding Registers)       00 192: start register              00 02: number of bytes 01 03 04 00 02 00 00 91 243 01: The SlaveID    03: The Function Code 3 (read Analog Output Holding Registers)       04: The number of data bytes to follow          00: The contents of register 192             02: The contents of register 193                00: The contents of register 194                   00: The contents of register 195 please try to change the 16 'values' to 32

you need to pull dev to incrase the values, with my simulation it works, but it's a workaround,
i will write a fix, to read the values in the right order and ignore the last 16bit's

Please Log in to join the conversation.

More
2 months 3 hours ago #349159 by meister
oh, no, my fault, i send number of bytes, not number of registers :(

Please Log in to join the conversation.

More
2 months 3 hours ago #349160 by meister
I hope I’ve managed it now; it’s a bit tricky without the hardware

please set back to 16 values, update dev and try again

Please Log in to join the conversation.

Time to create page: 0.211 seconds
Powered by Kunena Forum