How to solve the bug that the ubuntu system totally freezed?

I use ubuntu 12.10.
Sometimes it freeze totally that means I can’t use keyboard and mouse.
I found that it seems be locked after I using binary driver.
I don’t want to reboot again and again, because I use it to build robot system.
I need a very stable system that can protect the safe of human.
How to know what happened?
Thank you very much~