Dwall,
(See below)Nongrounding Receptacle Replacement or Branch Circuit Extensions. The equipment grounding conductor of a grounding-type receptacle or a branch-circuit extension shall be permitted to be connected to any of the following:
(1) Any accessible point on the grounding electrode system as described in 250.50
(2) Any accessible point on the grounding electrode conductor
(3) The equipment grounding terminal bar within the enclosure where the branch circuit for the receptacle or branch circuit originates
(4) For grounded systems, the grounded service conductor within the service equipment enclosure
(5) For ungrounded systems, the grounding terminal bar within the service equipment enclosure
Article 250 says:All grounding electrodes as described in 250.52(A)(1) through (A)(7) that are present at each building or structure served shall be bonded together to form the grounding electrode system. Where none of these grounding electrodes exist, one or more of the grounding electrodes specified in 250.52(A)(4) through (A)(8) shall be installed and used.
Article 250.52(A)(4)-(A)(8)
I will list only the ones you may have available
250.52(A)
1.
Interior metal water piping located more than 1.52 m (5 ft) from the point of entrance to the building shall not be used as a part of the grounding electrode system or as a conductor to interconnect electrodes that are part of the grounding electrode system.
5.
Rod and Pipe Electrodes. Rod and pipe electrodes shall not be less than 2.44 m (8 ft) in length and shall consist of the following materials.
(a) Grounding electrodes of pipe or conduit shall not be smaller than metric designator 21 (trade size ¾) and, where of steel, shall have the outer surface galvanized or otherwise metal-coated for corrosion protection.
(b) Grounding electrodes of stainless steel and copper or zinc coated steel shall be at least 15.87 mm ( in.) in diameter, unless listed and not less than 12.70 mm (½ in.) in diameter.
3. You should not use:
1. Metal underground gas piping systems
2. Aluminum
You said:
ran a separate ground wire to the same main water line that the house service is grounded to, And everything works fine!
If this does not meet NEC 250.52(A)1, then you are in violation