Miguel
Clearly you are having all sorts of problems and getting some unusual outcomes. These problems are usually due to overflow issues and I would need to look carefully through the code however, I don't have the time at the moment.
I would suggest that you try code that is tried and tested. At this time I think you need something that is basic and the Sketch I use has been implemented on a number of rotary tables and it has worked out every time. Note, it is setup for a 90:1 rotary table. If yours is something different then a small change is required. If you can send me a personal message with your email address and rotary table ratio, I will send you the Sketch.
Regards
Bruce W-S
Clearly you are having all sorts of problems and getting some unusual outcomes. These problems are usually due to overflow issues and I would need to look carefully through the code however, I don't have the time at the moment.
I would suggest that you try code that is tried and tested. At this time I think you need something that is basic and the Sketch I use has been implemented on a number of rotary tables and it has worked out every time. Note, it is setup for a 90:1 rotary table. If yours is something different then a small change is required. If you can send me a personal message with your email address and rotary table ratio, I will send you the Sketch.
Regards
Bruce W-S