There is a contrivance in writing that is often used when a problem is just too difficult to solve by standard means. This
This is when he creates a Deus Ex Machina or God in machine. It's a machine that simply solves the problem without any explanation. This is rampant in science fiction as many problems are outside the realm of natural science. For example, Heisenberg's Uncertainty Principle states that its impossible to to the position and speed of a particle because any method used to measure it will cause a change.
In Star Trek, they need to know both for a transporter to work, so they created the Heisenberg compensator. When writing a science fiction story, don't let the ease of simply creating a machine take away from story development. Deus Ex Machina should only be done as a last resort. Take the time to do research and see if there is a way you can use actual science to solve the problem. The best science fiction is the one that is based in science fact.