⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 code_notes.lyx

📁 CNC 的开放码,EMC2 V2.2.8版
💻 LYX
📖 第 1 页 / 共 4 页
字号:
 Otherwise the machine is placed in teleop mode. The kinematics code is activated, interpolators are drained and flushed, and the Cartesian velocity commands are set to zero.\layout SubsectionCOORD\layout StandardThe COORD command places the machine in coordinated mode. In coord mode, movement of the machine is based on Cartesian coordinates using kinematics, rather than on individual joints as in free mode. In addition, the main trajectory planner is used to generate motion, based on queued LINE, CIRCLE, and/or PROBE commands. Coord mode is the mode that is used when executing a G-code program. \layout SubsubsectionRequirements\layout StandardThe command handler will reject the COORD command with an error message if the kinematics cannot be activated because the one or more axes have not been homed. In addition, if any joint is in motion (GET_MOTION_INPOS_FLAG() == FALSE), then the command will be ignored (with no error message). This behaviour is controlled by code that is now located in the function \begin_inset Quotes eld\end_inset set_operating_mode()\begin_inset Quotes erd\end_inset  in control.c. I believe the command should not be silently ignored, instead the command handler should determine whether it can be executed and return an error if it cannot.\layout SubsubsectionResults\layout StandardIf the machine is already in coord mode, nothing. Otherwise, the machine is placed in coord mode. The kinematics code is activated, interpolators are drained and flushed, and the trajectory planner queues are empty. The trajectory planner is active and awaiting a LINE, CIRCLE, or PROBE command.\layout SubsectionENABLE\layout StandardThe ENABLE command enables the motion controller.\layout SubsubsectionRequirements\layout StandardNone. The command can be issued at any time, and will always be accepted.\layout SubsubsectionResults\layout StandardIf the controller is already enabled, nothing. If not, the controller is enabled. Queues and interpolators are flushed. Any movement or homing operations are terminated. The amp-enable outputs associated with active joints are turned on. If forward kinematics are not available, the machine is switched to free mode.\layout SubsectionDISABLE\layout StandardThe DISABLE command disables the motion controller.\layout SubsubsectionRequirements\layout StandardNone. The command can be issued at any time, and will always be accepted.\layout SubsubsectionResults\layout StandardIf the controller is already disabled, nothing. If not, the controller is disabled. Queues and interpolators are flushed. Any movement or homing operations are terminated. The amp-enable outputs associated with active joints are turned off. If forward kinematics are not available, the machine is switched to free mode.\layout SubsectionENABLE_AMPLIFIER\layout StandardThe ENABLE_AMPLIFIER command turns on the amp enable output for a single output amplifier, without changing anything else. Can be used to enable a spindle speed controller.\layout SubsubsectionRequirements\layout StandardNone. The command can be issued at any time, and will always be accepted.\layout SubsubsectionResults\layout StandardCurrently, nothing. (A call to the old extAmpEnable function is currently commented out.) Eventually it will set the amp enable HAL pin true.\layout SubsectionDISABLE_AMPLIFIER\layout StandardThe DISABLE_AMPLIFIER command turns off the amp enable output for a single amplifier, without changing anything else. Again, useful for spindle speed controllers.\layout SubsubsectionRequirements\layout StandardNone. The command can be issued at any time, and will always be accepted.\layout SubsubsectionResults\layout StandardCurrently, nothing. (A call to the old extAmpEnable function is currently commented out.) Eventually it will set the amp enable HAL pin false.\layout SubsectionACTIVATE_JOINT\layout StandardThe ACTIVATE_JOINT command turns on all the calculations associated with a single joint, but does not change the joint's amp enable output pin.\layout SubsubsectionRequirements\layout StandardNone. The command can be issued at any time, and will always be accepted.\layout SubsubsectionResults\layout StandardCalculations for the specified joint are enabled. The amp enable pin is not changed, however, any subsequent ENABLE or DISABLE commands will modify the joint's amp enable pin.\layout SubsectionDEACTIVATE_JOINT\layout StandardThe DEACTIVATE_JOINT command turns off all the calculations associated with a single joint, but does not change the joint's amp enable output pin.\layout SubsubsectionRequirements\layout StandardNone. The command can be issued at any time, and will always be accepted.\layout SubsubsectionResults\layout StandardCalculations for the specified joint are enabled. The amp enable pin is not changed, and subsequent ENABLE or DISABLE commands will not modify the joint's amp enable pin.\layout SubsectionENABLE_WATCHDOG\layout StandardThe ENABLE_WATCHDOG command enables a hardware based watchdog (if present).\layout SubsubsectionRequirements\layout StandardNone. The command can be issued at any time, and will always be accepted.\layout SubsubsectionResults\layout StandardCurrently nothing. The old watchdog was a strange thing that used a specific sound card. A new watchdog interface may be designed in the future.\layout SubsectionDISABLE_WATCHDOG\layout StandardThe DISABLE_WATCHDOG command disables a hardware based watchdog (if present).\layout SubsubsectionRequirements\layout StandardNone. The command can be issued at any time, and will always be accepted.\layout SubsubsectionResults\layout StandardCurrently nothing. The old watchdog was a strange thing that used a specific sound card. A new watchdog interface may be designed in the future.\layout SubsectionPAUSE\layout StandardThe PAUSE command stops the trajectory planner. It has no effect in free or teleop mode. At this point I don't know if it pauses all motion immediately, or if it completes the current move and then pauses before pulling another move from the queue.\layout SubsubsectionRequirements\layout StandardNone. The command can be issued at any time, and will always be accepted.\layout SubsubsectionResults\layout StandardThe trajectory planner pauses.\layout SubsectionRESUME\layout StandardThe RESUME command restarts the trajectory planner if it is paused. It has no effect in free or teleop mode, or if the planner is not paused. \layout SubsubsectionRequirements\layout StandardNone. The command can be issued at any time, and will always be accepted.\layout SubsubsectionResults\layout StandardThe trajectory planner resumes.\layout SubsectionSTEP\layout StandardThe STEP command restarts the trajectory planner if it is paused, and tells the planner to stop again when it reaches a specific point. It has no effect in free or teleop mode. At this point I don't know exactly how this works. I'll add more documentation here when I dig deeper into the trajectory planner.\layout SubsubsectionRequirements\layout StandardNone. The command can be issued at any time, and will always be accepted.\layout SubsubsectionResults\layout StandardThe trajectory planner resumes, and later pauses when it reaches a specific point.\layout SubsectionOPEN_LOG, START_LOG, STOP_LOG, CLOSE_LOG\layout StandardThese commands are used to control the logging feature of the motion controller. Logging will probably be changed in the near future, so I'm not attempting to document these commands in detail right now. Parts of the logging feature may be replaced by halscope and other tools, other parts will be retained. \layout SubsubsectionRequirements\layout StandardTo be documented later.\layout SubsubsectionResults\layout StandardTo be documented later.\layout SubsectionSCALE\layout StandardThe SCALE command scales all velocity limits and commands by a specified amount. It is used to implement feed rate override and other similar functions. The scaling works in free, teleop, and coord modes, and affects everything, including homing velocities, etc. However, individual joint velocity limits are unaffected.\layout SubsubsectionRequirements\layout StandardNone. The command can be issued at any time, and will always be accepted.\layout SubsubsectionResults\layout StandardAll velocity commands are scaled by the specified constant.\layout SubsectionOVERRIDE_LIMITS\layout StandardThe OVERRIDE_LIMITS command prevents limits from tripping until the end of the next JOG command. It is normally used to allow a machine to be jogged off of a limit switch after tripping. (The command can actually be used to override limits, or to cancel a previous override.)\layout SubsubsectionRequirements\layout StandardNone. The command can be issued at any time, and will always be accepted. (I think it should only work in free mode.)\layout SubsubsectionResults\layout StandardLimits on all joints are over-ridden until the end of the next JOG command. (This is currently broken... once an OVERRIDE_LIMITS command is received, limits are ignored until another OVERRIDE_LIMITS command re-enables them.)\layout SubsectionHOME\layout StandardThe HOME command initiates a homing sequence on a specified joint. The actual homing sequence is determined by a number of configuration parameters, and can range from simply setting the current position to zero, to a multi-stage search for a home switch and index pulse, followed by a move to an arbitrary home location. For more information about the homing sequence, see section \begin_inset LatexCommand \ref{sec:Homing}\end_inset  of this document.\layout SubsubsectionRequirements\layout StandardThe command will be ignored silently unless the machine is in free mode.\layout SubsubsectionResults\layout StandardAny jog or other joint motion is aborted, and the homing sequence starts.\layout SubsectionJOG_CONT\layout StandardThe JOG_CONT command initiates a continuous jog on a single joint. A continuous jog is generated by setting the free mode trajectory planner's target position to a point beyond the end of the joint's range of travel. This ensures that the planner will move constantly until it is stopped by either the joint limits or an ABORT command. Normally, a GUI sends a JOG_CONT command when the user presses a jog button, and ABORT when the button is released.\layout SubsubsectionRequirements\layout StandardThe command handler will reject the JOG_CONT command with an error message if machine is not in free mode, or if any joint is in motion (GET_MOTION_INPOS_FLAG() == FALSE), or if motion is not enabled. It will also silently ignore the command if the joint is already at or beyond it's limit and the commanded jog would make it worse. \layout SubsubsectionResults\layout StandardThe free mode trajectory planner for the joint identified by emcmotCommand->axis is activated, with a target position beyond the end of joint travel, and a velocity limit of emcmotCommand->vel. This starts the joint moving, and the move will continue until stopped by an ABORT command or by hitting a limit. The free mode planner accelerates at the joint accel limit at the beginning of the move, and will decelerate at the joint accel limit when it stops.\layout SubsectionJOG_INCR\layout StandardThe JOG_INCR command initiates an incremental jog on a single joint. Incremental jogs are cumulative, in other words, issuing two JOG_INCR commands that each ask for 0.100 inches of movement will result in 0.200 inches of travel, even if the second command is issued before the first one finishes. Normally incremental jogs stop when they have travelled the desired distance, however they also stop when they hit a limit, or on an ABORT command.\layout SubsubsectionRequirements\layout StandardThe command handler will silently reject the JOG_INCR command if machine is not in free mode, or if any joint is in motion (GET_MOTION_INPOS_FLAG() == FALSE), or if motion is not enabled. It will also silently ignore the command if the joint is already at or beyond it's limit and the commanded jog would make it worse. \layout SubsubsectionResults\layout Standard

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -