The order of the wires shown in the picture Bob Sylvester posted is correct. I'll note that this is a rear (bottom) view of the regulator mounted inside the frame. My 330 has the regulator mounted outside the frame, so the wire order is reversed (mirror image) of the picture.
What those wires connect to, starting at the left end in the picture.
1. Red. DC output to the electrical system. Goes to one of the three ring terminals on the top starter stud.
2, 3 These are the AC out from the alternator, and are interchangeable on those two terminals.
4. Brown. +12 volts to the indicator lamp on the instrument panel when the system is not charging.
Note that this is a different setup than on the Onan tractors and others that are voltage-sensing.
On the small Yanmars, an internal circuit in the voltage regulator senses "no output." Functionally similar to an idiot light in an automobile.
5. Green. Voltage sense for voltage control. This particular wire, and the voltage level on it, is critical to proper operation of the charging circuit. The basic principles of operation of the Yanmar regulator are the same as for the common 3-terminal pass regulators used on other engines with a stator and a permanent magnet field. On the 3-terminal regulators, the output voltage is sensed at the output connection. On the Yanmar setup, the output voltage is sensed remotely from the regulator. This allows voltage control by monitoring somewhere near the system electrical loads and for the regulator output voltage to run high to compensate for losses in the power wiring. The voltage on the green wire terminal needs to be the voltage at the starter top terminal for proper operation. As Deere built it, the green wire is fed through a fusible link, key switch contacts, the 10A fuse, and wiring in the 10A power circuit. So there is a lot between the desired sense point and the actual sensing circuit. Any voltage drop in the wiring that feeds the sense circuit will cause an overvoltage at the starter top stud.
Note that this particular circuit applies only to the Yanmar engines in the 322, 330, and 332. The 430 alternator and regulator are electromagnetic field type, and voltage control is obtained by controlling the field current.
Hank