Using a china controller with better hardware
Posted: Wed Nov 14, 2018 4:50 am
For code development, and possibly races, I think a motor controller with custom code that costs $70 and maybe two hours of soldering would be really nice. Makes blowing one up a lot less painful, and easier to get into more vehicles. I've got some amount of a plan for doing this. I think I can get at least 15% more efficient than dumb controllers, and do better with fuse current control too.
The basic idea is to use one of the $30 China controllers as the power part. Seems like they're reasonably robust, and can handle a fair amount of current at 48V.
A custom PCB with a real MCU and hall effect current sensors seems like the way to go for the actual logic. I'm thinking of sticking with the Kinetis-K chips on the Teensy and my previous custom motor controllers. That should be a ~$40 PCB quantity 10.
Plan A is minimal modifications to the China controller. Seems like it should be possible to move the data in and out using some of the various wires that already come out of it. If that works out, then the only modifications would be possibly some attachment points to program it and then actually programming the MCU. Current thoughts on how to move data back and forth are either analog values (noise tolerant, should be able to easily get sufficient bandwidth, but ends up being a lot of signals) or some digital protocol (it has SPI hardware; 20kHz * 8 bits * 3 phases = 480kHz, which is totally achievable as a ballpark).
Plan B is to pull the MCU off the China controller and solder in a custom PCB with castellations on the pads from it. Should be doable, but a lot more work for each controller. From there, either a connector to another PCB with the custom logic or to wires out to the main PCB are options. Pulling the MCU off with hot air and then dropping another PCB in its place isn't all that hard, but it's way more than just plugging stuff in, so hoping to avoid this option.
First step to derisking plan A is to figure out how to program the MCU. Looking at the datasheet, it has an I2C programming interface. That should be pretty easy to poke at, if I can get some idea what commands it recognizes. There's a reference in the datasheet to a "programming guide" which should have that info. Didn't manage to find a copy of that online, but haven't given up searching yet. I suspect any generalplus programming guide will have the info I'm looking for (basically, what bytes to send to read and write from the flash).
The basic idea is to use one of the $30 China controllers as the power part. Seems like they're reasonably robust, and can handle a fair amount of current at 48V.
A custom PCB with a real MCU and hall effect current sensors seems like the way to go for the actual logic. I'm thinking of sticking with the Kinetis-K chips on the Teensy and my previous custom motor controllers. That should be a ~$40 PCB quantity 10.
Plan A is minimal modifications to the China controller. Seems like it should be possible to move the data in and out using some of the various wires that already come out of it. If that works out, then the only modifications would be possibly some attachment points to program it and then actually programming the MCU. Current thoughts on how to move data back and forth are either analog values (noise tolerant, should be able to easily get sufficient bandwidth, but ends up being a lot of signals) or some digital protocol (it has SPI hardware; 20kHz * 8 bits * 3 phases = 480kHz, which is totally achievable as a ballpark).
Plan B is to pull the MCU off the China controller and solder in a custom PCB with castellations on the pads from it. Should be doable, but a lot more work for each controller. From there, either a connector to another PCB with the custom logic or to wires out to the main PCB are options. Pulling the MCU off with hot air and then dropping another PCB in its place isn't all that hard, but it's way more than just plugging stuff in, so hoping to avoid this option.
First step to derisking plan A is to figure out how to program the MCU. Looking at the datasheet, it has an I2C programming interface. That should be pretty easy to poke at, if I can get some idea what commands it recognizes. There's a reference in the datasheet to a "programming guide" which should have that info. Didn't manage to find a copy of that online, but haven't given up searching yet. I suspect any generalplus programming guide will have the info I'm looking for (basically, what bytes to send to read and write from the flash).