-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issues about emcmotSetCycleTime() #3268
Comments
What you say makes sense, but it seems unlikely that LinuxCNC would have worked at all for so long if this was wrong in a way that mattered. So maybe it all works out as it should? Or maybe there really is something wrong, but nobody has ever noticed. I am travelling all this weekend so can't look much deeper than this, but if you have time to look through what actually happens in detail then that would be useful. |
Looking at the github "blame" view there may be some clues as to why and when this code was introduced. |
Hello, I apologize for disturbing you on the weekend, but I am really eager to clarify this issue, to the point where it has been troubling me to the extent that I am unable to sleep.
Then, I run linuxcnc/configs/sim/axis/pentapod/pentapod.ini,PERIOD setting is:
Below is the information printed when starting LinuxCNC:
What might be wrong? Although I set TRAJ_PERIOD to be ten times SERVO_PERIOD, the interpolationRate for cubic is still 1. I believe the correct result should be 10. |
pentakins uses core_sim.hal (via basic_sim.tcl) and that does not set traj_period from the INI. See also http://linuxcnc.org/docs/stable/html/config/core-components.html#sec:motion |
Hello, I used a new ini file and loaded TRAJ_PERIOD in the hal file.
I have two points of confusion:
|
Is it possible that the traj period isn't even used? emcmot runs in the servo thread. I think that to run traj at a slower rate the system would have to simply skip that code on a certain proportion of invocations. (as there isn't a slower thread for traj to be run in). Is that what actually happens? |
Hello, I recently went through the code of the Trajectory Planner module in linuxcnc and studied the relationships between several cycles, including servoCycleTime, trajCycleTime, and cubic.segmentTime. In lines 1327 to 1387 of the control.c file, we can find some clues. linuxcnc/src/emc/motion/control.c Line 1327 in 8afe712
I think that the role of the TP (Trajectory Planner) is to calculate trajectory points (carte_pos_cmd) in the Cartesian coordinate system under the trajectory planning cycle (trajCycleTime), then convert carte_pos_cmd into joint positions (joint->coarse_pos) through inverse kinematics. To reduce motor vibrations during operation, cubic polynomials (cubic.c) are used for fine interpolation in the joint space, resulting in control commands for each servo cycle (joint->pos_cmd). Therefore, I think the following equations hold: trajCycleTime = cubic.segmentTime; |
I have been intending to look into this, but haven't found the time. |
I am a student learning motion control,There are some parts that I believe have issues.
function in motion.c:
The trajectory planning cycle should be an integer multiple of the servo cycle. The trajectory cycle is used for coarse interpolation, while the servo cycle uses cubic spline curves for fine interpolation.
The correct function logic, in my opinion, is:
The text was updated successfully, but these errors were encountered: