Also for me I went there and got to the end where the mechanism is but I couldn't open it so I left. I got the piece and went back but at the end where you pull out the junk from the gears, there wasn't any pieces to get unstuck{the junk in the gears wasn't there since I already pulled them out} so I would wait until you have the piece before completing the dungeon.
There is a back entrance you should have unlocked. If you go to where the first entrance is but keep going up instead of in there is a tower-like structure with a dwemer elevator leading you right to the area with the contraption. That way you don't have to walk all the way through. This of course requires that you have opened that alternate entrance/exit from the inside to begin with however. Always make sure to open backdoor shortcuts in dungeons when they are available in case you need them for later quests to to pick up chests etc. That you couldn't get at that time.