# MrProzaki.

• MrProzaki. commented on tomasdecamino's instructable Simple Arduino XY Plotter1 year ago

Hello again ... got back after some learning , but i still cant get it to work , am having problems with aligning the arms of the servo . I tried working with proccessing in order to help me but am not making anything to work , ok so ill provide a picture and where i align with proccessing : the first image shows the paper in which am tryn to draw . What should i change in the code ? Or if its not the code i should change then what should i change ? am so confused ... and when i thought i was done ... thank you for your time .

• MrProzaki. commented on tomasdecamino's instructable Simple Arduino XY Plotter1 year ago

I hope you are still watching this post :). Ok first of all , great project awsome work . Ive been looking for something like this and finaly i found it so thanks .My question now : I see you code but i cant understand how you get to use angle from first servo and the angle of second servo and by that you calculate (x,y).Can you please show me how you did it based on your code ? Green angle is servo 1 angle , while red is servo 2 angle . so we need based on those 2 angles to calculate brown angle as showed in your picture.My trigonometry is bad , so please when you have time answer my questions . Thanks in advance .

Thanks a lot for your fast reply i still fail to get it xD . Am a student atm at greece Automation Engineer and i still am dumb enough to understand trigonometry . So lets go one more time please :L1 is the armlength of the base servo as you can see in the picture ,L2 is the second servo armlength , so they are kinda different .While φ1 is the angle of the base servo , and φ2 is the angle of the second servo.Is this equation right ?x= L1*cosφ1 + L2*cosφ2 .y=L1*sinφ1 + L2*sinφ2 .if that equation is right am gona need some help to translate it into code , am sorry to put you through this .Although your code seems advanced for my eyes it seems more awsome .. lets give it another try . first you define this int posX = 90, posY = 90; then you say armTo(posX, posY); ...

see more »