mxlemming
100 kW
- Joined
- Jul 17, 2020
- Messages
- 1,201
Nice big update:
JLC PCB delivered populated boards! Only had to solder another 5 capacitors, 4 chips 2 inductors... Turns out JLC had the chip and inductor parts, but they were so badly categorised I couldn't find them. Grrr.
Got duty cycle controlled FOC working. Tried to get current control FOC working, but it all went a bit squiffy. Try again later. Juggling wife, baby, full tie engineering job that Covid has not generated the slightest slack for takes away most of my project time. Think the problem was to do with not being able to read current at 100% duty cycle. TBC. Also not helped that the U phase current readings are poor due to the DCDC converter spewing noise onto it. Have some plans to get around that... mainly use the other ADC channels as default, and apply a filter.
Here it is spinning away in FOC. Torque is very good.
https://photos.app.goo.gl/Ktq4RAeRV5Ez2vDE6
Turns out FOC really isn't that hard in the end, just 2 matrix transforms, 2 inverse transforms, total of like 20 lines of code when you're not doing sensorless (the hall sensors generate an angle by counting pulses since the last change, which seems pretty robust). There are still lots of little niggly bits, current control, ADC channel management, error handling etc... but fundamentally... it took an extra ~6 hours of knuckle down coding to implement simple FOC. Pretty pleased. Can build on this.
Not all good though, Texas Instruments LM5163 100V DCDC is garbage if you use the "Typical implementation" from the first page of the datasheet. Roughly 10% ripple unloaded, down to about 5% with 200mA draw. Still, it works, and the important analogue bits are running off a linear reg... Guess I shouldn't have rushed that quite so much and done the bare minimum to make the PCB pin compatible with the LM5163 and LMR36510... I mean... it IS pin compatible and technically works with both now :lol:
I'm starting to get pretty hacked of with TI and their burying information half way through datasheets. They screwed me with opamps that phase inverted a while ago (documented in the middle of a pararaph on P33/50), and screwed my colleague with errata on their MCUs. If only some other manufacturer made 100V DCDCs... Any suggestions (looking to On Semi or ST if anyone from those companies read this...
)? Even considering whether the ST VIPer series could be used (weird devices for mains voltages that have inexplicable feedback mechanisms).
Cheers! It's been an on and off PITA, but moments of joy as it first spinnied. Learning so much about coding, power electronics etc.
JLC PCB delivered populated boards! Only had to solder another 5 capacitors, 4 chips 2 inductors... Turns out JLC had the chip and inductor parts, but they were so badly categorised I couldn't find them. Grrr.
Got duty cycle controlled FOC working. Tried to get current control FOC working, but it all went a bit squiffy. Try again later. Juggling wife, baby, full tie engineering job that Covid has not generated the slightest slack for takes away most of my project time. Think the problem was to do with not being able to read current at 100% duty cycle. TBC. Also not helped that the U phase current readings are poor due to the DCDC converter spewing noise onto it. Have some plans to get around that... mainly use the other ADC channels as default, and apply a filter.
Here it is spinning away in FOC. Torque is very good.
https://photos.app.goo.gl/Ktq4RAeRV5Ez2vDE6
Turns out FOC really isn't that hard in the end, just 2 matrix transforms, 2 inverse transforms, total of like 20 lines of code when you're not doing sensorless (the hall sensors generate an angle by counting pulses since the last change, which seems pretty robust). There are still lots of little niggly bits, current control, ADC channel management, error handling etc... but fundamentally... it took an extra ~6 hours of knuckle down coding to implement simple FOC. Pretty pleased. Can build on this.
Not all good though, Texas Instruments LM5163 100V DCDC is garbage if you use the "Typical implementation" from the first page of the datasheet. Roughly 10% ripple unloaded, down to about 5% with 200mA draw. Still, it works, and the important analogue bits are running off a linear reg... Guess I shouldn't have rushed that quite so much and done the bare minimum to make the PCB pin compatible with the LM5163 and LMR36510... I mean... it IS pin compatible and technically works with both now :lol:
I'm starting to get pretty hacked of with TI and their burying information half way through datasheets. They screwed me with opamps that phase inverted a while ago (documented in the middle of a pararaph on P33/50), and screwed my colleague with errata on their MCUs. If only some other manufacturer made 100V DCDCs... Any suggestions (looking to On Semi or ST if anyone from those companies read this...

by district9prawn » Sep 10 2020 10:51am
Hey congrats on getting a motor spinning from scratch! Your project seems like a great way for people to learn motor about motor control. Arguably easier to get into than the available dev kits made for that very purpose.
Cheers! It's been an on and off PITA, but moments of joy as it first spinnied. Learning so much about coding, power electronics etc.