If you are like me who is struggling with this problem since you upgraded to 10.10 then you are not alone.
The quick solution that I found after referring to several forums is that there is an issue with the power management (pm-utils) which checks for the state of the battery and the Ubuntu system would just freeze.
Solution, for now is to just install the pm-utils. Goto the Synaptic Package Manager, search for pm-utils and uninstall it. I have done the same and till now the freeze problem has not occurred while I am writing this post. At other times, the system use to freeze within 30 seconds when on battery.
The forums to follow on this one are