I haven't even bothered watching after "only DC motors can be used as a generator".
As far as I am aware, a motor can be of the following families:
- Permanent magnet DC brushed. DC back emf.
- Coiled stator DC brushed (as a separate winding, or internally wound as series or parallel). DC back emf IF the stator is powered. Single phase universal motors are a subset of series connection types for which, regardless of the polarity of the voltage, torque is always generated (needs moveable brushes or a different wiring to change direction though).
- Permanent magnet AC synchronous (three phases). Three phase AC back emf.
- Coiled rotor AC synchronous. I think those generally are not brushed but rather rectify the current induced by the stator. If brushed, no back emf unless the rotor is powered.
- DC brushless. This one is basically a permanent magnet AC synchronous with hall sensors built in, to be able to electronically switch the phases. The back emf is however square or trapezoidal to maximise flux linkage.
- Stepper motor (2, 3, 5 phases). Close to the PM AC synchronous in its construction, except that the motor is made to maximise the number of stable equilibrium positions of the rotor (many alternating magnetic poles at the rotor or variable reluctance). Back emf depends on how it's driven.
- AC asynchronous (3 phases). The rotor is a closed loop (a coil, or a squirrel cage made of bars) which creates its field from currents induced by the stator. Can only be used as a generator beyond the synchronous rpm (+voltage at stator). AC back emf (TBC).
- AC asynchronous (single phase). The motor cannot be self-started unless an out-of-phase auxiliary supply is created via a reacting capacitor, and fed to windings 90° from the main windings. Can only be used as a generator beyond the synchronous rpm (+voltage at stator). AC back emf (TBC).
There are many more (e.g. hybrids), but I think those represent 95% of the production. I'm sure I've missed a few important ones, please feel free to comment and I'll update the list.
The biggest clue to the type of a motor is the number of wires, but as you can see this is not enough. Some motors cannot generate power without an excitation, some not at all, and even if they do, the back emf is funny sometimes (trapezoidal for example) depending on its construction.
You could plan to try the various types of supplies on the motor, ramping up the voltage, and see if it does anything, but what's your "OK that's not it, better cut the power before I smoke it" point? If you don't know what type of motor it is, I assume you don't know anything about it. Including the voltage and current ratings, Max rpm. You could get that from eyeballing it, but there is no guarantee then.
For your specific problem though, if you are certain your motor is a DC bruhless but you don't know if the inverter+control circuit are integrated, look at the number of wires. Generally the motor does not have a circuit built in, and an ESC must be connected to it. You will have to identify which wires are the hall sensors.
ESC might or might not be used for current generation, it depends on how they are made. I don't think there can be any harm in hooking up a resistive load compatible with its current range at the input and test it.
The simplest solution would be to use a low side NPN switch:
You say the motor DC resistance is 11.5 Ω, so the maximum current it can draw is 1.8 V / 11.5 Ω = 160 mA. Actually the transistor will eat up a few 100 mV lowering the maximum possible current, so this is a safe maximum to design to. Figure the transistor is good for a gain of 50 minimum, so we need at least 160 mA / 50 = 3.2 mA base current. 5 mA is then a good target to make sure the transistor is solidly saturated when on. Figure the B-E drop to be 700 mV, so that leaves 1.1 V across the resistor when on. 1.1 V / 5 mA = 220 Ω.
C1 is there to speed up the turn-on and turn-off. (220 Ω)(4.7 nF) = 1 µs, which is the C1-R1 time constant.
The PWM frequency should be fast enough so that the current thru the motor changes little each on and off phase. The ripple caused by the PWM is a AC voltage superimposed on the average DC voltage. Only the DC voltage goes to moving the motor. The AC component causes no torque, only heat, so you want to keep it low relative to the DC. Generally you run motors a bit above the human hearing limit, which is also usually fast enough to keep the AC component small. At 25 kHz, for example, the PWM period is 40 µs, which should give you plenty of resolution from any reasonable PWM peripheral in a microcontroller.
Added in response to collector scope trace
The basic shape of the waveform looks good, so it appears the transistor is switching properly and the voltage is being applied across the motor properly.
The spikes at turn-off are worrisome. They could possibly be scope artifacts, but if your scope trace is accurate, then the diode is not working or not connected properly. The spikes shouldn't be more than a volt or so above the supply.
D1 not only keeps the transistor from getting fried, but it preserves much of the motor current during the off time. The first is necessary, and the second increases efficiency.
Added 2
Looking more closely at your scope trace, I see that the collector voltage when the motor is off is 2.48 V. You say the supply is 1.8 V, so that makes the off voltage 680 mV above the supply. That means you did not build the circuit as I said. You obviously used a ordinary silicon diode, probably a slow one like a 1N400x. The slow turn on time of the diode explains the voltage spike, and reduces overall drive levels a bit at a specific PWM duty cycle. It will also cause shoot-thru for a time when the transistor is turned on again, since the diode is still conducting. A Schottky diode will have lower forward drop and effectively instant reverse recovery in the context of this circuit.
The system should still generally work, but try with a Schottky diode like I specified.
Best Answer
Your power device appears to be a PNP transistor, not a MOSFET. As such, it requires significant base current to become fully saturated.
The datasheet that you linked to says that the minimum Hfe is 20. You should probably target a forced Beta of 15 to ensure full saturation.
So now you need to tell us what your motor current is. Then we can help you calculate the required base current. I'm also guessing that your opto-coupler is way undersized for the base current that you need.
Finally, your schematic diagram is extremely confusing in regards to the polarity markings on the 120 Vdc terminals. Because this is a PNP device, the Emitter should be the most Positive terminal.
BTW - The transistor symbol in your schematic diagram is the wrong symbol for the device that you are using. You should be using the symbol that is in the datasheet that you linked to.