Yeah, and it will take memory, too. That’s why I’m in a rush to upgrade to a better MCU. There are bound to be things I need to do, and even the most elementary program has to be absolutely squeezed into the lepton.
To be fair I am now having a similar problem with the blue pill. The flash is too small to run the commander. Once again it highlights the need for at least one flagship combo of hardware and code base that is reasonably flexible.
What we have right now is a bunch of parts lying around. Every single time I try any combination there are so, so many problems and barriers it’s ridiculous. It’s not a building block that can be stood upon.
I managed to get the open loop working with the bluepill, and the angle sensor. When I try the code I posted most previously, minimally adapted to make it fit the blue pil, it exhibits the same behavior, so now I at least know it’s not the lepton. I will follow Deku’s advice, but I think there is something the Commander does when it executes a command which I am not doing in my code, or something I am messing up.
Somehow, torque control mode is not being engaged, I think. It’s doing angle mode with some random angle, or something. I tried reloading the library in case, no dice.
That doesn’t explain the second weak spot, though. As I rotate the rotor, it has two weak spots. One stable point where the rotor started, and one about halfway around, which is not quite stable but pretty close. Like the space vector voltage curve… hm pretty sure that’s not related unless some wires got crossed in a remarkable coincidence of some kind.
Additionally, may we reflect for a moment perhaps, I’ve spend maybe 5 working days on this, = 200 bucks a day at least, so 1000 bucks, plus 240 for the boards and shipping, the frustration, and we aren’t done yet. At least $1240, at $3 per board, that’s a lot of boards to sell before you save that money. It wouldn’t solve all the problems here, but I’m just trying to point out that a couple extra bucks per board is a good deal if it makes things work better, even just in the development stage, even if you are making a lot of products that include said boards.
When I read the datasheets of other motor driver chips and boards, a lot of them hawk their “code free” stuff, precisely because it saves dev time. It’s a legit thing to save dev time, and people will accept higher per unit cost for sure. Esp when the per unit cost isn’t really the engineer’s problem.