does anyone can help me with my Z sensor - Where the wire is attached (I do not want to track it manually) Or maybe anyone has a wiring diagram for this machine? I appreciate your help

My limit switches they never worked since I purchased this machine. Maybe they need to be setup correctly. Where they are connected and what is controlling them?

I wish overseas manufacturer should provide service manual and troubleshooting guide for its customers.