EcoModder Forum Paul & Sabrina's cheap DIY 144v motor controller

Register Now
 Remember

 08-14-2017, 03:06 PM #7201 (permalink) PaulH     Join Date: Feb 2008 Location: Maricopa, AZ (sort of. Actually outside of town) Posts: 3,766 Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000 Thanks: 1,345 Thanked 1,071 Times in 700 Posts It's always fun to read all these updates when I've been away! Here's my understanding for the losses with the IGBTs. There are switching losses, and conduction losses. The DC controller switches at like 7-12kHz (spread spectrum) so it averages maybe 9.5KHz or something like that. Each time the IGBT turns on and off, that's one of the 9500 per second. So, if the turn-on energy is 50mJ (for example) and the turnoff is 50mJ, then the off/on cycle is 0.1Joule, or 0.1Joule/cycle * 9500cycle/sec = 950 watts. JUST FROM TURNING IT OFF AND ON!!! AAHH!! But notice that their numbers for switching energy are at the absolute worst case. Like 600v and 300amp or whatever. If the current or voltage is less, the switching energy falls dramatically. Sometimes they don't include the full range of switching energy vs current, but sometimes they do. Then there's the conduction losses, like 1.75v while on. Then if you are at, say, 50% PWM, then it would be current * 1.75v * 0.50 for the waste heat from conduction losses. __________________ kits and boards Last edited by MPaulHolmes; 08-14-2017 at 05:54 PM..
 Today Popular topics Other popular topics in this forum... View the most popular topics in this subforum by views or by posts
 08-15-2017, 08:46 AM #7202 (permalink) EcoModding Lurker   Join Date: Jul 2017 Location: Croatia Posts: 23 Thanks: 0 Thanked 2 Times in 1 Post tnx will those work with your logic ? FUJI 1MBI600U4B-120 Last edited by mfox; 08-15-2017 at 04:51 PM..
 09-10-2017, 01:48 PM #7203 (permalink) EcoModding Lurker   Join Date: Sep 2017 Location: Cracow Posts: 1 Thanks: 0 Thanked 0 Times in 0 Posts Hello. I'm trying to write soft for Field Oriented Control of induction motor. I have finished 3ph 3kW inverter, controled by STM32F4, and V/F open loop algorithm to control ACIM - it works. Now I'm trying to implement FOC algorithm rewriting code from this project using float variables. CortexM4 have FPU so operations on floating points numbers take same time (cycles) as operating on integers. Here is part of code: Code: ```void ClarkPark(float L1_curr, float L2_curr) { vector.Ialpha = L1_curr; vector.Ibeta = (L1_curr + 2.0*L2_curr) / 1.732; //Id = Ialpha*cos(Angle) + Ibeta*sin(Angle) vector.Id = vector.Ialpha*cos(vector.AngleFluxDeg) + vector.Ibeta*sin(vector.AngleFluxDeg); // Iq = -Ialpha*sin(Angle) + Ibeta*cos(Angle) vector.Iq = (-1.0)*vector.Ialpha*sin(vector.AngleFluxDeg) + vector.Ibeta*cos(vector.AngleFluxDeg); } //qdImag = qdImag + qKcur * (qId - qdImag) ;; magnetizing current void curModel(void) { //qdImag = qdImag + qKcur * (qId - qdImag) ;; magnetizing current vector.Imag = vector.Imag + (LOOP_PERIOD / ROTOR_TIME_CONST) * (vector.Id - vector.Imag); if(vector.Imag == 0) { return; } // VelSlipRPS = (1/fRotorTmConst) * Iq/Imag / (2.0*pi) vector.VelSlipsRPS = (1 / ROTOR_TIME_CONST ) * (vector.Iq / vector.Imag) / (2.0*PI); //VelFluxRPS = iPoles * VelMechRPS + VelSlipRPS vector.VelFluxRPS = 2.0 * speed.perSec + vector.VelSlipsRPS; //AngFlux = AngFlux + fLoopPeriod * 2.0 * pi * VelFluxRPS vector.AngleFluxRad = vector.AngleFluxRad + LOOP_PERIOD * 2.0 * PI * vector.VelFluxRPS; vector.AngleFluxDeg = vector.AngleFluxRad * (180.0 / PI); }``` Please tell me If I'm wrong: I have to keep an eye on vector.AngleFluxDeg variable to be value between 0 - 360 degree? (back to 0 if 360 overflowed). It will be correct? Thanks for any reply. Last edited by fasset; 09-10-2017 at 02:15 PM..
Master EcoModder

Join Date: Sep 2010
Posts: 1,227

ChargE - '92 Mazda MX6 LX
90 day: 33.89 mpg (US)

WinterTransport - '07 hyundai Sante Fe SE
Thanks: 682
Thanked 443 Times in 354 Posts
??

Quote:
 Originally Posted by fasset I'm trying to write soft for Field Oriented Control of induction motor. I have finished 3ph 3kW inverter, controled by STM32F4, and V/F open loop algorithm to control ACIM - it works. Now I'm trying to implement FOC algorithm rewriting code from this project using float variables.
