MATLAB: How to model two-rack-one-pinion coupling in Simscape Multibody

rack and pinion constraintSimscape Multibody

I would like to model the coupling which consists of two parallel racks with the mutual pinion in between of them in Simscape Multibody. Based on tutorial I connected two racks to F-ports of two Rack and Pinion Constraint Blocks and one pinion to Blocks' B-ports. Each Rack in its turn were connected to the prismatic joint and pinion was connected to revolute joint. In order to connect racks properly I used different reference frames in pinion which were opposite in their X, Y – directions. But I got an error "Model not assembled: position violation". I would appreciate any help.

Best Answer

Seems like you have a geometric loop with incompatible constraints. Try to break the geometric loop by commenting out one of the Rack and Pinion Constraint Blocks, and assemble your mechanism. This should give you a idea of how to correctly orient the frames to close the loop.