bad experiment with 2 IRF520 mosfets
- bad experiment with 2 IRF520 mosfets
- damage analysis
- Pi3A+ controlled PWM motor control via L298N motor driver
- summary/next steps
I did what I explained before, connected two 16V mosfet outputs (one with switched polarity) together in screw terminal.
I did set 1st mosfet SIG to 1 and 2nd mosfet SIG to 0.
Then I measured voltage at screw terminal as 16.7V.
Next I did set 1st mosfet SIG to 0 and 2nd mosfet SIG to 1.
Before I was able to measure, bad smelling of mosfets happened.
I did set 2nd mosfet SIG to 0 and separated Pi3A+ and mosfets.
I had used GPIO18 and GPIO17, and tested then whether they work -- they did not.
I tested whether GPIO27 works, and it did not
Then I did shutdown the PI3A+, waited a moment and powered it up.
Via ssh I was able to verify that GPIO27 worked again.
BUT GPIO18 and GPIO17 are dead permanently.
Next I tested the mosfet modules.
One was fine, the other broken (it always showed full voltage on output, regardless of SIG setting).
GPIO17 is really dead, 0V always, but GPIO18 shows 0.02V/0.06V for setting low/high.
What I missed to add were diodes that would have avoided output voltage of one mosfet module to go back to the other module.
Pi3A+ controlled PWM motor control via L298N motor driver
I looked for other motor drivers I have that allow for 16.8V and more than 1A.
Luckily I found three L298N modules, that can do up to 35V and 2A.
I had to remove all 3 jumpers of L298N module:
The 1st because voltage was above 12V.
The 2nd because I wanted to do PWM to drive out1/out2.
The 3rd because I will not use out3/out4 -- the other caterpillar motor will get its own L298N and 4S lipo.
Because jumper1 was removed, I had to power the 5V line of the module with 5V from Pi3A+.
GND from Pi3A+ and 4S lipo are connected to GND of L298N.
16.7V from 4S lipo is connected to input labeled "12V" of L298N.
I used JuiceSSH on my smartphone to control the motor with pigpio pigs command (robot Wifi remote control).
"pigs p 23 64" did set PWM signal to 25%, directions were selected by GPIO27 and GPIO22.
https://stamm-wilbrandt.de/en/forum/Scr ... iceSSH.jpg
This is photo of Pi3A+ controlled motor running at full speed (255).
I tested both motors connected to L298N, and voltage of 4S lipo was a bit reduced to 16.49V.
Both times measured speed was slightly above 1600rpm, 5m/s or 18km/h under full speed and direction control of Pi3A+ !!
Lost GPIO18 and GPIO17 of Pi3A+ permanently, but besides that all else seems to work (I verified that camera works).
L298N can drive the 12V/1500rpm with >16V and achieve target speed of 5m/s even when not fully loaded.
L298N module has the screw terminals needed to connect thick cables because of amps.
Now its time to assemble the two 4S lipos with L298Ns and the Pi3A+ with its own lipo onto the robot ...
I did cover the 4 screws that fixate flat Lego plate on robot with flat 2x2 Lego pieces.
I had to dremel some stuff of their underside away in order to fully cover the metallic screws.