While I wait for my lunch to defrost I’ll type this.
For the last couple of days I’ve been getting close to my wits’ end with these motor driver boards. No matter what I tried I couldn’t get them to run without overheating. I was certain that this wasn’t a problem with the old Spot 9 boards, so I hauled out the old boards and reprogrammed some chips with the old code and sure enough, the FETs stayed cool while running the motors.
I can’t understand whey there should be any difference between the old boards and the new boards, because all I did was take the old boards and divide them in half, putting the PIC driver on one PCB and the FETs and motor connections on another board. Everything else should have been the same.
So I cleared the decks, set up the test bed and tried again. I took the current motor drive PIC code that talks to the Pico and stripped out all the microstepping code, replacing it with the simple coil energisation sequence from the old code. I left in the 4-line command system because that’s all in hardware and I don’t see how that could be the problem. Naturally, when I pressed GO, nothing happened. I noticed I had 2 instances of IcProg running and I might have programmed the PIC with the one that I hadn’t loaded the .hex file into first. I reflashed the chip and the motor started running, but once more it was running rough and hot.
The speed control buttons in the web interface didn’t seem to be working but after I restarted the program I was able to get them to speed up the motor to a stage where it was running smoothly. At the same time I noticed that the FETs were much cooler. At the slower speed at least one of the FETs was almost uncomfortable to touch, but in the last test I could run the motor for some time without the FETs becoming noticeably hot. My guess is that running the motor too slowly increases the load on the FETs because the rotor comes to a momentary stop and disperses (not the word I want, what is the word I want?) all its kinetic energy, so the the next coil has to overcome static friction and inertia, resulting in a high current draw. If I knew what I was doing I could stick an ammeter in the circuit to test this hypothesis.
My plan is to increase the default speed of the motors and retest in Spot X.
One thing I did notice is that at maximum speed, with a delay of 1ms between steps, the unloaded motor is unable start up. This supports my earlier hypothesis about inertia and momentum. I think I will need to re-implement some form of acceleration curve that lets the motors start off slowly and accelerate to their target speed. I would also like to achieve this in a non-bodgy manner.
At any rate, old Spot X is in pieces at the moment while I try to figure out what to do about its bumpers, which aren’t in the best condition and new Spot X needs to be stripped down and have the wheel bearings glued in properly, because they are falling out of position.