THIS IS NOT A BID
I have done development work on SCARA robots in the past (late 90s).
The task you are doing is way harder than you think and you will need lots of support and help.
There is a book on Robot Kinematics whihc has all of the equations in it. I have a copy somewhere - it has a blue cover. It has all of the kinematic matrices in it, including SCARA.
What you will need to do most of all in your controller is have a very regular program cycle. In practical terms kinematics needs around a 1 millsecond cycle or the lags in the PID loops start to effect the outcome. Its needs to be extremely consistent or again the PID loops get effected. This why companies like Fanuc, Kuka, Adept, etc often use a dedicated math processor to handle the kinematics.
Good luck.