- LinuxCNC
- General LinuxCNC Questions
- How would you design a real time application for cnc control in c / c++ ???
How would you design a real time application for cnc control in c / c++ ???
15 Mar 2022 15:15 #237337
by udoS
Replied by udoS on topic How would you design a real time application for cnc control in c / c++ ???
@Grotius
Is there a trigger in lcnc that can be used as an event . Like position of any joint changed or something like that.
Or how can that be done.
I don't want to loop the status, just trigger an event. ??
Is there a trigger in lcnc that can be used as an event . Like position of any joint changed or something like that.
Or how can that be done.
I don't want to loop the status, just trigger an event. ??
Please Log in or Create an account to join the conversation.
30 Mar 2022 14:53 #238739
by udoS
Replied by udoS on topic How would you design a real time application for cnc control in c / c++ ???
@ Grotius
Could you supply a very basic example of a component and how to compile it without halcompile. KIS.
Most interesting how to compile.
udoS
Could you supply a very basic example of a component and how to compile it without halcompile. KIS.
Most interesting how to compile.
udoS
Please Log in or Create an account to join the conversation.
30 Mar 2022 17:34 #238761
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
Hi Udo,
Could you supply a very basic example of a component and how to compile it without halcompile. KIS.
Most interesting how to compile.
The best example for this :
github.com/grotius-cnc/hal-core/tree/mai.../hal/components/test
Where the "make" (script) file shows the gcc compile steps.
Is there a trigger in lcnc that can be used as an event . Like position of any joint changed or something like that.
Or how can that be done.
I don't want to loop the status, just trigger an event. ??
I think events are used by programs like qt. A event triggers something without the need of a endless loop or thread.
In the background qt has it's own thread. I suspect at low level, the event is triggered by that qt thread, but i don't know for sure.
If a status channel would have a qt OBJECT in the header (or at least is qt object compatible), i think it's possible to create a event in the way signals and slots
are used, but i don't know this for sure.
I suggest the status server has is own thread, so polling the status channel at a fixed time or flag makes sense.
I don't have a good advice what will be the best solution in this case. Speaking for myself, i would just poll the status channel.
Could you supply a very basic example of a component and how to compile it without halcompile. KIS.
Most interesting how to compile.
The best example for this :
github.com/grotius-cnc/hal-core/tree/mai.../hal/components/test
Where the "make" (script) file shows the gcc compile steps.
Is there a trigger in lcnc that can be used as an event . Like position of any joint changed or something like that.
Or how can that be done.
I don't want to loop the status, just trigger an event. ??
I think events are used by programs like qt. A event triggers something without the need of a endless loop or thread.
In the background qt has it's own thread. I suspect at low level, the event is triggered by that qt thread, but i don't know for sure.
If a status channel would have a qt OBJECT in the header (or at least is qt object compatible), i think it's possible to create a event in the way signals and slots
are used, but i don't know this for sure.
I suggest the status server has is own thread, so polling the status channel at a fixed time or flag makes sense.
I don't have a good advice what will be the best solution in this case. Speaking for myself, i would just poll the status channel.
Please Log in or Create an account to join the conversation.
30 Mar 2022 17:59 #238768
by Reinhard
Replied by Reinhard on topic How would you design a real time application for cnc control in c / c++ ???
Hi,
> I suggest the status server has is own thread, so polling the status channel at a fixed time or flag makes sense.
> I don't have a good advice what will be the best solution in this case. Speaking for myself, i would just poll the status channel.
if you look at my FalconView project you'll see, that the whole application is event based. Including all values from linuxcnc status. But ...
... there's no trigger from linuxcnc that fires signals or the like.
You have to do it on your own, which in the end means, that you have to poll status channel.
In my case - I use ValueModels to convert polling into signals/events. Statuschannel is read at fix interval and Status reader writes all values into appropriate ValueModels - on every timer call.
Its the ValueModel, that compares the values from StatusReader against the value it holds and when the value changes, than it fires an event/signal.
Thus the whole application can rely on events and status polling is isolated to a single source
> I suggest the status server has is own thread, so polling the status channel at a fixed time or flag makes sense.
> I don't have a good advice what will be the best solution in this case. Speaking for myself, i would just poll the status channel.
if you look at my FalconView project you'll see, that the whole application is event based. Including all values from linuxcnc status. But ...
... there's no trigger from linuxcnc that fires signals or the like.
You have to do it on your own, which in the end means, that you have to poll status channel.
In my case - I use ValueModels to convert polling into signals/events. Statuschannel is read at fix interval and Status reader writes all values into appropriate ValueModels - on every timer call.
Its the ValueModel, that compares the values from StatusReader against the value it holds and when the value changes, than it fires an event/signal.
Thus the whole application can rely on events and status polling is isolated to a single source
The following user(s) said Thank You: Grotius
Please Log in or Create an account to join the conversation.
31 Mar 2022 06:52 #238874
by udoS
Replied by udoS on topic How would you design a real time application for cnc control in c / c++ ???
Thank's to the both of you.
That's what I'm doing right now. Timer and then signals and slots. Then model to view.
@Reinhard: I'm going to have a closer look at your project. Again .
@Grotius: I'lll give it a try and see where I end up.
Thank' again.
That's what I'm doing right now. Timer and then signals and slots. Then model to view.
@Reinhard: I'm going to have a closer look at your project. Again .
@Grotius: I'lll give it a try and see where I end up.
Thank' again.
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
12 Apr 2022 12:45 - 12 Apr 2022 12:47 #240042
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
Hi Grotius
I'm back and want to continue development with my real time application.
In a global sense, I want to make a "conveyor tracking" function like Beckhoff (Twincat) or Codesys did for example.
Now I settled on the fact that I managed to control the 3d model to hal variables using the scrollbar and textbox
I want to control this model without G-code and scrollbar. Only code in application like function Pick-and-Place (Twincat).
For starting Can you give simple example to do motion for 3 point (for example)?
I'm back and want to continue development with my real time application.
In a global sense, I want to make a "conveyor tracking" function like Beckhoff (Twincat) or Codesys did for example.
Now I settled on the fact that I managed to control the 3d model to hal variables using the scrollbar and textbox
I want to control this model without G-code and scrollbar. Only code in application like function Pick-and-Place (Twincat).
For starting Can you give simple example to do motion for 3 point (for example)?
Last edit: 12 Apr 2022 12:47 by TheRoslyak.
The following user(s) said Thank You: thefabricator03
Please Log in or Create an account to join the conversation.
12 Apr 2022 22:25 #240090
by bkt
Replied by bkt on topic How would you design a real time application for cnc control in c / c++ ???
eoffset component can not work for you? as conveyor traking is perfect ..... or maybe we can insert some sort of distance-limit-disable for prevent traking in to non desired position ....
but some big have special kins for that pourpose .... not om...om .... for example ....
bkt
but some big have special kins for that pourpose .... not om...om .... for example ....
bkt
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
13 Apr 2022 08:28 #240120
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
Ok. This is very similar to what I need.
Do you have any example how to write hal-file with this this component.
In fact, I need to create such a configuration as in this video
- Velocity of conveyor need to set const or counter of external encoder.
- Lim of "sync zone" will be a circle equation or a simple line.
- How I control robot? Use g-code or any else (like pick-and-place).
- How I can switch coordinate systems.
For example : g53 - this starting coordinate system
g54 - This coordinate system of conveyor (which changes over time)
Do you have any example how to write hal-file with this this component.
In fact, I need to create such a configuration as in this video
- Velocity of conveyor need to set const or counter of external encoder.
- Lim of "sync zone" will be a circle equation or a simple line.
- How I control robot? Use g-code or any else (like pick-and-place).
- How I can switch coordinate systems.
For example : g53 - this starting coordinate system
g54 - This coordinate system of conveyor (which changes over time)
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
13 Apr 2022 09:06 - 13 Apr 2022 13:12 #240121
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
I looked at the examples in external_offsets, but I don’t understand yet which one is more suitable
I try default example of "eoffset" and get some offset. Then I create my configuration and get nothing
I try default example of "eoffset" and get some offset. Then I create my configuration and get nothing
Last edit: 13 Apr 2022 13:12 by TheRoslyak.
Please Log in or Create an account to join the conversation.
14 Apr 2022 00:28 #240198
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
Hi Roslyak,
Nice you are back.
> For starting Can you give simple example to do motion for 3 point (for example)?
github.com/grotius-cnc/skynet_robot_control_rtos_ethercat
github.com/grotius-cnc/hal-core
In the meantime i coded some components for hal-core.
Like this example : github.com/grotius-cnc/hal-core/tree/mai.../hal/components/test
There are some motion components inside hal-core : github.com/grotius-cnc/hal-core/tree/mai.../hal/components/dofs
In general you can use Lcnc or Hal-core. Hal-core is more hard coded c & c++ and uses a Opencascade 3d graphics displayer.
It looks you got a lot of coding to do. A medium size project.
I am busy with coding some stuff i like to do.
Once in a while i can help you with specific things if you get stuck.
My advise so far would be, get the kinematic model working in opencascade as your picture show's.
Then use a component like "dofs" to control motor operations in hal. Try to get this running first.
I think you have to send motion commands in xyz positions instead of joint values.
Don't worry about Gcode, offset's or moving conveyors. This is no issue to integrate later on.
And maybe keep it closed source for now.
Nice you are back.
> For starting Can you give simple example to do motion for 3 point (for example)?
github.com/grotius-cnc/skynet_robot_control_rtos_ethercat
github.com/grotius-cnc/hal-core
In the meantime i coded some components for hal-core.
Like this example : github.com/grotius-cnc/hal-core/tree/mai.../hal/components/test
There are some motion components inside hal-core : github.com/grotius-cnc/hal-core/tree/mai.../hal/components/dofs
In general you can use Lcnc or Hal-core. Hal-core is more hard coded c & c++ and uses a Opencascade 3d graphics displayer.
It looks you got a lot of coding to do. A medium size project.
I am busy with coding some stuff i like to do.
Once in a while i can help you with specific things if you get stuck.
My advise so far would be, get the kinematic model working in opencascade as your picture show's.
Then use a component like "dofs" to control motor operations in hal. Try to get this running first.
I think you have to send motion commands in xyz positions instead of joint values.
Don't worry about Gcode, offset's or moving conveyors. This is no issue to integrate later on.
And maybe keep it closed source for now.
Please Log in or Create an account to join the conversation.
- LinuxCNC
- General LinuxCNC Questions
- How would you design a real time application for cnc control in c / c++ ???
Time to create page: 0.109 seconds