I have a vacuum that that currently powered by a 3 phase 5 HP electric motor. Currently I cannot power this vacuum with a generator, I would like to convert this vacuum to a gas engine instead. I know that I need to match RPM, shaft diameter, bolting pattern, etc. What I do not understand is how do I get the engine to run at a specific rpm. The electric motor ran at 3450 rpm. The engine I want to replace it with maxes out at 3800 rpm. How do you get the engine to run at around 3450 rpm.
A gasoline engine does not need to, or even want to, run at its max rpm. You can adjust the throttle to run at a convenient speed like 3450 rpm.
Most stationary engines like this have a "governor" that you can adjust to make it run at a set speed. So you should find an engine that has one of these and set it up appropriately.
By the way, I doubt that a vacuum is all that sensitive to the shaft speed. I'm sure that +/- 10% or even more will be adequate. Some trial and error will likely get you to a reasonable speed.
First, you have to know how fast the engine is running. To do this, you use an optical tachometer. On your flywheel or whatever you can mark, place a light colored dash on it and point the optical tachometer at it. This will tell you +/- what RPMs your engine is running at.
Second, to control the engine ... most small gasoline engines have carburetors. Quite a few these days also have air vane governors as well. The governor keeps the engine at a constant speed. The governor is attached to the throttle on the carburetor. With the engine running, and as the air pressure from the engine fan blows against it, the governor blade goes in and out, which affects the throttle and thus the engine speed. The governor blade is counterbalanced by a spring which is fighting the air pressure hitting it. From the factory, it is set at a constant speed. To change the speed, you can either tighten or loosen the spring. A much easier way is to just remove the governor altogether and adjust it manually.
To get to the right engine speed, use the optical tachometer to detect engine speed, then adjust the carb so that engine speed is fairly constant at the speed you need.