Minn. Stat. § 611.42
Subd. 1. Competency to stand trial.
A defendant is incompetent and shall not plead, be tried, or be sentenced if, due to a mental illness or cognitive impairment, the defendant lacks the ability to:
Subd. 2. Waiver of counsel in competency proceedings.
(a) A defendant must not be allowed to waive counsel if the defendant lacks ability to:
Subd. 3. Competency motion.
Subd. 4. Dismissal, referrals for services, and collaboration.