‘PID versus state-space’ sounds like a choice between two controllers, but the categories are different. PID tells you how to compute a command from an error. State-space tells you how to describe a system's internal dynamics. You can even put a PID controller around a state-space plant model.
Representation, design method and I/O layout
A linear state-space model writes ẋ = Ax + Bu and y = Cx + Du. It works for one input and one output, and naturally organizes multiple inputs and outputs. A transfer-function matrix can also represent MIMO systems, so ‘state-space can do MIMO while transfer functions cannot’ is inaccurate. SISO/MIMO describe the number of inputs and outputs; they do not name the controller.
LQR uses a specified A/B model and chosen Q/R costs to calculate state feedback. It is not just ‘PID with more gains’. Its control law needs the states: measured directly or estimated by an observer. A state-space model may come from physical equations, linearization or identification from data; knowing every physical constant beforehand is not mandatory.
The cart-pole exposes the difference
Imagine controlling only pole angle. The pole can look upright while the cart continues toward a rail end. A useful state vector includes cart position, cart speed, pole angle and angular speed. You can design a cascade of simpler loops, or use full-state feedback to consider all four at once. Neither choice abolishes the rail or force limit.
Our cart-pole has one force input and several states. That makes it a useful state-feedback lesson, not a working MIMO actuator example. The LQR gain is computed from a linearization near upright, then tested on the nonlinear simulation. If the initial angle grows large or the actuator saturates, the assumptions behind the linear design become important.
How to choose a first design
List what you can measure, what you can command, and which failure matters. For a single motor speed loop with modest requirements, an experimentally tuned PID may be a fast starting point. For coupled objectives, hidden states or explicit tradeoffs between motion and effort, write or identify a model and consider state-space design. In both cases, validate against disturbances, sensor noise, model error and input limits.
Compare PID with LQR or another controller—not with state-space itself. Choose the model representation and control law according to the signals, objectives and constraints you actually have.