Drive-on-motor has been tried several times, and is making a resurgence again. Depending on how the drive and motor are integrated, failure of one can be twice as costly as when the drive and motor are more traditionally separated.
Putting the drive out in a production environment invites this sort of failure. The production environment may be extremely hot, or extremely dirty, or extremely wet. Any of these may lead to that more costly failure.
Finally, there's the amount of space needed for the drive when piggy-backed to the motor. Many times the space inside a machine is sufficient for the motor only (and sometimes, not even then).
Protecting the drive electronics is no harder than protecting the motors. Properly designed motor controls can withstand the same harsh enviroments as the motors they control, perhaps even more so given that the electronics can be fully sealed since they have no moving parts. I would argue that the modular motor/control set is easier to replace since it has fewer connections with only power and comm, whereas a separate controller must also route sensor wiring. I have been designing and using modular motor control electronics for years and am always pleased with how clean the connectivity is in the final product.
Several suppliers do offer IP67 rated motor-drives, which is often the level of protection used in packaging. Obviously the specifics of the application are vital but many of these units are finding their way into packaging capitalizing on their ability to provide distributed control.
Festo's BionicKangaroo combines pneumatic and electrical drive technology, plus very precise controls and condition monitoring. Like a real kangaroo, the BionicKangaroo robot harvests the kinetic energy of each takeoff and immediately uses it to power the next jump.
Design News and Digi-Key presents: Creating & Testing Your First RTOS Application Using MQX, a crash course that will look at defining a project, selecting a target processor, blocking code, defining tasks, completing code, and debugging.
Focus on Fundamentals consists of 45-minute on-line classes that cover a host of technologies. You learn without leaving the comfort of your desk. All classes are taught by subject-matter experts and all are archived. So if you can't attend live, attend at your convenience.