On Thu, 14 Jan 2021 at 09:56, Andreas Linnarsson <andreas.linnars...@gmail.com> wrote:
> I finally had the possibility to test your code and unfortunately it didn't > do it. It behaves in the same way as before. I am still not 100% clear on how it behaves at all. > Before testing the code I > thought that the "p -= 1;" at the end of the tool change would make it > report back the wrong (-1) tool position. It should. Doesn't it? > But it will report back the > correct position although it hasn't reached the correct pocket. When I > coded my little fix my assumption was that the deducation has to take place > during the start of the move instead of during the reverse latching, > thereby forcing the turret to go one step further. The logic of my fix is meant to be: The system is unhomed. state-0 The component is enabled, it starts to home. State 0 -> 10 -> 11 The pulse and home are seen, current-position = 1, state -> 0 Motor commands off, turret backs onto latch. Drops off of pulse, new logic is true. current-position = 0 (Not usually valid, but OK) Movement command comes in, the turret starts to move, sees the pulse, current-position = 1. If the requested tool is 1, it stops and latches again. If it is more than 1, then it should move the right number of steps. Note: As it stands jogging won't work as current_position is one less than the actual position. Did you check M6 Tnn commands, or only jogging? -- atp "A motorcycle is a bicycle with a pandemonium attachment and is designed for the especial use of mechanical geniuses, daredevils and lunatics." — George Fitch, Atlanta Constitution Newspaper, 1912 _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users