- 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++ ???
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
14 Apr 2022 08:33 - 14 Apr 2022 08:45 #240213
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
Ok. I started to understand something
In the previous example, I forgot to set the parameter OFFSET_AV_RATIO
Now I need to understand how this function can be used to implement conveyor tracking. How to connect hal component? use g-code or not? switch on/off conveyor coordinate system? and etc
On video I try to imitate working of conveyor tracking when object is on sych zone.
In the previous example, I forgot to set the parameter OFFSET_AV_RATIO
Now I need to understand how this function can be used to implement conveyor tracking. How to connect hal component? use g-code or not? switch on/off conveyor coordinate system? and etc
On video I try to imitate working of conveyor tracking when object is on sych zone.
Last edit: 14 Apr 2022 08:45 by TheRoslyak.
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
21 Apr 2022 13:24 - 21 Apr 2022 15:52 #240797
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
Hi Grotius
First of all I want to make only one hal component of conveyor traking with eoffset, give up because there are too many "crutches"
I started watching your files and can't find "the_function" component (to understand the basics).
What hal configuration do you use in your project (ethercat.hal - is main?) What about streamer component?
I can't understand where is input pin (like joint.0.motor-pos-cmd) and output (like joint.0.motor-pos-fb) in your program?
First of all I want to make only one hal component of conveyor traking with eoffset, give up because there are too many "crutches"
I started watching your files and can't find "the_function" component (to understand the basics).
What hal configuration do you use in your project (ethercat.hal - is main?) What about streamer component?
I can't understand where is input pin (like joint.0.motor-pos-cmd) and output (like joint.0.motor-pos-fb) in your program?
Last edit: 21 Apr 2022 15:52 by TheRoslyak.
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
27 Apr 2022 10:02 - 27 Apr 2022 10:06 #241368
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
Anyone (besides Grotius)
Can tell me how to set a linear movement in a variable (like "joint-cmd") so that it would be shred by thread period.
The problem is that if I send the final position value without crushing by thread period - driver get error.
In linuxcnc this task do byI understand that everything you need is in the Hal-core by Grotus files.But I can't figure it out without him.
Can tell me how to set a linear movement in a variable (like "joint-cmd") so that it would be shred by thread period.
The problem is that if I send the final position value without crushing by thread period - driver get error.
In linuxcnc this task do by
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
addf motion-command-handler servo-thread
addf motion-controller servo-thread
Last edit: 27 Apr 2022 10:06 by TheRoslyak.
Please Log in or Create an account to join the conversation.
28 Apr 2022 22:58 #241581
by andypugh
Replied by andypugh on topic How would you design a real time application for cnc control in c / c++ ???
I don't 100% understand the question, but possibly the answer is limit3 or simple_tp
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
29 Apr 2022 08:06 - 29 Apr 2022 11:19 #241615
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
Ok. I mean that the signal that I receive from the application has a different frequency.
This is bad for the drive. The frequency must be equal to servo-thread. pic 1
Or I don't get need signal with good delta. pic 2
I don't understand which of these hypotheses is my case.But I understand that dofs componets (by Grotius) solves this problem + needed signal has s curve acceleration
UPD
Thank you very much. simple_tp - exactly maybe what is needed.
I correctly understood that dofs (by Grotius) differs from simple_tp in that it has s curve acceleration?isn't it
This is bad for the drive. The frequency must be equal to servo-thread. pic 1
Or I don't get need signal with good delta. pic 2
I don't understand which of these hypotheses is my case.But I understand that dofs componets (by Grotius) solves this problem + needed signal has s curve acceleration
UPD
Thank you very much. simple_tp - exactly maybe what is needed.
I correctly understood that dofs (by Grotius) differs from simple_tp in that it has s curve acceleration?isn't it
Last edit: 29 Apr 2022 11:19 by TheRoslyak.
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
29 Apr 2022 13:41 #241641
by TheRoslyak
So. This is the first "successful" run of Scara on a real driver without using Linuxcnc. Point to point. Now the problems are as follows:
When using the component simple_tp - velocity and acceleration don't change!
If I put small values than those that I currently have set in *.hal - The drive will give an error.
The video is hard to see - but scara moves in an arc - This is a good function because this way the motor consumes less energy than with linear motion.
But I need linear motion) But I don't know how to do it yet.
Perhaps "synchrodofs" (by Grotius) will help me. But I don't understand how to install a simple dofs.
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
So. This is the first "successful" run of Scara on a real driver without using Linuxcnc. Point to point. Now the problems are as follows:
When using the component simple_tp - velocity and acceleration don't change!
If I put small values than those that I currently have set in *.hal - The drive will give an error.
The video is hard to see - but scara moves in an arc - This is a good function because this way the motor consumes less energy than with linear motion.
But I need linear motion) But I don't know how to do it yet.
Perhaps "synchrodofs" (by Grotius) will help me. But I don't understand how to install a simple dofs.
Please Log in or Create an account to join the conversation.
02 May 2022 20:00 #241873
by andypugh
Replied by andypugh on topic How would you design a real time application for cnc control in c / c++ ???
I think to move a SCARA in straight lines you need kinematics. And to run kinematics I think you need the LinuxCNC motion module...
Please Log in or Create an account to join the conversation.
02 May 2022 20:00 #241874
by andypugh
Replied by andypugh on topic How would you design a real time application for cnc control in c / c++ ???
(Or to write your own to suit the system you have)I think to move a SCARA in straight lines you need kinematics. And to run kinematics I think you need the LinuxCNC motion module...
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
03 May 2022 05:56 #241896
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
I actually use scara kinematics and delta kinematics in general.
The video shows that I control the coordinates and not the angles.
The idea is to make an application like Twincat or Codesys.
In which you can use several independent processes at once on one compute.Motion module is very limited. First of all I can use only one robot with one kinematic. In put coordinates is possible only from g-code(Analog, joging incremental - doesn't count. because I can't use circular interpolation.)+
The video shows that I control the coordinates and not the angles.
The idea is to make an application like Twincat or Codesys.
In which you can use several independent processes at once on one compute.
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
addf motion-command-handler servo-thread
addf motion-controller servo-thread
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
04 May 2022 11:31 #241974
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
Anybody can install hal-core (Grotius). I to install his file and get error/
I copy libdofs.* file to usr/lib/linuxcnc/modules and get error with libhalcore.so.0
If I copy libhalcore.* file to usr/lib/ -get error with libdofs.*
I copy libdofs.* file to usr/lib/linuxcnc/modules and get error with libhalcore.so.0
If I copy libhalcore.* file to usr/lib/ -get error with libdofs.*
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.102 seconds