Artificial gravity is easy to produce. Just set a spacecraft to spinning around its longitudinal axis, and a force (actually, a centripetal acceleration) will be generated that feels just like gravity. If your spacecraft is cylindrical in cross-section, you can walk around on the inside of the hull and it will feel like you are in a gravitational field. If human beings must have gravity to maintain their health on long space voyages, this is the only way we know how to do it.
The amount of centripetal acceleration produced can be easily calculated using the simple equation, a = w^2 r, Where a is the acceleration in m/s^2, r is the radius of gyration in meters, and w is the rotational velocity in radians per second. A radian is about 57 degrees, and this unit is picked because the math comes out easier if you do it in radians. One radian per second is equivalent to about 0.159 revolutions per second, which is about 9.55 Revolutions Per Minute. RPM is the unit we commonly use to describe rotational, or angular, velocity in engineering applications. So to increase the acceleration produced by spinning your spacecraft, you either need to increase your rotational velocity, or increase the radius of gyration.
Suppose you have a spacecraft hull with a radius of about 5m (about the size of a USS George Washington class missile submarine). And suppose you wish to spin it fast enough to produce a centripetal acceleration equal to 1 earth gravity, 9.8 m/s^2. What rotational velocity do you need?
a = w^2 r
9.8 = w^2 (5)
w = sqrt (9.8/5)
w = sqrt (1.96)
w = 1.4 radians/sec
1.4 radians/sec = 84 radians/min = 13.4 RPM
For you SF writers, keep in mind that there may be severe mechanical issues in spinning a hull this size this fast, it might be prone to instability, especially if cargo was shifted about. Also, walking on the inside of the curved hull might be awkward. particularly if you rapidly changed direction. As you moved away from the hull, towards the ship’s centerline, the artificial gravity would appear weaker, and objects inside might be affected by peculiar Coriolis forces. Clearly, it would be impractical to provide artificial gravity in small spacecraft, and it would be prudent to not start a gravity-simulating spin unless the ship was in free fall.
Navigational observations and docking maneuvers might be difficult because the views out the windows would be very disorienting, and going on extravehicular activity would be dangerous–you could be slung clear of the ship like mud off a spinning wheel. And when the crew finally returned home, they might need a few days to get their “earth legs” back.