Search Results (Searched for: )
- viesturs.lacis
04 Oct 2026 19:59 - 04 Oct 2026 20:01
Replied by viesturs.lacis on topic Help with Modbus needed
Rod, awesome video! I actually understood a lot more of that sample INI file, definitely had mistakes. hopefully now it is better (but seems like not yet good because it is not working completely).
I have attached:
1) mb2hal.hal file, which at the moment only loads mb2hal module
2) mb2hal.ini file
3) modbus.png which shows few hal pins of the mb2hal module. what I find a good sign there is that first transaction for reading the registers seem good, no errors are accumulated there
4) modbus error.png shows the error message in terminal when I started LinuxCNC there, maybe that is helpful for understanding what am I missing
5) VFD manual
6) VFD modbus register map
I have a suspicion that "First element" in mb2hal.ini is not correct because of the values that are reported on hal pins.Values of those hal pins match following settings from VFD: P-01 (max speed) is set to 24000 and P-02 (min speed) is set to 1800 and P-03 accel ramp time and P-04 decel ramp are both 6.0 seconds
And now as I was writing this, I checked - if I change P-04 parameter (decel time) to 7.0 seconds, mb2hal.status.coast_stop.int immediately changes value to 700 and changing P-03 to 5.6 seconds changes mb2hal.status.reset.int to 560 - hooray I have some basic communication going!
I chose those names according to functions of first 4 bits of register 1 that show status of VFD - I thought that they would reflect values of the first 4 bits, but now I see that they are integer type hal pins, so now I am confused which registers am I looking at.
I took the "First element" value of 128 from very bottom of page 36 of VFD manual (section 8.4 "Modbus register map")
Could you please hint me what am I doing wrong? Because from that register map I understand that register 4 holds accel / decel (from modbus register map it seems that it is one value used for both accel and decel but I proved that those are 2 separate values received from VFD) and I am somehow reading that but I do not see in that map any register that shows min and max speed settings. Where do those come from (got curious and checked - hal pin values are updated immediately when I change those settings in VFD)?
And it seems obvious that if the first transaction is not reading the register that I thought it would then other 2 transactions will not write the register that I thought they would and they produce those errors...
Thanks in advance!
I have attached:
1) mb2hal.hal file, which at the moment only loads mb2hal module
2) mb2hal.ini file
3) modbus.png which shows few hal pins of the mb2hal module. what I find a good sign there is that first transaction for reading the registers seem good, no errors are accumulated there
4) modbus error.png shows the error message in terminal when I started LinuxCNC there, maybe that is helpful for understanding what am I missing
5) VFD manual
6) VFD modbus register map
I have a suspicion that "First element" in mb2hal.ini is not correct because of the values that are reported on hal pins.Values of those hal pins match following settings from VFD: P-01 (max speed) is set to 24000 and P-02 (min speed) is set to 1800 and P-03 accel ramp time and P-04 decel ramp are both 6.0 seconds
And now as I was writing this, I checked - if I change P-04 parameter (decel time) to 7.0 seconds, mb2hal.status.coast_stop.int immediately changes value to 700 and changing P-03 to 5.6 seconds changes mb2hal.status.reset.int to 560 - hooray I have some basic communication going!
I chose those names according to functions of first 4 bits of register 1 that show status of VFD - I thought that they would reflect values of the first 4 bits, but now I see that they are integer type hal pins, so now I am confused which registers am I looking at.
I took the "First element" value of 128 from very bottom of page 36 of VFD manual (section 8.4 "Modbus register map")
Could you please hint me what am I doing wrong? Because from that register map I understand that register 4 holds accel / decel (from modbus register map it seems that it is one value used for both accel and decel but I proved that those are 2 separate values received from VFD) and I am somehow reading that but I do not see in that map any register that shows min and max speed settings. Where do those come from (got curious and checked - hal pin values are updated immediately when I change those settings in VFD)?
And it seems obvious that if the first transaction is not reading the register that I thought it would then other 2 transactions will not write the register that I thought they would and they produce those errors...
Thanks in advance!
- tuxcnc
04 Oct 2026 19:56
Replied by tuxcnc on topic Standalone LinuxCNC machine simulator using the Stepper-Ninja HAL interface
I haven't tested 0.1.2, but I think I found the reason for the zeros moving apart.
In a normal machine, zero is counted from the point where the limit switch is actuated, but here the position of the limit switch is apparently set as relative to zero...
In my settings HOME_OFFSET = 6, so limits set Z max must be 2400 and not 4000 as it was.
After this change, the zeros in both windows are in place.
So there's nothing to fix, but some comment in the virtual-io.conf file would be helpful.
In a normal machine, zero is counted from the point where the limit switch is actuated, but here the position of the limit switch is apparently set as relative to zero...
In my settings HOME_OFFSET = 6, so limits set Z max must be 2400 and not 4000 as it was.
After this change, the zeros in both windows are in place.
So there's nothing to fix, but some comment in the virtual-io.conf file would be helpful.
- tuxcnc
04 Oct 2026 19:14
Bellow is what was and I described above.
Replied by tuxcnc on topic Standalone LinuxCNC machine simulator using the Stepper-Ninja HAL interface
It's late, so I do test v0.1.2 rather tomorrow.
[/code][/code][/code][/b][/code][/b]Code:[b][b][code][code][code][code][b][url=https://github.com/FredericM88/linuxcnc-sim/releases/tag/v0.1.2][b]Could you try v0.1.2 with the new Phase 3 configuration and see whether the Z offset still occurs on your system?[/b][/url][/b]
Bellow is what was and I described above.
- fmueller
04 Oct 2026 18:22
Replied by fmueller on topic Standalone LinuxCNC machine simulator using the Stepper-Ninja HAL interface
Thanks for the detailed feedback and also for the launcher script!
We haven't had the opportunity to test your script yet, but we will definitely take a closer look at it. Starting LinuxCNC and the simulator together with a single command is a very useful idea.
I went through the three points you mentioned and used them to update the Phase 3 example.
Working area
You were right that the previous working area was much too small for a realistic milling machine example.
The Phase 3 machine now uses:
The virtual limit switches were updated accordingly and are located 1 mm outside the normal working area.
Z homing
I also changed the Z homing as you suggested.
X and Y still home toward their minimum switches, but Z now homes upward toward the maximum/home switch. The Z switch is therefore approached from below with a positive HOME_SEARCH_VEL.
Z offset between AXIS and the simulator
This was the point I was most interested in, so I tried to reproduce it deliberately.
For the test I placed the physical Z home switch at +1 mm and configured:
This means that the physical switch position is intentionally different from the final G53 Z0 position.
I tested the complete homing sequence with LinuxCNC 2.10.0-pre2.
Z approaches the upper switch from below, backs off, performs the slow latch approach and finally moves back to G53 Z0.
After homing, both AXIS and the simulator showed exactly Z0.
I then commanded:
AXIS showed:
and the simulator showed exactly:
at 400 steps/mm.
I also checked the simulator's min/max switch implementation and added an explicit automated test for approaching the Z maximum switch from below, including its hysteresis behavior.
So far I have not been able to reproduce the several-millimeter Z offset you are seeing.
These changes are now included in v0.1.2:
linuxcnc-sim v0.1.2
The complete simulator test suite also passes with the new configuration: 91/91 tests passed.
Could you try v0.1.2 with the new Phase 3 configuration and see whether the Z offset still occurs on your system?
If the offset is still there, could you send me your LinuxCNC .ini and .hal files, and your virtual-io.conf if you changed it?
Then I can reproduce your exact configuration instead of guessing where the difference comes from.
Thanks again for testing the simulator. Your feedback already resulted in several improvements to the example configuration.
We haven't had the opportunity to test your script yet, but we will definitely take a closer look at it. Starting LinuxCNC and the simulator together with a single command is a very useful idea.
I went through the three points you mentioned and used them to update the Phase 3 example.
Working area
You were right that the previous working area was much too small for a realistic milling machine example.
The Phase 3 machine now uses:
Code:
X: 0 .. 600 mm
Y: 0 .. 400 mm
Z: -200 .. 0 mm
The virtual limit switches were updated accordingly and are located 1 mm outside the normal working area.
Z homing
I also changed the Z homing as you suggested.
X and Y still home toward their minimum switches, but Z now homes upward toward the maximum/home switch. The Z switch is therefore approached from below with a positive HOME_SEARCH_VEL.
Z offset between AXIS and the simulator
This was the point I was most interested in, so I tried to reproduce it deliberately.
For the test I placed the physical Z home switch at +1 mm and configured:
Code:
HOME = 0
HOME_OFFSET = 1
HOME_SEARCH_VEL = 2
HOME_LATCH_VEL = 0.2
This means that the physical switch position is intentionally different from the final G53 Z0 position.
I tested the complete homing sequence with LinuxCNC 2.10.0-pre2.
Z approaches the upper switch from below, backs off, performs the slow latch approach and finally moves back to G53 Z0.
After homing, both AXIS and the simulator showed exactly Z0.
I then commanded:
Code:
G53 G0 X10 Y10 Z-5
AXIS showed:
Code:
X = 10.000
Y = 10.000
Z = -5.000
and the simulator showed exactly:
Code:
X = 4000 steps = 10.000 mm
Y = 4000 steps = 10.000 mm
Z = -2000 steps = -5.000 mm
at 400 steps/mm.
I also checked the simulator's min/max switch implementation and added an explicit automated test for approaching the Z maximum switch from below, including its hysteresis behavior.
So far I have not been able to reproduce the several-millimeter Z offset you are seeing.
These changes are now included in v0.1.2:
linuxcnc-sim v0.1.2
The complete simulator test suite also passes with the new configuration: 91/91 tests passed.
Could you try v0.1.2 with the new Phase 3 configuration and see whether the Z offset still occurs on your system?
If the offset is still there, could you send me your LinuxCNC .ini and .hal files, and your virtual-io.conf if you changed it?
Then I can reproduce your exact configuration instead of guessing where the difference comes from.
Thanks again for testing the simulator. Your feedback already resulted in several improvements to the example configuration.
- Vegko
04 Oct 2026 17:16
Replied by Vegko on topic VTK based version of Vismach
I have converted my old vismach to this VTK and i must say that i am impressed with it!
My configuration is only a simple 3 axis machine.
In the attachments, my configuration (vtkvismach is in the config folder) and 3d files (these go in your nc_files folder)
Some pro's for the new VTK implementation, in my opinion:
The pins necessary for my HUD are now created in "custom.hal".
Also i added a few extra lines (classes) to vtk_vismach.py, some for my own preferences/use
My configuration is only a simple 3 axis machine.
In the attachments, my configuration (vtkvismach is in the config folder) and 3d files (these go in your nc_files folder)
Some pro's for the new VTK implementation, in my opinion:
- Smaller stl from freecad (old vismach you needed to export as .ast, now normal .stl)
- In less lines you can configure your machine.
- Model groups are a real nice way to toggle off machine components you don't want to see during simulation.
- Transparent stock!
- Runs from you config folder stand alone.
- You can start it while your program is already running, or even if your machine is not homed yet.
- Quick switching of the viewing planes.
The pins necessary for my HUD are now created in "custom.hal".
Also i added a few extra lines (classes) to vtk_vismach.py, some for my own preferences/use
- ini_work_file:
ini file reading, i use a ini file in the NC folder to specify my Job, in the ini file you can state your workpiece, raw stock and the work holding. In my example the files are read from the nc_files folder.- Syntax:
- Product_stl=ini_work_file('WorkpieceModel', 'solidname').database_read(INI_Path_File)
- Syntax:
- Polygon:
enter a polygon solid in Z direction (for example: used for my stock creation from hexbar to round)- Syntax:
- Polygon((comp),x_center, y_center, z_center, length, radius, number_sides, inscribed)
- number_sides = number of polygon sides
- inscribed = boolean = if the given radius is: read as inscribed, measured on flats (1) or measured on the points (0).
- Syntax:
- ThreadBox:
Creates a box of "wiremess" (for example: used for my working area)- Syntax:
- Polygon((comp),xmin, ymin, zmin, xmax, ymax, zmax, radius, sradius)
- xyz min and max for your corners.
- radius = the radius of the ribs.
- sradius = the radius of the sphers on the corners.
- Syntax:
- Small aditions, icon, View_Ori and TextHeightButtons (to keep the screen small with to many model groups).
- Made parallel the starting option.
- Changed "show overlay" from radio button to check box
- CylinderOriented, this function won't work if xystart and xyend are equal. i added some (brute force) logic to check and bypass the used matrix.
- cmorley
04 Oct 2026 16:40
Replied by cmorley on topic qtvismach, a axis toolpath
I tried this out. Excellent job.
I did not if I move the origin the material stock does not move, even if I rebuild the material. Does this happen for you?
I did not if I move the origin the material stock does not move, even if I rebuild the material. Does this happen for you?
- anfänger
04 Oct 2026 12:54
Replied by anfänger on topic Barnworks shop update
During all this progress we also setup my wife's shop with warm and cold water
and what once was my temporary home is now the shelter for our old sofa and her loom
all that was left was to get sone beer and cake
set up the benches
and wait in the courtyard by the fire with the dog for the friend to arrive
and what once was my temporary home is now the shelter for our old sofa and her loom
all that was left was to get sone beer and cake
set up the benches
and wait in the courtyard by the fire with the dog for the friend to arrive
- anfänger
04 Oct 2026 12:45
Replied by anfänger on topic Barnworks shop update
then it was time for the lathe.
getting here under power and leveled was a bit more challenging. then there was another issue. In the old shop I could have a hoist on a roof beam to change the chucks... here not, so I needed another solution:
An old winch, one multifix mount and a pickup crane did the trick
getting here under power and leveled was a bit more challenging. then there was another issue. In the old shop I could have a hoist on a roof beam to change the chucks... here not, so I needed another solution:
An old winch, one multifix mount and a pickup crane did the trick
- anfänger
04 Oct 2026 12:39
Replied by anfänger on topic Barnworks shop update
followed by the battery powered shit
and the welding table
then the first cnc machine was ready to get leveled and under power:
and for the first time since I started setting up this machine it got its two vices mounted:
so it can be used soon hopefully and also I can start working on fully integrate the 4th axis.
and the welding table
then the first cnc machine was ready to get leveled and under power:
and for the first time since I started setting up this machine it got its two vices mounted:
so it can be used soon hopefully and also I can start working on fully integrate the 4th axis.
- anfänger
04 Oct 2026 12:33
Replied by anfänger on topic Barnworks shop update
- anfänger
04 Oct 2026 12:26
Replied by anfänger on topic Barnworks shop update
the there was really long time no progress, cause focus was on the house, which brings us to the point two months ago, where instead of going on our vacation we made a big leap with our shops.
Beginning by further insulating mine.
and finishing the walls
setting up first work benches and begin wiring the whole shop
Beginning by further insulating mine.
and finishing the walls
setting up first work benches and begin wiring the whole shop
- anfänger
04 Oct 2026 12:17
Replied by anfänger on topic Barnworks shop update
- anfänger
04 Oct 2026 12:14
Replied by anfänger on topic Barnworks shop update
- anfänger
04 Oct 2026 11:50
Replied by anfänger on topic Barnworks shop update
Then it was moving day, the crew arrived with two truck and a forklift, I would haul my trailer in addition.
Loading went really fast with on truck on the street and on in the courtyard. at the new house both needed to fit in the courtyard cause the street is to narrow to park a truck there.
first we unloaded my wife's carding machine to the 2nd floor
where I could move it around on my own:
while the professionals brought in the mill and the lathe.
this was moving day.
Loading went really fast with on truck on the street and on in the courtyard. at the new house both needed to fit in the courtyard cause the street is to narrow to park a truck there.
first we unloaded my wife's carding machine to the 2nd floor
where I could move it around on my own:
while the professionals brought in the mill and the lathe.
this was moving day.
- anfänger
04 Oct 2026 10:50
Replied by anfänger on topic Barnworks shop update
looks like renovating and moving while having a full time job takes much longer than expected.
But finally this weekend I was able invite over some friends to celebrate the latest incarnation of ma shop.
a lot has happend in the last years to get the shop to the state wehere I can continue using and working on my linuxcncn machines.
first step was to close up the hole for the never installed window and it would be blocked by a machine anyway
the it was time to insulate nd cover the first wall cause here will land the heavy machine I can't move on my own.
the it was tie to haul the first smaller machines by myself
the wood shop and the fabric shop of my wife well be upstairs so I hoisted them up
But finally this weekend I was able invite over some friends to celebrate the latest incarnation of ma shop.
a lot has happend in the last years to get the shop to the state wehere I can continue using and working on my linuxcncn machines.
first step was to close up the hole for the never installed window and it would be blocked by a machine anyway
the it was time to insulate nd cover the first wall cause here will land the heavy machine I can't move on my own.
the it was tie to haul the first smaller machines by myself
the wood shop and the fabric shop of my wife well be upstairs so I hoisted them up
Time to create page: 6.862 seconds