Strange stepgen behaviour with 7i95t_1pktv2d firmware
- Finngineering
- Offline
- Junior Member
Less
More
- Posts: 36
- Thank you received: 22
01 Nov 2024 08:10 #313586
by Finngineering
Hello,
I am using the 7i95t_1pktv2d.bin firmware for my Maho MH600T for controlling the spindle VFD. After I got the Modbus communication to the spindle working I started getting following errors, and this is still without using encoder feedback. There are jumps in the stepgen.xx.position-fb while everything is idle. I condensed the setup as much as possible to try to pinpoint the issue, and this is outlined below.
Using 7i95t_1pktv2d.bin firmware:
I use this minimal test.hal which I run with "halcmd -f test.hal":
With this maho_vfd.mod:
I get these jumps in hm2_7i95.0.stepgen.00.position-fb:
Currently I don't have the VFD connected, and the jumps occur every second plus some. This occurs more frequently with the VFD connected and communication working. I imagine the jumps occur on every Modbus request. Strangely enough, I don't see the issues if leave the num_stepgens undefined for hm2_eth. And I could do just that and go ahead with my life. But I fear this will come back to bite me if I do.
Any ideas what may be causing this? Some problem with my setup? A bug in the Mesa driver or firmware?
I am using the 7i95t_1pktv2d.bin firmware for my Maho MH600T for controlling the spindle VFD. After I got the Modbus communication to the spindle working I started getting following errors, and this is still without using encoder feedback. There are jumps in the stepgen.xx.position-fb while everything is idle. I condensed the setup as much as possible to try to pinpoint the issue, and this is outlined below.
Using 7i95t_1pktv2d.bin firmware:
md5sum 7i95t_1pktv2d.bin
26b79f7bdef81b79ab3299925886b118 7i95t_1pktv2d.bin
I use this minimal test.hal which I run with "halcmd -f test.hal":
loadrt threads name1=servo-thread period1=1000000
loadrt hostmot2
loadrt hm2_eth board_ip="10.10.10.10" config="num_stepgens=5" # This causes jumps in hm2_7i95.0.stepgen.00.position-fb
#loadrt hm2_eth board_ip="10.10.10.10" # This appears to work without issues
addf hm2_7i95.0.read servo-thread
addf hm2_7i95.0.write servo-thread
loadrt maho_vfd ports=hm2_7i95.0.pktuart.0
addf maho_vfd.00 servo-thread
start
With this maho_vfd.mod:
#define MAX_MSG_LEN 16 // may be increased if necessary to max 251
static const hm2_modbus_chan_descriptor_t channels[] = {
/* {TYPE, FUNC, ADDR, COUNT, pin_name} */
{HAL_FLOAT, 3, 0x1000, 1, "status"},
};
I get these jumps in hm2_7i95.0.stepgen.00.position-fb:
Currently I don't have the VFD connected, and the jumps occur every second plus some. This occurs more frequently with the VFD connected and communication working. I imagine the jumps occur on every Modbus request. Strangely enough, I don't see the issues if leave the num_stepgens undefined for hm2_eth. And I could do just that and go ahead with my life. But I fear this will come back to bite me if I do.
Any ideas what may be causing this? Some problem with my setup? A bug in the Mesa driver or firmware?
Attachments:
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19226
- Thank you received: 6443
01 Nov 2024 08:57 #313590
by tommylight
Replied by tommylight on topic Strange stepgen behaviour with 7i95t_1pktv2d firmware
Config files?
Please Log in or Create an account to join the conversation.
- Finngineering
- Offline
- Junior Member
Less
More
- Posts: 36
- Thank you received: 22
01 Nov 2024 09:17 #313592
by Finngineering
Replied by Finngineering on topic Strange stepgen behaviour with 7i95t_1pktv2d firmware
I reduced the config files from ~700 lines down to the ~10 lines included in the first post, which are needed to reproduce the issue. As such, I can post the full configs if you think it is necessary? But the full configs are currently a work in progress, and I think its more likely to lead us astray than help. Part of the reason I reduced it to the above test case was to make sure I had nothing else in the configs that could be the cause of the issue.
Please Log in or Create an account to join the conversation.
01 Nov 2024 14:39 #313603
by PCW
Replied by PCW on topic Strange stepgen behaviour with 7i95t_1pktv2d firmware
I think I have see that before and it looks like a bug in the mesa_modbus driver.
(the 1 Hz is the modbus timeout/retry period) In my testing, it went away mysteriously
and I was not able to re-create it. Looks like maybe request/reply mismatch in some
circumstances.Can you retry the test with the stepgen position not at 0?
(that would provide a bit more information.)
There are a number of already known bugs in mesa_modbus:
(the 1 Hz is the modbus timeout/retry period) In my testing, it went away mysteriously
and I was not able to re-create it. Looks like maybe request/reply mismatch in some
circumstances.Can you retry the test with the stepgen position not at 0?
(that would provide a bit more information.)
There are a number of already known bugs in mesa_modbus:
Attachments:
Please Log in or Create an account to join the conversation.
- Finngineering
- Offline
- Junior Member
Less
More
- Posts: 36
- Thank you received: 22
01 Nov 2024 15:08 #313604
by Finngineering
Replied by Finngineering on topic Strange stepgen behaviour with 7i95t_1pktv2d firmware
Attachments:
Please Log in or Create an account to join the conversation.
01 Nov 2024 17:10 #313608
by PCW
Replied by PCW on topic Strange stepgen behaviour with 7i95t_1pktv2d firmware
I can take a look at this next week, now that there's a way to re-create the issue.
Please Log in or Create an account to join the conversation.
- Finngineering
- Offline
- Junior Member
Less
More
- Posts: 36
- Thank you received: 22
02 Nov 2024 09:03 #313646
by Finngineering
Replied by Finngineering on topic Strange stepgen behaviour with 7i95t_1pktv2d firmware
Okay, cool! Let me know in case you need anything from me. I have had a look at the relevant code and might also be able to troubleshoot myself, but it would be a quite steep learning curve.
Please Log in or Create an account to join the conversation.
02 Nov 2024 16:27 #313665
by PCW
Replied by PCW on topic Strange stepgen behaviour with 7i95t_1pktv2d firmware
I tried that firmware on a 7I95T with the included relayboard.mod
and stepgens set to 5 with no issues (with or without a relay modbus
device connected).
I'll try your example on Monday. Worst case, may be debuggable with
tcpdump.
and stepgens set to 5 with no issues (with or without a relay modbus
device connected).
I'll try your example on Monday. Worst case, may be debuggable with
tcpdump.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- Finngineering
- Offline
- Junior Member
Less
More
- Posts: 36
- Thank you received: 22
02 Nov 2024 17:53 #313669
by Finngineering
Replied by Finngineering on topic Strange stepgen behaviour with 7i95t_1pktv2d firmware
Okay, so this is not reproducible for you. I also think it was working for a short while for me before I started getting the following errors.
The value position-fb jumps to is consistent across time and even if unloading all modules and starting over. But it has changed as well at some time, but I'm not quite sure what has been the trigger for that. Perhaps some change in the modbus .mod "config", but I'm not sure.
I actually was also thinking about narrowing it down by a ethernet capture, and already took one with Wireshark. I could see the LBP16 commands, but have not tried to decipher what is written/read yet (by the LBP16 commands). But just by looking at the source code, it appears the step rate is written and the position feedback (16.16 floating point accumulator) is read back. It shouldn't be too difficult to figure out if something strange happens with those. Hopefully
The value position-fb jumps to is consistent across time and even if unloading all modules and starting over. But it has changed as well at some time, but I'm not quite sure what has been the trigger for that. Perhaps some change in the modbus .mod "config", but I'm not sure.
I actually was also thinking about narrowing it down by a ethernet capture, and already took one with Wireshark. I could see the LBP16 commands, but have not tried to decipher what is written/read yet (by the LBP16 commands). But just by looking at the source code, it appears the step rate is written and the position feedback (16.16 floating point accumulator) is read back. It shouldn't be too difficult to figure out if something strange happens with those. Hopefully
Please Log in or Create an account to join the conversation.
04 Nov 2024 21:04 - 04 Nov 2024 21:45 #313781
by PCW
Replied by PCW on topic Strange stepgen behaviour with 7i95t_1pktv2d firmware
Well unfortunately, I have not been able to reproduce this.
Using your maho_vfd.mod example either with a running
LinuxCNC instance or your hal script I get all stepgens fb positions
= 0 and stable (or running as expected under LinuxCNC)
This is with LinuxCNC 2.9.3, but I don't think the have been any
mesa modbus changes between 2.92 and 2.93 (last mesa modbus
change was in Sept 2023, and 2.92 was released in Dec 2023)
Edit: There's definitely a loose wire in mesa modbus because if I change your script
to:
#loadrt hm2_eth board_ip="10.10.10.10" config="num_stepgens=5" # This causes jumps in hm2_7i95.0.stepgen.00.position-fb
loadrt hm2_eth board_ip="10.10.10.10" # This appears to work without issues
I get a segv!
Using your maho_vfd.mod example either with a running
LinuxCNC instance or your hal script I get all stepgens fb positions
= 0 and stable (or running as expected under LinuxCNC)
This is with LinuxCNC 2.9.3, but I don't think the have been any
mesa modbus changes between 2.92 and 2.93 (last mesa modbus
change was in Sept 2023, and 2.92 was released in Dec 2023)
Edit: There's definitely a loose wire in mesa modbus because if I change your script
to:
#loadrt hm2_eth board_ip="10.10.10.10" config="num_stepgens=5" # This causes jumps in hm2_7i95.0.stepgen.00.position-fb
loadrt hm2_eth board_ip="10.10.10.10" # This appears to work without issues
I get a segv!
Last edit: 04 Nov 2024 21:45 by PCW.
Please Log in or Create an account to join the conversation.
Time to create page: 0.110 seconds