what is granding machinin workning principal