- Posts: 19306
- Thank you received: 0
Small victory in the war against the Cincinnati cinturn 12u
3 years 11 months ago #255880
by andypugh
All the HAL pins are connected up as defined by the net commands (if you are interested, all that really happens is that the internal variables of the C-code that defines the functions internally that are part of the same net are moved into the same memory address. So a variable called "out1" of one bit of code will have the exact same memory address as the pins "in2" and "latch" (for example) of other bits of code)
Then, every SERVO-THREAD period all the functions that have been "addf-ed" to the SERVO-THREAD are executed in strict one-by-one sequence.
Each component reads its inputs, does it's internal thing, and updates its outputs. Then the next function is executed.
The same is true of BASE-THREAD.
Some components have more than one function, for example the software stepgen has a very fast, integer-only BASE-THREAD function to create pulses and a more complicated one that runs in the SERVO-THREAD to calculate the required step rate.
And the Mesa driver has separate READ and WRITE functions, so that all inputs are read at the start of the thread cycle, and all outputs are updated at the end.
Replied by andypugh on topic Small victory in the war against the Cincinnati cinturn 12u
I thought that I had explained this, but the HAL file is read only once, at the beginning.So, Hal reads and executes the file how often ? Is it a single loop subroutine ? or a single loop open ended main routine with a need for a callback to start ?
All the HAL pins are connected up as defined by the net commands (if you are interested, all that really happens is that the internal variables of the C-code that defines the functions internally that are part of the same net are moved into the same memory address. So a variable called "out1" of one bit of code will have the exact same memory address as the pins "in2" and "latch" (for example) of other bits of code)
Then, every SERVO-THREAD period all the functions that have been "addf-ed" to the SERVO-THREAD are executed in strict one-by-one sequence.
Each component reads its inputs, does it's internal thing, and updates its outputs. Then the next function is executed.
The same is true of BASE-THREAD.
Some components have more than one function, for example the software stepgen has a very fast, integer-only BASE-THREAD function to create pulses and a more complicated one that runs in the SERVO-THREAD to calculate the required step rate.
And the Mesa driver has separate READ and WRITE functions, so that all inputs are read at the start of the thread cycle, and all outputs are updated at the end.
Please Log in to join the conversation.
- smc.collins
- Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 721
- Thank you received: 0
3 years 11 months ago #255881
by smc.collins
Replied by smc.collins on topic Small victory in the war against the Cincinnati cinturn 12u
ok, So if for instance
net.toolchange,output is a run once, or it runs on every call to M6 , does it store the variable of the tool number somewhere in hal or do I have to declare the storage or is it part of the component.
Is there a way to fetch without grep the commands in each component or better to just read the C file?
Also is the carousel component called on every m6, or just each time through the main hal routine ? just trying to wrap my head around how the program works, my mind needs to connect things like virtual physical blocks with a label assigned to each block. sounds weird but I see things as complex interacting machines as mental visual images. So I will often design a part in my head before I begin making it. that's why most of the tutorials are useless until I see the code as the parts and how they interact as functional mechanisms and I can label them. at some point it'll hopefully just click
net.toolchange,output is a run once, or it runs on every call to M6 , does it store the variable of the tool number somewhere in hal or do I have to declare the storage or is it part of the component.
Is there a way to fetch without grep the commands in each component or better to just read the C file?
Also is the carousel component called on every m6, or just each time through the main hal routine ? just trying to wrap my head around how the program works, my mind needs to connect things like virtual physical blocks with a label assigned to each block. sounds weird but I see things as complex interacting machines as mental visual images. So I will often design a part in my head before I begin making it. that's why most of the tutorials are useless until I see the code as the parts and how they interact as functional mechanisms and I can label them. at some point it'll hopefully just click
Please Log in to join the conversation.
3 years 11 months ago #255882
by andypugh
Components can store their own internal data, they are just small programs.
Components don't have commands. They only have inputs and outputs. (which are just numbers)
carousel sits there, generally doing nothing. Every thread cycle it checks to see if the "enable" input pin has gone high. If it has, and if the pocket-number pin has a different number to what the feedback sensors are telling it, then it enters a different state, and outputs a motor command on an output pin.
Then, when the position feedback input pins tell it that it is in the right place, it turns off the motor controls pins, signals "ready" and goes back to waiting.
So, the only way that caraousel knows that there is a tool change going on is generally when the iocontrol.0.tool-change pin goes high. (And that _is_ directly controlled by the M6 command)
Replied by andypugh on topic Small victory in the war against the Cincinnati cinturn 12u
net.toolchange,output is a run once, or it runs on every call to M6 , does it store the variable of the tool number somewhere in hal or do I have to declare the storage or is it part of the component.
Components can store their own internal data, they are just small programs.
Is there a way to fetch without grep the commands in each component or better to just read the C file?
Components don't have commands. They only have inputs and outputs. (which are just numbers)
Also is the carousel component called on every m6, or just each time through the main hal routine
carousel sits there, generally doing nothing. Every thread cycle it checks to see if the "enable" input pin has gone high. If it has, and if the pocket-number pin has a different number to what the feedback sensors are telling it, then it enters a different state, and outputs a motor command on an output pin.
Then, when the position feedback input pins tell it that it is in the right place, it turns off the motor controls pins, signals "ready" and goes back to waiting.
So, the only way that caraousel knows that there is a tool change going on is generally when the iocontrol.0.tool-change pin goes high. (And that _is_ directly controlled by the M6 command)
Please Log in to join the conversation.
3 years 11 months ago #255883
by andypugh
Replied by andypugh on topic Small victory in the war against the Cincinnati cinturn 12u
Sorry, missed a question.
To see the pins and functions of any hal component, either use "man name" at the command line (eg, "man carousel")
Or, more legibly and less geekily, look in the web docs:
linuxcnc.org/docs/stable/html/
The realtime and userspace components are all listed at the bottom.
There are many of them, and it's possibly worth a _very_ superficial skim through them to get a feel for what they do.
Most are very simple. motion is very complicated (it's the entire motion controller).
The main ones to look at for everyday reference are motion, halui and io.
To see the pins and functions of any hal component, either use "man name" at the command line (eg, "man carousel")
Or, more legibly and less geekily, look in the web docs:
linuxcnc.org/docs/stable/html/
The realtime and userspace components are all listed at the bottom.
There are many of them, and it's possibly worth a _very_ superficial skim through them to get a feel for what they do.
Most are very simple. motion is very complicated (it's the entire motion controller).
The main ones to look at for everyday reference are motion, halui and io.
Please Log in to join the conversation.
- smc.collins
- Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 721
- Thank you received: 0
3 years 11 months ago #255963
by smc.collins
Replied by smc.collins on topic Small victory in the war against the Cincinnati cinturn 12u
Please Log in to join the conversation.
3 years 11 months ago #255967
by piflixe
Replied by piflixe on topic Small victory in the war against the Cincinnati cinturn 12u
We are in the process of retrofitting a Morbidelli U13 woodworking machine with a 7i97. Basic config is already working, all axes moving correctly. So if it helps I can share our config or give you some hints on how to set it up. Still new to Mesa cards and LinuxCNC but I am happy to give back some of the advice I received from the forum.
Please Log in to join the conversation.
- smc.collins
- Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 721
- Thank you received: 0
3 years 11 months ago #255977
by smc.collins
Replied by smc.collins on topic Small victory in the war against the Cincinnati cinturn 12u
Please Log in to join the conversation.
- smc.collins
- Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 721
- Thank you received: 0
3 years 11 months ago #256094
by smc.collins
Replied by smc.collins on topic Small victory in the war against the Cincinnati cinturn 12u
Please Log in to join the conversation.
- smc.collins
- Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 721
- Thank you received: 0
3 years 11 months ago #256106
by smc.collins
Replied by smc.collins on topic Small victory in the war against the Cincinnati cinturn 12u
is there a limit to the number of serial io cards you can use ?? or should i use something else ??? i have 2 control panels I'd like to bring back toniseable condition and a USB xhc wireless pendant.
Please Log in to join the conversation.
- smc.collins
- Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 721
- Thank you received: 0
3 years 11 months ago #256111
by smc.collins
Replied by smc.collins on topic Small victory in the war against the Cincinnati cinturn 12u
first pass at turret config
Please Log in to join the conversation.
Time to create page: 0.572 seconds
