How would you design a real time application for cnc control in c / c++ ???

More
14 Apr 2022 08:33 - 14 Apr 2022 08:45 #240213 by TheRoslyak
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. 
Attachments:
Last edit: 14 Apr 2022 08:45 by TheRoslyak.

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

More
21 Apr 2022 13:24 - 21 Apr 2022 15:52 #240797 by TheRoslyak
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?
Attachments:
Last edit: 21 Apr 2022 15:52 by TheRoslyak.

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

More
27 Apr 2022 10:02 - 27 Apr 2022 10:06 #241368 by TheRoslyak
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 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
I understand that everything you need is in the Hal-core by Grotus files.But I can't figure it out without him.
Last edit: 27 Apr 2022 10:06 by TheRoslyak.

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

More
28 Apr 2022 22:58 #241581 by andypugh
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.

More
29 Apr 2022 08:06 - 29 Apr 2022 11:19 #241615 by TheRoslyak
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
Attachments:
Last edit: 29 Apr 2022 11:19 by TheRoslyak.

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

More
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.
 
Attachments:

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

More
02 May 2022 20:00 #241873 by andypugh
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.

More
02 May 2022 20:00 #241874 by andypugh

I think to move a SCARA in straight lines you need kinematics. And to run kinematics I think you need the LinuxCNC motion module...

(Or to write your own to suit the system you have) 

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

More
03 May 2022 05:56 #241896 by TheRoslyak
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.
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
addf motion-command-handler servo-thread
addf motion-controller servo-thread
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.)+

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

More
04 May 2022 11:31 #241974 by TheRoslyak
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.*
Attachments:

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

Time to create page: 0.102 seconds
Powered by Kunena Forum