[Home]History of ClassicLadderExamples

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Revision 98 . . October 26, 2017 8:51 pm by KimK [Add nowiki tags to LinuxCNC mentions.]
Revision 97 . . July 7, 2012 7:42 pm by Archivist [fix bad links emcinfo.pl->wiki.pl]
  

Difference (from prior major revision) (no other diffs)

Changed: 8c8
Contact me Chris Morley c/o the EMC users maillist-I'll try to help

Contact me Chris Morley c/o the LinuxCNC users maillist-I'll try to help


Changed: 17c17
|| This is a program for a tool turret.
The turret has a home switch at tool position 1 and another another switch to tell you when the turret is in a lockable position. To keep track of the actual tool number one must count how many positions past home you are. We will use Classicladder's counter block '$CO'.The counter is preset to 1 when RESET is true. The counter is increased by one on the rising edge of INDEX. We then 'COMPARE' the counter value (%C0.V) to the tool we want (in the example only checks for tool 1 and 2 are shown). We also 'OPERATE' the counter value to a word variable (%W0) that (you can assume) is mapped on to a S32 out HAL pin so you can let some other HAL component know what the current tool number is. In the real world another S32 (in) pin would be used to get the requested tool number from EMC.You would have to load Classicladder's realtime module specifying that you want S32 in and out pins. See 'loading options' above.||upload:counter_sample.png ||
|| This is a program for a tool turret.
The turret has a home switch at tool position 1 and another another switch to tell you when the turret is in a lockable position. To keep track of the actual tool number one must count how many positions past home you are. We will use Classicladder's counter block '$CO'.The counter is preset to 1 when RESET is true. The counter is increased by one on the rising edge of INDEX. We then 'COMPARE' the counter value (%C0.V) to the tool we want (in the example only checks for tool 1 and 2 are shown). We also 'OPERATE' the counter value to a word variable (%W0) that (you can assume) is mapped on to a S32 out HAL pin so you can let some other HAL component know what the current tool number is. In the real world another S32 (in) pin would be used to get the requested tool number from LinuxCNC.You would have to load Classicladder's realtime module specifying that you want S32 in and out pins. See 'loading options' above.||upload:counter_sample.png ||

Changed: 156c156
These last two rungs work together. The job of the seventh rung is to either terminate the tool change (if homed) or terminate the test move (if homing). First check that stepgen has been sent a command (B0 set), then that the tool is in position (I2 set), and IF homed (B1 set) then tell EMC that the tool chang is done (Q0) and also reset the flag that indecates tool change is still in progress (B2). Note that if the first two checks pass (B0 and I2), then B0 is reset deactivating this whole rung. This brings us to B3, which involves the last rung.
These last two rungs work together. The job of the seventh rung is to either terminate the tool change (if homed) or terminate the test move (if homing). First check that stepgen has been sent a command (B0 set), then that the tool is in position (I2 set), and IF homed (B1 set) then tell EMC that the tool change is done (Q0) and also reset the flag that indicates tool change is still in progress (B2). Note that if the first two checks pass (B0 and I2), then B0 is reset deactivating this whole rung. This brings us to B3, which involves the last rung.

Changed: 160c160
The job of the eigth and final rung is to lock the turret at each tool position tried while homing. This rung only comes into play when homing, after that it is not used again. So, if stepgen has finished (B0 reset), and if NOT homed (B1 reset), then trip a timer that brings B3 TRUE long enough for the turret to lock. B3 is then used in several rungs to put a hold on things while the index mark is checked. Going back up the rungs, in rung seven B3 is used to disable stepgen by dropping out Q3 (stepgen.2.enable), in rung six it disables the whole rung, in rung one it deactivates the drive amp and locks the turret.
The job of the eighth and final rung is to lock the turret at each tool position tried while homing. This rung only comes into play when homing, after that it is not used again. So, if stepgen has finished (B0 reset), and if NOT homed (B1 reset), then trip a timer that brings B3 TRUE long enough for the turret to lock. B3 is then used in several rungs to put a hold on things while the index mark is checked. Going back up the rungs, in rung seven B3 is used to disable stepgen by dropping out Q3 (stepgen.2.enable), in rung six it disables the whole rung, in rung one it deactivates the drive amp and locks the turret.

Changed: 176c176
If you are using Linuxcnc 2.5 or better use the command G10 L20 P0 Z.250 P0 means use the current coordinate system

If you are using LinuxCNC 2.5 or better use the command G10 L20 P0 Z.250 P0 means use the current coordinate system


LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
Search:
Published under a Creative Commons License