I think that maybe this should be moved to the AC controller thread? Do you need to be a moderator to do that?

As for the translation of the code, you should be able to run the code as Paul wrote it. The floating point variables should work as written. It appears to be ansi standard C with no goofy library calls.

If you want to optimize the math to make better use of your floating point math library, I'd suggest doing that after you have Paul's math running. Just my opinion. That way you can run through a test set for your math before your changes and after your changes to make sure it still works!

As for the range on degrees, you should be able to use the modulo or mod() function on your angle to bring it back to the range 0 - 360. It won't matter for the intermediate calculations. Sin(0) = sin(360) = sin(720). It is only convention that shows the angle between 0 and 360 degrees.

Hope this helps
__________________
In THEORY there is no difference between Theory and Practice
In PRACTICE there IS!

 The Following User Says Thank You to thingstodo For This Useful Post: MPaulHolmes (11-21-2017)
 11-21-2017, 01:00 PM #7205 (permalink) PaulH     Join Date: Feb 2008 Location: Maricopa, AZ (sort of. Actually outside of town) Posts: 3,766 Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000 Thanks: 1,345 Thanked 1,071 Times in 700 Posts Yes, thingstodo, and I actually use 0-65535 for the "degrees" so that when it rolls over, it automatically goes back to zero, so you don't have to worry about it. mfox: I would use either a high side IGBT with a diode on the low side (I think they call those choppers), or an IGBT half bridge, since you need a freewheel diode too, and just just the IGBT. So, the part you listed wouldn't work for that. __________________ kits and boards
 02-07-2018, 06:30 PM #7206 (permalink) EcoModding Lurker   Join Date: Feb 2018 Location: Colorado Springs Posts: 9 Thanks: 0 Thanked 2 Times in 2 Posts Hey, folks - Paul supplied me with a DC board for IGBTs and has been helping me with my controller. Seeing as he's pretty busy right now, does anyone have a current copy of the DC control software? I've read through a ton of posts, and I keep seeing messages about the software being sent back and forth, so hopefully someone can lend a hand Thanks!
 02-07-2018, 09:52 PM #7207 (permalink) Master EcoModder   Join Date: Apr 2009 Location: Charlton MA, USA Posts: 463 EVVette - '71 Chevy Corvette Coupe Thanks: 31 Thanked 172 Times in 92 Posts Index of /firmware __________________ www.EVVette.com - 1971 Corvette Coupe Conversion to all Electric! www.AdamBrunette.com - Machining, CNC, Robotics and Electronics. You can download RTD Explorer for the Cougar controllers at www.EVVette.com
Master EcoModder

Join Date: Sep 2010
Posts: 1,227

ChargE - '92 Mazda MX6 LX
90 day: 33.89 mpg (US)

WinterTransport - '07 hyundai Sante Fe SE
Thanks: 682
Thanked 443 Times in 354 Posts
Quote:
 Originally Posted by jbman Hey, folks - Paul supplied me with a DC board for IGBTs and has been helping me with my controller. Seeing as he's pretty busy right now, does anyone have a current copy of the DC control software? I've read through a ton of posts, and I keep seeing messages about the software being sent back and forth, so hopefully someone can lend a hand Thanks!
The code I have for the IGBT DC version (Paul doesn't call it the cougar) does not compile for me on MPLAB X. This zip file does include the .hex file for .. I think it's version 7 that Paul uses?

Dated April 4, 2017 ... even though the zip file shows it is today's date.

This is the version I was running when I posted the test videos
Attached Files
 DC_Controller_2017_April_04.zip (48.4 KB, 3 views)
__________________
In THEORY there is no difference between Theory and Practice
In PRACTICE there IS!

Master EcoModder

Join Date: Sep 2010
Posts: 1,227

ChargE - '92 Mazda MX6 LX
90 day: 33.89 mpg (US)

WinterTransport - '07 hyundai Sante Fe SE
Thanks: 682
Thanked 443 Times in 354 Posts
Quote:
 Originally Posted by jbman Hey, folks - Paul supplied me with a DC board for IGBTs and has been helping me with my controller.
Hmmm .. if Paul sent you the board, it should already have the latest firmware loaded ... but it never hurts to have the source files!
__________________
In THEORY there is no difference between Theory and Practice
In PRACTICE there IS!

EcoModding Lurker

Join Date: Feb 2018
Posts: 9
Thanks: 0
Thanked 2 Times in 2 Posts
Quote:
 Originally Posted by thingstodo Hmmm .. if Paul sent you the board, it should already have the latest firmware loaded ... but it never hurts to have the source files!
You are correct, I believe that it was loaded already. I was having a lot of trouble getting it to respond, however, so I made a mess of it XD I figured it would be easier to find a current copy of the software, but I was mistaken.

I am having a ton of trouble connecting to the controller via realterm.

I appreciate everyone's help!

Last edited by jbman; 02-10-2018 at 01:57 AM..