Confusion-please enlighten

More
30 Jul 2016 19:36 #78168 by bill.anderson
I am trying to switch over from Mach3 to Linuxcnc. I am trying to understand getting from the output pins (DB25) on the back of a Mesa 5i25 board (plain, no daughterboard) to a G540 and then out to my stepper driven Mill /Lathe combination with a (0-10v) input spindle VFD.

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 or Create an account to join the conversation.

More
30 Jul 2016 22:15 #78172 by andypugh
Replied by andypugh on topic Confusion-please enlighten
The signals on the pins on the 5i25 are largely governed by the firmware that is flashed on the card.

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 or Create an account to join the conversation.

More
31 Jul 2016 02:17 #78176 by bill.anderson
I have done all that. PNCCONF doesn't have a plain Mesa 5i25 with a G540 and the xml that I was able to find doesn't make any sense to me in the inputs and outputs it offers in PNCCONF.

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 or Create an account to join the conversation.

More
31 Jul 2016 09:54 - 31 Jul 2016 09:57 #78178 by andypugh
Replied by andypugh on topic Confusion-please enlighten
The presence of the HAL layer makes LinuxCNC extremely flexible, but that flexibility does come at the expense of some complexity.

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:
net signal-name pin1 pin2 pin3 pin5
net signal-name pin4
"signal-name" can be anything that you want, there are no pre-defined or special signal names. Every pin net-ed to the same signal-name will have the same numerical value. For this to be logically consistent it is necessary that only one of the pins should be an output pin, ie a pin that supplies a value to HAL.

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:
halrun
loadrt hostmot2
loadrt hm2_pci
show pin
And then to get the parameters for things like step-length:
show param
Save that to a text file. If you leave that file open in a text file in Gedit then when you edit the text file those pin names will become spelling suggestions, which can help.

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
loadrt hostmot2
loadrt hm2_pci
remove any other parport loadrts
in the addf section swap addf parport.0.read base-thread for
addf hm2_5i25.0.read servo-thead
and swap parport.0.write base-thread for
addf hm2_5i25.0.write servo-thread
Delete the loadrt and addf for stepgen, and swap every "stepgen.N" for "hm2_5i25.0.stepgen.N" checking against the previously created pin-list to check the spelling.
Last edit: 31 Jul 2016 09:57 by andypugh.
The following user(s) said Thank You: rodw

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

More
31 Jul 2016 14:50 #78186 by bill.anderson
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
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 or Create an account to join the conversation.

More
31 Jul 2016 14:55 #78187 by bill.anderson
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? Where would I put files from Mesanet so that stepconf and pncconf find them and what do they need to contain bit xml hal ini etc?

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

More
31 Jul 2016 17:27 #78196 by andypugh
Replied by andypugh on topic Confusion-please enlighten

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 or Create an account to join the conversation.

More
31 Jul 2016 17:33 #78197 by andypugh
Replied by andypugh on topic Confusion-please enlighten

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 or Create an account to join the conversation.

More
31 Jul 2016 18:16 #78198 by bill.anderson
I was replying that I didn't understand the reference to "servo" since I have a stepper

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

More
31 Jul 2016 19:53 - 31 Jul 2016 19:55 #78202 by andypugh
Replied by andypugh on topic Confusion-please enlighten

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.
Last edit: 31 Jul 2016 19:55 by andypugh.

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

Time to create page: 0.158 seconds
Powered by Kunena Forum