- Posts: 31
- Thank you received: 0
Confusion-please enlighten
- bill.anderson
- Topic Author
- Offline
- Junior Member
-
I have searched throughout this site and the Mesa site to try to understand the meaning and the logic behind the syntax in the various .ini files and the .hal files. I would really like to find a block diagram that would show the signals from and to each hardware component and what configuration commands are required to generate, enable and assign them. Mach3 was never this confusing.
Thanks for any direction or enlightenment
Please Log in to join the conversation.
If you flash the 5i25 with a G540 Firmware then things should, to a large extent, just work.
Then PNCConf should be able to help with the rest.
Please Log in to join the conversation.
- bill.anderson
- Topic Author
- Offline
- Junior Member
-
- Posts: 31
- Thank you received: 0
I can use STEPCONF to configure a parallel port and the selection for inputs and outputs make sense and work except for the outputs for the analog 0-10 volt pwm output for the VFD Spindle
Please Log in to join the conversation.
The INI file is just a central data store where various bits of LinuxCNC expect to find certain settings. Your Stepconf-created config should have made a valid one of these.
The HAL file is where the interface between the software and hardware is defined, and it is also where the realtime-system is most visible. You will see a set of "loadrt" functions that load realtime drivers for various types of hardware drivers (loadrt hal_parport, for example).
When you loadrt a function (or loadusr a non-realtime function, they can coexist) a set of HAL "pins" will be created to link the data-flow Each of these drivers also creates at least one realtime function call, that is then added to a realtime-thread with "addf". Every 1ms the servo-thread runs and every addf-ed realtime function is run in sequence. With a parport config you will also have a base-thread of simpler, faster functions that are called every 20uS or so. With a 5i25 you won't need a base-thread.
The HAL file will retrieve settings from the INI file with a format that looks like [SECTION]VALUE. You are perfectly at liberty to add new VALUES to existing [SECTIONS] in the INI and to create your own [SECTIONS] but there are certain entries that LinuxCNC expects to find there, so don't delete anything without being sure it it unused.
As well as the hardware drivers, HAL has many realtime functions that modify HAL signals, for example scaling functions, logic-gates, multiplexers to send different values to a pin depending on other pin states etc etc. The full list of the HAL components is listed in one of the sections near the bottom of here under "HAL components and kernel modules"
HAL signals are linked together with the "net" command:
If you have a plausible-looking config for the parport you might well be able to start from there.
First, to get a list of all the HAL pins from the 5i25 open a terminal and:
Now make a copy of the stepconf config to work on.
The INI file will probably remain the same.
In the HAL file replace "loadrt hal_parport" with
in the addf section swap addf parport.0.read base-thread for
Please Log in to join the conversation.
- bill.anderson
- Topic Author
- Offline
- Junior Member
-
- Posts: 31
- Thank you received: 0
>addf hm2_5i25.0.read servo-thead
>and swap parport.0.write base-thread for
>addf hm2_5i25.0.write servo-thread
I am having trouble understanding a bunch of the terms or labels and how they relate to the ports & pins
I am used to with Mach3
Please Log in to join the conversation.
- bill.anderson
- Topic Author
- Offline
- Junior Member
-
- Posts: 31
- Thank you received: 0
Please Log in to join the conversation.
bill.anderson wrote: Your reply takes some of the confusion away, but if I am using a stepper why would I be using
>addf hm2_5i25.0.read servo-thead
>and swap parport.0.write base-thread for
>addf hm2_5i25.0.write servo-thread
Well, if you are using a 5i25 instead of a parallel port, you need to swap the parallel port refererences to 5i25 ones. Or have I misunderstood?
Please Log in to join the conversation.
bill.anderson wrote: I would like to also understand the directory structure required. What is required and where is it required to be? Is all we really need a ini file and a hal file in our home directory?
Each machine config is expected to live in its own directory under "linuxcnc"
A directory can contain more than one INI file, and that will show up in the config-chooser as two separate configs. It is quite common to do this to have a metric and an imperial version of a machine, for example. They can share all or some HAL files. (sharing the tool table between metric and imperial versions would be asking for trouble, though). [1]
The Basic config is an INI file that references one or more HAL files, a .var file to hold persistent G-code parameters and a tool table.
If you are editing the stepconf-created file there is probably not much point keeping the .stepconf file, as re-using it will over-write all your changes with a brand-new config.
Have you noticed that stepconf can import a Mach3 XML config directly? That is partly why I am suggesting that.
[1] And note that a metric machine can run imperial G-code and display inches in the DRO and vice-versa.
Please Log in to join the conversation.
- bill.anderson
- Topic Author
- Offline
- Junior Member
-
- Posts: 31
- Thank you received: 0
Please Log in to join the conversation.
bill.anderson wrote: I was replying that I didn't understand the reference to "servo" since I have a stepper
Ah, right. That's just the name given to the slower thread of the two, where floating point calculations (including the motion planning) is done.
Arguably the word isn't wrong, as there is still a feedback loop in operation controlling the position of a motor. But it's mainly called that for historical reasons.
[Edit] The fast stuff is done in the FPGA, so you don't need anything in the base thread. The 5i25 driver, on the other hand, needs to do floating-point calculations, so the servo-thread is where the 5i25 driver read and write need to be.
Please Log in to join the conversation.
