# Another homebrew AC-controller



## jhuebner (Apr 30, 2010)

Hello everybody!

I have been reading here for a while and I'm simply impressed by the projects shown here.

So today I want to make my first humble contribution.

Short story:
1,5 years ago I came up with the idea of converting a regular ICE car electric (how unusual  ). I decided it would have to be an AC-motor since most of the complicated parts of spinning it are done in software plus it offers the best effiency. I also found out that standard ACIMs are really cheap and can be overpowered for short periods. Unfortunatly I also found out that controllers are really expensive.
Being an electrical engineer I decided to give it a try. My first inverter consisted of some BUZ50 mosfets and controlling circuitry around it. It basically worked but of course would only drive a 1:10 model of a car 
So I scaled up and have now got this:










It uses a 1200V 90A IGBT, IGBT drivers, a hardware PWM-module and a PC. It basically spins the motor at whichever frequency you set it to and it even uses the space-vector modulation scheme to achieve the highest possible amplitude. I know 90A isn't much but it's a start.










At the top you see the voltage with the little space vector "dent" and the current at the bottom.

There is one problem though: it is all open loop and it uses a PC. Also the PWM resolution is just 8 bits.
My plan is to put the controller program on a little µC which offers 16-bit pwms. For closing the control loop I want to start out with a speed sensor and thereby control the slip of the ACIM in some clever way that is still to be figured out. Since I have never seen any serious motor controller without current sensors and vector control I might have to implement that as well. There are closed loop sensors already on the IGBT-module but their output somehow didn't seem to linearly follow the amplitude of the current.
When all is finished I want to document it like the well known Open Source Motor Controller.

So... do you think this is a promising project worth continuing? And if yes, any suggestions?

Looking forward for replies 
Johannes
----
 State of the project
As of today there are probably around 100 vehicles making use of this project. There have been forks by "Jack Bauer", arber333 and others to use the technology in OEM inverters (Tesla, Ampera, i3, Leaf, ...)



Hardware
Logic (brain) board based on STM32F1
Simple 4A gate drivers
Melexis current sense boards
Isolated voltage sense board
 
Software
Bootloader for firmware upgrade without programming hardware
Firmware with mature support for asynchronous motors and experimental support for synchronous motors
Web interface using ESP8266 Wifi chip supporting Parametrization, plotting and firmware upgrade
 
The "vanilla" kit and documentation can be found here: http://johanneshuebner.com/quickcms/index.html%3Fen_inverter-kit,10.html
Web shop here: https://openinverter.org/shop
Forum here: https://openinverter.org/forum

Tesla Boards here: http://evbmw.com/index.php/evbmw-webshop, Source:https://github.com/damienmaguire
Inverter Source code here: https://github.com/tumanako



Please let me know what else should be mentioned here.


----------



## Salty9 (Jul 13, 2009)

I am interested in your project but don't really know enough to be helpful. I will be following the thread. There is a real need for a reasonably priced AC controller. Keep it up.


----------



## etischer (Jun 16, 2008)

The first lesson I learned when building up my inverter was the importance of a nice stout DC bus. Use flat copper bus bars to connect the capacitor bank to the IGBTs. Keeping the inductance low is key to not blowing IGBTs up, you want to minimize the wire length between the capacitors and IGBTs. 

Another lesson, make sure you have hooks in to automatically disable the inverter if the DC bus voltage gets too high. I was surprised that regen worked without any effort, even in volts / hz mode. I was lucky I didn't blow up my capacitor bank, I hit voltages over 400 volts a few times by accident. Also make sure you have proper fusing, IGBTs fail as a short circuit. 

Congrats on getting your motor spinning!

You can get a little more low end torque by adding some voltage offset at low speed. Instead of following the V/Hz curve down to 0 volts, 0 Hz, try 10 volts @ 0 Hz.


----------



## jhuebner (Apr 30, 2010)

Yes, these sound like important points to take care of, I probably would have forgotten some 

Here's another question then:








You can see here the PCB-interface to the pressure-contacts (or whatever the term is) of the IGBT interface. As you can see in the first post I simply fixed some lugs to the power contacts. Would you recommend fabricating a bus bar and try to fix it without drilling holes in the precious copper area?

Edit: picture of the redesign








Now some question concerning the design: enough gap for high voltages? What about the tickness of the PCB, can arcs ignite from the top to the bottom layer?

/Johannes


----------



## jhuebner (Apr 30, 2010)

Yet another question:










On the left you can see the current sensors that are supposedly "closed loop". The transfer ratio is 1:2000.

Does anyone know how to make use of them? if I simply attach the scope to either the large or the small coil (or hall sensor?) I do get an output which seems to be in no way proportional to the current though. I then tried feeding the output of the small thing into an OpAmp and feed back the output of the OpAmp to the large coil. I attached the scope to the output, too. That gave me the output you see in the first post but the amplitude stayed the same no matter what the actual current was.

Has anyone ever build a closed-loop current sensor here? What is going wrong?

/Johannes


----------



## JRoque (Mar 9, 2010)

Hey Johannes, welcome to the forum.

Got a part number for the current sensors? I think you're right, that looks like a hall sensor at the end of the coil core. Current transducer these days come complete with opamp, filter, etc; you feed it a voltage and ground reference and they output half of that voltage at rest and move to either rail as current flows through. 

If what you have is the discrete coil and hall, you might want to take the hall output, feed each leg to an opamp then the opamp output to one leg of the coil with the other leg being your current output. Reference the output to ground with a resistor. The opamp should output about half the rail voltage so you have both pos and neg current flow measurements. Add some ceramic caps for filtering/bypassing. Or, buy a set of Honeywell CSLA2DK current transducers that have this already done for you.

Good to see you're doing this. I'm taking the Eric T. route and using an industrial VFD brains with external IGBTs and current sensors. These VFD are cheap enough in low HP ratings but they have every possible motor control parameter already coded. 

JR


----------



## etischer (Jun 16, 2008)

jhuebner said:


> You can see here the PCB-interface to the pressure-contacts (or whatever the term is) of the IGBT interface. As you can see in the first post I simply fixed some lugs to the power contacts. Would you recommend fabricating a bus bar and try to fix it without drilling holes in the precious copper area?
> 
> 
> /Johannes


It looks like the IGBT has spade lugs? I would drill holes in the PCB and solder some spade lugs on it. Can you make a larger PCB so you can solder in some caps on the same board?

If you are planning to eventually scale up to larger IGBTs, you might consider buying those and designing your DC bus around them.


----------



## jhuebner (Apr 30, 2010)

JRoque said:


> Got a part number for the current sensors? I think you're right, that looks like a hall sensor at the end of the coil core. Current transducer these days come complete with opamp, filter, etc; you feed it a voltage and ground reference and they output half of that voltage at rest and move to either rail as current flows through.


I don't have a part number for the sensor itself, since it is integrated in the IGBT module. The latter one is called "SKiiP 82 AC 12 I" and manufactured by Semikron.



JRoque said:


> If what you have is the discrete coil and hall, you might want to take the hall output, feed each leg to an opamp then the opamp output to one leg of the coil with the other leg being your current output. Reference the output to ground with a resistor. The opamp should output about half the rail voltage so you have both pos and neg current flow measurements. Add some ceramic caps for filtering/bypassing.


Thats basically what I did. I'll keep trying.



JRoque said:


> Or, buy a set of Honeywell CSLA2DK current transducers that have this already done for you.


I don't really like redundancies  These sensors are there and I want to use them. But as mentioned above, I will be starting with a V/Hz kindof control which doesn't need them. It's only later with space vector control that I do.



JRoque said:


> Good to see you're doing this. I'm taking the Eric T. route and using an industrial VFD brains with external IGBTs and current sensors. These VFD are cheap enough in low HP ratings but they have every possible motor control parameter already coded.


Since I'm a professional software developer but a hobbyist at electrics I'd rather buy an all done hardware device and do the programming myself. Haven't found anything like it though. Can I see your progress anywhere?



etischer said:


> It looks like the IGBT has spade lugs? I would drill holes in the PCB and solder some spade lugs on it. Can you make a larger PCB so you can solder in some caps on the same board?
> 
> If you are planning to eventually scale up to larger IGBTs, you might consider buying those and designing your DC bus around them.


Why would I need holes for soldering on spade lugs? The IGBT module itself is definitly meant to be contacted by a PCB.
A larger PCB would be a dream. I originally planned to integrate the drivers on the same PCB but failed to do so because of limited equipment for making PCBs. Maybe I should employ one of those PCB makers and reconsider that.
I also noticed that most newer Semikron modules are using screw contacts again. So once I upgrade I can just use lugs.

/Johannes
P.S. More pictures can be found here: http://johanneshuebner.com/coppermine/thumbnails.php?album=60


----------



## JRoque (Mar 9, 2010)

> Can I see your progress anywhere?


I don't have anything to show just yet. I bought a Hitachi SJ300 5HP VFD and thought it would be better to do my experiments with a known good VFD rather than having to worry about the IGBTs also. Once I get the other parts working, I'll do the external switches/sensors. 

I bought a smaller 5HP motor to play with and I'm now working on the accelerator/brake/regen concept. I want to accelerate only and not decelerate with the accelerator  I will only decelerate - and regen in the process - with the brake pedal. I tried to get the VFD to do this but it looks like I'm going to end up with external logic to handle it using start, stop with coasting, accel/decel functions.

What language and target hardware do you code for? I'm doing mostly basic and assembler on Atmel chips with some dabbling on C. I believe the Tumanako open source project is C exclusively and might be a good reference - or you can lend a hand in their effort.

JR


----------



## jhuebner (Apr 30, 2010)

Looks like Semikron's SKAI is the answer  Still quite pricy but therefor garanteed to work. I didn't see much progress at the Tumanako project but they did make a good selection of components.


----------



## jhuebner (Apr 30, 2010)

JRoque said:


> What language and target hardware do you code for? I'm doing mostly basic and assembler on Atmel chips with some dabbling on C. I believe the Tumanako open source project is C exclusively and might be a good reference - or you can lend a hand in their effort


Sorry JRoque, totally missed that question. I only code in C so far. As mentioned I'm still using a PC for sine wave generation. Thus I wrote a C program on top of a linux kernel with the Xenomai real time patch.
I don't need to use lookup tables since the PC can probably calculate 1000 sine waves during one PWM period.

Now I am indeed planning to join the Tumanako project. Their code is written in C/C++ and runs on an STM32 µC.

Yesterday I wanted to employ my redesigned IGBT contact board but it was mirrored  So now I built a mechanical prototype that looks like that:









Of course the controller board is missing here because it simply non-existent 

/Johannes


----------



## JRoque (Mar 9, 2010)

Hey Johannes,



> Now I am indeed planning to join the Tumanako project.


Yes I saw your introduction to the team, that's excellent news. To be honest I kinda felt they were cutting themselves short by using a prebuilt external IGBT pack, but I'm warning up to the idea now. I also didn't like the $595 price tag they put on the board the team is developing. That number seems high - and suspiciously Marketing-driven - for an open source project. I've participated in more than one "open source" project where after it was developed, the principals decide it's a good commercial product and split further development to their own branch leaving the open source lagging behind. Hopefully this is not the case here since some of us can really use it for our DIY projects.



> Yesterday I wanted to employ my redesigned IGBT contact board but it was mirrored


You mean you didn't mirror the layer before routing it? If so, you have company on that corner. I must have done that so many times in my prototypes I lost count. Now I keep a steps list before I cut my proto boards and one of the steps is "mirror used bottom layers" 

Do you route your own boards or is that chemically etched?

JR


----------



## jhuebner (Apr 30, 2010)

JRoque said:


> Yes I saw your introduction to the team, that's excellent news. To be honest I kinda felt they were cutting themselves short by using a prebuilt external IGBT pack, but I'm warning up to the idea now. I also didn't like the $595 price tag they put on the board the team is developing. That number seems high - and suspiciously Marketing-driven - for an open source project. I've participated in more than one "open source" project where after it was developed, the principals decide it's a good commercial product and split further development to their own branch leaving the open source lagging behind. Hopefully this is not the case here since some of us can really use it for our DIY projects.


I'm not planning to buy any custom-built hardware for now. I picked up some board with an STM32 from work. Concerning the power stage I'll just use what I've got so far. I designed it with a lot of help from Semikron themselves so I think the chances are good for it to actually work.




JRoque said:


> You mean you didn't mirror the layer before routing it? If so, you have company on that corner. I must have done that so many times in my prototypes I lost count. Now I keep a steps list before I cut my proto boards and one of the steps is "mirror used bottom layers"


Yeah kinda like that  Top and bottom line up perfectly but when putting it on top of the module it is "right side left".



JRoque said:


> Do you route your own boards or is that chemically etched?


Erm what? It's both  I did the layout with a program called FreePCB, printed it on a photo-sensitive board and etched everything away that wasn't black.

/Johannes


----------



## jhuebner (Apr 30, 2010)

Progress is slow but visible:










I've mounted IGBT and drivers to a large heatsink and am now driving it with an STM32 with the help of the Tumanako project. I've implemented a very simple sine wave generator which I submitted to Tumanako.

It also looks like I'm close to cracking the current sensor issue with the help of the DRV401 IC. Tumanako has already implemented the field oriented control methods and is waiting for a suitable driver model to run it on.

I'm pretty optimistic that we'll have a working inverter soon, though not road legal...

/Johannes


----------



## Automcdonough (Sep 1, 2010)

I'm a little worried about the board to IGBT connection not being physically stout enough, especially when you have more than 40A or so going through them. Probly won't happen with no load on the motor, but when you really put this to the test I think that will be the weak link.
Also 8 bit ought to be enough, it doesn't need to be silky smooth looking.


----------



## JRoque (Mar 9, 2010)

Hi. Are you referring to the IGBT driver board? I'm not sure where you say there will be 40 amps. The driver board won't put out that much and the IGBT will likely switch 400 A. Typo maybe?

JR


----------



## jhuebner (Apr 30, 2010)

Hi!

Heres a better picture:










The high current connections are made through the slugs that are screwed onto the board. The small wires are just used for driving the IGBT gates. Do you still think this connection could be overloaded? Oh BTW: theres just a 90A IGBT module beneath, so its not really high performance yet unless run at 800V or so 

/Johannes


----------



## Automcdonough (Sep 1, 2010)

Sorry I misunderstood what I was looking at, for some reason I thought you were intending to pump serious current through that control board!


----------



## MPaulHolmes (Feb 23, 2008)

Awesome job, Johannes!!! You are the man. I can't wait to see you driving down the road with that sucker!


----------



## jhuebner (Apr 30, 2010)

Thanks Paul 










This weekend i learned my lesson about EMI. All the power cables were rather thin and I lacked an intermediate circuit capacity. As a result I was unable to read the motor shaft encoder because the MCU would count tons of spikes caused by the PWM. Voltage spikes on the DC bus would reach +-100V (at bus voltage of 80V and the motor idling)
As you can see, there are thicker cables now and a large capacitor. The voltage spikes have dropped to around +-5V and I can cleanly read the encoder. Well, sort of. I have to use the STM32s digital filter to get a clean count.
So, next I can implement a simple slip controller with the simple equation slip ~ torque (thats what it says in my text book)

/Johannes


----------



## JRoque (Mar 9, 2010)

Looks good, Johannes. To cut the PWM noise, I usually add a low-pass RC filter and that works well. Current limiting the signal output and using Zeners also help in case you can't get rid of the noise source.

To clean up your signal, nothing beats hardware like logic or a Schmitt trigger. But I've also used the included comparator on many newer micros as a quick alternative. Not sure if the ST you're using has one of those and the pins are available.... there's never enough pins on a micro, isn't it?

Looking forward to video of your motor spinning.

JR


----------



## Automcdonough (Sep 1, 2010)

I'm of the opinion that the DC bus can have whatever ripple/spikes it wants, the micro and signals should be rolling with the punches. In my experience more than 50% of noise immunity comes from careful grounding. You have your signal and power grounds separated? Each sensor's power and ground should have it's own path back to the micro's inputs. Same with the gate drivers. We call it a "spider" connection. that should connect to the power ground at only one place, usually right on the FET source for sake of avoiding false turn-ons. Or IGBT equiv. The CAN/USB communication to outside the box will need some protection/cleanup. I'd prefer to totally isolate it to avoid any sort of ground loop. 

This makes it pretty much impossible for it to share the same current path as the power switches and bulk caps. That's like a freakin hazmat zone as far as the micro is concerned, 1000A surges flying around and stuff. 
If you groundplaned it then the best you can do is make sure the whole plane connects to the power at only 1 point..

I hope that helps!


----------



## jhuebner (Apr 30, 2010)

Well, its about time to report some news:

1. I implemented a simple slip control. The rotor speed is measured with a toothed wheel and the inverter tries to follow that speed. If the inverter has a higher frequency, the motor accelerates, if it runs at lower frequency the motor breaks. Works as expected, but the motor never came to a stand-still. I think there is still some EMI spikes that make it through the filter.

2. I tested the inverter with the newly arrived 18,5 kW motor. It runs smoothly, except at 40-50 Hz it jiggles about. At any higher or lower frequency it is smooth. If I accelerate too quickly, say from 30 to 70 Hz without a ramp, the bridge drivers switch off. Should be enough hardware protection for now.

3. Today I tested the inverter with a 3kW DC source and a 32 kW load resistor (3,5 Ohms). It gets fairly hot after a couple of minutes. Also one driver shut off, presumable due too over temperature. I'll add some fans to avoid hot spots.

The video should be ready soon!
Johannes


----------



## JRoque (Mar 9, 2010)

Hello Johannes. Between this and your open source project work it sure sounds like you're keeping busy.

Hey so what happens if the speed sensor goes out and stops working? Would that tell the controller speed = 0 and command higher current/speed? Hopefully the controller will shutdown if there's no signal from the sensor.

Is the sensor cable shielded? I wouldn't expect EMI issue at such low power (nearly stopped) and no load. Maybe your comparator is being too sensitive or needs a bit of padding. Perhaps you can filter at the switch side with a couple of caps to take up the transients. 

Could the vibration be self resonance at 50 hz? Lets hope some of the motor gurus jump in here.

A 32kW resistor! wow, never seen a monster like that. Is it a 3 phase load? Would love to see a pic of that thing or a video as you mentioned.

JR


----------



## etischer (Jun 16, 2008)

If you run your inverter in simple V/Hz mode (no speed feedback), do you get the stall at 40-50hz? 

Could it be your DC bus voltage is sagging and you don't have enough voltage to maintain your V/Hz ratio? Could your speed PID loop just be a bit unstable? 

To get the motor to come to a complete stop with simple slip control you can try implementing a DC injection brake. 




jhuebner said:


> Well, its about time to report some news:
> 
> 1. I implemented a simple slip control. The rotor speed is measured with a toothed wheel and the inverter tries to follow that speed. If the inverter has a higher frequency, the motor accelerates, if it runs at lower frequency the motor breaks. Works as expected, but the motor never came to a stand-still. I think there is still some EMI spikes that make it through the filter.
> 
> ...


----------



## jhuebner (Apr 30, 2010)

Hi!



JRoque said:


> Hello Johannes. Between this and your open source project work it sure sounds like you're keeping busy.
> 
> Hey so what happens if the speed sensor goes out and stops working? Would that tell the controller speed = 0 and command higher current/speed? Hopefully the controller will shutdown if there's no signal from the sensor.


Security stuff will have to wait ;-) Right now it would shut down the motor inherently, because 0 rpm is reported when the sensor connection fails.



JRoque said:


> Is the sensor cable shielded? I wouldn't expect EMI issue at such low power (nearly stopped) and no load. Maybe your comparator is being too sensitive or needs a bit of padding. Perhaps you can filter at the switch side with a couple of caps to take up the transients.


Well, thats some hints. I have added an RC-filter right before the micro. But the cable isn't shielded.



JRoque said:


> Could the vibration be self resonance at 50 hz? Lets hope some of the motor gurus jump in here.
> 
> A 32kW resistor! wow, never seen a monster like that. Is it a 3 phase load? Would love to see a pic of that thing or a video as you mentioned.
> 
> JR


Yep, the resistor is rather large. It has its own trolley and weighs 50kg. Its small though compared to the 1MW resistors used for some tests of the 900kW solar inverters.
Next test is scheduled for Friday next week (17th of June). I hope that I won't forget my camera this time. Maybe I can connect to the motor before that date and make a video of it spinning at 200 Hz.



etischer said:


> If you run your inverter in simple V/Hz mode (no speed feedback), do you get the stall at 40-50hz?
> 
> Could it be your DC bus voltage is sagging and you don't have enough voltage to maintain your V/Hz ratio? Could your speed PID loop just be a bit unstable?
> 
> To get the motor to come to a complete stop with simple slip control you can try implementing a DC injection brake.


Yes, the stall is at 40-50 Hz. The DC-voltage is way too low for this motor anyway. Should be 500V but I only have 120V available.
Also right now there is no speed PID loop. Especially with the new motor there isn't even any slip control because the shaft encoder needs to be rebuilt.
I'm simpy running at a fixed frequency with the amplitude controlled by V/Hz.

Cheers.
Johannes


----------



## jhuebner (Apr 30, 2010)

More news:

Heres a video: http://www.youtube.com/watch?v=PvUmBNgT1KQ

And some pics:








Fixed the capacitors and the adapter circuit board.









This is the 32 kW resistor. We did a 2nd test run last friday.
At 480V strange noises came from the unpowered inverter. Seems like some distances need to be enlarged to hold up to the desired 600V.

We then looked at the switching patterns:








Text book switching









Text book how-to-not-do-it switching

Around the 0-axis the switching looks really nasty. Besides that, it's beautiful. Anyone ever seen this? Hardware or software issue?

Cheers.
Johannes


----------



## steven4601 (Nov 11, 2010)

Awesome project!

My guess is false triggered gate signals. If you plot all 3 voltages you'll see the svmpattern for each phase flipping over. If it is synchronous to these weird short blips then you know where to start fault finding.


----------



## meanderingthemaze (Jan 25, 2010)

Does anyone know, can you write controller software to work on multiple hardwares? Or does it have to be written hardware specific. Or could it just need to be ported to a different set of hardware rather than rewritten ground up.


----------



## TigerNut (Dec 18, 2009)

meanderingthemaze said:


> Does anyone know, can you write controller software to work on multiple hardwares? Or does it have to be written hardware specific. Or could it just need to be ported to a different set of hardware rather than rewritten ground up.


On different controller families (and I mean microcontrollers, not a Soliton vs. a Zilla), the register interfaces to the timers and I/O ports are going to be different, so that the code would have to be customized at least at the hardware driver level. Above that, it depends on how much you apply the ethic of modular design and configurable code blocks. If the code was written without a view to separating hardware dependency from control algorithm functions, then it would be a ground up rewrite.


----------



## meanderingthemaze (Jan 25, 2010)

Well, I'm just hoping that some gracious programmers start up an "open source" controller software project so that we DIYers can ultimately make our own motors and controllers.


----------



## jhuebner (Apr 30, 2010)

steven4601 said:


> Awesome project!
> 
> My guess is false triggered gate signals. If you plot all 3 voltages you'll see the svmpattern for each phase flipping over. If it is synchronous to these weird short blips then you know where to start fault finding.


Thanks 
I hope it is that kind of a software problem. Even though the shallow slopes make it seem like something else. I'm actually on holiday now for 3 weeks, so investigations will continue then.



meanderingthemaze said:


> Does anyone know, can you write controller software to work on multiple hardwares? Or does it have to be written hardware specific. Or could it just need to be ported to a different set of hardware rather than rewritten ground up.


In a good software design you would just swap the hardware modules.
In the company I work for, the controllers are actually designed in Matlab and the controller model would work on any controller thats quick enough.

Cheers.
Johannes


----------



## jhuebner (Apr 30, 2010)

*Controller Rebuild*

Hi!

I've spent the last couple of days rebuilding my controller. I replaced the jerky wiring with small copper bus bars, well capable of 100A. It looks much cleaner already, even though I don't like the long way from the back of the module to the front.
I also had the back of the contactor PCB and the gate driver board covered with opaque paint.
A problem I spotted though is within the red circle: The gate signal of bottom IGBT of phase 1 runs really close to phase leg 1. The gate signal is a potential of +/-15V whereas the phase leg is between 0V and Vdc, which will get as high as 600V. I guess I should cut the trace and wire it or put a big blob of paint on it. What do you guys think?










I also got some film capacitors. They read 1100V and 420µF. I'm planning to install 2 of those in parallel. The old electrolytic capacitors got me up to 3400µF and I'm just hoping that 840µF will be enough. A 22kW inverter that I just bought has 1100µF

Cheers,
Johannes


----------



## Arlo (Dec 27, 2009)

This is pretty awesome. I would like to know more about it!


----------



## jhuebner (Apr 30, 2010)

Somehow my last post disappeared, so lets try again:










Overall view of the inverter










Terminal area










Capacitor board

Runs the motor smoother than before, not sure whether the jiggling at around 30Hz ist gone though. At least it got weaker


----------



## JRoque (Mar 9, 2010)

Hey Johannes, nice basket! And the controller's looking good too  I like those caps. Is that bracket just mechanical or is there (or can it be) any potential running through it? What's your target specs for the controller, if you plan to use it for your EV?

JR


----------



## jhuebner (Apr 30, 2010)

Thanks, love that basket, too 

Not sure about the controller specs. I mean I'm sure about the IGBT specs but not the systems capabilities, especially the heat sink.

IGBT-wise it should handle up to 850Vdc, 90A. So thats 76kW. According to semisel thats roughly 1,5 kW of losses. I'm pretty sure the heat sink is not gonna support that kind of power.

For now, the inverter will be run at 18,5 kW maximum (500Vdc, 39A). The bracket is mostly mechanical, it just connects to the "earth" screw of the caps.

Once the car is running I will experiment with liquid cooling.


----------



## bruceme (Dec 10, 2008)

*Re: Controller Rebuild*



jhuebner said:


> Hi!
> I also got some film capacitors. They read 1100V and 420µF. I'm planning to install 2 of those in parallel. The old electrolytic capacitors got me up to 3400µF and I'm just hoping that 840µF will be enough. A 22kW inverter that I just bought has 1100µF


This is what you bought right?

http://octopart.com/ffli6u0437k---avx-19659950

Ok, so I have a theory question... What is the equation for sizing the filter capacitors. I imagine there's a base equation which requires the system voltage, coil inductance and switching frequency. I just wonder what it is? Also there appears to be a great deal of trial and error to find the right size. 

Thanks,

-Bruce


----------



## bruceme (Dec 10, 2008)

I might have found my own answer...

http://www.newark.com/pdfs/techarticles/cornell/selectinvcap.pdf


----------



## jhuebner (Apr 30, 2010)

*Re: Controller Rebuild*



bruceme said:


> This is what you bought right?
> 
> http://octopart.com/ffli6u0437k---avx-19659950
> 
> ...


At least they look similar. Fortunately I didn't have to buy them, just noticed they're rather expensive.

To be honest I didn't do any calculation but looked at existing devices to get the order of magnitude right. Our 880kW solar inverters use 27 of them, so 11340µF. They run a PWM frequency of 3 kHz and maximum current is 1500A. I run at 8 kHz and maximum current will be 50A. I believe that capacity has to increase linearly with the current draw and decrease linearly with rising PWM frequency. So I need 50/1500 * 3/8 * 11340 = 141µF to obtain the same ripple current as one of our solar inverters. 840µF should put me on the safe side then.


----------



## bruceme (Dec 10, 2008)

So if I want 3x yours... 423uf. Ok, I get it.

-Bruce


----------



## jhuebner (Apr 30, 2010)

Some progress made. I have added DC link voltage measurement.
It works like this:

B+ ..3M ........... 10k .......... 1M .. B-
---|\/\/|-------|\/\/|-------|\/\/|----
...................| 100µF |
...................|---||--|
...................| to ADC|

So the ADC is decoupled from the high voltage with resistors. The rather large capacitor smoothes out the voltage. It's one hell of a low-pass but the bus voltage should only change slowly. Anyone see a problem with that arrangement?

The voltage is only used for contactor control. When a threshold is reached by means of precharge, the contactor closes.

I also found out the the SKHI22 drivers add 5µs dead time on each side of the pulse. That might explain some strange voltage jumps observed earlier.


----------



## DJBecker (Nov 3, 2010)

jhuebner said:


> So the ADC is decoupled from the high voltage with resistors. The rather large capacitor smoothes out the voltage. It's one hell of a low-pass but the bus voltage should only change slowly. Anyone see a problem with that arrangement?


This doesn't isolate the high voltage from the controller. And you are unlikely to measure what you expect. If your controller is nominally isolated, it will tell you which side of the traction circuit has the most leakage -- probably by saturating the input range and injecting current into the pin. Or it might just pick up capacitively coupled noise.

There are reasonable ways to measure voltages using optocouplers, especially if you aren't demanding about speed or precision. But with two or more voltages you find that using a SPI A/D converter and a Si84xx or ADUM isolator is easier to build.



jhuebner said:


> I also found out the the SKHI22 drivers add 5µs dead time on each side of the pulse. That might explain some strange voltage jumps observed earlier.


That's a really long dead-time, suitable for old, slow IGBT modules. You might want to increase your turn-off time to compensate. The increase in thermal load might be easier than trying to modify encapsulated gate driver modules.


----------



## jhuebner (Apr 30, 2010)

DJBecker said:


> This doesn't isolate the high voltage from the controller. And you are unlikely to measure what you expect. If your controller is nominally isolated, it will tell you which side of the traction circuit has the most leakage -- probably by saturating the input range and injecting current into the pin. Or it might just pick up capacitively coupled noise.
> 
> There are reasonable ways to measure voltages using optocouplers, especially if you aren't demanding about speed or precision. But with two or more voltages you find that using a SPI A/D converter and a Si84xx or ADUM isolator is easier to build.


It sort of makes sense what your saying. But:
a) it works, quite accuratly actually
b) A similar technique is used in the solar inverters that my company builds

So in principle this does work, the question is whether the way I do it is sane.
Only when theres a problem with isolation it does go wrong indeed. I connected GND with B- to try it out (effectively shorting the 1M res) which gave me a reading that was too low.




DJBecker said:


> That's a really long dead-time, suitable for old, slow IGBT modules. You might want to increase your turn-off time to compensate. The increase in thermal load might be easier than trying to modify encapsulated gate driver modules.


The SKHI22 (without "a" or "b") are rather old indeed and I was unable to find a data sheet for it. I guess at some point I will redesign and use SKHI22B or concept drivers.
I saw that the open source charger uses an inexpensive DIL IC that seems to do the job. Maybe those large drivers are plain overkill? They are 170€ each.


----------



## bjfreeman (Dec 7, 2011)

I follow similar design, I use a opto isolated gate driver with an Isolated voltage to make sure the IGBT has hard turn off and turn one. this board mount directly to the IGBT This keeps all low level circuits out of the High voltage loop. 
I use IGBT with low on resistance to minimize the heat dissipation.
for Cooling I started with Cold Plates but have developed a thin Aluminum sealed case with ports for fluid flow for all IGBT, at 3gpm into a transmission cooler.


----------



## DJBecker (Nov 3, 2010)

jhuebner said:


> It sort of makes sense what your saying. But:
> a) it works, quite accuratly actually
> b) A similar technique is used in the solar inverters that my company builds


Do you understand that you are making the traction system non-isolated? And that it's likely to return bogus values during operation because of capacitive coupling?



jhuebner said:


> I saw that the open source charger uses an inexpensive DIL IC that seems to do the job. Maybe those large drivers are plain overkill? They are 170€ each.


A typical IGBT gate driver module does much more than a TC4451 gate driver chip. The module has voltage isolation, desaturation detection, fault latching, overlap/deadband enforcement, undervoltage lockout, and often an isolated gate power supply.

To get similar functionality you would need a gate driver, optoisolator, a bi-polar DC-DC converter, and some design effort. Even then you are skipping desaturation and fault protection. And the undervoltage lock-out is probably ineffective.

We use a Si8233 chip and a uni-polar DC-DC converter, and are delighted with its performance, noise rejection and isolation. But we're using MOSFETs, which are easier to turn off than IGBTs. We don't need a negative voltage on the gate or deadband timing that varies with the current.


----------



## bjfreeman (Dec 7, 2011)

DJBecker said:


> A typical IGBT gate driver module does much more than a TC4451 gate driver chip. The module has voltage isolation, desaturation detection, fault latching, overlap/deadband enforcement, undervoltage lockout, and often an isolated gate power supply.


FOD3184 is even less functional than this.
this is made up by the DSP and is auto-correctable in code.


----------



## DJBecker (Nov 3, 2010)

bjfreeman said:


> FOD3184 is even less functional than this.
> this is made up by the DSP and is auto-correctable in code.


That's just a opto-isolated gate driver, not a gate driver module.

You can tell just by the price -- $1-$2, instead of $40-$200.

Putting the optoisolator in the same package as mediocre gate driver doesn't make it a module. 

Most gate driver module features can't be implemented with code. They require hardware. Every feature that could be done in software (undervoltage lockout, desaturation turn-off) requires enough hardware to sense that you might as well just the full feature directly in hardware.


----------



## bjfreeman (Dec 7, 2011)

DJBecker said:


> That's just a opto-isolated gate driver, not a gate driver module.
> 
> You can tell just by the price -- $1-$2, instead of $40-$200.
> 
> ...


I respect your view about hardware, it makes sense in some situations.
I grew up as a hardware person.
Now, I prefer to use software, maintainence and revision is much easier. though I admit the upfront cost and technology does effect the design cost till you have the volume to justify it.
fortunately I have other endeavors that the up front cost is absorbed.


----------



## DJBecker (Nov 3, 2010)

bjfreeman said:


> I respect your view about hardware, it makes sense in some situations.
> I grew up as a hardware person.
> Now, I prefer to use software, maintainence and revision is much easier. though I admit the upfront cost and technology does effect the design cost till you have the volume to justify it.
> fortunately I have other endeavors that the up front cost is absorbed.


I also much prefer software. But most of what a gate driver module does can't possibly be done in software. You can't implement an isolating DC-DC converter in software. A software model for current ramping doesn't do any good with an unexpected short -- you need something like desaturation detection for that.


----------



## bjfreeman (Dec 7, 2011)

DJBecker said:


> I also much prefer software. But most of what a gate driver module does can't possibly be done in software. You can't implement an isolating DC-DC converter in software. A software model for current ramping doesn't do any good with an unexpected short -- you need something like desaturation detection for that.


yes I agree I did not include other devices on the board that interacts with the IGBT. I don't like to use hardware that ties me to one source, so the less complicated the device package the better I feel. The Bill of materials an the cost of assembly is also considered.


----------



## jhuebner (Apr 30, 2010)

DJBecker said:


> Do you understand that you are making the traction system non-isolated? And that it's likely to return bogus values during operation because of capacitive coupling?


Yes I understand that the battery power is now connected to the logical supply voltage via a 1M or 3M resistor respectively. So the computer is no longer isolated from the power stage. What practical difference does this make? The battery pack is still isolated from the car chassis as far as I can see.
I checked the circuit diagram of the solar inverter today. The main difference is an operational amplifier for higher input impedance.
By capacitive coupling you mean that a stray capacitance might develop in parallel to the resistors and thus disturb my voltage sensing?



DJBecker said:


> A typical IGBT gate driver module does much more than a TC4451 gate driver chip. The module has voltage isolation, desaturation detection, fault latching, overlap/deadband enforcement, undervoltage lockout, and often an isolated gate power supply.
> 
> To get similar functionality you would need a gate driver, optoisolator, a bi-polar DC-DC converter, and some design effort. Even then you are skipping desaturation and fault protection. And the undervoltage lock-out is probably ineffective.
> 
> We use a Si8233 chip and a uni-polar DC-DC converter, and are delighted with its performance, noise rejection and isolation. But we're using MOSFETs, which are easier to turn off than IGBTs. We don't need a negative voltage on the gate or deadband timing that varies with the current.


I have to admit that desaturation detection has saved my module probably 50 times.
I understand that discretely building the gate drive circuit is more than just plugging in a decoupling device. But then you're saying that you're delighted with the performance of the Si8233. I saw a diagram with a second DC-DC converter that even provides negative voltage. So if the desaturation detection is easy to replicate it should be a sane alternative. Hardware deadband generation is completely redundant with a modern µC.



bjfreeman said:


> I follow similar design, I use a opto isolated gate driver with an Isolated voltage to make sure the IGBT has hard turn off and turn one. this board mount directly to the IGBT This keeps all low level circuits out of the High voltage loop.
> I use IGBT with low on resistance to minimize the heat dissipation.
> for Cooling I started with Cold Plates but have developed a thin Aluminum sealed case with ports for fluid flow for all IGBT, at 3gpm into a transmission cooler.


Do you have any more details an that case?



bjfreeman said:


> yes I agree I did not include other devices on the board that interacts with the IGBT. I don't like to use hardware that ties me to one source, so the less complicated the device package the better I feel. The Bill of materials an the cost of assembly is also considered.


For the solar inverters the gate drivers are implemented using FPGA. But those are Megawatt devices that use stuff like gate current control. FPGAs are definitly fast enough for gate drive logic, not sure about DSPs


----------



## bjfreeman (Dec 7, 2011)

jhuebner said:


> Do you have any more details an that case?


I will put it at the top of list to document and will put a link on here


> For the solar inverters the gate drivers are implemented using FPGA. But those are Megawatt devices that use stuff like gate current control. FPGAs are definitly fast enough for gate drive logic, not sure about DSPs


FPGA'a are definitely faster as well as specific in design compared to DSP56F803.
the question is the difference of an important? in other words, will the slower DSP cause catastrophic failure?
I can only say so far DSP has dealt with all conditions I have encountered.


----------



## jhuebner (Apr 30, 2010)

bjfreeman said:


> FPGA'a are definitely faster as well as specific in design compared to DSP56F803.
> the question is the difference of an important? in other words, will the slower DSP cause catastrophic failure?
> I can only say so far DSP has dealt with all conditions I have encountered.


Yes, it's important never to over-engineer stuff.
My desaturation detection is set to 10µs. I can see a DSP doing this.


----------



## jhuebner (Apr 30, 2010)

Ok, some good news, as mentioned here:

http://www.diyelectriccar.com/forums/showpost.php?p=278006&postcount=14

The inverter moved the car!
http://youtu.be/jCyK6MCE66o

It has a tendency to be jumpy e.g. when applying the brakes. Also when accelerating just lightly, desaturation protection kicks in.

Stuff I will try:

- digitally Filter analog inputs
- reduce pwm frequency from 8,8 to 4,4 khz
- Rethink the slip control algorithm
- Run the inverter in V/f mode to see if slip control is the problem


----------



## JRoque (Mar 9, 2010)

Nice, Johannes! 

Where is it shutting down? Breaker due to over current? Shoot-thru perhaps? How's your inputs look after your recent mods? Does it spin ok when lifted off the ground but trips under load?

IMHO, I think your frequency is fine. I can hear a bit of it on your video too. Unless you plan to vary the PWM freq with load/speed, you probably won't see much improvement by changing that. Or maybe you're just troubleshooting in which case, I'll shut up 8 - )

JR


----------



## jhuebner (Apr 30, 2010)

Yes when lifted off the ground it runs ok. The breaker has no trip function it's the desaturation detection.

Sorry it's late here, will add more this weekend


----------



## jhuebner (Apr 30, 2010)

As mentioned in my conversion thread, I have made some progress also with the inverter:

http://youtu.be/xkuDTby8pQw

I fixed the SVPWM routines. I had fed them through a simulation and it turned out that
a) 0V phase-to-phase voltage wasn't accomplished by running all three phases at 50/50 dutycycle but 0 dutycycle. That also meant that low sine amplitudes happened in the short-pulse range. Not good for accuracy and effiency.
b) There were some general flaws with the implementation that resulted in unclean waveforms.

I also placed a median filter between the slip controller and the rev counter as to minimize problems with induced spikes. It also compromises throttle response quite a bit. Will play with the available parameters like sample time and filter depth.

Apart from that I don't think my 90A IGBT module is up to the job. It shuts down on harder acceleration (which doesn't mean brutal) a bit to soon for my taste. But could also be down to the algorithm - the current rises linearly to the slip.


----------



## JRoque (Mar 9, 2010)

Congrats Johannes! Great progress from the last video where you were just moving back and forth in your driveway. 

Hmmm I didn't quite follow the 0V / phase issue you described. Do you mean the phases were fighting each other by being energized 50% at all times? Got any scope screenshots of the latest waves?

Did you get around to change the PWM frequency after all? Any plans to vary PWM base frequency with speed? Not sure that's even necessary other than to squeeze max torque and reduce switching noise.

As it stands, it's a great accomplishment that it runs the truck even if it's not finished yet so congratulations on getting this far.

JR


----------



## jhuebner (Apr 30, 2010)

JRoque said:


> Hmmm I didn't quite follow the 0V / phase issue you described. Do you mean the phases were fighting each other by being energized 50% at all times? Got any scope screenshots of the latest waves?


No fighting ;-) Its just that the way it was the IGBTs were operated with short pulses. My old-ass drivers insert 2,5µs deadtime before AND after each pulse. Thus, any pulse shorter than 5µs will simply not do anything at all.
So now, say you want 20% of your sine amplitude. You should accomplish that by varying your dutycycle from 40% to 60%. Instead I had used 0% to 20%.



JRoque said:


> Did you get around to change the PWM frequency after all? Any plans to vary PWM base frequency with speed? Not sure that's even necessary other than to squeeze max torque and reduce switching noise.


 Yeah, changed it to 4,4 kHz. I think it is better inspite of the huge dead time. Though it is rather noisy. Whats cool though is that it sounds exactly like the tram here in Kassel 
The frequency is fixed, advanced stuff might follow later on.



JRoque said:


> As it stands, it's a great accomplishment that it runs the truck even if it's not finished yet so congratulations on getting this far.


Thanks 

Even if it sounds cocky: 4 years ago I didn't even know what "3-phase current" meant. Now I'm running a car on it. It is quite a kick.


----------



## jhuebner (Apr 30, 2010)

So, yet another power stage.

Since me and others are supposed to be able to reproduce the inverter, I rebuilt in using legacy components:

3 half-bridge modules (Semikron 1200V, 400A)
6 A3120 gate drive opto couplers
6 DC/DC converters to supply switching power
3 custom gate driver PCB to hold the latter (basically Valerys design from the charger)

I decided that I don't need any of the advanced functionality of those expensive SKHI gate drivers:
- dead time: done by the STM32
- under voltage lockout: A3120 supports that
- desaturation detection: will be replaced by a hardware current limit, AC currents will be measured anyway
- Only 2.5A gate current: switching off is "slow", 1.5µs but I'm not aiming towards 98% efficiency

Further advantage of the A3120 is that it can be driven by a controller pin. with the SKHI drivers I needed a level shifter.

I also use a huge heat sink that is more level than the old one and should allow for easier case manufacturing. The motor and batteries are connected directly to the IGBT modules, no additional wiring inside the controller is done.

Ok, enough writing, heres some pics:


















I ran my 2hp test motor on it. Tried 16kHz, so smooth!

The bus bar is a 20x2mm alloy strip, couldn't be bothered to use copper for a shabby 30% better conductivity. It directly connects the bus caps, IGBT modules and snubber caps. Like said, the battery terminals are connected to it too.

The controller board is a small STM32H103 from Olimex. I now need to do the IO-stuff: temps, voltages, currents, rev counter, throttle, DC switch, .... Will design another PCB for that.


----------



## bruceme (Dec 10, 2008)

jhuebner said:


> Only 2.5A gate current: switching off is "slow", 1.5µs but I'm not aiming towards 98% efficiency


First off... !WOW! very cool. _I have controller envy_

So I purchase 3 Fuji 2MBI200N-060 200A / 600V IGBT half-bridge bricks. datasheet

I'd rather use something like this... IRS23364DSPBF - high speed power MOSFET and IGBT driver Because it's cheep and does have the lockouts, protections, and it is at MC voltages.

I now see two problems (please confirm)

- not opto-isolated
- not powerful at 350mA

Where do I figure gate current from the brick spec?

Thanks,

-Bruce


----------



## jhuebner (Apr 30, 2010)

bruceme said:


> First off... !WOW! very cool. _I have controller envy_


What a compliment 




bruceme said:


> So I purchase 3 Fuji 2MBI200N-060 200A / 600V IGBT half-bridge bricks. datasheet
> 
> I'd rather use something like this... IRS23364DSPBF - high speed power MOSFET and IGBT driver Because it's cheep and does have the lockouts, protections, and it is at MC voltages.
> 
> ...


I've used a similar device in my first controllers. At little power its ok not to isolate logic from power. At the kind of voltage and current we are talking about here it will probably result in problems, but give it try (or someone else elaborate on that).



bruceme said:


> Where do I figure gate current from the brick spec?
> 
> Thanks,
> 
> -Bruce


You could use the gate resistance plot on page 3. It ranges from 2.5 to 20Ohms. At 2.5Ohm you get a tr=80ns and tf=200ns. If you switch between 0 and 15V, the peak current is 15/2.5=6A
At 15Ohm you get tr=300ns and tf=200ns (still pretty good) and peak gate current is 15/15=1A.
With bipolar switching (-+15V) the peak current doubles.

350mA would result in a gate resistor of 15/0.35=43Ohm and is off the chart. So aim for the 1A range when selecting your driver.


----------



## mizlplix (May 1, 2011)

This is beyond my electronics know-how, but I'm watching....Go guys!
Miz


----------



## bruceme (Dec 10, 2008)

jhuebner said:


> What a compliment
> 
> 
> 
> ...


Great knowledge transfer here, totally get it. Il use the drive you are. Less trouble, but I better get the mp code right or big expensive smoke!


----------



## jhuebner (Apr 30, 2010)

bruceme said:


> Great knowledge transfer here, totally get it. Il use the drive you are. Less trouble, but I better get the mp code right or big expensive smoke!


Yeah, thats why I gradually built up power. Starting with BUZ50 MOSFETs (killed many) then IXYS 170A MOSFETs, then the 90A 3-phase brick with "I'll do it all for you" drivers, now the 400A bricks with "I'll do nothing for you" drivers.

BTW I'm running a customized (=experimental) version of the tumanako slip control code.


----------



## bruceme (Dec 10, 2008)

jhuebner said:


> Yeah, thats why I gradually built up power. Starting with BUZ50 MOSFETs (killed many) then IXYS 170A MOSFETs, then the 90A 3-phase brick with "I'll do it all for you" drivers, now the 400A bricks with "I'll do nothing for you" drivers.
> 
> BTW I'm running a customized (=experimental) version of the tumanako slip control code.


Is that controller code open source? Links?

I like that approach, I think I will do something similar myself, except, I'll probably start with a few dozen mosfets/drivers configured like the bricks.


----------



## jhuebner (Apr 30, 2010)

bruceme said:


> Is that controller code open source? Links?


Yes it is:
http://tumanako.svn.sourceforge.net/viewvc/tumanako/trunk/inverter/fw/motor_control/src/sine/
Browse the repo a bit, theres more elaborate versions of the code.

To download you can use the "Download GNU tarball" link or an svn client.


----------



## bruceme (Dec 10, 2008)

jhuebner said:


> Yes it is:
> http://tumanako.svn.sourceforge.net/viewvc/tumanako/trunk/inverter/fw/motor_control/src/sine/
> Browse the repo a bit, theres more elaborate versions of the code.
> 
> To download you can use the "Download GNU tarball" link or an svn client.


I found this link in one of the diagrams... I get the ideas, but man!


----------



## bjfreeman (Dec 7, 2011)

this is the ST library.
www.st.com/internet/com/SALES_AND_M...r_control_firmware_library_marketing_pres.pdf

then you add a DSP library for the STM32F4.


----------



## bruceme (Dec 10, 2008)

bjfreeman said:


> this is the ST library.
> www.st.com/internet/com/SALES_AND_M...r_control_firmware_library_marketing_pres.pdf
> 
> then you add a DSP library for the STM32F4.


Does this look like good intro hardware?
http://octopart.com/stm32f4discovery-stmicroelectronics-20382043


----------



## bjfreeman (Dec 7, 2011)

bruceme said:


> Does this look like good intro hardware?
> http://octopart.com/stm32f4discovery-stmicroelectronics-20382043


I order mine from mouser.
it comes with the header pins so you can make a mother board for it to plug into. dual row 25 pin on each side.
http://www.st.com/internet/evalboard/product/252419.jsp click on design support
My controller is using the Motorola/freescale 56f803
so I am porting and testing, at this point with the STM32F417IG click on the Resources.
I don't want to water down Jacks thread with my controller, so please msg me from the email link on my page.


----------



## Stiive (Nov 22, 2008)

Congratulations, and good to see this thread revitalised.


----------



## mihaicoli (Jul 3, 2011)

Does anyone used MC3PHAC in the controller? I mean the circuit is autonomous and can control pwm by muxing in the signal return...


----------



## chaz0507 (Aug 14, 2012)

Salty9 said:


> I am interested in your project but don't really know enough to be helpful. I will be following the thread. There is a real need for a reasonably priced AC controller. Keep it up.


There are places like Flight Systems Industrial Products in PA that offer remanufactured AC controllers, which are priced about 50% less than new.


----------



## jhuebner (Apr 30, 2010)

New hardware!

I finally pieced things together and built an all new base board for the AC controller. Here it is:









Features external:


8 digital inputs 12V: on, start, brake, motor protection switch, forward, reverse, emergency stop, bms
4 digital outputs, open collector: dc switch, error, over temperature, precharge
1 PWM output with the highest relative temperature signal: motor or heatsink
3 analog inputs: throttle, throttle redundance, motor temperature
1 pulse generator input
Features internal


4 analog inputs: current L1, current L2, DC link voltage, heatsink temperature
3 complementary PWM outputs for the bridge
Programmable hardware over current protection
2 UART pin headers: 1 for programming, 1 for console/communication
USB - yet unused
Hardware PWM inhibit logic. The PWM is interrupted by: over current, motor protection signal, emergency stop signal. The latter two are failsafe: they must be high for the PWM to work
Thats pretty much it, I tried to keep it as simple as possible. Heres the baby built in:










And here are some mistakes I made/lessons I learned:


 I twisted one of the pin headers for the olimex board. Had to cut all traces and rewire  I thought I'd triple-checked it because I was so afraid of it. Next time I'll quad-check
Due to a lack of space I skipped over voltage protection diodes. When I tested the digital inputs I applied 12V to the analog throttle input. BANG, controller dead
Also due to a lack of space I skipped OpAmps for the current measuring inputs. Now I realised that the ADC inputs have a nasty low impedance when sampling a pin. This will pose accuracy problems and it makes the over current protection a bit inaccurate, too
Some parts are a bit close together. Didn't spend much time on determining the correct foot print for every capacitor, pin header and so on


Things that work as expected:


PWM with Al cheapo gate drivers - I'm delighted with the performance
hardware PWM inhibit: cut any of the two digins and the motor stops immediatly.
hardware overcurrent protection: when set low it will detect a blocked motor shaft even on my 1.5kW test motor run at 60V (instead of 380V)
Cheap dc link voltage sensing: no galvanic isolation but high resistance (1M) to high voltage.
Temperature measurement: lookup table in software is very accurate
5V Current sensors: no negative supply voltage needed
I will conduct some more tests once the controller is in the car. But most circuits are already proven by the previous model so I'm optimistic.


As soon as I've made corrections I will post the circuit diagram. The software is still the largest question mark: as mentioned here (http://www.diyelectriccar.com/forums/showthread.php/vfd-foc-dtc-back-basics-76985.html) the control algorithm is quite crude but drives a car.


Besides that it might be time to offer a kit. Anyone interested?


----------



## toddshotrods (Feb 10, 2009)

jhuebner said:


> ...Besides that it might be time to offer a kit. Anyone interested?


I might be. What's the overall size, and what are the specs (volts, amps, etc)?


----------



## jhuebner (Apr 30, 2010)

toddshotrods said:


> I might be. What's the overall size, and what are the specs (volts, amps, etc)?


Size will be 355x210x275mm.

It uses 400A, 1200V IGBTs. I'd spec it at 800V, 300A maximum (240kW).

Theres no 600V version planned. It would only require using different bus caps and IGBT modules though.


----------



## aeroscott (Jan 5, 2008)

Yes , been flowing with much interest. Thanks for the good work.


----------



## Siwastaja (Aug 1, 2012)

I don't know if this has been posted before but I think this is a very good piece of information: 
http://www.scribd.com/doc/7342732/Dealing-With-IGBT-Modules-Semikron

It shows pretty well what to include in the small gate driver PCB and how to physically design and decouple the DC bus. Just get these right and you should be fine...

IGBT half-bridge modules are very easy to use and need a relatively low number of external components. AC controller is easier than many people think. Of course you can make it as complex as you want, but the basic case is simple, as shown in this thread very well.

We use ACNW3130 as gate drivers (similar if not the same as referred in this thread?); they cost something around $6 per piece and you need 6. It can supply 2 amps (with gate resistor about 10 ohms). With the gate capacitance of our 1200V150A IGBT bricks, this means 0.2 µs RC time - better multiply that by 5 to be sure; so this will limit the rise time by about 1 µs in our case. If high switching frequencies are desired at high power levels, a stronger driver might be necessary, but we will go with those, too. They are optoisolated and have under-voltage lock-out. Having a voltage range of 30V, I'm thinking about having +18/-10V drive. Yes they specify you can live with single-sided supply, but having a negative drive _will_ make switching off faster and more reliable.

You also should pay some attention to driving the LED of the optocoupler; it can fire off falsely from inductive coupling of the wiring. ACNW3130 datasheet specifies a certain way to connect the LED when driven from an open-drain output, but IMHO this is not needed with a typical CMOS push-pull output; but this should be kept in mind.


----------



## jhuebner (Apr 30, 2010)

Siwastaja said:


> I don't know if this has been posted before but I think this is a very good piece of information:
> http://www.scribd.com/doc/7342732/Dealing-With-IGBT-Modules-Semikron
> 
> It shows pretty well what to include in the small gate driver PCB and how to physically design and decouple the DC bus. Just get these right and you should be fine...


Well I got the gate drive right: installed right on the module with gate clamping (diode and resistor). The IGBT modules came with snubbers which I installed right at the terminal. I didn't put much effort into the DC busbar. The two poles don't overlap as they do in there drawings, they just run parallel over all 3 modules. Maybe a problem at high power?



Siwastaja said:


> IGBT half-bridge modules are very easy to use and need a relatively low number of external components. AC controller is easier than many people think. Of course you can make it as complex as you want, but the basic case is simple, as shown in this thread very well.


Hardware-wise I think its no harder than Valerys charger. Software might be a little harder, especially if you actually want to understand what you're doing.



Siwastaja said:


> We use ACNW3130 as gate drivers (similar if not the same as referred in this thread?); they cost something around $6 per piece and you need 6. It can supply 2 amps (with gate resistor about 10 ohms). With the gate capacitance of our 1200V150A IGBT bricks, this means 0.2 µs RC time - better multiply that by 5 to be sure; so this will limit the rise time by about 1 µs in our case. If high switching frequencies are desired at high power levels, a stronger driver might be necessary, but we will go with those, too. They are optoisolated and have under-voltage lock-out. Having a voltage range of 30V, I'm thinking about having +18/-10V drive. Yes they specify you can live with single-sided supply, but having a negative drive _will_ make switching off faster and more reliable.
> 
> You also should pay some attention to driving the LED of the optocoupler; it can fire off falsely from inductive coupling of the wiring. ACNW3130 datasheet specifies a certain way to connect the LED when driven from an open-drain output, but IMHO this is not needed with a typical CMOS push-pull output; but this should be kept in mind.


I use the A3120 as in the charger. I only found symmetric DC/DC converter modules and didn't feel like rolling my own.
The Optos are driven with a push-pull outputs, the cable is 20cm long, untwisted and unshielded. I hope that won't stop the show. Since only pulses longer than 1µs make it through all the delays I'm pretty confident it will be ok.


----------



## aeroscott (Jan 5, 2008)

Siwastaja, great link . Just finished it and saved it .


----------



## jhuebner (Apr 30, 2010)

My favority mechanic has gone to work again and built a house for the inverter. Is that sweeeeet or what?!



















I'm refactoring the firmware code to match the inner with the outer beauty.


----------



## Stiive (Nov 22, 2008)

Very nice. 
Are you gonna cut off the surplus heatsink?


----------



## jhuebner (Apr 30, 2010)

Stiive said:


> Very nice.
> Are you gonna cut off the surplus heatsink?


I could but it comes in handy to have the controller sit above the steering assembly.


----------



## Genius Pooh (Dec 23, 2011)

jhuebner said:


> My favority mechanic has gone to work again and built a house for the inverter. Is that sweeeeet or what?!
> 
> 
> 
> ...


 
OMG so cool!!! Wow.. 

I want to make good controller. for remy !!

Wow!!


----------



## z_power (Dec 17, 2011)

jhuebner said:


> My favority mechanic has gone to work again and built a house for the inverter. Is that sweeeeet or what?!
> 
> 
> 
> ...


using LiFePO4 as supporting brick: priceless


----------



## TigerNut (Dec 18, 2009)

jhuebner said:


> New hardware!
> ...
> Besides that it might be time to offer a kit. Anyone interested?


Interested... looking for something to drive my AC24LS.


----------



## jlcortex (Nov 29, 2012)

Congratulations, nice controller, i am willing to see it installed and working!



jhuebner said:


> New hardware!
> Besides that it might be time to offer a kit. Anyone interested?


I am interested!, i like your board with olimex development board
probably you are not interested in sell kits but i could be interested in only boards and list of components.

Do you run tumanako firmware with no modifications in your board?

I attach some pictures i am planning to build
jlcortex


----------



## jhuebner (Apr 30, 2010)

jlcortex said:


> Congratulations, nice controller, i am willing to see it installed and working!


Well, this it where it lives:



















jlcortex said:


> I am interested!, i like your board with olimex development board
> probably you are not interested in sell kits but i could be interested in only boards and list of components.


Well I guess I should just offer the PCB including components on the PCB and you have to get the heat sink and power components yourself. Complete kits might be a next step, will see.



jlcortex said:


> Do you run tumanako firmware with no modifications in your board?


I have heavily refactored the tumanako software and haven't gotten around to merging it to the svn.



jlcortex said:


> I attach some pictures i am planning to build
> jlcortex


Looks neat and very compact. Are you using concept drivers? The round things are the bus caps or just snubbers?

Heres a preliminary circuit diagram:
http://johanneshuebner.com/stuff/cb.png


----------



## jlcortex (Nov 29, 2012)

hehehehe!! renault R4, my grandfather have one of them about 20 years ago!

about your board, i send you a PM.

I was thought use a Semikron skyper from semikron or from a chinese company than build copies of semikron, infineon and concept drivers:

it is interesting, take a look:
http://www.qtjtec.com/en/products.asp

but finally i have bought a SEMIKRON SKiiP 232 GD120-313/04 MODULE with integrated drivers and current sensors, it is only 200A but it is cheap and seems easier to start


----------



## jhuebner (Apr 30, 2010)

jlcortex said:


> hehehehe!! renault R4, my grandfather have one of them about 20 years ago!


I love its simplicity. Theres a total of about ten cables in the engine compartment to run the temp dial, warning lights and the key switch.



jlcortex said:


> about your board, i send you a PM.


I'll get back to you when I've ordered a batch if the revised board.



jlcortex said:


> I was thought use a Semikron skyper from semikron or from a chinese company than build copies of semikron, infineon and concept drivers:
> 
> it is interesting, take a look:
> http://www.qtjtec.com/en/products.asp


What are the prices for the chinese drivers?



jlcortex said:


> but finally i have bought a SEMIKRON SKiiP 232 GD120-313/04 MODULE with integrated drivers and current sensors, it is only 200A but it is cheap and seems easier to start


Thats a really nice module. How much is it?
What bothers me a little is its need for 15V supply voltage and logic levels which you'd have to step up from the cars 12V battery.


----------



## jlcortex (Nov 29, 2012)

i have not prices but i have asked for it.
about SKiip $270 with shipping


----------



## jhuebner (Apr 30, 2010)

jlcortex said:


> i have not prices but i have asked for it.
> about SKiip $270 with shipping


new or used part? The gate drivers of my previous inverter alone cost that much.

Did some in car testing today. First I tested my new slip control. The throttle will set the slip between 0..X%, whereas part of the throttle is for braking and gives a slip from -Y..0%. At the same time the sine amplitude is varied from Z..100%, where 100% is the respective point on the FU diagram.

The slip controller itself is a PID controller but after some simulation I removed the I and D parts as they add nothing useful to the controller response.

Since the controller becomes unstable at low speeds it will output a fixed frequency when below R rpm.

So first I tested this with the motor idling. It spins up nicely whereas the first 50% of the throttle don't do much. Will have to play with the parameters or maybe introduce an exponential pedal map instead of a linear one. But then I was only testing with 80V instead of 500 so maybe it will behave different when more power is at hand.

Next test was letting the car drive up a step (as in sidewalk) to see the 0rpm capabilities. It actually climbed the step nicely after playing with the parameters a bit. Doing the test I unwillingly tested the over current protection (set to 100A). Seems to work 

Only error I found is that the motor temperature isn't displayed. The voltage output of the sensor looked ok but apparently the ADC didn't pick it up.

No video of today because it would have probably been boring.


----------



## jhuebner (Apr 30, 2010)

Question: on the new board I'm planning to make the digital inputs active low. That means: floating = 0, connected to GND = 1.
It removes the need for a 12->3.3V voltage divider and eases the wiring in most cases as GND can be found on the cars chassis. Personally I'll have a problem with the ignition switch and the brake pedal which are both active high. I'll either need to invert them with a transistor.

Besides that, can anyone spot a problem with low active inputs?


----------



## jhuebner (Apr 30, 2010)

Just calculated parts cost when ordering for 10 inverters including German VAT (19%): *1050€/1360$*

This is how it adds up:


 Heat sink, case: *130€/$170*
 Power electronics (IGBT modules 200A, snubbers, main film caps): *690€/$890*
 Electronics (PCBs, parts): *170€/$220*
 Connectors, screws etc.: *60€/$80*
 
So the most potential for saving money is buying used power electronics. Especially those film caps are really expensive ($218 each!), this is where a 400V version (using elcaps) would be significantly cheaper. Thank god I got that stuff for free


----------



## jhuebner (Apr 30, 2010)

Maybe time for an inverter update.

I has a new home:









The software is in good condition now, very modular and with an extremely well working slip control. I wouldn't mind calling it a "production version".

What is lacking is some logic to cut power when the BMS signals a cell went out of range and logic to cut power when the heatsink or motor overheats. Or at least put on the warning light.
I could also imagine a DC voltage window to cut power on regen at overvoltage or on acceleration at undervoltage.

Concerning the kit issue:
I have 10 more sets of PCBs here but simply didn't get around to ordering the parts and setting up the logistics to actually be able to ship kits. There are some design changes so I would like to test one before shipping it.


----------



## valerun (Nov 12, 2010)

Johannes - great to hear about your progress! Would be very interested in resuming our discussion. ..


----------



## Hollie Maea (Dec 9, 2009)

jhuebner said:


> Maybe time for an inverter update.
> 
> I has a new home:
> 
> ...


Johannes,

I'm close to having enough money to start working on my car again, and I might be interested buying a partial kit from you. Probably will buy a powerstage separately. Going for a bit higher power


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> Maybe time for an inverter update.
> 
> I has a new home:
> 
> ...


Hum.. Very familiar... Did you had to use a motor with the same color as mine too? Haha 

Nice setup. I am working on something similar. Slip control. But I am having an issue with the voltage. 
What do you use for encoder feedback?

So far I have modified a controller to work with slip control, but it uses the same V/Hz profile. What I want to do is change this.. In fact, keeping the slip constant and increasing voltage does increase torque, but in a much more efficient way. However if the voltage is too high, like when using torque boost its quite nice for acceleration, but the motor will drain excessive power at part load with a very low poor power factor.

I am curious to know what you did to tackle this issue


----------



## PStechPaul (May 1, 2012)

An idea I had was to measure the DC link bus and DC current to determine the actual power consumption, and then assume that torque is proportional to the current drawn by the motor (which can be obtained at various combinations of voltage and frequency, within a certain range of slip that avoids breakdown torque). You should be able to find a "sweet spot" where you get the torque you need for the least power in. This maximizes efficiency and minimizes reactive current which results in low power factor. The output power can be estimated from the shaft RPM and the torque (which is indirectly measured by the current). 

The problem with using current to measure torque is that the reactive current does not contribute to power and thus should be subtracted from the total current. That should be something that can be derived from the phase angle of the current with respect to voltage applied, which of course is a vector operation, and perhaps just another way to express the space vector control algorithm.

So you might be able to tweak the applied voltage and frequency (or slip), and see if the power factor improves. Eventually (within a few cycles) the optimum combination should be obtained for the given set of conditions, but in an EV they can change quickly. However, this tweaking is mostly advantageous under constant load conditions where efficiency is more critical. You can jump into a more responsive algorithm when maximum performance is required even at the cost of lower efficiency.


----------



## Siwastaja (Aug 1, 2012)

cts_casemod said:


> In fact, keeping the slip constant and increasing voltage does increase torque, but in a much more efficient way. However if the voltage is too high, like when using torque boost its quite nice for acceleration, but the motor will drain excessive power at part load with a very low poor power factor.


It shouldn't be. Have you measured this? Keeping optimum slip and increasing voltage should generate torque with all the current. Power factor gets only poor when you have a combination of having voltage but not producing torque -- which only happens with low slip.

Automotive traction is easy because you don't need separate concepts for physical load and torque command; you always generate your physical load instantly by instructing torque, as there always is a large mass to accelerate.


----------



## jhuebner (Apr 30, 2010)

cts_casemod said:


> Hum.. Very familiar... Did you had to use a motor with the same color as mine too? Haha
> 
> Nice setup. I am working on something similar. Slip control. But I am having an issue with the voltage.
> What do you use for encoder feedback?


This should give you the idea:








The shaft coupler also has the pulse encoder function.



cts_casemod said:


> So far I have modified a controller to work with slip control, but it uses the same V/Hz profile. What I want to do is change this.. In fact, keeping the slip constant and increasing voltage does increase torque, but in a much more efficient way. However if the voltage is too high, like when using torque boost its quite nice for acceleration, but the motor will drain excessive power at part load with a very low poor power factor.
> 
> I am curious to know what you did to tackle this issue


I use a regular V/Hz profile scaled by the throttle input.



Siwastaja said:


> It shouldn't be. Have you measured this? Keeping optimum slip and increasing voltage should generate torque with all the current. Power factor gets only poor when you have a combination of having voltage but not producing torque -- which only happens with low slip.
> 
> Automotive traction is easy because you don't need separate concepts for physical load and torque command; you always generate your physical load instantly by instructing torque, as there always is a large mass to accelerate.


Yeah, thats what I found. What I have repeatedly read about is saturation. So at some point your extra current won't be producing a useful magnetic field but unuseful heat. I have no idea when that happens though.



PStechPaul said:


> An idea I had was to measure the DC link bus and DC current to determine the actual power consumption, and then assume that torque is proportional to the current drawn by the motor (which can be obtained at various combinations of voltage and frequency, within a certain range of slip that avoids breakdown torque). You should be able to find a "sweet spot" where you get the torque you need for the least power in. This maximizes efficiency and minimizes reactive current which results in low power factor. The output power can be estimated from the shaft RPM and the torque (which is indirectly measured by the current).
> 
> The problem with using current to measure torque is that the reactive current does not contribute to power and thus should be subtracted from the total current. That should be something that can be derived from the phase angle of the current with respect to voltage applied, which of course is a vector operation, and perhaps just another way to express the space vector control algorithm.
> 
> So you might be able to tweak the applied voltage and frequency (or slip), and see if the power factor improves. Eventually (within a few cycles) the optimum combination should be obtained for the given set of conditions, but in an EV they can change quickly. However, this tweaking is mostly advantageous under constant load conditions where efficiency is more critical. You can jump into a more responsive algorithm when maximum performance is required even at the cost of lower efficiency.


As the software is open source, you may try it out


----------



## jhuebner (Apr 30, 2010)

I found that I might have oversized my caps quite a bit.
http://www.ecicaps.com/pdf/whitepapers/IEMDC_2009_11310_Final_Rev_4.pdf

By this paper I calculated the actual capacity need for a voltage ripple of 1%. I then end up at around 300µF.
Caps like that cost around 80$ at digikey, bringing down the price significantly.

The reason why capacities are so large when elcaps are used is the ripple current capability. For example a typical inverter elcap @1200µF has a ripple current capability of 6-7Arms. But the ripple current in my case is more like 40Arms. So I'd need around 7200µF of elcaps.
Film caps have a much larger ripple current capability and thus can be sized by the voltage ripple requirement.


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> I found that I might have oversized my caps quite a bit.
> http://www.ecicaps.com/pdf/whitepapers/IEMDC_2009_11310_Final_Rev_4.pdf
> 
> By this paper I calculated the actual capacity need for a voltage ripple of 1%. I then end up at around 300µF.
> ...


I used 6x47uF 900V on my new inverter. Each is rated for a ripple current of 100Amps. Before I was using 4700uF*6 which was just a bit over the required capacity to operate 60HP @ 5KHz @ 320V.

With the increase to 440V either I would have to get some 500V ones, which is both expensive and risky on high temperatures, or I would have required about 10 of these for operation up to 100HP, in series (Rated for 800V)

But it is difficult to find info on this subject. Most literature refers to rectifier input which goes all the way down to zero. Also, it is important to refer to the impedance of a lithium battery. On my case my pack has 6mOhm + Cable losses. A good electrolytic has at least 20-30Mohms, so not only paralleling them is required to handle the ripple current but also, because an electric current travels trough the path with less impedance, which in this case would certainly be the battery and not the capacitor.


----------



## valerun (Nov 12, 2010)

film caps are the way to go. That, plus a laminated copper bus. We use PowerRing caps (datasheet attached). Rated Ripple current 500A continuous for a 1,000uF 600V device.


----------



## PStechPaul (May 1, 2012)

That's a very impressive capacitor. How much does something like that cost? I could not find any pricing on their website:
http://www.sbelectronics.com/

I found similar capacitors at Digikey, such as this 380 uF 400V, for $88:
http://www.digikey.com/product-detail/en/C4DEFPQ6380A8TK/399-5957-ND/2704611

Here are the specs:
http://www.kemet.com/kemet/web/homepage/kechome.nsf/file/C4DE%20Series/$file/F3303_C4DE.pdf

Rather impressive also with 100A RMS at 10kHz, 5700A peak, 810 uOhms ESR and 40 nH ESL. This compares to the Power-Ring device 1000uF 600V with 125 uOhms and 5 nH. 

How do you determine the size of capacitor needed? One way might be to determine the energy storage requirement based on the switching frequency and allowed ripple. Assume 400 VDC and 100 amperes with an allowable ripple of 5% or 20 volts, and 10 kHz. The energy is 400*100*100uSec or 4 W-sec. Since E=0.5*C*V^2, C=50 uF. But since we need 380V minimum, the energy difference between the two voltages needs to be used. Thus, we can use dV = I * dt/C, which results in 500 uF.

It may be useful also to consider the size of an inductor that would perform similarly. E=0.5*L*I^2, so 4 Joules at 100A would be 800 uH, and for 5% ripple it would be 8 mH. A 100uH 10A inductor is about $3 and to get 800 uH at 100A would take 800 pieces so the capacitor seems to be the clear winner.

There may be better ways to do this, and my calculations might not be correct, but they seem reasonable, at least for the capacitor. 

I just found the reference posted previously for sizing the capacitors, and the formula is:

C = V / (32*L*dV*f^2)

Using their example with L=100uH, the capacitor for 5% ripple would be 400/(32*100*20*10^2) = 62.5 uF. But obviously the inductance affects the result significantly, and with 10 uH the capacitor would be 625 uF. The motor would be the load inductance, and that might be estimated from the voltage, current, and PF. So a 240 VAC 10 kW motor might have a 0.8 PF which would have 41.6A resistive and 8A reactive at 60Hz so X(L) = (240*0.2)/(41.6+8) = 0.96 ohms and L = 0.96/(2*PI*60) = 2.5 mH. These are very rough calculations and I'm not sure they apply directly to a three phase induction motor inverter. The example seems to be for a DC motor.


----------



## jhuebner (Apr 30, 2010)

PStechPaul said:


> C = V / (32*L*dV*f^2)
> 
> Using their example with L=100uH, the capacitor for 5% ripple would be 400/(32*100*20*10^2) = 62.5 uF. But obviously the inductance affects the result significantly, and with 10 uH the capacitor would be 625 uF. The motor would be the load inductance, and that might be estimated from the voltage, current, and PF. So a 240 VAC 10 kW motor might have a 0.8 PF which would have 41.6A resistive and 8A reactive at 60Hz so X(L) = (240*0.2)/(41.6+8) = 0.96 ohms and L = 0.96/(2*PI*60) = 2.5 mH. These are very rough calculations and I'm not sure they apply directly to a three phase induction motor inverter. The example seems to be for a DC motor.


Yes, I calculated a similar inductance for my AC motor. I still haven't quite understood why the ripple current is independend from the actual AC load current. Any idea?

Here in Germany I'm running into troubles with the home brew inverter. It has to meet EMC regualations. Which seems ok. What isn't, is the price for getting the certificate: around 10000-20000 bucks. Clearly favors big car makers.


----------



## valerun (Nov 12, 2010)

jhuebner said:


> Yes, I calculated a similar inductance for my AC motor. I still haven't quite understood why the ripple current is independend from the actual AC load current. Any idea?
> 
> Here in Germany I'm running into troubles with the home brew inverter. It has to meet EMC regualations. Which seems ok. What isn't, is the price for getting the certificate: around 10000-20000 bucks. Clearly favors big car makers.


do you have to get certified in order to sell a kit? I don't think so, no?

Anyway, PowerRing I referenced can be had for ~$200 in volume now, I think. We sell them in our store, too - $249 in single quantities. The main advantage is a natural mating to a laminated copper bus and resulting extremely low inductance. With something like a Kemet cap Paul mentioned, you still need snubber caps on IGBTs (40nH will kick you up over 100V on an IGBT's collector at 500A being switched in 250ns - pretty typical rates - that's in addition to ~50V you are getting from irreducible internal IGBT inductance so things do add up).


----------



## jhuebner (Apr 30, 2010)

valerun said:


> do you have to get certified in order to sell a kit? I don't think so, no?
> 
> Anyway, PowerRing I referenced can be had for ~$200 in volume now, I think. We sell them in our store, too - $249 in single quantities. The main advantage is a natural mating to a laminated copper bus and resulting extremely low inductance. With something like a Kemet cap Paul mentioned, you still need snubber caps on IGBTs (40nH will kick you up over 100V on an IGBT's collector at 500A being switched in 250ns - pretty typical rates - that's in addition to ~50V you are getting from irreducible internal IGBT inductance so things do add up).


No worries, the f..n certificate is only needed for Germany.

That ring cap is good price for value. Each of the round ones I use is that much.
For lower power application I'd consider a smaller 320µF film cap and a less sophisticated bus bar.


----------



## jhuebner (Apr 30, 2010)

Ok guys, I am finally ready to ship kits. These include:

- PCBs:



















and all the parts needed to populate them.

The result looks like this:



















Minor design glitch on that one: the foot prints for the current sensors are mirrored so I shifted all the parts except the opamp from top to bottom.










So to build a complete 3-phase inverter you'll need:


IGBTs (400A, 1200V or less depending on your requirements)
DC bus (I use simple aluminum strips from the hardware store)
DC bus caps (like the ring cap mentioned above)
Snubber caps (about 1µF film cap)
Heat sink and case
waterproof cable bushing for power cables
waterproof connector for control signals
Mounting material for fixing the PCBs to the case (screws, angles)
Some more information on pricing and build instructions can be found here:
http://johanneshuebner.com/quickcms/index.html?en_inverter-kits,10.html

I'm short on current sensors right now, all other parts are "on stock". As soon as some orders come in I will restock.


----------



## cts_casemod (Aug 23, 2012)

Nice work. Without going trough the whole topic again (Ive read it a few months ago) what exactly do you claim with your inverter? Is is open loop or closed loop?

I might be interested in those gate drivers for a bunch of 200Amp IGBTs I have for some other projects. Do they have VCE SAT protection?

Regards


----------



## tylerwatts (Feb 9, 2012)

Hi Johannes 
What power capabilities might be achieved with your kits please? What is required to program the control boards? I'm not too experienced with electronics so need something simple I can handle with guidance. 
Thanks


----------



## jhuebner (Apr 30, 2010)

cts_casemod said:


> Nice work. Without going trough the whole topic again (Ive read it a few months ago) what exactly do you claim with your inverter? Is is open loop or closed loop?
> 
> I might be interested in those gate drivers for a bunch of 200Amp IGBTs I have for some other projects. Do they have VCE SAT protection?
> 
> Regards


a) its open source, schematics and software are freely available
b) its probably as simple as it gets
c) It runs an ACIM in closed loop slip control
I am successfully using it in my VW Polo with 1200V/400A IGBTs
The drivers do not have any intelligence. The control board has fast (15µs) hardware overcurrent protection so I skipped VCE SAT.
Even during hard testing while I broke a shaft coupler due to programming errors I did not break any IGBTs thanks to the overcurrent protection.



tylerwatts said:


> Hi Johannes
> What power capabilities might be achieved with your kits please? What is required to program the control boards? I'm not too experienced with electronics so need something simple I can handle with guidance.
> Thanks


As mentioned above I use 1200V/400A IGBTs. You could run them at around 800V or maybe 850V with a good bus bar allowing power levels of.. well 800*400/sqrt(2) = 227kW.
The control board is configured through a text terminal (e.g. hyperterminal). Software update happens with a small C-program or perl script using the same serial port.
I attached a ZigBee module to the serial port so now I can update the software and configure the board without any wires. Might work with Bluetooth as well.


----------



## tylerwatts (Feb 9, 2012)

Forgive my simple questions, but how does this half bridge controller differ from the ipm circuit on your website? Is the operation and software common? Are there benefits of one over the other? 
I note here CTS uses 3 IGBTs so take it this is the stronger solution. My fear is my inexperience leads me to build a potentially 200kw fire cracker! And I shudder at the thought I might be earthing said fireworks when they go off!


----------



## jhuebner (Apr 30, 2010)

tylerwatts said:


> Forgive my simple questions, but how does this half bridge controller differ from the ipm circuit on your website? Is the operation and software common? Are there benefits of one over the other?
> I note here CTS uses 3 IGBTs so take it this is the stronger solution. My fear is my inexperience leads me to build a potentially 200kw fire cracker! And I shudder at the thought I might be earthing said fireworks when they go off!


The half bridge version comes with gate drivers, the IPM version comes w/o as they are built into the IPM.
IPMs are slick parts, as they combine a lot of things in one module.
As a downside I found them harder to find then ordinary half bridge modules. Thats why I didn't want to rely on them.

On the experience issue: I started in 2008 with 0 experience in inverter and power electronics. But I started out small, the first things that exploded were $1 BUZ11 MOSFETs. Thats a small firecracker.
You can use the kit with such small MOSFETs as well and then scale up once you get more confident.
I wouldn't recommend that you start out with hardcore currents and voltages if you don't know what you're doing.


----------



## cts_casemod (Aug 23, 2012)

tylerwatts said:


> Forgive my simple questions, but how does this half bridge controller differ from the ipm circuit on your website? Is the operation and software common? Are there benefits of one over the other?
> I note here CTS uses 3 IGBTs so take it this is the stronger solution. My fear is my inexperience leads me to build a potentially 200kw fire cracker! And I shudder at the thought I might be earthing said fireworks when they go off!


Tylerwatts, IPMs are way to expensive. I was using them in first revs of my conversion, but once I was ready to jump to voltages above 400V and hence required 1200V devices the price was sky high. Individual models can be had for much cheaper, so if you have your own driver and controller i wouldn't look further.

People use IPMs on a variety of conversions because if correctly interfaced to a VFD they make a conversion to high peak level pretty easy and are virtually indestructible. You need to upgrade the individual power supplies (4) and change any current metering devices to your new power levels and thats pretty much all there is to do. Control logic remains the same and you don't have issues with the driver not fully matching your particular IGBT. Sure you can do that with individual IGBTs but is a lot more work as you can see on my conversion, thus requiring some knowledge on how this things work.

I must say, for 320V 200Amps is a decent power level, if you increase to 400V you have 80BHP available. 400Amps is a massive amount. On my conversion I am using 100Amps limited by the motor and it drives nicely as your everyday vehicle if you don't want to be doing any drift races. So you have to ask yourself what do you plan to do and what kind of car you have (I have a Polo)

But yes, as you point, there is a limit to how much power you can safely handle. Although the IGBTs can handle 800V tests revealed to much of an issue in case something wrong was to happen. Its hard and expensive to find cable and fuses rated for DC voltages. As an example a good quality 690V AC contactor can only handle 440VDC and this is assuming both poles (+ and -) are used, otherwise the limit is 220VDC. Specialty fuses and contactors use a sealed contact with some inert gas inside. Know your limits and you'll be fine.


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> a) its open source, schematics and software are freely available
> b) its probably as simple as it gets
> c) It runs an ACIM in closed loop slip control
> I am successfully using it in my VW Polo with 1200V/400A IGBTs
> ...


Nice work. 
Not sure i fully agree with the software current limit, but assuming all connections are well done and you don't have a dead short, that should be alright.

Thats actually cool. I don't plan to do a car inverter, but I was looking for some assembled hardware for some other projects of mine like the A/C or some cheap the gate drivers for the sine wave inverter so sure this can save me a lot of time.

How much are you thinking in selling the PCB's? Also are the gate drivers parts of the main PCB or separate like on the first revs? 
How do you measure DC-Link Voltage?
What do you use for speed input (for slip control)?

Regards


----------



## jhuebner (Apr 30, 2010)

cts_casemod said:


> Nice work.
> Not sure i fully agree with the software current limit, but assuming all connections are well done and you don't have a dead short, that should be alright.
> 
> Thats actually cool. I don't plan to do a car inverter, but I was looking for some assembled hardware for some other projects of mine like the A/C or some cheap the gate drivers for the sine wave inverter so sure this can save me a lot of time.
> ...


Thanks 
Who talks about software current limit? It is a hardware comparator that directly controls the gate signals. When it trips, all gate signals are shut off. The 15µs are the time constant of the low pass filter, so the higher the overcurrent, the faster the reaction.

By the PCBs you mean PCBs only? Haven't calculated that option but I surely can if you're interested. The gate drivers are seperate PCBs.

The sensor board that I supply measures the DC link voltage resistively with 4 1M resistors. How dare I do that?
a) The German norms dictate an isolation resistance of 500Ohm/V on each pole, so for 500V that is 250kOhms. Thus measuring with a couple of MOhms stays under that limit
b) Any capacitive coupling that "shorts" those resistors only shorts the AC components being the PWM ripple. Therefor the reading is dead stable even though motor and inverter share a common ground
c) The company that I used to work for (world market leader for solar inverters) does it too (recursive argument )
d) It costs nothing compared to an actual galvanically isolated measurement

For measuring the speed I use an infrared light barrier that is interrupt by 60 teeth on the shaft coupler. But you can use anything that supplies an open collector pulse signal. Siwastaja seems to do fine with 8 pulses, so 60 is rather luxurios.
The current software cannot handle pulse rates faster than the PWM frequency (8.8kHz) so it shouldn't be too many.
One downside is the lack of a direction signal, but I think theres other ways to determine that. With the current software you shouldn't roll backwards while in forward gear.

Here are some pictures:


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> For measuring the speed I use an infrared light barrier that is interrupt by 60 teeth on the shaft coupler. But you can use anything that supplies an open collector pulse signal. Siwastaja seems to do fine with 8 pulses, so 60 is rather luxurios.


Oh... yes! I remember who you are now! All this time I though you were using the Tumanako "KiwiAC" controller. Guess I got confused 



jhuebner said:


> Who talks about software current limit? It is a hardware comparator that directly controls the gate signals. When it trips, all gate signals are shut off. The 15µs are the time constant of the low pass filter, so the higher the overcurrent, the faster the reaction.


Good choice, using a comparator, I thought you were using a loop to read the current sensors, which obviously takes valuable time.



jhuebner said:


> By the PCBs you mean PCBs only? Haven't calculated that option but I surely can if you're interested. The gate drivers are seperate PCBs.


Likely. I will use different power levels, so have to change a few things. Also different current sensors.



jhuebner said:


> The sensor board that I supply measures the DC link voltage resistively with 4 1M resistors.


Same as i did with the MC3PHAC controller board on last rev, although on last tests I successfully used a voltage to pulse converter to read with an optocoupler. I was having a few issues with the ground paths due to capacitive coupling, so I decided to fully isolate the HV GND. Only £2 worth of components.


----------



## jhuebner (Apr 30, 2010)

cts_casemod said:


> Oh... yes! I remember who you are now! All this time I though you were using the Tumanako "KiwiAC" controller. Guess I got confused


Well I did submit some code to tumanako but the hardware is different. Maybe thats how you got confused.



cts_casemod said:


> Likely. I will use different power levels, so have to change a few things. Also different current sensors.


By "different" you mean more or less? Because I'm afraid with an 8-DIP footprint you won't find any stronger gate drivers than the ones I use. Adding additional transistors might be the only option.




cts_casemod said:


> Same as i did with the MC3PHAC controller board on last rev, although on last tests I successfully used a voltage to pulse converter to read with an optocoupler. I was having a few issues with the ground paths due to capacitive coupling, so I decided to fully isolate the HV GND. Only £2 worth of components.


Thats cool. Keen to share that?
Still I'm surprised you had issues. What exactly were you doing?


----------



## PStechPaul (May 1, 2012)

I think there could be a problem with the DC voltage measurement circuit (IC1A). This uses two 1 Meg resistors and a 50k resistor to get a signal of 5V per 100V at the input. This may be OK if there is no leakage to ground on the battery pack. But even 100 Megohms can cause an error of 1%. That's why a differential amplifier is much better, and it only requires one more 50k resistor.


----------



## tylerwatts (Feb 9, 2012)

You guys speak a different language to me! I'll try understand it but I like the prospect of your product. And I take great heed in CTS's advice and respect his opinion on your designs. I've got a motorcycle conversion in mind, and also want to hybrid my SUV to run EV in town and open up the ice on the highway.


----------



## tylerwatts (Feb 9, 2012)

One thing I would like to ask please, would this arrangement drive an induction motor to 12000rpm? 
Also, would it run a permanent magnet motor? I realise this is software based so I assume the hardware is fine and some reprogramming might be required. Is this right? 
Thanks


----------



## cts_casemod (Aug 23, 2012)

tylerwatts said:


> One thing I would like to ask please, would this arrangement drive an induction motor to 12000rpm?
> Also, would it run a permanent magnet motor? I realise this is software based so I assume the hardware is fine and some reprogramming might be required. Is this right?
> Thanks


Tylerwatts,

Why on earth would you want to rev an induction motor at 12KRPM!? Induction can reach such speeds but we are talking about a customized motor with special rotor. If this is for your bike use a PMDC instead.

I think a good starting point to you would be a car alternator. You can take about 10KW out of one at say 10.000RPM and 96V. They are usually geared at 3/1 so a typical alternator is safe to spin at up to 15-18KRPM and they are... CHEAP , unlike a dedicated PMDC that can cost you a few hundred £'sssss!

And yes, the control is just like a PMDC, so you can find lots of info on the web on how to control one. I don't think this controller is the best choice for it, since you need 3 sensors, an absolute encoder, or some special tooth gear with a missing tooth for initial calibration, either method would require extensive modification, but you can use things like the gate drivers, the same IGBTs, etc and interface them with a cheap e-bike brushless controller that you can have for like £20.

Since the power electronics are the same, is a good start point since there are lower voltages involved and it is very unlikely that you'll be able to burn your IGBTs, but by the time you complete this you will be more than ready to do a full car conversion


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> By "different" you mean more or less? Because I'm afraid with an 8-DIP footprint you won't find any stronger gate drivers than the ones I use. Adding additional transistors might be the only option.


I mean less. For applications up to 10KW. The gate drivers should be the same, regardless.



jhuebner said:


> Thats cool. Keen to share that?


I don't have a schematic since I build my prototypes on demand. By the time I need another one I usually come up with something better or with additional features.

Basically it works as every digital opto-isolated stuff . 

You read the analog voltage corresponding to the input and you assign a minimum and maximum frequency. Say if your voltage is 2V your pulse rate is 1KHz and for a maximum voltage of 5V your pulse rate is 2KHz. You can use a cheap micro with an ADC or a LM2907/17. Here, on the high side, you have a real GND path so errors should be minimized when making the readings.

On the output, again, you can use an ICL2907/17 calibrated to respond to your frequency and get your analog voltage back to source to your master for reading. But since you are using a uP already it only makes sense you read this data digitally. This saves you the hassle of using the ADC. 

Any decent VFD uses this method nowadays. High end cars also use this system to adjust the A/C condenser FAN speed. This gives you complete isolation and immunity to noise, since there is no analog signal anymore.


----------



## toddshotrods (Feb 10, 2009)

cts_casemod said:


> ...Why on earth would you want to rev an induction motor at 12KRPM!? Induction can reach such speeds but we are talking about a customized motor with special rotor. If this is for your bike use a PMDC instead.
> 
> I think a good starting point to you would be a car alternator. You can take about 10KW out of one at say 10.000RPM and 96V. They are usually geared at 3/1 so a typical alternator is safe to spin at up to 15-18KRPM and they are... CHEAP , unlike a dedicated PMDC that can cost you a few hundred £'sssss!...


Thats' what it takes to do the job on a direct drive motorcycle, with serious performance aspirations; _e.g._, bikes like the Lightning superbike - look at the size of the rear sprocket... Definitely talking custom motors here.

PMDC and car alternators won't cut it. I am looking at your kit for similar reasons to tylerwatts. I want to spin a 3-phase motor to 10-12K, and 227kW is exactly what I am looking for. I'm going to do a little research and planning but will probably pull the trigger on a kit and start the process of tweaking to make it fit my needs.

I can buy a Rinehart, and pay to have them tune it to my motor, but really, really, wanted to go open source - and then, this!


----------



## tylerwatts (Feb 9, 2012)

Beautiful timing right Todd! Thanks for this great opportunity Jhuebner. 

CTS, this is actually to drive a custom motor of sorts, I have 4 Azure AC24LS motors rated to 12krpm, and to reach my top speed I need to get to the full 12k to maintain a good reduction ratio. I'd run less rpm in the bike, probably not much less, but the 12k is for my hybrid conversion using the Azure matched AT1200 single speed transaxle with 10:1 reduction. In the car this motor won't make huge torque but multiply by 10 and it becomes very promising. I just need to hold on to some power to peak rpm. 

Jhuebner
Would you point us to the open source software please, and maybe some idiot's guide (for me) on how to build the controller and program it please? 
Thanks


----------



## cts_casemod (Aug 23, 2012)

tylerwatts said:


> Beautiful timing right Todd! Thanks for this great opportunity Jhuebner.
> 
> CTS, this is actually to drive a custom motor of sorts, I have 4 Azure AC24LS motors rated to 12krpm, and to reach my top speed I need to get to the full 12k to maintain a good reduction ratio. I'd run less rpm in the bike, probably not much less, but the 12k is for my hybrid conversion using the Azure matched AT1200 single speed transaxle with 10:1 reduction. In the car this motor won't make huge torque but multiply by 10 and it becomes very promising. I just need to hold on to some power to peak rpm.
> 
> ...


Nice, I wouldn't mind buying one of those from you 
But are you planing to drive them in constant torque up to 12KRPM!? 

They are wound for delta at 40V, likely 1500RPM, so you'll need 320V (assuming the insulation wont break, as these were factory used up to 170V, so as to provide constant torque up to 5.5 or 6KRPM and constant horsepower thereafter). But I think the original controller was rated at 650Amps. (amps go high because nominal voltage is low). Not that bad of a motor in fact


----------



## jhuebner (Apr 30, 2010)

tylerwatts said:


> One thing I would like to ask please, would this arrangement drive an induction motor to 12000rpm?
> Also, would it run a permanent magnet motor? I realise this is software based so I assume the hardware is fine and some reprogramming might be required. Is this right?
> Thanks


12 krpm is no problem. Just don't generate too many impulses (maybe 20-30) pur turn and you'll be fine.
I haven't gotten around to testing a PM motor. My guess is that if I set the slip to 0 it should run fine.
What I can definitly say is that regarding the hardware it is absolutely no problem to run any kind of 3-phase motor.
Different motors might require software customization. But hey, its open source.



cts_casemod said:


> I mean less. For applications up to 10KW. The gate drivers should be the same, regardless.


Absolutely. The price difference to lower current components isn't too large here. I'd just use the gate drivers as is.




cts_casemod said:


> I don't have a schematic since I build my prototypes on demand. By the time I need another one I usually come up with something better or with additional features.
> 
> Basically it works as every digital opto-isolated stuff .
> 
> ...


Ok, I understand. What do you power your HV side µC from?



toddshotrods said:


> I can buy a Rinehart, and pay to have them tune it to my motor, but really, really, wanted to go open source - and then, this!


You spotted it  
The existing software is very "frameworky" so it should be easy to change control algorithms, add new parameters etc.



tylerwatts said:


> Would you point us to the open source software please, and maybe some idiot's guide (for me) on how to build the controller and program it please?
> Thanks


Use the tumanako github: https://github.com/tumanako/tumanako-inverter-fw-motorControl/tree/master/src/sine

I have to update it when I get home

Building it is a bit more hassle, you need a GNU ARM toolchain. Here is a linux howto:

https://wiki.ubuntu.com/Toolchain/Crosscompilers/ARMEABIToolchain

I will address the software topic on the project website to make it more "idiot proof"


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> 12 krpm is no problem. Just don't generate too many impulses (maybe 20-30) pur turn and you'll be fine.
> I haven't gotten around to testing a PM motor. My guess is that if I set the slip to 0 it should run fine.
> What I can definitly say is that regarding the hardware it is absolutely no problem to run any kind of 3-phase motor.
> Different motors might require software customization. But hey, its open source.


Unless you are running in a sensorless kind of aproach I dont see how you can know the absolute position of the rotor to energize the correct coil on a PMDC. Does your PCB come with extra inputs that can be used for that purpose!?



jhuebner said:


> Ok, I understand. What do you power your HV side µC from?


I usually have either a high side power supply or an isolated DC-DC, so I havent included these in cost. Same used to drive the pre-charge circuitry and low side IGBTs, which are both referenced to HVGND. Your design may differ but should not be very hard to implement.
I plan to do this with the current sensors as well. Hitachi uses an optocoupler that does that for you, I need to see if I can find the P/N.



jhuebner said:


> I will address the software topic on the project website to make it more "idiot proof"


I forgot to ask, where's this website?


----------



## tylerwatts (Feb 9, 2012)

Website above, CTS. 

Thanks Jhuebner for the info. Idiot proof is always appreciated.


----------



## jhuebner (Apr 30, 2010)

cts_casemod said:


> Unless you are running in a sensorless kind of aproach I dont see how you can know the absolute position of the rotor to energize the correct coil on a PMDC. Does your PCB come with extra inputs that can be used for that purpose!?


Couldn't you just encode the position? Like mentioned above, leave out one tooth at the 0 position.



cts_casemod said:


> I usually have either a high side power supply or an isolated DC-DC, so I havent included these in cost. Same used to drive the pre-charge circuitry and low side IGBTs, which are both referenced to HVGND. Your design may differ but should not be very hard to implement.


I get it. New designs just spawned in my head


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> Couldn't you just encode the position? Like mentioned above, leave out one tooth at the 0 position.


Sure, but as you say it wont work out of the box, so you need to say what features the hardware has that can or not be used to make it work, obviously with a change in firmware. Just being open source might not be good enough if you are not a guru of programming 

PS: 
This is not as simple as setting the slip to zero - It might run unloaded, if started from a zero frequency, but as soon as its loaded it will get out of phase and stall, so no torque is achieved (I tried it). Implementing the method I described the controller must be able to run open loop, it will only make corrections after the motor is actually spinning, compare them to what it is trying to output and make changes as necessary. It also limits low rpm operation since the motor can count one pulse backwards and assume it as positive which will create an error. With 3 sensors the encoder knows the actual position anytime and just uses a table, which requires less computing.

-------------------------------------------------------------

All this conversation about slip got me thinking... 
I currently process the slip as an analog quantity, representing the motor feedback on which I add or take before its converted back into the PWM waveform.

This add or take is done by the accelerator pedal and respective circuitry and added to the closed loop resulting in negative, nule or positive torque. I wanted to have a software to let me input the number of PPR and add or take using the accelerator pedal, so a single box that would take the throttle input (4-20mA or 1-5V) and could read the encoder output.

The parameters would be:

Input from speed sensor
Input from temperature sensor
DC-LINK Voltage
PPR from the encoder
Nominal slip
Peak slip
Regenerative slip (Throttle up)
Regenerative slip (Brake pressed)

The idea is to regulate the charging voltage when the batteries are very cold and hence reduce regeneration if required, as well as disable regeneration if below a certain speed, because at a certain point is starts to draw power, not generate, plus the usual brake pedal controlled regeneration

Brake pedal slip (should be set up to 200% nominal slip and adjustable).

The output would be a 4-20mA or 2-10V

How hard would it be to actually make something like this?


----------



## cts_casemod (Aug 23, 2012)

tylerwatts said:


> Website above, CTS.


Where? I need one of those idiot proof links now


----------



## toddshotrods (Feb 10, 2009)

cts_casemod said:


> Where? I need one of those idiot proof links now


 This one?

Idiot proof : http://johanneshuebner.com/quickcms...nics-kit-for-igbt-half-bridge-modules,11.html


----------



## cts_casemod (Aug 23, 2012)

toddshotrods said:


> This one?
> 
> Idiot proof : http://johanneshuebner.com/quickcms...nics-kit-for-igbt-half-bridge-modules,11.html


Nice one


----------



## jhuebner (Apr 30, 2010)

cts_casemod said:


> How hard would it be to actually make something like this?


I think this is pretty much exactly what the software currently does.
On every cycle (about every 120µs) it checks whether a tooth passed the encoder. If it has, the angle is increased respectively. It also knows how much time passed since the last tooth passed the encoder and how much time passed between the previous two teeth. From that it can interpolate the current angle of the shaft.
So in case of an async machine on every cycle it adds some amount to that angle to generate slip. So e.g. if the motor turned 1° the field turns 1.1° (just made those numbers up).
So the term frequency doesn't really exist for the field angle calculation. It is used for the voltage calculation though.

I should draw something to make this explanation idiot proof 

So there are indeed parameters called "slipmin", "slipmax", "ampmin", "ampmax" (for the sine wave voltage), "brknom" (the amount of the throttle pedal being used as regen region), "brknompedal" (the amount of braking torque when the brake pedal is pressed).
I will add something like "brkderate" to ramp down the regen torque at low frequency. It is rather annoying if regen works all the way down to 0 rpm.


----------



## cts_casemod (Aug 23, 2012)

Cool,

I was asking for an interface to use with my system but instead of a 6 output pwm an analog signal.

I need to take a look closer. What uP are you using and what's your data output shown? Any sort of LCD?


----------



## PStechPaul (May 1, 2012)

I'm still concerned about the amplifier used to read bus voltage. Here is a simulation showing the effects of leakage from BT- to GND:










As a true differential amplifier:


----------



## jhuebner (Apr 30, 2010)

PStechPaul said:


> I'm still concerned about the amplifier used to read bus voltage. Here is a simulation showing the effects of leakage from BT- to GND:


Ok, looks like an easy improvement. Does it work in an unipolar setup? Sorry I didn't follow up before.

So far the current setup hasn't caused any problems as I found absolutely no leakage between the battery pack and the chassis. There is capacitive leakage when the inverter is running but that doesn't effect the DC readings.


----------



## PStechPaul (May 1, 2012)

Even capacitance can cause some distortion of the output. Of course, some filtering would take care of that.


----------



## jhuebner (Apr 30, 2010)

PStechPaul said:


> Even capacitance can cause some distortion of the output. Of course, some filtering would take care of that.


Yes, the DC input is filtered (16Hz) and again filtered in software. Its absolutely stable that way.


----------



## gunnarhs (Apr 24, 2012)

jhuebner said:


> Yes, I calculated a similar inductance for my AC motor. I still haven't quite understood why the ripple current is independend from the actual AC load current. Any idea?
> 
> Here in Germany I'm running into troubles with the home brew inverter. It has to meet EMC regualations. Which seems ok. What isn't, is the price for getting the certificate: around 10000-20000 bucks. Clearly favors big car makers.


Hi Johannes,
congrats with your product and thanks for your open source contribution.
You should not worry to much about the EMC/EMI certificate as you will most likely not be an OEM. In case of DIY in Germany (and mosts part of Europe I I know) the DIY has in any case to make the complete test for the vehicle with or without a certified Inverter. But a good product of course helps with passing this test. So if your car passes the test in Germany with your inverter (cost about 1000 Euros), it is good enough for others.


----------



## Hollie Maea (Dec 9, 2009)

I got my kit from Johannes in the mail yesterday. Arrived promptly and undamaged, and it looks like everything is there.

Now comes the fun part of assembly and designing a power stage.


----------



## jhuebner (Apr 30, 2010)

gunnarhs said:


> Hi Johannes,
> congrats with your product and thanks for your open source contribution.
> You should not worry to much about the EMC/EMI certificate as you will most likely not be an OEM. In case of DIY in Germany (and mosts part of Europe I I know) the DIY has in any case to make the complete test for the vehicle with or without a certified Inverter. But a good product of course helps with passing this test. So if your car passes the test in Germany with your inverter (cost about 1000 Euros), it is good enough for others.


This guy (http://zeropolomobil.blogspot.de/) didn't even have to do the complete test. For just 300€ he got his car legalized.
I'll see if I can follow his tracks.
Regarding the practical aspects of EM radiation I found out that the touchpad of my laptop stops working when I'm standing right in front of the car and the inverter is running.



Hollie Maea said:


> I got my kit from Johannes in the mail yesterday. Arrived promptly and undamaged, and it looks like everything is there.
> 
> Now comes the fun part of assembly and designing a power stage.


Thanks again for your feedback. Keep us posted of your progress.

I updated the build instructions a bit and uploaded the source code in a zip file.

See here: http://johanneshuebner.com/quickcms/index.html?en_downloads,14.html


----------



## jhuebner (Apr 30, 2010)

I have a first economy estimate for the inverter running in my Polo.

I drove 30km in town with slightly hilly terrain and had to recharge 4.2kW. That makes it 14kwh/100km. So one cannot say that slip control ruins economy in the first place.


----------



## gunnarhs (Apr 24, 2012)

jhuebner said:


> I have a first economy estimate for the inverter running in my Polo.
> 
> I drove 30km in town with slightly hilly terrain and had to recharge 4.2kW. That makes it 14kwh/100km. So one cannot say that slip control ruins economy in the first place.


Ok thanks for posting. Assuming your polo is about 1000 kg (?) and you kept a average speed of at least 50 km/h 7 km/kWh is very similar to results we have been having with our car using (a slightly different) slip control.

In any case a better result than when using an average standard-inverter with FOC


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> ... So one cannot say that slip control ruins economy in the first place.


Why would you assume it would?


----------



## jhuebner (Apr 30, 2010)

gunnarhs said:


> Ok thanks for posting. Assuming your polo is about 1000 kg (?) and you kept a average speed of at least 50 km/h 7 km/kWh is very similar to results we have been having with our car using (a slightly different) slip control.
> 
> In any case a better result than when using an average standard-inverter with FOC


The Polo weighs 765kg with the petrol engine. Assuming I haven't added any extra weight in the front, I removed 50kg from the back (the tank) and added 150kg auf batteries. So now it should weigh around 860kg.



cts_casemod said:


> Why would you assume it would?


Because I'm a doubtful person  Now, I'm amused by the fact that this simple algorithm works so well.


----------



## cts_casemod (Aug 23, 2012)

Hi,
When can one buy these kits and what's the price/availability?

Regards


----------



## jhuebner (Apr 30, 2010)

There is no high-tech shop set up yet, but you can order by email. See here

http://johanneshuebner.com/quickcms/index.html?en_products,18.html

You'll also find the prices there.


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> There is no high-tech shop set up yet, but you can order by email. See here
> 
> http://johanneshuebner.com/quickcms/index.html?en_products,18.html
> 
> You'll also find the prices there.


 
Brilliant. I've sent you an e-mail with what I need

Regards


----------



## jackbauer (Jan 12, 2008)

Great work on the kit. Congratulations. I'll order one first week in feb.


----------



## jhuebner (Apr 30, 2010)

Ok great, time to refill my stock


----------



## tylerwatts (Feb 9, 2012)

Jhuebner
Can you advise which kit and switch design you recommend and why. Also, where would you recommend buying IPM/IGBT modules from in eu? Is it ok to salvage from old vfd units? 
Thanks


----------



## jhuebner (Apr 30, 2010)

tylerwatts said:


> Jhuebner
> Can you advise which kit and switch design you recommend and why.
> Thanks


I'd recommend bare half bridge modules without any integrated electronics.
a) They all have the same electrical interface, i.e. the gate can always be operated with +-15V
b) It's the setup I'm most experienced with.

IPMs on the other hand sometimes need 24V, 15V, they all vary in how they map the output current to a voltage range. Plus I find them harder to source than regular "bricks".



tylerwatts said:


> Also, where would you recommend buying IPM/IGBT modules from in eu? Is it ok to salvage from old vfd units?


Absolutely. IGBTs have a very long MTBF. For a car to reach 100000km takes 1000-2000h. Thats nothing to an IGBT with a typical MTBF of 100000h.
Same goes for film capacitors but not for elcaps. I wouldn't recommend elcaps for their poor ripple current capability.

My unit runs with parts (heatsink, caps, IGBTs) from a large solar inverter.

I made a mechanical drawing some days ago


----------



## tylerwatts (Feb 9, 2012)

Thank you.


----------



## hbthink (Dec 21, 2010)

Semikron IGBTs at auction on ebay check it out:

http://www.ebay.com/itm/141178683263?ssPageName=STRK:MESELX:IT&_trksid=p3984.m1555.l2649

OEM grade serious stuff at much less than MSRP.

Semikron SKiM909GD066HD+P12 Semiconductor Trench IGBT switch 60-1000V.

Features
- Trench = Trenchgate technology
- VCE(sat) with positive temperature coefficient
- High short circuit capability, self limiting to 6 x Ic

Typical Applications
- Automotive Inverter
- AC Inverter Drives

Advanced solderless SKiM technology for extended lifetime cycling.

Currently going for less than $20 bid now!


----------



## jackbauer (Jan 12, 2008)

Ordered my kit from Johannes and received within 5 days. Very good service. All components individually labelled and bagged so very easy to stuff the boards using bom and circuit diagram.

The power stage will be built using 3 x CM600DY12NF 600A 600V igbts on a dmoc heatsink with 6 x 450v 1800uf el caps as used in the dmoc645 inverter. Have 1pv5135 and a 48v linde AC forklift motor for testing. Should be a fun project and I plan to add a few features of course


----------



## cts_casemod (Aug 23, 2012)

jackbauer said:


> Ordered my kit from Johannes and received within 5 days. Very good service. All components individually labelled and bagged so very easy to stuff the boards using bom and circuit diagram.
> 
> The power stage will be built using 3 x CM600DY12NF 600A 600V igbts on a dmoc heatsink with 6 x 450v 1800uf el caps as used in the dmoc645 inverter. Have 1pv5135 and a 48v linde AC forklift motor for testing. Should be a fun project and I plan to add a few features of course


That looks very nice.
I would just say to double check what the ripple capability of those electrolytic capacitors is, seems a small bank looking at your massive IGBT's.

Looking forward for some updates on your project


----------



## John Metric (Feb 26, 2009)

jackbauer said:


> Ordered my kit from Johannes and received within 5 days. Very good service. All components individually labelled and bagged so very easy to stuff the boards using bom and circuit diagram.
> 
> The power stage will be built using 3 x CM600DY12NF 600A 600V igbts on a dmoc heatsink with 6 x 450v 1800uf el caps as used in the dmoc645 inverter. Have 1pv5135 and a 48v linde AC forklift motor for testing. Should be a fun project and I plan to add a few features of course


I just ordered a "huebner" kit.
Can you guys provide the calculation on how to size the bus capacitors?


----------



## jhuebner (Apr 30, 2010)

John Metric said:


> I just ordered a "huebner" kit.
> Can you guys provide the calculation on how to size the bus capacitors?


Taken from this: http://www.ecicaps.com/pdf/whitepapers/IEMDC_2009_11310_Final_Rev_4.pdf

C = Vbus/ (32∗L∗ΔV0.5t∗f²)

Vbus bus voltage
L motor inductance
ΔV0.5t allowed ripple voltage
f PWM frequency


If you don't care about EMI very much ΔV0.5t can be rather high, like 10V or so. I calculated the motor inductance using nameplate values where I'm not sure thats entirely correct:
L=I/(V*2*pi*f)
E.g. I=39A, V=360V, f=120Hz -> L=144µH

Now, assuming a PWM frequency of 4kHz and a bus voltage of 600V:
C=600/(32*144*10^-6*10*4000²)=815µF

So why are elcaps always so large? Because of their low ripple current capability. The ripple current in the above case is
Ic=Vbus/(8*sqrt(2)*f*L)=92A
A typical 4700µF elcap has a ripple current capability of around 40A. So you need 2-3 of them to support 92A. This results in a bus capacity of 14100µF which ripple voltage wise is way too much.


----------



## John Metric (Feb 26, 2009)

jhuebner said:


> Taken from this:
> A typical 4700µF elcap has a rippl...nds, could I get by with much less capacitor?


----------



## jhuebner (Apr 30, 2010)

John Metric said:


> So it appears I need the capacitor amperage capability calculation not the ripple current capacity? I assume that is on the spec sheet? or is there a calculation for that as well?
> 
> Is the capacitor amperage "capability" a function of heating? If my duty cycle was only about 10 seconds, could I get by with much less capacitor?


Yes, cooler is better.
Regarding you application where neither EMI nor longevity really matters I wouldn't worry too much about the capacitor topic. You only need them to keep the spikes down to prevent IGBT overvoltage destruction.
Find out about the iductance of your motor, then size the caps for 5% ripple voltage. Use film caps, not elcaps.


----------



## Hollie Maea (Dec 9, 2009)

Keep in mind that any inductance of the DC bus will cancel out capacitance, so design it to be as low as possible.


----------



## cts_casemod (Aug 23, 2012)

John Metric said:


> So it appears I need the capacitor amperage capability calculation not the ripple current capacity? I assume that is on the spec sheet? or is there a calculation for that as well?
> 
> 
> Is the capacitor amperage "capability" a function of heating? If my duty cycle was only about 10 seconds, could I get by with much less capacitor?


Just as said above capacitor selection can be complicated and depends on a number of factors. Generally it is safe to say metal film capacitors will address most of all of the concerns.

Temperature: not just electrical, for example a car parked in the sun during the summer with the inverter/capacitors inside

Frequency: The higher the frequency the more inductive spikes hence larger ripple current capability required.

DC BUS: DC Bus construction AND material (coper, alluminium, thickness, etc) is very important when designing a capacitor Bank. The more capacitors needed (ie. Electrolitics) the bigger the DC BUS, hence the larger the inductance.

Calculate your ripple current requirements. This depends on your motor, the maximum power, etc. Once this is known select a suitable capacitor(s). Specs are listed on datasheet and vary for type. For example, my system uses 6x47uF as below for a ripple current capability of 600A in the inverter and 2x100uF for smoothing and reserve of the PFC Charger output, which has mains ripple. Both are part of the DC BUS for the integrated charger/inverter. This makes for a very compact design with a very low inductance. Check link bellow:

http://www.amazon.com/gp/aw/d/B00HKJ08RE/ref=redir_mdp_mobile

EMW also sells some power film capacitors. Check their store to have an idea of the specs.

As a summary: Electrolitics are preferred on applications without a battery since the added capacitance is often desirable, such as industrial drives and or wind turbines. We don't need that since we are operating from a battery. The capacitor only needs to handle the voltage spikes caused by switching of the IGBTs for protection of your equipment and RMI/RFI.

Be aware: The type I posted is a very low ESR, high power capacitor. There are film capacitors with larger capacitance whose primary purpose is to serve both as energy reserve and low impedance. While these can be used they will handle LESS current and will be physically larger, so choose accordingly.

As for electrolitics there is no reason to choose them other than to save money if you are uninformed. Rather spend your money in a smaller set of power film capacitors.

Also don't forget some decent snubbers. Good quality ones. 1uF for every 50Amps battery current is a good choice. You'll need 3, so 0.33uF per IGBT per each 50Amps.


----------



## John Metric (Feb 26, 2009)

So my project so far looks like this....

QTY=3 Powerex IGBT CM1400DU-24NF DUAL 1200V 1400Amp
http://www.ineltron.de/english/mitsubishi-data/IGBT/CM1400DU-24NF.pdf
QTY=6 Powerex Gate Driver VLA500-01
http://www.pwrx.com/pwrx/docs/vla500_01.pdf
QTY=3 Gate Driver Board BG2A
http://www.pwrx.com/pwrx/docs/bg2a_application_note.pdf
QTY=? Film Capacitors 1100volts 47uF 10% (nice match)
http://www.amazon.com/gp/aw/d/B00HKJ08RE/ref=redir_mdp_mobile
Code Name is "Ghidorah".


The 85kw Siemens motor I am looking at has data point of 250amps at 650V at 3600rpm.
Not sure how to determine the L there but L=I/(V2pif)= 1022uH if 60HZ is 3600rpm. I will have research that a little more....

C = Vbus/ (32∗L∗ΔV0.5t∗fpwm²)
C=600/(32*1022e-6*10*4000^2)=114uF
and ripple current of 
Ic=Vbus/(8*sqrt(2)*fpwm*L)
Ic=600/(8*sqrt(2)*4000*1022) = 13amps


If I use 10kHz as the PWM instead of 4kHz(because the caps appear to be function of the inverse square of the PWM frequency), this becomes 18uF and 5amps. 
That seems pretty small......Is that reasonable?


----------



## Stiive (Nov 22, 2008)

John Metric said:


> QTY=3 Powerex IGBT CM1400DU-24NF DUAL 1200V 1400Amp
> http://www.ineltron.de/english/mitsubishi-data/IGBT/CM1400DU-24NF.pdf


PWOAH! That's a beast.
Cant recommend highly enough to start small, iron out all the bugs, and only then in increase scale. Digikey lists these bad boys at ~$1k each.

Your risking a lot of money here on a hardware and software design that is largely untested especially at high power levels!

Get some 1200V 300A modules first, they are a lot cheaper should easily give the 80kW you require with proper cooling.




John Metric said:


> That seems pretty small......Is that reasonable?


----------



## jhuebner (Apr 30, 2010)

I second what you wrote, but this:



cts_casemod said:


> Frequency: The higher the frequency the more inductive spikes hence larger ripple current capability required.


You're driving an inductive load with your inverter. Higher frequency -> less current. Thats why the ripple voltage is inversely proportional to the square (!) of the PWM frequency. Check the formulars.




John Metric said:


> The 85kw Siemens motor I am looking at has data point of 250amps at 650V at 3600rpm.
> Not sure how to determine the L there but L=I/(V2pif)= 1022uH if 60HZ is 3600rpm. I will have research that a little more....
> 
> C = Vbus/ (32∗L∗ΔV0.5t∗fpwm²)
> ...


Those values seem pretty small. Do some more background research about the motor inductance. I'm not sure whether "my" method is all the way correct.



Stiive said:


> PWOAH! That's a beast.
> Cant recommend highly enough to start small, iron out all the bugs, and only then in increase scale. Digikey lists these bad boys at ~$1k each.
> 
> Your risking a lot of money here on a hardware and software design that is largely untested especially at high power levels!
> ...


I second that, its exactly how I developed this inverter. But thats the point, I've already made most mistakes, so the risk software-wise has become quite small.
Desat and maybe overcurrent protection will catch the worst mistakes.

One thing that even destroys the strongest IGBT brick is loose gate connections. That will leave one IGBT floating somewhere in the linear region and the other will happily switch the full power.

Ok I'm starting to see your point  Some testing with cheaper hardware might be appropriate.


----------



## cts_casemod (Aug 23, 2012)

Agree. What motor is that anyway? Is it an Industrial motor? Is the 650V AC or DC? That is, in my opinion, a bad choice. Also is it 2 or 4 poles? Get a 4 pole.

I can not stress how important it is to avoid voltages higher than 440V Nominal. It turns really hard to find DC fuses contactor's and other safety equipment rated for those levels. Ideally you want to break the battery in smaller 150-200V when the system is off as to protect against any faults. There are good motors out there rated for 115VAC up to 208 that you can use. But that's another topic that has been discussed many times. Familiarize yourself with all these terns first.

As to PWM you want to go as low as possible. 4-6Khz being the sweet spot between efficiency and noise. Although higher frequencies reduce PWM noise they will stress the power components, motor included. From experience, you can barely hear the PWM noise inside the car anyway, even at the minimum 2KHz. What you can hear is the motor 'slipping' under load and there is nothing you can do about that. If you live near a big town lisyen to any new trains. They are mostly AC induction nowadays. That's about the same noise your car will do.


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> I second what you wrote, but this:
> 
> 
> You're driving an inductive load with your inverter. Higher frequency -> less current. Thats why the ripple voltage is inversely proportional to the square (!) of the PWM frequency. Check the formulars.


Thanks for poi ting that out. I am not refering to the ripple current as per the motor supply, but ripple current caus ed by the inductance of the DC BUS, ie spikes at the IGBT that increase with higher PWM frequencies. Perhaps there is a better term for those.

Also at higher frequencies switching losses and eddy losses on the core (iron losses) will increase.


----------



## Stiive (Nov 22, 2008)

jhuebner said:


> I second that, its exactly how I developed this inverter. But thats the point, I've already made most mistakes, so the risk software-wise has become quite small.
> Desat and maybe overcurrent protection will catch the worst mistakes.
> 
> One thing that even destroys the strongest IGBT brick is loose gate connections. That will leave one IGBT floating somewhere in the linear region and the other will happily switch the full power.
> ...


I meant no disrespect to you Johannes, but I think you see what I mean.

Software glitches can still happen - its just the nature of the beast. There's always something you haven't thought of, or you add one feature and cause an issue somewhere else. 
Whether or not they cause catastrophic failure of the switches is another thing and case dependant. My point is more that John has not had his hand in developing this product so is investing a lot of faith that you have used best practices to ensure his $4k system doesn't end up in the bin.

But even more-so, the whole setup will rely on his hand-soldering of all the components of the PCB, and then the hardware design layout. Something as simple as running the gate driver output or current sensor feedback signals the wrong way at such high power levels can lead to failure. Maybe he has noise in his system, or a high capacitive coupling between the LV and HV systems, or an even slightly loose connection as you state - there are so many gotcha's in an EV

Best to start small (as you did), make sure it works how you want before you invest so much money into it, because when things go badly, they go badly quicky . 

It's worth noting, I'm not trying to scare anyone off a sale here. I'm just saying 'start small'. Test bench your system if you can with lots of protection mechanisms (for yourself and the equipment).


----------



## cts_casemod (Aug 23, 2012)

Stiive said:


> I meant no disrespect to you Johannes, but I think you see what I mean.
> 
> Software glitches can still happen - its just the nature of the beast. There's always something you haven't thought of, or you add one feature and cause an issue somewhere else.
> Whether or not they cause catastrophic failure of the switches is another thing and case dependant. My point is more that John has not had his hand in developing this product so is investing a lot of faith that you have used best practices to ensure his $4k system doesn't end up in the bin.
> ...


Well... IGBT wise if he uses fast fuses of 50 or 100 AMPs chances are he will burn the fuses before the monster IGBTs. I said FAST semiconductor fuses not generic ones (They are pricey) That happened to me once with my 600Amp IGBTs when I thouched the driver board and blown the optocoupler leaving the IGBT to short the DC link. Thankfully only minor damage to a few optocouplers and blown fuses but with a smaller IGBT maybe I wouldn't be so lucky.

Other than that agree. Not saying the design is bad, on the contrary, but as a DIY many things can go wrong out of the designer control like the 12KW charger from EMW. It's important to be aware of this. A bad solder point can cause intermittent erratic behaviour and things like a over current protection fault may go unnoticed until it is too late.


----------



## Stiive (Nov 22, 2008)

cts_casemod said:


> Well... IGBT wise if he uses fast fuses of 50 or 100 AMPs chances are he will burn the fuses before the monster IGBTs. I said FAST semiconductor fuses not generic ones (They are pricey)


Of course, semiconductor fuses are essential - but are mainly to protect the source rather than the IGBTs.
I would say most failures happen to due over voltage (inductive kick), over temp, or gate driver/noise kills the gate. All of which wont necessarily be protected by an adequately rated fuse.

Sure, it will be harder to blow these units, but no way near impossible.
I don't see any reason not to go for 1200V 300A in this case...


----------



## Tesseract (Sep 27, 2008)

John Metric said:


> ...
> C = Vbus/ (32∗L∗ΔV0.5t∗fpwm²)
> C=600/(32*1022e-6*10*4000^2)=114uF
> and ripple current of
> ...


Good grief... those equations look totally made up.

Load (motor) inductance is irrelevant and, in fact, the input capacitor sees the highest ripple current when load inductance is infinite (ie - exactly opposite what eq. 1 suggests). I'll leave it as an intellectual exercise for those so inclined to reason out why this is so (hint: input current is discontinuous while output current is continuous).

The ripple current rating of the input capacitor in a 3ph. inverter does depend on the power factor, cosΦ, of the load (worst case is at cosΦ = 1) and the modulation index, m, of the PWM waveform (worst case is at m = 0.6). The actual equation for calculating ripple current in a PWM 3ph. inverter is ridiculous, actually, so best to use the following rules of thumb: ripple current rating is 50% of RMS phase current; capacitance is 10uF per RMS amp for film types and 80uF per amp for electrolytic.




John Metric said:


> QTY=3 Powerex IGBT CM1400DU-24NF DUAL 1200V 1400Amp
> ...
> If I use 10kHz as the PWM instead of 4kHz...


You won't be switching any 1200V IGBT at 10kHz. In fact, 4kHz is probably pushing it, as by that point switching losses will be equal to conduction losses; 1-2kHz is more realistic. And yeah, I get that you probably won't need maximum power for more than 10 seconds at a time, but thermally-induced failure of semiconductors can happen in a matter of milliseconds, so that 10 second drag race looks like an eternity to them.


----------



## cts_casemod (Aug 23, 2012)

Stiive said:


> Of course, semiconductor fuses are essential - but are mainly to protect the source rather than the IGBTs.
> I would say most failures happen to due over voltage (inductive kick), over temp, or gate driver/noise kills the gate. All of which wont necessarily be protected by an adequately rated fuse.
> 
> Sure, it will be harder to blow these units, but no way near impossible.
> I don't see any reason not to go for 1200V 300A in this case...


True. I didn't say they would be indestructible, I said using common sense he would be better of since these IGBTs are harder to blow and can withstand higher thermal loads, well required when operating at higher switching frequencies, all else being the same. Now if no thermal protection is fitted and the temperature is allowed to increase too much no IGBT will survive, no mather how large or small it will be.

Also well spotted in the topic above, at higher frequencies switching losses increase and IGBTs need to be de-rated, so one that could do the job at a couple KHz might be working towards the limits at frequencies of 8-10KHz, assuming it is even possible to operate them at such frequencies.


----------



## jackbauer (Jan 12, 2008)

Some small progress. Have the boards built so just need to get the power stage hardware together.


----------



## valerun (Nov 12, 2010)

Tesseract said:


> You won't be switching any 1200V IGBT at 10kHz. In fact, 4kHz is probably pushing it, as by that point switching losses will be equal to conduction losses; 1-2kHz is more realistic. And yeah, I get that you probably won't need maximum power for more than 10 seconds at a time, but thermally-induced failure of semiconductors can happen in a matter of milliseconds, so that 10 second drag race looks like an eternity to them.


Not sure. Production 700v dc link inverters we use (made by visedo) are switching at 8khz hard switching. 250kw peak in a 15 kg package


----------



## jhuebner (Apr 30, 2010)

valerun said:


> Not sure. Production 700v dc link inverters we use (made by visedo) are switching at 8khz hard switching. 250kw peak in a 15 kg package


Same here at SMA. 250 kW solar inverter switch at 16kHz whereas the 2MW models switch at 3kHz. They use 1200V IGBTs, I think the latter even 1700V.

I haven't replied to the ripple topic yet as I want to do more research.


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> Some small progress. Have the boards built so just need to get the power stage hardware together.


Nice and simple bus bars


----------



## Tesseract (Sep 27, 2008)

valerun said:


> Not sure. Production 700v dc link inverters we use (made by visedo) are switching at 8khz hard switching. 250kw peak in a 15 kg package


With careful attention to parasitics and a willingness to trade-off current rating for switching frequency, sure you can hard-switch 1200V IGBTs at 8kHz. But when I wrote, "you won't be switching any 1200V IGBT at 10kHz," what I meant was that anyone who is not an experienced power electronics engineer should not attempt to run 1200V IGBTs at 10kHz... or even much above 4kHz. This is especially true if using older IGBTs (like those 1400A Powerex/Mitsubishi modules) and/or if wanting to push the maximum amount of current through them (as John Metric will surely want to do).

But don't take my word for it, use the freely available simulation software provided by Fuji, Powerex/Mitsubishi, Semikron, etc. to compare different modules at different frequencies.


----------



## jhuebner (Apr 30, 2010)

I might have found the paper that states pretty much exactly what Tesseract says.
https://www.pes.ee.ethz.ch/uploads/tx_ethpublications/round_JournalIEE_2006.pdf

It gives an estimation formular saying ripple=1/2*rms current.
No switching frequency or inductance seems to play a significant role.
So thanks for pointing it out.

But please: keep it experimental. "You can't do this and can't do that" are not encouraging words to the amateur.
Heres a collection of things experts told me over the years while I developed the inverter:


"The thermal paste must be spread extremely accurately or your IGBTs will overheat". Well I spread it with a simple scraper until my eye said "this is even" and nothing overheats
"To control an AC motor in an EV you definitly need FOC or DTC". I use slip control which turns out to be efficient and smooth
"You need to pay close attention to the gate resistors or you'll have rock bottom effiency". I use 10Ohms instead of the advised 2 Ohms. "Rock bottom" probably means 95% instead of 97% effiency.
"Its best to galvanically isolate all inputs and outputs". The only thing I isolated are the gate driver. No problems anyway.
Ok, enough of that. What I'm saying: had I stuck to all that advise there would be no inverter as of now.
Being an expert in software engineering I have experienced this notion to belittle the simple solutions. Its whats experts do e.g. once they accepted 95% effiency as "rock bottom" or voltage spikes of 100V as "outrageous".

John will will be sensible enough not to pump 3000A through his inverter first start. First 50A, then 100A, then 200A... And even if things go wrong - its not the end of the world.


----------



## John Metric (Feb 26, 2009)

cts_casemod said:


> Agree. What motor is that anyway? Is it an Industrial motor? Is the 650V AC or DC? That is, in my opinion, a bad choice. Also is it 2 or 4 poles? Get a 4 pole.
> 
> I can not stress how important it is to avoid voltages higher than 440V Nominal. It turns really hard to find DC fuses contactor's and other safety equipment rated for those levels. Ideally you want to break the battery in smaller 150-200V when the system is off as to protect against any faults.


For a test mule, I am looking at two Siemens 1PV5138-4WS24 on a common shaft.

Yes, we are building for 1200VDC all around but plan on a VDC bus no higher than 600 and will probably start below the 500VDC A50Q shawmut fuse level.


----------



## John Metric (Feb 26, 2009)

Tesseract said:


> You won't be switching any 1200V IGBT at 10kHz. In fact, 4kHz is probably pushing it, as by that point switching losses will be equal to conduction losses; 1-2kHz is more realistic.


That's fine with me.



Tesseract said:


> so best to use the following rules of thumb: ripple current rating is 50% of RMS phase current; capacitance is 10uF per RMS amp for film types and 80uF per amp for electrolytic.


However, that is a little frightening.
Capacitor current rating 50% of RMS phase current?
50% of 2800amps = 1400amps?

Capacity 10uF per RMS amp
10*2800 = 28000uF?

If IGBT amp rating is a close approximation for "RMS" amp then these are pretty big capacitors.
So that's about QTY=28 1000uF 50Arms 1200V caps?


----------



## Stiive (Nov 22, 2008)

John Metric said:


> For a test mule, I am looking at two Siemens 1PV5138-4WS24 on a common shaft.


Ohh, I see the need for the high powered controller now... Your going to be drag racing this vehicle!

Don't want to be a negatively Nelly, but I don't think this setup is the right choice for your application 
This runs a very basic slip control algorithm. You'll get sluggish torque response, and it easily becomes unstable at high torque.

UNLESS your taking this on as a 'learning project' or a bit of fun, IMO you'll be better off (and it'll be cheaper in the long run) to purchase a controller from a well established brand in racing applications. 



John Metric said:


> Yes, we are building for 1200VDC all around but plan on a VDC bus no higher than 600 and will probably start below the 500VDC A50Q shawmut fuse level.


700VDC semiconductor fuses are easy to find and not much more expensive, and still have a very decent I2t rating.



[DISCLAIMER] Again, I think Johannes offering kits is great - but I see the application for more of a 'cruiser' where efficiency and power aren't the main goal. Great for a EV runabout on a budget where you don't mind lots of tinkering/debugging hours and the occasional failure. Just my 2cents.


----------



## John Metric (Feb 26, 2009)

Stiive said:


> Ohh, I see the need for the high powered controller now... Your going to be drag racing this vehicle!


yes sir......



Stiive said:


> This runs a very basic slip control algorithm.
> UNLESS your taking this on as a 'learning project' or a bit of fun, IMO you'll be better off (and it'll be cheaper in the long run) to purchase a controller from a well established brand in racing applications.


Little bit of a learning project. I liked the open source idea of his kit, writing my own "slip control" algorithm, I have my own ideas on this when I only need one thing from the algorithm, acceleration at any cost.

Can you point to a ~1megawatt AC racing controller I can buy? or two?


----------



## Stiive (Nov 22, 2008)

John Metric said:


> Can you point to a ~1megawatt AC racing controller I can buy? or two?


No, but ever think there might be a good reason for it?...

Most likely because
A) It's not a trivial task pumping out that much juice
B) You'd be better off with 4 smaller motors than 1 large
C) You're going to struggle to put 2MW of power to the tarmac from just the rear wheels.
D) 2MW batteries?
E) You will likely evaporate the windings on your 80kW motors


I'm using 1200V600A IGBTs and struggle pushing anything above about 400kW


----------



## jhuebner (Apr 30, 2010)

Stiive said:


> This runs a very basic slip control algorithm. You'll get sluggish torque response, and it easily becomes unstable at high torque


How do you know?
Well its soon to be found out 

Re Cap rating: The 10µF/A probably has an MTBF background as well. Your controller will be off most of the time (even more than in any other vehicle).

Maybe try to find out what other high power controllers are using and stick with that. 28000µF sounds outrageous, especially volume-wise.

I saw a video of how they assemble the Semikron SKAI 200kW inverter. The capacitor is film type and looked tiny.


----------



## jhuebner (Apr 30, 2010)

Stiive said:


> No, but ever think there might be a good reason for it?...
> 
> Most likely because
> A) It's not a trivial task pumping out that much juice
> ...


I'd like to add an 
F) Because no manufacturer sees a market for drag racing controllers

It took VW years and many engineers to build the 1300hp Veyron. It takes an amateur less time to pump up his car to 2000hp using some turbochargers etc.
Whats the difference? Veyron is street legal, probably runs fine 20 years without an engine rebuild and is over all so secure that nobody will be able to sue VW.

Manufacturers need to be conservative and assume worst case scenarios for everything. A DIY dragracer can do the exact opposite.


----------



## John Metric (Feb 26, 2009)

Stiive said:


> No, but ever think there might be a good reason for it?...


you suggested it, just asking where you thought I could get one.


----------



## Tesseract (Sep 27, 2008)

jhuebner said:


> I might have found the paper that states pretty much exactly what Tesseract says.
> https://www.pes.ee.ethz.ch/uploads/tx_ethpublications/round_JournalIEE_2006.pdf
> 
> It gives an estimation formular saying ripple=1/2*rms current.
> ...


Good find. The similarly-titled paper I have on this is by Folker Renken of Siemens, but the one you cited is a bit easier to follow.



jhuebner said:


> But please: keep it experimental. "You can't do this and can't do that" are not encouraging words to the amateur.


Fair enough, with the caveat that if someone who is demonstrably knowledgeable advises against doing something then it behooves the amateur to pay attention. And on that note...



jhuebner said:


> Heres a collection of things experts told me over the years while I developed the inverter:
> 
> 
> "The thermal paste must be spread extremely accurately or your IGBTs will overheat". Well I spread it with a simple scraper until my eye said "this is even" and nothing overheats
> ...


1. I don't think it's ever possible to spread thermal paste "extremely accurately" so that is nonsense advice, but you can definitely kill a module by spreading the paste so unevenly that there are obvious spots where there is too much paste as well as none at all. I've cut open IGBT modules where just one of the dice failed - the one right above a spot on the baseplate where there was no paste. That said, many sins like this will be forgiven if you don't try to push more than half the datasheet current rating through the IGBT.

2. While your slip control approach does work, you do not know if it works as well as FOC or DTC. Granted, your point was that some "expert" (possibly even me... ) said you needed to use FOC/DTC, and, well, you've proven that wrong, but unless you can achieve the breakdown torque rating of the motor (which ranges from 2x to 4x the full load torque) then your scheme is not the best to use for traction applications. 

3. Higher gate resistance only slows down turn-on of an IGBT - it has very little effect on turn-off (until the value becomes absurdly high) - so the main effects of this are a reduction in reverse recovery current in an opposing leg's FWD and, of course, an increase in switching loss. Keep in mind that when driving a highly inductive load, switching loss is the overlap of linearly falling voltage times the full current (and not a linearly-rising current, as would be the case if driving a purely resistive load).

4. I'm with you on this one. Galvanic isolation of all I/O is the lazy designer's way of dealing with ground loops. Applying a little thought - and some judicious filtering - will let your motor controller (etc.) safely interact with the outside world.


----------



## major (Apr 4, 2008)

John Metric said:


> Can you point to a ~1megawatt AC racing controller I can buy? or two?


This comes pretty close to a MW. http://motorsandcontrol.com/product...-au4a1200uaa-380-480v-3-phase-1000-900hp.html 

These guys make a half MW mobile drive. http://www.arens.com/products/powerelectronics/tractioninvertors.cfm

You do realize the motor you specified has a 150kW peak at 650VDC? You might be able to push that a bit, but even at 2000VDC, you'll be under half a MW.


----------



## rochesterricer (Jan 5, 2011)

John Metric said:


> Can you point to a ~1megawatt AC racing controller I can buy? or two?


You could always pester Otmar to finish development of the Tri-Zilla


----------



## gunnarhs (Apr 24, 2012)

John Metric said:


> Little bit of a learning project. I liked the open source idea of his kit, writing my own "slip control" algorithm, I have my own ideas on this when I only need one thing from the algorithm, acceleration at any cost.


I totally like where this thread is going starting from the homebrew controller to a monster driving a motor-setup only seen before in a bus configuration . 
But that is the beauty of the open-source that everyone can (theoretically at least) make his own solution, it would be impossible to make a complete setup fulfilling all needs of the DIY here.
For those who are afraid of the slip-control there is also FOC-code included in the Tumanako-project as mentioned often in this thread.


----------



## tylerwatts (Feb 9, 2012)

Would a train traction inverter not come close to MW ratings? Maybe? Of course they could just be running lots of smaller drives on each bogie so the inverter will be smaller. Just a thought. Trains almost drag race between stops.


----------



## John Metric (Feb 26, 2009)

major said:


> This comes pretty close to a MW. http://motorsandcontrol.com/product...-au4a1200uaa-380-480v-3-phase-1000-900hp.html
> 
> These guys make a half MW mobile drive. http://www.arens.com/products/powerelectronics/tractioninvertors.cfm


Jeff, 
First drive weighs 1600lbs and is $70,000
Second one looks like OEM bulk purchase only. 




major said:


> You do realize the motor you specified has a 150kW peak at 650VDC?


Yes, it is right on the datasheet.

Do you realize a Netgain Warp9 is listed at 144V and 70HP? Not sure what your point is? Can you suggest another cheap test "mule" to the two 85kw Siemens that I found for $4500 each? I appreciate any positive criticism you want to give.


----------



## Stiive (Nov 22, 2008)

John Metric said:


> Yes, it is right on the datasheet.


What is the motor? If its a permanent magnet one you will demagnetise the magnets.. You'll need an induction if you want to abuse it.




John Metric said:


> Can you suggest another cheap test "mule" to the two 85kw Siemens that I found for $4500 each?I appreciate any positive criticism you want to give.


Try find an aluminium frame low voltage 6pole+ machine. 
The higher pole count will give you lots of torque, replace the bearings and do a rotor balance and then voltage overclock to rev it up to 10k

Best bet would be to start with buying a motor with a water cooled jacket and then get it rewound yourself. 
Try a ~30VAC 6/8-pole high current winding.
OR rewind your Siemens (if they are induction motors), but maybe best to start with a lower voltage motor so the laminations are more suitable for the winding. Not too sure how the square laminations influence the flux either - prob designed specifically for 4 pole. You would need to research.


----------



## John Metric (Feb 26, 2009)

rochesterricer said:


> You could always pester Otmar to finish development of the Tri-Zilla


I did, we talked for several weeks, his price was too high, voltage too low, lead time too long, IP not for sale, only the drives. I talked to a few other teams as well. I am going to do it on my own. 
Perhaps a little help from the DIY brain trust like Johannes, Jeff, Tess and the rest of you. True "DIY" fashion. Please stay positive, and I will. I have also been told several " you can't do that's" by self appointed experts that were bad advice in the end. Too many to count. 
Not claiming to be an expert here, in fact just the opposite, just want to break a few paradigms. 

First paradigm " AC motors are not good for drag racing"


----------



## toddshotrods (Feb 10, 2009)

I might join this crusade. I am almost certainly going AC with Scrape, eventually. I have been seriously considering purchasing one of these kits and doing similar to what you're up to John; though my needs on the bike are probably less extreme. I just have so many irons in the fire, at the moment, that I can't dedicate the necessary resources to developing my own inverter.

The thing about a race vehicle is we don't need all the refinement and security that's needed for street driven vehicles, and mass consumption. We just need to make power, somewhat reliably, and minor rough edges are acceptable.


----------



## major (Apr 4, 2008)

John Metric said:


> Jeff,
> First drive weighs 1600lbs and is $70,000
> Second one looks like OEM bulk purchase only.


Just trying to point out the scope of what you ask



John Metric said:


> Do you realize a Netgain Warp9 is listed at 144V and 70HP? Not sure what your point is?


Induction motors have a very basic difference compared to torque in the series DC machine. You can't just keep increasing current and get more and more torque. The peak torque listed on the IM spec sheet is likely close to breakdown torque. It can draw more current but torque will decrease and the motor will stall. Stall/starting torque is less than breakdown torque. The only way to get more power is to up the speed/frequency and that requires higher voltage on that particular machine, which it may not tolerate with the present insulation system. So my point is that a MW inverter isn't going to get much more power than what was indicated on the motor spec sheet.



> Can you suggest another cheap test "mule"


I'm all for you experimenting with a test mule. I don't know about cheap, but a better choice for your goal would be the top end Model S motor and drive, IMO. How about 3 or 4 of those coupled together to get you into the MW electric world?


----------



## cts_casemod (Aug 23, 2012)

Why are we comparing solar inverters to motor inverters? On the first type a higher switching frequency is better so that a simple LC filter can be used to supply a true sine wave output supply. PWM does NOT show in the output unlike a VFD where the motor is forced to act as an inductor on which the inductive peak is recycled by the snubbers and power dissipation on the later INCREASES with frequency. Of course I could also add that any capacitor ESR INCREASES with frequency effectively reducing the capacitor ability to perform the above, but let's not take this into account now.



We could start a whole debate about switching frequencies. It is known that there are specific motors VFD rated for this purpose but the same people that say higher is better fail to properly mention this. I am aware the inverter here shown is used with a VFD rated motor. My motor, for example is NOT so this should be taken into account when switching frequency is choosen for a particular setup (which can be software changed)

The only reason consumer drives typically operate at higher frequencies is in the same principle, there are several papers out there stating possible problems in failures to the insulation of the motor and bearings from the use of higher switching frequencies, core losses, increased losses on the switching transistors, etc... but then again reliability comes second in the consuner world. The point is not to say use or not use, but to make aware of possible advantages and disavantages. The only advantage I see is noise wise, at an expense of a more complex inverter design and efficiency which I personally would avoid, backed up with relevant reasons. Just because some inverters can go to 15 KHz is not a relevant reason to say higher is better, the information is here to help people make an informed decision for a particular setup.


Now it is also true that using a larger PWM the ripple seen by the power source is smaller which is interesting for an AC supply point of view. Not that I care because our supply is DC anyway, but under extreme causes it might cause the wires from the battery to act as an inductor increasing EMI and other nasty effects at very low frequencies if the capacitors are not able to cope. Perhaps this is where different opinions are based. Input ripple current decreases with frequency, BUT internal inductive losses INCREASE and the capacitors MUST be able to recycle this energy.


----------



## jhuebner (Apr 30, 2010)

Wow that a lot of posts in a short time. Sorry can't reply to all personally.

I'll just pick 4 topics:
Motor:
I'd judge the rewinding a 4/6/8-pole motor the most promising path as you're not dependend on a single source (like Tesla). I don't see a point of getting watercooled equipment for a 10s dragrace. Thermal mass will do it.
The 4x figure for breakdown torque/rated torque is what it states in the data sheet of my motor as well. Imagine this: Breakdown torque at 10000rpm - for my machine thats a power multiplier of 11!

Slip control:
I have two improvements in mind to get close to breakdown torque. One is a dedicated [email protected] lookup table instead of a fixed or linearly increasing slip value. That way you can tune the slip to the fine line between maximum torque and stall/oscillation.
I've experienced some issues when starting at 0rpm with a high slip frequency (more then twice the rated). The motor starts to oscillate instead of producing torque. At higher speeds, say above 200rpm this is no longer an issue. Can't really test the limits myself has I have a weak TS battery pack.
Again, my guess is that FOC/DTC gets only a tiny bit closer to breakdown torque than slip control. We'll see.

Advise:
It just needs to be formulated in a way that expresses: pay attention to this if you run into problems. Don't worry about it if you don't.

Switching frequency:
Yes, switching losses increase, yes capacitive coupling over the insulation increases. But applying above advise-advise: this might be totally irrelevant for a given project. And very relevant to another.
The switching frequency is currently configurable in 4 steps: 2.2, 4.4, 8.8 and 17.6 kHz.


----------



## major (Apr 4, 2008)

jhuebner said:


> The 4x figure for breakdown torque/rated torque is what it states in the data sheet of my motor as well.


The rule of thumb works for standard TEFC motors. That Siemens motor is rated for liquid cooling on the continuous figure and also gave a peak number, which would be close to BDT.


----------



## jackbauer (Jan 12, 2008)

Please excuse my ignorance but what is break down torque?


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> Please excuse my ignorance but what is break down torque?


The T_max from this plot:








[/URL]

Its the highest torque the machine can achieve and it needs a lot of slip (g_max). Now if the slip is increased even more, the torque diminishes.


----------



## major (Apr 4, 2008)

jackbauer said:


> Please excuse my ignorance but what is break down torque?


You're excused  First google hit: http://www.engineeringtoolbox.com/electrical-motors-torques-d_651.html BDT is the maximum torque an induction motor can produce. As you load the motor nearing BDT, the slip starts to increase rapidly and in most cases the inverter faults out (or blows up).


----------



## tomofreno (Mar 3, 2009)

John Metric said:


> I did, we talked for several weeks, his price was too high, voltage too low, lead time too long, IP not for sale, only the drives. I talked to a few other teams as well. I am going to do it on my own.
> Perhaps a little help from the DIY brain trust like Johannes, Jeff, Tess and the rest of you. True "DIY" fashion. Please stay positive, and I will. I have also been told several " you can't do that's" by self appointed experts that were bad advice in the end. Too many to count.
> Not claiming to be an expert here, in fact just the opposite, just want to break a few paradigms.
> 
> First paradigm " AC motors are not good for drag racing"


Seems like it might be better to use multiple smaller motors that give the combined peak torque required, since you could likely maintain that torque out to higher vehicle speed then without as much gear shifting compared to using one larger AC motor. I think one group that has put a lot of thought into this is Mate Rimac's.


----------



## McRat (Jul 10, 2012)

The GM AC drive is >150kW in factory trim.

Nobody has any idea how much abuse it's watercooled drivetrain can tolerate. GM is famous for "leaving meat on the table", ie - large safety margins. 

Could it put out 200kW per motor for 30 seconds? Nobody knows.

You can play with the motor itself for about $2,000. The controller? It might be easier than you think to make it standalone. It is very easy to do their gas engines. Their ECM does not need all the sensors or modules to operate. I've taken a wildly different ECM (different chipset, different code, 64-bit) and driven a totally fly by wire powertrain.

You use foolers (devices that mimic sensors) to eliminate problems.

To get the whole enchilada, ECM, Battery, Battery control, charger, electric motor controller, two motors (it uses a smaller motor for regen) harnesses, etc, is $4000-$7000. Then you sell off what you're not going to use.


----------



## jhuebner (Apr 30, 2010)

One more thought: torque is a function of slip AND terminal voltage. So twice the rated terminal voltage=twice the torque? If so, the same goes for breakdown torque and suddenly the magical factor of 4 could become an 8, 12, 16?
I roughly remember that core saturation somehow limits something. Anyway I'd like to know how far you could take this.


----------



## rochesterricer (Jan 5, 2011)

tomofreno said:


> Seems like it might be better to use multiple smaller motors that give the combined peak torque required, since you could likely maintain that torque out to higher vehicle speed then without as much gear shifting compared to using one larger AC motor. I think one group that has put a lot of thought into this is Mate Rimac's.


Doing something similar to Shawn Lawless' Lemon Juice truck certainly might be the path of least resistance. Although I don't get the impression that John is looking to find the easy way out, he wants to push limits and change paradigms.


----------



## gunnarhs (Apr 24, 2012)

jhuebner said:


> One more thought: torque is a function of slip AND terminal voltage. So twice the rated terminal voltage=twice the torque? If so, the same goes for breakdown torque and suddenly the magical factor of 4 could become an 8, 12, 16?
> I roughly remember that core saturation somehow limits something. Anyway I'd like to know how far you could take this.


Ok in my control I have done both but not at the same time, this would destroy any motor I have used at least. I have stuck to the limit having max torque 2,5 times nominal torque. But to iterate I have not been drag racing.
The maximum overvoltage I have used is 1,5 nominal voltage (for Siemens motor, less for standard motor)


----------



## jhuebner (Apr 30, 2010)

Yeah I guess its rather a scenario for custom wound motors. Of course I²R produces 256 times more heat at 16 times the current. But within 10s.. hmm


----------



## major (Apr 4, 2008)

jhuebner said:


> So twice the rated terminal voltage=twice the torque?


I don't think this is correct. It never worked that way for me


----------



## gunnarhs (Apr 24, 2012)

I have here pictures of the curves of Siemens 1PV5 series under different voltages (Power is increased by this motors by increasing the Voltage). One picture is showing the efficiency spectrum, the other shows the time the power/torque can be hold.
What you do by applying higher voltage is in practice that you move the base-speed to higher RPM (meaning you can hold max torque over longer RPM-range but only for a limited time). Here the time is shown specifically for the S14-winding type at 300 V.
Around base speed it is more efficient to increase voltage than slip to gain constant (max) torque (meaning you would like to hold slip constant low if possible to increase voltage for more torque). 
But in cases like startup condition (especially in stop/start situation) it can be better to allow more slip to lower startup current. 
This becomes important in vehicles with small battery-pack, used battery pack, and in cold conditions. In that case you do not produce max-torque which inevitable draws large current but just the torque you "need" to move the vehicle.


----------



## John Metric (Feb 26, 2009)

gunnarhs said:


> I have here pictures of the curves of Siemens 1PV5 series under different
> But in cases like startup condition (especially in stop/start situation) it can be better to allow more slip to lower startup current.
> This becomes important in vehicles with small battery-pack, used battery pack, and in cold conditions. In that case you do not produce max-torque which inevitable draws large current but just the torque you "need" to move the vehicle.


In god I trust all others need to bring data. Thanks for sharing this. 
Do you have anything showing frequency. In fact I would love to get anything you have on this family of motors. 

Also "Base speed"? It seems these charts always are for static conditions. 
Assuming we wanted only accelerating conditions and were not concerned with the battery pack, Would you advise maximum slip percentage? In fact the highest frequency and the highest voltage right from the start?

In fact, in my industrial background, in an "across the line" start, meaning you just throw a switch, and bring on 60HZ and full substation line voltage, is there any faster way to bring that motor up to speed? With an AC controller, I didn't say more efficient, I said faster.


----------



## jhuebner (Apr 30, 2010)

John Metric said:


> In fact, in my industrial background, in an "across the line" start, meaning you just throw a switch, and bring on 60HZ and full substation line voltage, is there any faster way to bring that motor up to speed? With an AC controller, I didn't say more efficient, I said faster.


Yes there is.
a) this is depicted by the slip/torque diagrams
b) I tested it.

I used a 220V motor at 80V, which makes it slow but well observable. Then
1) Set the inverter to a fixed frequency (say 50Hz) and started
2) Commanded full torque to slip control and started
The latter spins up way faster.

@gunnar: Informative diagrams, got any more?

Its not surprising that the base speed is moved up. I mean "base speed" is just some arbitrary operating point. But how much more torque can the motor deliver if you apply more voltage AT base speed while the slip remains unchanged?
Will the extra voltage and resulting current just go up in heat or will it produce more torque? Up to which point?
Major, you pointed out his never worked for you. How exactly did it not work?


----------



## major (Apr 4, 2008)

jhuebner said:


> Its not surprising that the base speed is moved up. I mean "base speed" is just some arbitrary operating point. But how much more torque can the motor deliver if you apply more voltage AT base speed while the slip remains unchanged?
> Will the extra voltage and resulting current just go up in heat or will it produce more torque? Up to which point?
> Major, you pointed out his never worked for you. How exactly did it not work?


For a particular motor, the breakdown torque is it. The maximum. Regardless of what you connect to it whether it be the mains or a megaWatt inverter. 

And base speed or base frequency isn't arbitrary. It is defined by the winding in the motor and applied voltage. This is often quantified as Volts/Hertz. Run lower than that ratio and you lose torque, as evidenced in field weakening (running above base frequency). Run higher than that ratio and you saturate and things get messy in a hurry, but you don't get more torque.

And using a flux vector drive on a motor and load can accelerate it much quicker than an across the line start because you essentially get breakdown torque from the start (zero RPM) instead of the lesser starting torque for the IM. It will also see lower phase current and source energy.


----------



## major (Apr 4, 2008)

John Metric said:


> Do you have anything showing frequency.


John,

It is a 4 pole motor. The frequency is RPM/30, give or take a few percent. Slip is typically less than 3Hz.




> Also "Base speed"?


From the spec sheet on your original post it appears base speed is 3000 RPM @ 650 VDC.

http://w3.usa.siemens.com/us/internet-dms/Internet/MarineComm/General/Docs/ELFA_Data%20Sheet.pdf


----------



## jhuebner (Apr 30, 2010)

major said:


> For a particular motor, the breakdown torque is it. The maximum. Regardless of what you connect to it whether it be the mains or a megaWatt inverter.


I don't buy it.
What magic goes on in a DC motor that makes it (supposedly) lack such an absolute maximum?



major said:


> And base speed or base frequency isn't arbitrary. It is defined by the winding in the motor and applied voltage. This is often quantified as Volts/Hertz


Ok, V/Hz isn't arbitrary, but something like [email protected]@230V is. For grid tie motors chosen for the simple reason that it is the grid frequency. You might as well specify [email protected]@460V.

Its exactly what happened to my 18.5kW Lenze motor that probably started live as a 7.5kW motor judging from its size. They wound it differently and now rate it at [email protected]@360V.



major said:


> Run lower than that ratio and you lose torque, as evidenced in field weakening (running above base frequency). Run higher than that ratio and you saturate and things get messy in a hurry, but you don't get more torque.


Gunnar states he ran at 1.5x nominal V/Hz. Thats exactly my point. You CAN push it above the nominal V/Hz. I agree its gets messy once the iron saturates. How big is the margin in practical examples, not in theory (no pun intended)?


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> Its not surprising that the base speed is moved up. I mean "base speed" is just some arbitrary operating point. But how much more torque can the motor deliver if you apply more voltage AT base speed while the slip remains unchanged?
> Will the extra voltage and resulting current just go up in heat or will it produce more torque? Up to which point?
> Major, you pointed out his never worked for you. How exactly did it not work?





major said:


> For a particular motor, the breakdown torque is it. The maximum. Regardless of what you connect to it whether it be the mains or a megaWatt inverter.
> 
> And base speed or base frequency isn't arbitrary. It is defined by the winding in the motor and applied voltage. This is often quantified as Volts/Hertz. Run lower than that ratio and you lose torque, as evidenced in field weakening (running above base frequency). Run higher than that ratio and you saturate and things get messy in a hurry, but you don't get more torque.
> 
> And using a flux vector drive on a motor and load can accelerate it much quicker than an across the line start because you essentially get breakdown torque from the start (zero RPM) instead of the lesser starting torque for the IM. It will also see lower phase current and source energy.


Torque on an assynchronous machine is dependednt, as major indicated, on the V/Hz Ratio, but not only that. On slip too. Because if you dont have slip there is no magnetic field on the rotor, hence the stator is a big inductor being charged on the on cycle, which returns the power on the off cicle of the inverter. This is REACTIVE POWER going from the inverter to the battery and so on, which causes nothing more than losses. 

100% torque is archieved at maximun current, however most industrial motors rated for continuous duty can go up to 200% torque at the expense of a higher current and thermal load. Quite often this is the maximun you can run with linear efficiency. At 250% current you get 220% torque and so on (This can be checked on the spec sheet or a particular motor). This is the base principle of motors with a lower duty cicle, such as 15min on/30min off. They run at maximun alowable torque with no overload capacity, which makes them small for a given power output, but because of the temperature rise continuous duty cycle is not allowed, or other methods like coolant or forced air cooling must be employed.
You can have a look at this info on any manufacturer catalogue

If only the voltage is increased you have a powerfull field on the stator, but a weak field on the rotor, so current will be returned to the inverter, as exp-lained above. On the other hand, if you increase the slip too much, you have a powerfull magnetic field on the rotor and a weak magnetic field on the stator, none of which will be optimun.

So yes, you can go past the optimun V/Hz ratio if you adjust your slip boost to your V/Hz profile, (assuming the motor/windings wont overheat) within a reasonable range which is 200% nameplate current, or whatever your motor specs say). The same is valid for over nameplate speed, since you run out of voltage you need to reduce the slip and hence the torque will fall. If you dont respect this and keep increasing the slip you are no longer working on the field weakening region and a result is a waste of power (Increase in current) without a proportional increase in torque (This might answer the question on your e-mail). Always remember the working principles of a series would DC motor. What happens at zero speed? Maximun torque. Now get a Shunt motor and try to get the same torque. You cant, because the rotor torque is not proportional to the stator torque. Again, this is why a series would can reach very high speeds that a shunt wound can not (obviously assuming no electronics).

The above should give you a light is why I have been discussing, on my mails, an inverter with variable V/Hz ratio that should be ajusted to the required torque and slip mantaining optimun conditions at all times, and hence maximun torque for unit of power delivered. Most comertial inverters fail to do this, the result is something that is not 100% optimun for vehicle use. It can work, but it will not be as energy efficient as it could be, since only slip is dictating maximun current or when the V/Hz ratio is too high for low slip conditions, such as coasting (Motor powered with 0Hz slip).


----------



## major (Apr 4, 2008)

jhuebner said:


> I don't buy it.
> What magic goes on in a DC motor that makes it (supposedly) lack such an absolute maximum?


For the DC machine there is no breakdown torque and the series wound DC machine avoids the demagnetization from armature reaction seen in PM and shunt motors. So the series motor has torque = armature current * flux. Flux assumes a fairly constant value as the core is saturated but current can continue to increase and increase torque. The limit is no longer a function of the electromagnetics, but rather in the ability to manage thermal and commutation issues. Guys like John have figured out how to manage those issues for the 8 or 9 second duty cycle, most of the time


----------



## McRat (Jul 10, 2012)

I'm stupid.

Can someone explain why stall torque (or whatever you want to call it), is significant at all under any circumstance?

All motors of all types have a stall torque. Don't believe it? Drop the clutch.

You control torque via gearing, not at the motor.

Or is it that you desire to make magic HP? 

Why is there such importance laid at the alter of torque? It's perhaps the easiest thing to adjust.

Want over 60,000ftlb torque at the tires? Been there. 30:1 reduction with 2000ftlb at the crank. 

The same truck went 197mph at Bonneville with less torque at the motor.

There is no magic about electricity. A 100HP max electric motor cannot go faster than the HP will take it.

The aftermarket EV parts deny that 400-2000 volts can improve anything.

The first hotrodder to use 1000vdc effectively is going to kick ass. That means no brushes.


----------



## major (Apr 4, 2008)

jhuebner said:


> Gunnar states he ran at 1.5x nominal V/Hz. Thats exactly my point. You CAN push it above the nominal V/Hz. I agree its gets messy once the iron saturates. How big is the margin in practical examples, not in theory (no pun intended)?


It could well be that his particular motor was conservatively rated originally. 1.5x sounds excessive IMO. I can buy 1.2x, maybe 1.3x, but John is looking for 4 or 5x. Ain't going to happen.

edit:



jhuebner said:


> Gunnar states he ran at 1.5x nominal V/Hz.


That's not exactly what he said. See below. He said 1.5x Voltage, not V/Hz. He doesn't say, but may have increased frequency as well.



gunnarhs said:


> The maximum overvoltage I have used is 1,5 nominal voltage (for Siemens motor, less for standard motor)


----------



## John Metric (Feb 26, 2009)

cts_casemod said:


> Torque on an assynchronous machine is dependednt, as major indicated, on the V/Hz Ratio, but not only that. On slip too. Because if you dont have slip there is no magnetic field on the rotor, hence the stator is a big inductor being charged on the on cycle, which returns the power on the off cicle of the inverter. This is REACTIVE POWER going from the inverter to the battery and so on, which causes nothing more than losses.
> 
> 100% torque is archieved at maximun current, however most industrial motors rated for continuous duty can go up to 200% torque at the expense of a higher current and thermal load. Quite often this is the maximun you can run with linear efficiency. At 250% current you get 220% torque and so on (This can be checked on the spec sheet or a particular motor). This is the base principle of motors with a lower duty cicle, such as 15min on/30min off. They run at maximun alowable torque with no overload capacity, which makes them small for a given power output, but because of the temperature rise continuous duty cycle is not allowed, or other methods like coolant or forced air cooling must be employed.
> You can have a look at this info on any manufacturer catalogue
> ...


This is fabulous, learning a lot here.
So if I were to pose a couple of "system requirements" to you guys, can we come up with the settings here for a drag race vehicle where pretty much only acceleration is needed.

1. Not interested in getting into the "field weakening" zone of the motor. (not interested in the motor starting to fall in horsepower above a certain rpm. I want to stay in the maximum torque from zero rpm up to "base speed". I'll handle the rest of the car design)
2. Not interested in the motor heat build up or internal heating due to I^2R or induction heating,(I am assuming the super short duty cycle and the ability to keep the conductors from melting will be taken care of by my IGBT budget to supply current to the system.) The shortest 'Nameplate ratings" I have seen are one minute readings. We are talking at least one sixth of that duty cycle, perhaps even one tenth of that duty cycle. So to me the 150% or 200% of nameplate current ratings can be stretched.
3. Would like the controller or motor to not blow up on each run. But once or twice a year might be the cost of doing business.
4. Assume the controller keeps the current and voltage within controller component design levels.
5. Assume we can go much nearer the motor design insulation voltage if needed.
6. Assume we can go much higher than the 100% duty cycle current rating or even the 60 second duty cycle rating.
7. Assume the battery has plenty of energy storage and power delivery potential and is not the bottleneck so electrical efficiency of the motor or other components is not the issue and battery sag will improve each year so we don't want to design for a saggy battery.

What settings (V & hz) to get the motor up to base speed in the quickest time (not most efficient).


----------



## cts_casemod (Aug 23, 2012)

major said:


> It could well be that his particular motor was conservatively rated originally. 1.5x sounds excessive IMO. I can buy 1.2x, maybe 1.3x, but John is looking for 4 or 5x. Ain't going to happen.


Industrial motors are rated conservatively. 
The have continuous duty cycle. Manufacturer specs show that overload is possible for a few seconds, limited by temperature increase, but they show overload using the same mains voltage or V/Hz profile, which results in excessive slip and hence excessive rotor temperature increase. For this reason EV type motors have copper rotors that allow less losses and higher temperatures. by increasing the voltage the losses on the rotor can be reduced and the stator can more easily be cooled as it is in contact with the outer casing.

On a vehicle torque is variable and I may well use 200% torque, and hence the equivalent flux without loss of efficiency, however at 300% current only 300% torque will result. This is no different from a series motor. There is a limit where saturation occurs and flux is no longer proportional to current. Its a trade-off. On a real road EV altough high power is needed for acceleration many times the car is coasting/stopped so the motor has time to cool down. 

On a drag race the story may well be different

*
Oh just as a side note:*

EV type motors that are rated at 150HP are actually intermitent dutty motors. they are likelly 7.5 to 11KW if rated as industrial motors. Granted they are forced cooled and have copper rotors, which might push the power above what an industrial one could go, but while I can say an industrial 7.5HP can have 100HP easily, the same is not true for a comertial EV motor, since the nameplate HP is a peak value. they know you cant put continuously 150HP to the wheels and they also rely on overvoltage, since most of these motors are rated at 90VAC but run at over 200VAC (300VDC)


----------



## major (Apr 4, 2008)

McRat said:


> I'm stupid.
> 
> Can someone explain why stall torque (or whatever you want to call it), is significant at all under any circumstance?
> 
> ...


Power = Torque * RPM. Want power? You need both; torque and RPM, right?

You keep going on about gearing for torque. I can say the same thing about RPM, can't I? What you can't gear up is power.

John is just trying to figure out how to get the same power out of an AC drive as he has been able to push out of his DC. When his DC drive can put out 5 times the torque it is proving difficult. We can't really run the AC at 5 times the RPM.

And in your battery thread you're super safe with a 4V cell but here you advocate a couple thousand Volts on the race track. That concerns me. I'd really like to see racers kept below 400  Too much unexpected sh!t happens on the track.


----------



## cts_casemod (Aug 23, 2012)

John Metric said:


> This is fabulous, learning a lot here.
> So if I were to pose a couple of "system requirements" to you guys, can we come up with the settings here for a drag race vehicle where pretty much only acceleration is needed.
> 
> 1. Not interested in getting into the "field weakening" zone of the motor. (not interested in the motor starting to fall in horsepower above a certain rpm. I want to stay in the maximum torque from zero rpm up to "base speed". I'll handle the rest of the car design)
> ...



For nameplate RPM increase simply increase the voltage. A 90V 1440RPM motor can work at 180V 2880RPM, assuming the windings can withstand this. This is how EV type motors work. They are re-winded for a low voltage at what you can call nominal power on an industrial motor. Since you can then mantain torque up to higher RPMs your HP increases accordingly. They also make use of MAXIMUN power and not continuously rated power as industrial types, offer forced cooling and rotors capable of higher temperatures.

This goes back to the times of the DC machines. The Warp 9 is likely to be a 72-90V motor, but people run them as high as 192V, others use 48V DC motors with 90-144V, Etc, Etc. You do this because its a car has intermitent duty cycle. You wouldnt do it on an industrial machine running 24/7, hence the different ratings

Inverter wise you would be better with a custom made DC series motor for that purpose. The electronics on an induction machine are quite complicated and thermal dissipation on a DC machine is often better since these are open frame. Most coolant cooled Induction machines are closed inside, so rotor temperature could be an issue. if you really want to go this route find one with a coper rotor, but inverter i wont be able to give you solutions yet. Ac motors are just prefered because of the lack of maintenance and regenerative options. A perfect AC system could only have so much efficiency as a series would machine and currently they have slightly LESS. Regeneration is what closes the gap, but for a drag vehicle it is useless.


----------



## McRat (Jul 10, 2012)

major said:


> Power = Torque * RPM. Want power? You need both; torque and RPM, right?
> 
> You keep going on about gearing for torque. I can say the same thing about RPM, can't I? What you can't gear up is power.
> 
> ...


Is 125 psig boost safe? No. Is an 8000 hp Hemi safe? No.

Even if the vehicle driveline is safe (no such animal), the speeds required to defeat other racers is not.

If you did have 2000 vdc, at 1000amps, you could only muster 2700 HP max.

This is exactly what the diesel guys are hitting. We can make the torque of a TF dragster, but not the RPM. Hence we will never compete.

All I am saying is that torque is not your goal. HP is.


----------



## John Metric (Feb 26, 2009)

jhuebner said:


> Yes there is.
> a) this is depicted by the slip/torque diagrams
> b) I tested it.
> 
> ...


Anybody have a slip/torque diagram for this family of siemens motor?


----------



## cts_casemod (Aug 23, 2012)

McRat said:


> The aftermarket EV parts deny that 400-2000 volts can improve anything.
> 
> The first hotrodder to use 1000vdc effectively is going to kick ass. That means no brushes.


True but you would not run such voltages on a car. Any electric car with a big battery pack is a bomb on its own let alone with voltages and currents capable of vaporizing metal. 

Some people have "cohones" to place a 20KW battery pack on the engine compartment. I just wish they never have a serious front crash with a lithium pack.

Sure you could have all that performance, but you also want to get alive from a crash in an electric car.


----------



## subcooledheatpump (Mar 5, 2012)

you may want to consider an oil filled motor. 

better bearing lubrication, needed for high speed operation

better motor cooling, both rotor and stator, needed for high current operation

higher dielectric strength, needed for high voltage operation

the catch, rotor drag and figuring out a good oil seal

just my thoughts. 

can't wait to see what you can come up with. sounds quite dangerous but still I'm interested


----------



## major (Apr 4, 2008)

McRat said:


> All I am saying is that torque is not your goal. HP is.


If I have 1 Nm of torque, how do you get me 2700hp? Kind of tough isn't it? You need both: Torque and RPM.

On the other hand, I can have 10,000 Nm of torque at 1 RPM, or 0 RPM, or 5000 RPM. Torque is actually "the Force". But let's not go there in this thread. Been there; done that  http://www.diyelectriccar.com/forums/showthread.php/torque-irrelevant-relevanti-36904.html


----------



## John Metric (Feb 26, 2009)

From Siemens, here is a laymans language description of the startup torque, pull up torque and breakdown torque, etc...
pg 38, 39, 40

http://www.industry.usa.siemens.com/topics/us/en/archivedsites/quickstep/Documents/ac_motors.pdf

Calls out starting currents 600-650% of nominal are typical for NEMA class B motors. pg 40

Also, I need to change my references to reaching "base speed" to reaching "breakdown torque". Maybe slightly past "breakdown torque" you are still making great horsepower.. If you reach "base speed" you are not making drag racing power....
That peak power looks like around 70-75% of synchronous speed(at line frequency).


----------



## McRat (Jul 10, 2012)

cts_casemod said:


> True but you would not run such voltages on a car. Any electric car with a big battery pack is a bomb on its own let alone with voltages and currents capable of vaporizing metal.
> 
> Some people have "cohones" to place a 20KW battery pack on the engine compartment. I just wish they never have a serious front crash with a lithium pack.
> 
> Sure you could have all that performance, but you also want to get alive from a crash in an electric car.



I've heard this all my life. A 10 gallon gas tank has enough energy to leave a 10 ft wide crater in the ground.

Racing is not about "safe". It's about acceptable limits. The biggest risk is the driver. 

You want your mass as low as possible, and centered to the vehicle. The protection hardware focuses on the driver's seat.

Racing is racing. It's a balanced risk. You put enough safety gear in to survive most crashes. You can never put enough in to survive all of them.


----------



## major (Apr 4, 2008)

John Metric said:


> From Siemens, here is a laymans language description of the startup torque, pull up torque and breakdown torque, etc...
> pg 38, 39, 40
> 
> http://www.industry.usa.siemens.com/topics/us/en/archivedsites/quickstep/Documents/ac_motors.pdf


Since you will have a drive controlling the motor, the relevant chart is on page 47.


----------



## cts_casemod (Aug 23, 2012)

McRat said:


> I've heard this all my life. A 10 gallon gas tank has enough energy to leave a 10 ft wide crater in the ground.
> 
> Racing is not about "safe". It's about acceptable limits. The biggest risk is the driver.
> 
> ...


I too heard many people saying HV is better and I am sure new members will think its safe to play with 1000VDC just because they can. It is not and if one knows the risks and acepts to take them its a personal decision hence things need to be put in perspective.

I am by no means saying it is safer to have a full tank of fuel on an ICE


----------



## McRat (Jul 10, 2012)

major said:


> If I have 1 Nm of torque, how do you get me 2700hp? Kind of tough isn't it? You need both: Torque and RPM.
> 
> On the other hand, I can have 10,000 Nm of torque at 1 RPM, or 0 RPM, or 5000 RPM. Torque is actually "the Force". But let's not go there in this thread. Been there; done that  http://www.diyelectriccar.com/forums/showthread.php/torque-irrelevant-relevanti-36904.html


Meh. I was turning 15,000 rpm in 1976. This was before anyone turned that fast. Hence I kicked 1000cc ass with 650cc.

Electric does not have the RPM limits that reciprocating engines do.

If you are not shooting for 50,000 rpm +, you are a niche racer. ie -handicapped.


----------



## McRat (Jul 10, 2012)

Sorry, I'm fixing a rotary air compressor and my helper didn't show up. ie - I'm cranky.

I do know that RPM is your friend. But most my records were set with diesels. Odd eh? Diesel fuel is RPM limited to about 6000. My claim to fame is spinning faster though.


----------



## jhuebner (Apr 30, 2010)

John Metric said:


> This is fabulous, learning a lot here.
> So if I were to pose a couple of "system requirements" to you guys, can we come up with the settings here for a drag race vehicle where pretty much only acceleration is needed.
> 
> 1. Not interested in getting into the "field weakening" zone of the motor. (not interested in the motor starting to fall in horsepower above a certain rpm. I want to stay in the maximum torque from zero rpm up to "base speed". I'll handle the rest of the car design)
> ...


Ok, I think all important bits and pieces have by now been mentioned. Let me summarize.

1) To increase horse power you have to components: speed (rpm) and torque.
2) To increase speed you need to rewind your motor to a lower voltage to avoid some kV battery pack
3) To maximize torque on an ACIM you must run it with breakdown slip and above the rated V/Hz ratio

Things to do:
1) Pick your base motor
2) Find out about its maximum speed by experimenting. The acim in my humble Ligier spun up to 12000 rpm and looked like a pretty normal industrial acim. Ok, no more speculations, test it. This indeed has a lot of potential to increase your power output.
3) Find out up to what point increasing the V/Hz ratio results in usable torque. If you don't have means to measure torque directly I can help you out with the inverter software. As mentioned this may result in a torque increase of 1.2 to 1.5 or even more.
4) Now rewind the motor so that you reach that maximum speed before you enter the (NEW) field weakening region. If its now [email protected] rewind it to [email protected] (totally made up values). Cramp as much copper into the slots as you possible can.

Example:
1) You start with a 70hp motor whos power is about 3-fold when running at breakdown torque. ->210hp
2) You find out that you can spin up to 16000rpm (maybe with additional balancing) instead of 3000rpm. ->1120hp
3) You figure you can increase V/Hz by a factor of 1.3. ->1456hp


----------



## Arlo (Dec 27, 2009)

Hey guys. Im trying to get a idea of how hard you can run IGBTs.

I have experience with mosfets and kind of understand their limits. IE about 40-50% of the rated numbers 

What about igbts. Say something was rated for 400 amps and 650volts.
Can I run this at 400 amps ever? even if its peak amps in a sine wave?

Im looking to get a leaf motor running with leaf voltage 411v fully charged and 360 nominal...

Im asking because im on a budget but looking to only buy the inverter stage once. I have all the stuff for the Brain sorted out and Im looking at IPMs with the driver board.


----------



## cts_casemod (Aug 23, 2012)

Arlo said:


> Hey guys. Im trying to get a idea of how hard you can run IGBTs.
> 
> I have experience with mosfets and kind of understand their limits. IE about 40-50% of the rated numbers
> 
> ...



400Amps @ 400V from the pack or 400Amps motor peak?

Same as mosfets. Dont forget the reactive powers. You dont see them, but they are there.

411 fully charged you might be able to get away with 600V IGBT's
I Think you could just limit the motor at 200Amps and use some 400Amp IGBT's to be safe. You need a lot of batteries to even drain more than that.

Dont get an IPM. Get jhuebner full kit and some decent IGBT's. He will be able to assist you.

What kind of motor does the leaf take? Is that induction?


----------



## Arlo (Dec 27, 2009)

cts_casemod said:


> 400Amps @ 400V from the pack or 400Amps motor peak?
> 
> Same as mosfets. Dont forget the reactive powers. You dont see them, but they are there.
> 
> ...


Motor amps which is what the igbts or mosfets care about. 
I have 7 800 amp 1200 volt igbts to play with if needed.
The leaf motor is PMAC I want to be able to go to at least 400 amps. Even if not right away. It will be 400 phase amps but with the right settigns at the peak of the HP it will be close to 400 battery amps and with field weakening the battery amps can be more then the phase (motor amps)


----------



## Arlo (Dec 27, 2009)

And I'm not worried about batteries. I will likely use Some lipo with a decent C rating like the enerdel power cells maybe RC lipo to get it going.
Oh and Im very interested in what he has done here I'm open to a lot of options. I never realized he had so many kits. The IGBTs I have are single switches with no diodes so its more work and I would like a more plug and play system. I have success with lower voltage up to 350 phase amps with stuff I have build and designed but Im more looking to get this Leaf motor ready in a timely matter.


----------



## gunnarhs (Apr 24, 2012)

John Metric said:


> This is fabulous, learning a lot here.
> So if I were to pose a couple of "system requirements" to you guys, can we come up with the settings here for a drag race vehicle where pretty much only acceleration is needed.
> 
> 1. Not interested in getting into the "field weakening" zone of the motor. (not interested in the motor starting to fall in horsepower above a certain rpm. I want to stay in the maximum torque from zero rpm up to "base speed". I'll handle the rest of the car design)
> ...


I found this paper when looking through thread
http://media3.ev-tv.me/Azure300VDC-400Acurve.pdf

Ok, assuming you are using the 650V 1PV138_4WS24, which is a bit different to the specs above (higher Voltage, lower nominal current)
see http://www.hec-drives.nl/Specs Siemens 1PV51XX.pdf
you should be able to push the max-current over the max rated 300A (but not more than 400A) for short time by increasing the voltage a bit and not exceeding 3000 RPM. 
For the lower Voltage 1PV135 motors it is possible to increase voltage more (theoretically 2-times I have done 1,5 for 200V motor) but anyway it would give less torque than the 138 gives. so for you it would be better to use 138 if possible and you have no battery limits. 
(I have only used 138 with fuel cell)

And now how to get started. the curves I have posted are for steady state as you say. I have not found any curves for startup conditions so I have to rely on own experience here and compare it with standard motors which you have a good documentation about (Nema-motors).
The problem I have been on the other side of the spectrum regarding range and efficiency instead of instant torque. And I have not the fuel cell available now, only a quite worn battery pack.

1) As stated before I have used slip control as well as (first part of) FOC for standard motors I have used slip-control at start to optimize startup current. 
In your case you would have to do the opposite, you would have to apply the FOC with maximal possible flux but without exceeding 400 Amps. Note I do not often recommend FOC like read in literature but in this case I definitely would. especially for this kind of motors.

2) You can play a bit with the startup-frequency (startup-slip) but I would not let the slip exceed 20Hz for this motor (no problem for standard motor). So as it is no problem for a standard motor to throw get 50 Hz at maybe 50% of rated voltage at startup I would be careful with 1PV5.

3) How much torque do you need? assuming each of your motors would put out 600 Nm at lets assume 700V RMS (1000 V DC) , you would have 1200 Nm available from 0-3000 RPM. This was the same as in our fuel cell Bus(!) at MAN.

I was digging out old papers, the MAN-bus had the (high-voltage) 75KW 1PV5135 inside, not the 138 http://www.brennstoffzellenbus.de/bus/index.html (older version)
Our test-equipment was able to produce 1000V but only half voltage was applied in the bus (was a low speed version for Airport)
So max-torque values would have been about only 800-900 Nm


----------



## cts_casemod (Aug 23, 2012)

Arlo said:


> And I'm not worried about batteries. I will likely use Some lipo with a decent C rating like the enerdel power cells maybe RC lipo to get it going.
> Oh and Im very interested in what he has done here I'm open to a lot of options. I never realized he had so many kits. The IGBTs I have are single switches with no diodes so its more work and I would like a more plug and play system. I have success with lower voltage up to 350 phase amps with stuff I have build and designed but Im more looking to get this Leaf motor ready in a timely matter.


Have a look at the tumanako project


----------



## major (Apr 4, 2008)

subcooledheatpump said:


> you may want to consider an oil filled motor.
> 
> better bearing lubrication, needed for high speed operation


Hi subcool,

Drag with the rotor in oil becomes too much above a few thousand RPM. It does work well for low speed continuous operation, but up in the range we're looking at, it's a loser. If needed, you could flood the motor to cool it in between passes. During the actual pass of 5 to 15 seconds, the mass of the parts is all that is going to count for temperature rise. 

Oil lubed bearing (drip or mist) is a good idea for the speeds I imagine he'll be working. I've used it on induction rotors up to 12krpm and as large as 286T size cast aluminum cage with precision balance and the paddles machined smooth. Or look at ceramic balls. 

Have you got your AC running again?

major


----------



## aeroscott (Jan 5, 2008)

Gas cooling with a water heat exchanger like the huge GE generators .
He or H2 they use H2 .


----------



## Hollie Maea (Dec 9, 2009)

The motors they use in the Rimac have an oil cooled rotor, but not submerged.


----------



## Arlo (Dec 27, 2009)

Hollie Maea said:


> The motors they use in the Rimac have an oil cooled rotor, but not submerged.


The leaf motor is water glycol cooled but its through the stator housing. It would be smart to have something pulling heat from the windings them selfs. 

As major wrote rpm matters with oil and the stiction it creates. if you can get the level just right to keep most of the oil off of the rotor and have it still spray the windings you will have low amounts of drag. But this all depends on the application. If It runs 10-15 seconds at a time it might not help to cool it at all during the run time just before and after....


----------



## Hollie Maea (Dec 9, 2009)

Arlo said:


> if you can get the level just right to keep most of the oil off of the rotor and have it still spray the windings you will have low amounts of drag.


Right, that's what I'm saying--with correct design, you can cool the whole motor without undue drag. EVdrive sells a similar motor, and they are able to get 500kw CONTINUOUS out of a 230 pound motor. While a Siemens motor--only cooling the stator--of a similar size is only rated continuously at around 65kw.


----------



## major (Apr 4, 2008)

Hollie Maea said:


> Right, that's what I'm saying--with correct design, you can cool the whole motor without undue drag. EVdrive sells a similar motor, and they are able to get 500kw CONTINUOUS out of a 230 pound motor. While a Siemens motor--only cooling the stator--of a similar size is only rated continuously at around 65kw.


Got a link for that motor?


----------



## toddshotrods (Feb 10, 2009)

major said:


> Got a link for that motor?


http://www.evdrive.com/products/evd-motor-controller/

Last one on the page. A real bargain! 

Also, you should enjoy their validation of the Remy core...


----------



## Hollie Maea (Dec 9, 2009)

toddshotrods said:


> A real bargain! :D
> [/QUOTE]
> Yeah... just out of drooling over the engineering :)


----------



## major (Apr 4, 2008)

toddshotrods said:


> http://www.evdrive.com/products/evd-motor-controller/
> 
> Last one on the page. A real bargain!


A couple of those should get John what he wants.


----------



## toddshotrods (Feb 10, 2009)

Hollie Maea said:


> Yeah they are expensive as all hell, especially if you are buying one off.
> 
> But I get plenty of value just out of drooling over the engineering


Agreed. I was seriously thinking about, eventually, taking the plunge on:

*EVD150HV-Rcr-90s-602-720vdc matched motor & 150kW RMS Inverter/ controller - Price: $20,170 USD* 

...as it's just about where I want to be, for power, on the bike; and I had a plan to sell my soul to raise the money for it. 

Honestly, after following the debate in this thread, I am almost convinced that I should just stick with DC for Scrape. If I were building a car, I would be mesmerized with the thought of two of those 500kw systems, spinning up to 8500+ RPM. With the bike, as I considered both sides of the _argument_ here, I realized that there doesn't seem to be a lot of difference between DC at 7K RPM (small diameter motor) with gobs of torque, and AC at 10K RPM with less torque and more gear.

The rabbits in the hat for me are, 300lb vehicle weight, and a small motor. When you move up to a 1500-2500lb vehicle, and 11-13" motors, weight and RPM become serious hurdles for the low-RPM big DC motors to overcome.


----------



## toddshotrods (Feb 10, 2009)

major said:


> A couple of those should get John what he wants.


Actually the cost can come down, significantly, for drag racing. A lot of what you're paying for there is EVDrive's engineering. A drag racer probably doesn't need the oil cooling system (case is designed specifically to make that work effectively), so just buy the Remy cores - four of them - and Rinehart drives - four of them. Put all four cores in a big, long, air-cooled, case, with the drives mounted close by...

I would say figure out how to make the jhuebner kit run them, but those motors are IPM - not sure what would be involved in that. You're also paying for EVDrive's investment in having Rinehart tune their drives to work with the Remy cored EVD motors - Rinehart says about two week$ on the dyno for that.


----------



## jhuebner (Apr 30, 2010)

toddshotrods said:


> I would say figure out how to make the jhuebner kit run them, but those motors are IPM - not sure what would be involved in that. You're also paying for EVDrive's investment in having Rinehart tune their drives to work with the Remy cored EVD motors - Rinehart says about two week$ on the dyno for that.


Unfortunately PM drives are untested. I can use a testbench at university but only in April.


----------



## tylerwatts (Feb 9, 2012)

Are pm drives not just (simplistically) a different timing arrangement since the field in the rotor is already present and not being induced, therefore you want an opposite polarity as the rotor field approaches the pole in rotation then an equal polarity as it passes to drive it onwards in rotation.


----------



## Arlo (Dec 27, 2009)

tylerwatts said:


> Are pm drives not just (simplistically) a different timing arrangement since the field in the rotor is already present and not being induced, therefore you want an opposite polarity as the rotor field approaches the pole in rotation then an equal polarity as it passes to drive it onwards in rotation.


Requires different code. And some sort of position sensor that's different as well. Also some PMAC motors are very low inductance which requires higher PWM. 

I am not worried about all that I have a amazing brain stage that does more then I can ask for. I just need to build a power stage.


----------



## toddshotrods (Feb 10, 2009)

Arlo said:


> ...And some sort of position sensor that's different as well...


I think they use a resolver, instead of a Hall sensor.


----------



## Arlo (Dec 27, 2009)

toddshotrods said:


> I think they use a resolver, instead of a Hall sensor.


You can use many differ things. 
Sine/co-sine, 3 halls, a hall type resolver, The brain I have switches to sensorless once the rpm comes up and I have a new one that measures inductance of each phase to determine rotor position so it can run sensorless all the time it produces a hum in the motor at 0 rpm to know where the position is. I will be testing that one soon.


----------



## jhuebner (Apr 30, 2010)

tylerwatts said:


> Are pm drives not just (simplistically) a different timing arrangement since the field in the rotor is already present and not being induced, therefore you want an opposite polarity as the rotor field approaches the pole in rotation then an equal polarity as it passes to drive it onwards in rotation.


Yeah I discussed this earlier with Valery. I reckon a PMAC motor can be run with slip control but without slip. Ok, Pizza Funghi without mushrooms.

No seriously, what the current algorithm does, is precisely track the rotors position on EVERY PWM cycle. In case of a PMAC it just needs to follow that position. When the sine amplitude is greater than what the motor generates at a given speed, torque is produced. If the amplitude is smaller negative torque is produced.
Of course with that algorithm you can't go into the field weakening region.


----------



## toddshotrods (Feb 10, 2009)

Arlo said:


> You can use many differ things...


I should have been more specific - I meant, I think that's what the manufacturers (where these motors come from) use. Physically, changing the senor isn't a huge deal, but since Rinehart and Tritium both have capability to read input from resolvers, and the "big boys" seem to be using them, I'm guessing they're more precise or something?






jhuebner said:


> ...Of course with that algorithm you can't go into the field weakening region.


Which is an interesting point to consider, when thinking about IPM, because field weakening seems to be the clue to getting 8-10K RPM out of them. So, without that, a standard ACIM might be a better choice with this controller...?


----------



## tylerwatts (Feb 9, 2012)

Or design/wire the motor for low voltage and run it at high voltage so that you effectively reach your target rpm before reaching field weakening. It also means you have Max torque throughout the rev range. But this might be asking alot, running that much flux through a core could reach saturation point before reaching desired rpm.


----------



## jhuebner (Apr 30, 2010)

toddshotrods said:


> I should have been more specific - I meant, I think that's what the manufacturers (where these motors come from) use. Physically, changing the senor isn't a huge deal, but since Rinehart and Tritium both have capability to read input from resolvers, and the "big boys" seem to be using them, I'm guessing they're more precise or something?


Resolvers are analog, so you get an angle reading at any given instant. And they are supposedly cheap to build.



toddshotrods said:


> Which is an interesting point to consider, when thinking about IPM, because field weakening seems to be the clue to getting 8-10K RPM out of them. So, without that, a standard ACIM might be a better choice with this controller...?


Absolutely, I do not recommend this controller if you want to run a PMAC out of the box. Not saying it won't work but its untested.


----------



## Arlo (Dec 27, 2009)

tylerwatts said:


> Or design/wire the motor for low voltage and run it at high voltage so that you effectively reach your target rpm before reaching field weakening. It also means you have Max torque throughout the rev range. But this might be asking alot, running that much flux through a core could reach saturation point before reaching desired rpm.


Also lowers the motor phase/phase inductance which makes for a harder to drive motor.


----------



## jhuebner (Apr 30, 2010)

tylerwatts said:


> running that much flux through a core could reach saturation point before reaching desired rpm.


Question: are you running any more flux through the core at 10000rpm compared to 1000rpm? If so, why?


----------



## jackbauer (Jan 12, 2008)

Bit more progress. Got the gate drivers and main board mounted. Also contactor and hv wiring installed.


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> Bit more progress. Got the gate drivers and main board mounted. Also contactor and hv wiring installed.


Nice work! And a good intermission from our journeys to theory 
Did you do any test runs so far? I mean not power-wise but logic-wise.


----------



## tylerwatts (Feb 9, 2012)

Jheubner, I was of the impression you run the same phase current across the rpm (until field weakening needs extra voltage) and voltage increases with rpm. So total phase power increases with rpm hence the magnetic strength proportional to time increases and thus saturation may be reached too soon. 

Am I wrong. I'll openly admit I am not an expert or even experienced to say otherwise. Just my understanding.


----------



## jhuebner (Apr 30, 2010)

I think its easier to understand with PMACs. The strength of the magnets stays the same no matter how fast you spin. The incoming current is converted 100% (neglecting ohmic and stray losses) to motion - not flux.
Right?

I have a hunch thats is the same story with an ACIM. Only the constant slip (frequency) is converted to flux.

My understanding is that you can only saturate the motor by excessively exceeding its operating voltage at any given frequency. So if its rated [email protected] and you run it with [email protected] the iron will saturate.

Maybe a word on saturation:









You charge a ferromagnetic material with magnetic flux. At some point its fully charged (like a battery) and doesn't accept any more energy. If you stay on the steep slope you're fine.

That is what happens when operating at high frequency: you stay on the steep slope but run up and down very fast.


----------



## John Metric (Feb 26, 2009)

jhuebner said:


> Ok, I think all important bits and pieces have by now been mentioned. Let me summarize.
> 
> 1) You start with a 70hp motor whos power is about 3-fold when running at breakdown torque. ->210hp
> 2) You find out that you can spin up to 16000rpm (maybe with additional balancing) instead of 3000rpm. ->1120hp
> 3) You figure you can increase V/Hz by a factor of 1.3. ->1456hp



That's what I am talking about.


----------



## bLdC (Jan 21, 2013)

jhuebner said:


> I think its easier to understand with PMACs. The strength of the magnets stays the same no matter how fast you spin. The incoming current is converted 100% (neglecting ohmic and stray losses) to motion - not flux.
> Right?


And don't forget it is temperature dependent. 
It will look something like this for the magnest in the furnace. 
For low temperatures the field strength is much better. Notice the graph for 20 C.
magnet hysteresis graphs.png


----------



## Tesseract (Sep 27, 2008)

jhuebner said:


> Example:
> 1) You start with a 70hp motor whos power is about 3-fold when running at breakdown torque. ->210hp
> 2) You find out that you can spin up to 16000rpm (maybe with additional balancing) instead of 3000rpm. ->1120hp
> 3) You figure you can increase V/Hz by a factor of 1.3. ->1456hp


No, you are not going to be able to hit the same level of breakdown torque you get at base speed (or below) as you will much above base speed (never mind many multiples of base speed). The rotor and stator leakage reactances will see to that. Which is to say, as RPM climbs above base speed it becomes harder to induce enough flux into the rotor to achieve breakdown torque. If you look at any inverter-driven AC motor speed/torque graph you will see a constant torque region from 0 to base speed, then a constant power region (where the decline in torque is matched exactly by the increase in speed) from base speed up to a certain RPM level, then above that motor power starts to decline. 

Increasing the V/Hz ratio over what is needed for the motor to develop maximum torque won't do anything useful, either; you're just over-exciting the motor which will likely result in reduced torque output and definitely result in higher reactive current between inverter and motor (and that current eats into the available current rating just the same as the "useful" torque producing component of current).


----------



## tomofreno (Mar 3, 2009)

Leakage reactance increases with frequency but it seems that just means you need to apply more voltage for a given unit flux increase. Base speed is defined as the point where the inverter can no longer continue to increase voltage to match voltage to frequency, which is limited by the DC bus or pack voltage. Increasing pack voltage enables moving the base speed out to higher frequency. In this sense there is no one base speed for a motor, it depends on the inverter and battery pack (both max voltage and max frequency). See for example, _Electrical Machines and Their Applications _by John Hindmarsh, fig 7.24 a family of torque-speed curves for constant flux per pole (i.e. constant V/f). There will be other effects I’m sure, such as increased Eddy current losses and somewhat higher copper losses due to the skin effect at higher frequency, but it’s not clear to me what the limiting factors (though I’m sure they exist) and the upper limit will be for increasing the base speed of a given motor with higher applied voltage, i.e. what determines the point where you get no extension of the constant torque region out to higher motor rpm by increasing V and f. But then I’m not a motor designer.


----------



## jhuebner (Apr 30, 2010)

Tesseract said:


> No, you are not going to be able to hit the same level of breakdown torque you get at base speed (or below) as you will much above base speed


You do realize I intended a motor rewind in my original post? Thats meant to shift the base speed to the said rpm region.

I do agree that the increase in hp might not quite be as linear as I sketched it. Leakage reactance and skin effect, like you say.

Asynchronous spindle machines reach 50000rpm. So its not unheard of in the ACIM world.

Anyway, the one to judge how well this is gonna work isn't you or me. Its the motor.


----------



## Tesseract (Sep 27, 2008)

tomofreno said:


> Leakage reactance increases with frequency but it seems that just means you need to apply more voltage for a given unit flux increase.


If all you had to worry about was the stator leakage reactance, then sure, just boost the V/Hz ratio with increasing RPM, but the rotor leakage reactance is what is important here, and its impedance is proportional to slip. As the impedance of the rotor leakage reactance approaches that of the rotor bar resistance, maximum possible torque declines. This is why increasing the rotor resistance can improve torque development at high slip.



tomofreno said:


> Base speed is defined as the point where the inverter can no longer continue to increase voltage to match voltage to frequency, which is limited by the DC bus or pack voltage. Increasing pack voltage enables moving the base speed out to higher frequency.


Yes, VFDs complicate the definition of "base speed," so I prefer to think of it as the synchronous RPM of the motor when it is driven with the designed value of voltage and frequency. In other words, base speed defines the V/Hz ratio for fully-fluxed operation.





jhuebner said:


> You do realize I intended a motor rewind in my original post? Thats meant to shift the base speed to the said rpm region.


That is irrelevant. You can rewind the stator all you want, but the rotor parameters are the ultimate determinant of peak torque (and therefore peak power).



jhuebner said:


> Asynchronous spindle machines reach 50000rpm. So its not unheard of in the ACIM world.


Oh, I'm not saying you can't achieve an insane RPM with an ACIM, I'm saying you can't get the same breakdown torque at that RPM as you can at "base speed". Your conjecture that a 70hp ACIM can be overdriven to deliver 1400hp+ is, shall we say, divorced from reality. Feel free to spend as much time and resources as you like to attempt to prove me wrong.


----------



## jhuebner (Apr 30, 2010)

Tesseract said:


> That is irrelevant. You can rewind the stator all you want, but the rotor parameters are the ultimate determinant of peak torque (and therefore peak power).


Torque yes, frequency no.
If you keep operating the motor with the same slip frequency (i.e. difference between rotor and stator frequency, not ratio!) the rotor sees the same frequency no matter how fast your stator field is spinning. The rotor reactance is constant at constant slip frequency. The rotor magnetic flux is constant at constant slip frequency.

Therefor the base speed is ONLY dependend on the stator parameters. And those are changed by rewinding it.

Of course the speed is limited by rotor imbalance and other mechanical effects. But the electrical parameters of the rotor don't limit the speed.

With inverters the traditional definition of slip as a ratio between the rotor and stator frequency is completely irrelevant. That is old grid tie stuff.

What is relevant is the DIFFERENCE between the rotor and the stator frequency.


----------



## jhuebner (Apr 30, 2010)

Just calculated the effective conducting area due to the skin effect at 500Hz: 8.7mm². Doesn't seem like a practical limit especially as strands can be wound in parallel.

EDIT: sorry it was too late last night. The actual area is 2*pi*2.96²mm=55mm².


----------



## John Metric (Feb 26, 2009)

Tesseract et al.....
Is this the size of the capacitor bank you are suggesting?

Capacitor current rating 50% of RMS phase current?
50% of 2800amps = 1400amps?

Capacity 10uF per RMS amp
10*2800 = 28000uF?

If IGBT amp rating is a close approximation for "RMS" amp then these are pretty big capacitor banks.
So that's about QTY=28 1000uF 50Arms 1200V caps?
That becomes the largest single cost item in the entire drive. 

Can we talk about the consequences of reducing the Amp capacity and the capacitance?
What am I risking in both cases in a ten second race?

I found some of these on ebay...
"Advance Medium Power Film Capacitor 66uF 800VDC 100Arms"
at $9 each.
CORNELL DUBILIER 947C 947C731K801CDMS CAPACITOR PP FILM 730UF 800V 10% SCREW at $99 each
Are film caps notorious for used ones failing earlier. or are they pretty stable..

My pack is going to have some real good "push" at 200 C rating.... charge rating of about 50C. Can we cut down on the "rule of thumb"? 
Can we start lower and build up if we see problems?


----------



## jhuebner (Apr 30, 2010)

John Metric said:


> I found some of these on ebay...
> "Advance Medium Power Film Capacitor 66uF 800VDC 100Arms"
> at $9 each.
> CORNELL DUBILIER 947C 947C731K801CDMS CAPACITOR PP FILM 730UF 800V 10% SCREW at $99 each


So 14 of the 66µF get you the 1400arms rating. Quite amazing if true. I couldn't find a datasheet for them.
The second one is rated 68Arms, so useless to you.



John Metric said:


> Are film caps notorious for used ones failing earlier. or are they pretty stable..


They are more stable than elcaps at least.



John Metric said:


> My pack is going to have some real good "push" at 200 C rating.... charge rating of about 50C. Can we cut down on the "rule of thumb"?
> Can we start lower and build up if we see problems?


The rule of thumb assumes a film cap like the cornell [email protected]µF. Better cap -> lighter rule of thumb. The "advance" caps take it to 1.5A/µF So the rule of thumb comes down to Arms*0.75.

I don't know the consequences of underrated bus caps. Film caps are considered "self-healing" as in they won't short out when they fail but they gradually loose capacity.

This ring cap here: http://www1.futureelectronics.com/doc/SB ELECTRONICS INC/700D10896-348.pdf
Has a peak-rating of 10000A and an rms rating of 200A. Not sure what a peak is. Valery might know more about it.


----------



## Tesseract (Sep 27, 2008)

jhuebner said:


> ...Of course the speed is limited by rotor imbalance and other mechanical effects. But the electrical parameters of the rotor don't limit the speed.
> 
> With inverters the traditional definition of slip as a ratio between the rotor and stator frequency is completely irrelevant. That is old grid tie stuff.


Firstly, I didn't say anything about the rotor electrical parameters limiting speed (though they will, actually... eventually), so that is a red herring. Secondly, "base speed" will always be relevant because it states the RPM of the AC motor at a specific frequency and voltage, and if the specified RPM is at full load, then you can also determine the slip (applies only to induction motors, obviously).





John Metric said:


> Capacitor current rating 50% of RMS phase current?
> 50% of 2800amps = 1400amps?
> 
> Capacity 10uF per RMS amp
> 10*2800 = 28000uF?


This is a correct application of the thumb-rules I mentioned earlier, yes, but note that the second rule (e.g. - 10uF/amp for film caps) is an approximation for achieving the necessary ripple current rating; if the capacitor datasheet says it can handle more ripple current than the thumb-rule suggests then by all means go with the datasheet rating.

That said, it seems you are still operating under the incorrect assumption that you will get something useful from an ACIM by running it at over 10x its rated current... I guess you don't believe me (or major) when I (we) say breakdown torque is the best you can get from an ACIM, no matter what tricks might be up your proverbial sleeve?



John Metric said:


> If IGBT amp rating is a close approximation for "RMS" amp then these are pretty big capacitor banks.


Sure, as long as you can keep the case temperature below whatever the datasheet says for that current (usually 80C for large modules), you can run a 1400A module at 1400A. At least for a few seconds at a time, anyway. 

That said, keep in mind that the peak current in a sine wave is 41% higher than the RMS and while the RMS value can be used for sizing at higher output frequencies (*not* switching frequency), the peak value is dominant at low output frequencies (e.g. - <1/10th of base speed).

Also keep in mind that if more than one module is used to achieve the desired output current rating then derating for unequal sharing will be required. This derating is necessary even if you only want to run the inverter at max current for 10 seconds at a time.



John Metric said:


> So that's about QTY=28 1000uF 50Arms 1200V caps?
> That becomes the largest single cost item in the entire drive.


Yep.



John Metric said:


> Can we talk about the consequences of reducing the Amp capacity and the capacitance?
> What am I risking in both cases in a ten second race?


Increased heating in the capacitors - possibly at a rate fast enough to cause dielectric failure - and higher voltage spikes across the IGBTs during turn-off. That said, the capacitor ripple current rating is one which Otmar has successfully abused for years. That's not my design philosophy, but I certainly won't argue that it hasn't worked out well for him (especially in the Z2K). The thing is, and not to be too blunt here, but you aren't Otmar...


----------



## tomofreno (Mar 3, 2009)

Tesseract said:


> If all you had to worry about was the stator leakage reactance, then sure, just boost the V/Hz ratio with increasing RPM, but the rotor leakage reactance is what is important here, and its impedance is proportional to slip. As the impedance of the rotor leakage reactance approaches that of the rotor bar resistance, maximum possible torque declines.


 Oh, ok, I was looking at it differently, thinking if you want more power (up to some point) just increase V and f and maintain the same slip and torque. I didn't see people were trying to further increase peak torque at some V and f. 



> This is why increasing the rotor resistance can improve torque development at high slip.


 Agree. Increasing rotor resistance increases starting torque, but at the expense of "running torque" (decreases the slope of the torque-spd curve at low values of slip).



> Yes, VFDs complicate the definition of "base speed," so I prefer to think of it as the synchronous RPM of the motor when it is driven with the designed value of voltage and frequency. In other words, base speed defines the V/Hz ratio for fully-fluxed operation.


 Agree, max flux per pole, which can be obtained at various values of V and f providing they are matched properly to maintain the max flux per pole.


----------



## gunnarhs (Apr 24, 2012)

jhuebner said:


> Example:
> 1) You start with a 70hp motor whos power is about 3-fold when running at breakdown torque. ->210hp
> 2) You find out that you can spin up to 16000rpm (maybe with additional balancing) instead of 3000rpm. ->1120hp
> 3) You figure you can increase V/Hz by a factor of 1.3. ->1456hp


1) When experimenting you will find out that if breakdown-torque is 3 times nominal torque, your maximal torque you can withhold for 30 seconds will be 2,5 x nominal torque near base speed of motor (at very low rpm it will be 1,5 -> 2 times)
2) Without rewinding the motor you could spin it to 10.000 rpm (instead the nominal 3.000) if you have no load and appropriate inverter. (you can see on Youtube people do that up to 30.000 rpm with standard motors). However when applying load you need torque to move that load and the torque is limited as stated in 1). So practically you reach maybe
6000 - 8000 rpm with nominal load (depending on induction motor type)
3) By increasing V/Hz (not more than 1.3 nominal Voltage for standard motors), you can do that just a little above the usual base speed. You are not doing that at say 6000 rpm for motor with (nominal) base speed 3000 rpm. 

So I would say you can theoretically get 4x nominal power out of a standard AC (70 hp nominal, 280 Hp maximal for 30 seconds or less).
And in that case you would probably need additional cooling.

I have no experience with rewound motors but their main problem I see is that the rotor is not changed, and in the end the rotor limits the performance


----------



## John Metric (Feb 26, 2009)

Tesseract said:


> That said, it seems you are still operating under the incorrect assumption that you will get something useful from an ACIM by running it at over 10x its rated current... I guess you don't believe me (or major) when I (we) say breakdown torque is the best you can get from an ACIM, no matter what tricks might be up your proverbial sleeve?


I do believe you that breakdown torque is the most torque you can get out of a motor of a specified design.

This is a generic drive with no motor manufacturer matched mate... so not sure how you draw your conclusion above....

I haven't picked out the final motor yet for my third race car which I haven't built yet. I am guessing I will have to build something like a twin copper rotor Tesla Motor to pull some crazy amps or four of Siemens motors or something extreme like that. But right now there is no reasonably priced megawatt AC controller out there. You hi-power DC controller guys haven't been able to make the conversion over to AC and I am tired of waiting. So, I am trying to build one.

I have picked out a test mule to test this drive.
It is TWO Siemens xxxx-4WS24 on a common shaft driven by this one drive.
Frankly because its in my budget and I trust the Siemens name to have more safety factor in it then your budget low V motors.

What is your name? What do you do over at EVNETICS? Have we met?


----------



## tomofreno (Mar 3, 2009)

John Metric said:


> ...You hi-power DC controller guys haven't been able to make the conversion over to AC and I am tired of waiting. So, I am trying to build one.


 I think it is more "unwilling" than "unable", due to lack of financial incentive - the market is very small and margins would be very slim. Now if someone were to give them a grant...


----------



## Tesseract (Sep 27, 2008)

John Metric said:


> I do believe you that breakdown torque is the most torque you can get out of a motor of a specified design.
> 
> This is a generic drive with no motor manufacturer matched mate... so not sure how you draw your conclusion above....


Breakdown torque is fixed by design for any particular ACIM. Which is to say, torque increases with current up to a certain point - called breakdown - and then it actually declines if current continues to increase. There is no way around this fact, it is an intrinsic property of the ACIM.

The reason for this is "saturation" of the stator, which is when the maximum number of lines of magnetic force that can be carried is reached. The number of lines of magnetic force through a magnetic material depends on the number of turns of wire about it and the current through said wire. Thus, saturation can be considered a hard current limit for any magnetic material. 

Now, the amount of torque a motor can produce depends on the strength of the stator magnetic force interacting with that of the rotor. In an ACIM, the stator has two duties to perform: it must creating the rotating magnetic field in space which the rotor interacts with to produce torque, and it also must induce a relatively stationary field into the rotor for said interaction to take place. If enough current is forced through the stator for it to begin saturating then there will be no increase in field strength for an incremental increase in current, and if there is no increase in field strength from the stator then there will not be an increase in field strength induced into the rotor. Ergo, no increase in torque.



John Metric said:


> But right now there is no reasonably priced megawatt AC controller out there. You hi-power DC controller guys haven't been able to make the conversion over to AC and I am tired of waiting. So, I am trying to build one.


Right. You want a higher power AC controller and it must be affordable while I want to make at least twice as much profit on every controller just to have a sustainable business model (our gross margin on the Soliton1 is uninspiring, and on the Jr it is down right pathetic). So, we seem to be at loggerheads.



John Metric said:


> What is your name? What do you do over at EVNETICS? Have we met?


My name is Jeffrey and like it says in my sig, I'm in charge of herding the electrons 'round these parts (which is to say, I am the EE). And yes, we have met. Nice to see I am so memorable in person...


----------



## McRat (Jul 10, 2012)

Market thoughts.

An EV drive system >200hp is $20k+. 

The existing EV aftermarket folk aren't interested at hotrodding production EV's, which is the bread and butter of the ICE aftermarket powertrain companies.

Soooo... Where does that leave you?

You either aim some of your product emphasis at production cars, or you aim at the "high rollers".

Motorhomes, trailers, off-road fun vehicles.

Trailers???? Motorhomes???? Recreational vehicles are "toys". People like their toys to be really nice.

What sucks? Lousy range and fuel economy. Loud generators. Constant electrical capacity woes.

A trailer with surge activated 50hp drive with regen and 2kW of solar up top would cost $20,000 for a kit. And make your $100,000 toy much more useful. Ditto for motorhome.

A hybrid motorhome or mileage assist trailer makes more sense than producing race-only and low-performance car parts.


----------



## major (Apr 4, 2008)

Say Tesser and/or jheub and/or gunna or anyone????

I think I can send John a bunch of surplus NOS electrolytic caps. These are top quality brandname which the likes of were used in motor drives for a few decades until the recent migration to film caps. These can be 400 to 500 VDC rated and 2000 to 5000 uF depending on what I can find. I think I can get enough identical caps to handle his megaWatt monster. 

So???? Is 28,000uF at 800 to 1000V a good total number???? 

This will likely be a one time pick opportunity for me and on the other hand I don't want to pack and ship more than I have to 



John Metric said:


> So that's about QTY=28 1000uF 50Arms 1200V caps?
> That becomes the largest single cost item in the entire drive.


----------



## Tesseract (Sep 27, 2008)

major said:


> ...So???? Is 28,000uF at 800 to 1000V a good total number???? .


Sure, but if those are literally New *Old* Stock then they might need to have their dielectric reformed, especially if connected in series (also will need ballasting resistors).

Give me a part number and I will look up the specs and give a better answer.


----------



## major (Apr 4, 2008)

Tesseract said:


> Sure, but if those are literally New *Old* Stock then they might need to have their dielectric reformed, especially if connected in series (also will need ballasting resistors).
> 
> Give me a part number and I will look up the specs and give a better answer.


Thanks. RIFA PEH200VT4330MU2, 3300uF, 400VDC. Typical. Depending on the quantity there may like this one or close. Some were 2700uF, 420V and some 2200uF, 500V. I'll get a lot of all same part numbers. Yes, I know of the ballasting resistors for series connected caps. These are 5 to 10 years old. Climate controlled storage. Appear in excellent shape. Perhaps a review of the reform procedure for John's sake is in order.

Appreciated


----------



## Tesseract (Sep 27, 2008)

major said:


> Thanks. RIFA PEH200VT4330MU2, 3300uF, 400VDC. Typical. Depending on the quantity there may like this one or close. Some were 2700uF, 420V and some 2200uF, 500V. I'll get a lot of all same part numbers. Yes, I know of the ballasting resistors for series connected caps. These are 5 to 10 years old. Climate controlled storage. Appear in excellent shape. Perhaps a review of the reform procedure for John's sake is in order.
> 
> Appreciated


These are old Evox-Rifa elkos. Decent stuff, and they hold up fairly well over time. I have a bunch of PEH series caps that are at least 20 years old but still meet their ESR and leakage specs.

The PEH line was bought by Kemet a few years ago so the datasheet might be "too new", but according to it each of these caps can handle 36.3A of ripple at 10kHz/40C ambient and have an ESR of 14-26 milliohms depending on frequency and temperature. I would say that John would need 40 of these capacitors (2 in series by 20 in parallel), as that would get him a ripple current rating of ~25% of the rated RMS phase current. If duty cycle is kept to 10 seconds on followed by 1-2 minutes off then that number could probably be cut in half again, but that is definitely getting into subjective/seat-o-the-pants territory.

As for reforming old elkos, there are several methods and which one to go with kind of depends on the equipment available. Personally, I like to simply apply a slowly increasing voltage over time, either by using a Variac/isolation transformer/bridge rectifier or an adjustable,current-limited DC power supply. The most commonly suggested procedure is to apply full rated voltage to the capacitor through a resistor which will limit maximum current to around twice the rated leakage current value, and leave it there until the current falls to the rated leakage value. In this case, the leakage current is ~5.3mA, and if using a rectified 240VAC (or doubled 120VAC) supply that would require a ~33k/5W resistor. 

As for the ballasting resistors (and yes, I know *you* know this, as well as about reforming the dielectric, etc.), the typical recommendation is that the resistor needs to be able to pass the full leakage current, so for two 400V caps in series, each running at, say, 350V, and with ~5.3mA of leakage the resistor needs to be no higher than 66.5k. The closest E24 series resistor would be 62k. Oh, and rated for 5W just to be safe.


----------



## Stiive (Nov 22, 2008)

As a reference, I use 1200V 800uF with 80A ripple capacity for 450ARMS continuous - I'm even thinking this is overkill.

It's all about good ULESL design and very fast fault condition detection and shutdown.

For your 1400A IGBTs @ 4khz you'd be looking at ~1000A derated. 
Not sure how you got to ~30,000uF! 

Pay extra for film caps and you'll save in the long run. 28 caps is going to introduce a lot of inductance and holds a dangerous amount of power 
At such high power levels, every design decision is crucial and needs to meticulously calculated - you cant just do whatever's easiest or cheapest - it will cost you more in the long run.


Oh, and to jump in on the IM power level debate - I ran a 1kW motor @ ~10kW after a 1/4voltage hack and re-applying nom voltage. Heated up pretty quick but would easily do 10s cycle.


----------



## jhuebner (Apr 30, 2010)

Ok, I think we're producing hot air here because things a a bit out of order.

1. We all agreed that breakdown torque is the maximum torque reachable
2. Can we please agree that running nominal torque at twice the base speed results in twice the POWER output?
3. Can we agree that the rotor current/flux is caused by a certain slip FREQUENCY (e.g. 5Hz) and is proportional to the stator current?
4. Can we now agree that the motor can run with the exact same slip frequency at 100rpm and at 10000rpm?
5. Can we therefor agree that the rotor reactance is an irrelevant quantity?
6. Can we agree that rewinding the stator with half as many windings will result in half the nominal voltage and twice the nominal current at nominal base speed and nominal torque?
7. Can we agree that rewinding tha stator that way does not produce any additional flux that saturates the iron?
8. Can we now agree that with the new rewound stator we can operate at twice the nominal frequency and still reach nominal torque or breakdown torque respectively?
9. Can we agree that breakdown torque is 2-4 times higher than nominal torque?
10. Can we now agree that we have doubled the motors power by rewinding it and that we again 2-4 folded it by running at breakdown torque?
11. Can we agree that that the motor outputs 4-8 times more power?
12. Can we sort of agree that by rewinding the stator with 10 times less windings (and therefor stronger wire) we can run at 10 times the nominal frequency and still reach nominal torque or breakdown torque respectively?
13. Can we sort of agree that this 20-40 folds the motors power?

Illustration:
Motor: 4 pole, 3560rpm, 50Nm (nominal) 200Nm (breakdown), 120Hz, 200V. (thats roughly what I use). Rated power is 18.5kW at rated torque and speed.
Slip frequency: fslip=fnom-Nnom*p 
fnom=120Hz, Nnom=3560/60=59.34 1/s=59.34Hz, p=2 (2 pole pairs)
fslip=120-59.34*2=1.34Hz

V/hz ratio (lets call it r):
r=Unom/fnom = 200V/120Hz=1.67V/Hz

Nominal torque is now reached at different speeds by applying fslip as slip frequency and 1.67*f as terminal voltage.
E.g. 1000rpm: f=2*1000/60+fslip=33.34+1.34=34.67Hz, U=1.67*34.67=58V

16000rpm: U~890V, f=534.67Hz

Since 890V is a bit on the tough side we now rewind the stator with 1/3 the number of windings. This results 1/3 of the inductance and 1/3 of the reactance. Therefore we must recalculate r
r=200/3/120=0.56V/Hz

Now we can reach nominal torque at 534.67Hz by applying 890/3=297V. Breakdown torque is reached by letting the rpm sag as to reach breakdown slip frequency. Lets assume that is the case at 15000rpm.
So now the power is P=2*Pi*15000/60*200=314kW (out of a 18.5kW motor)

Of course at the same time we probably produce maybe 30% of heat which is 94kW which is a lot. For me thats the actual question, can the thermal capacity of the motor cope with that much heat for 10s?
But then John has done that much overdriving with DC motors which produce the same sort of heat and they seem to hold up.

Capacitors: don't get hung up with specific capacities but with the ripple current capability. Or relax, as Tesseract says and use what is used in the Zilla.


----------



## jhuebner (Apr 30, 2010)

Stiive said:


> Oh, and to jump in on the IM power level debate - I ran a 1kW motor @ ~10kW after a 1/4voltage hack and re-applying nom voltage. Heated up pretty quick but would easily do 10s cycle.


Practise speaks for itself.
So did you increase the speed at all? Or did you actually manage to ten-fold torque? How did you hack?


----------



## Tesseract (Sep 27, 2008)

jhuebner said:


> 5. Can we therefor agree that the rotor reactance is an irrelevant quantity?


At low slip frequency (e.g. - 5Hz), sure, but keep in mind that the impedance of the rotor leakage reactance needs to only approach/exceed the resistance of the rotor shorting bars to cause a decrease in breakdown torque, and as the resistance of the rotor bars is very low, it therefore takes very little reactance (and/or a very low frequency) before its effects are felt.



jhuebner said:


> 8. Can we now agree that with the new rewound stator we can operate at twice the nominal frequency and still reach nominal torque or breakdown torque respectively?


Possibly, possibly not. You are ignoring iron losses in the stator laminations which increase at approximately the 1.6 power with frequency (e.g. - at twice the frequency losses are 2^1.6 higher, which is 3x).

NB - iron losses in the typical grades of silicon steel laminations (e.g. - M19) used for stator laminations for motors originally intended for base speed at 50/60Hz will have losses at that frequency of ~5W/kg at full flux (~1.5T). Thinner laminations and/or different types of silicon steel can have approximately half the losses, but with some reduction in maximum flux and increase in leakage reactance (due to there being a higher total amount of insulating coating present in the stator when more laminations of thinner material are used).



jhuebner said:


> 9. Can we agree that breakdown torque is 2-4 times higher than nominal torque?


I don't recall ever seeing breakdown torque exceed 3x full load torque, and it is closer to 2x in the Siemens motors that Jack Rickard is hawking these days, but, well... I'll give you this one.



jhuebner said:


> 10. Can we now agree that we have doubled the motors power by rewinding it and that we again 2-4 folded it by running at breakdown torque?


Sure, as long as you can agree that you have increased copper losses by 4x to 16x, and iron losses by 3x by running at twice the voltage and frequency and at 2x to 4x the current. Ergo, efficiency has taken a nosedive.



jhuebner said:


> 11. Can we agree that that the motor outputs 4-8 times more power?


Close; the inverter may be putting out 4-8x more power, but on account of the aforementioned losses, the motor will deliver some amount less than that.



jhuebner said:


> 12. Can we sort of agree that by rewinding the stator with 10 times less windings (and therefor stronger wire) we can run at 10 times the nominal frequency and still reach nominal torque or breakdown torque respectively?
> 13. Can we sort of agree that this 20-40 folds the motors power?


Nope, this is where you depart from reality.


----------



## kennybobby (Aug 10, 2012)

jhuebner said:


> ... Since 890V is a bit on the tough side we now rewind the stator with 1/3 the number of windings. This results 1/3 of the inductance and 1/3 of the reactance. Therefore we must recalculate r
> r=200/3/120=0.56V/Hz
> 
> Now we can reach nominal torque at 534.67Hz by applying 890/3=297V. Breakdown torque is reached by letting the rpm sag as to reach breakdown slip frequency. ....


Where did you come up with this formula? You have reduced the magnetic flux by 1/3 and will not reach the same torque. Torque goes by I^2, so it will be reduced by a factor of 9 at that speed.


----------



## major (Apr 4, 2008)

jhuebner said:


> Ok, I think we're producing hot air here because things a a bit out of order.


Are we still talking about the inverter for John's racecar? Then yes, I guess so because he has specified the motor and made no mention of having it rewound. So he has a 530Nm motor (max) maybe close to 200kW (max) at 650VDC. Why does he need a MW inverter? 

I have no problem with big power stuff, but I just wanted him to realize that the biggest inverter in the world or the local power plant via the mains isn't going to squeeze more torque out of his motor.

With regards to your lengthy post:

I haven't seen any drive actually tolerate BDT. While you can call BDT the maximum for a particular IM design, your inverter will achieve only 80, maybe 90% of that figure.

You claim 200Nm from your motor. What is the highest actual you have measured?

Inductance is proportional to the square of the coil turns. Not that that entered into any of your calculations here, but it certainly is a bitch to contend with when you start reducing turns by 10 factor.

Back to John's project: 

He wants to build a large drive using your kit. Kool  He says the caps are a big expense and sends out a call for help. I just happen to have some electrolytics I can send his way. If someone has something better, fine, I'll not waste the time and parcel cost.


----------



## jhuebner (Apr 30, 2010)

Tesseract said:


> At low slip frequency (e.g. - 5Hz), sure, but keep in mind that the impedance of the rotor leakage reactance needs to only approach/exceed the resistance of the rotor shorting bars to cause a decrease in breakdown torque, and as the resistance of the rotor bars is very low, it therefore takes very little reactance (and/or a very low frequency) before its effects are felt.


Absolutely with you on that one. Thing is you do not need to increase the slip frequency even when drastically increasing the motor speed. In papers on spindle motors slip is even considered a neglectable quantity.



Tesseract said:


> Possibly, possibly not. You are ignoring iron losses in the stator laminations which increase at approximately the 1.6 power with frequency (e.g. - at twice the frequency losses are 2^1.6 higher, which is 3x).


Agreed.
The iron losses are estimated at 25% of the total losses at "normal" speeds. They become prevelant at high frequency operation.
By the 25% estimation I calculated about 300W of iron losses for my motor. So at twice the frequency this becomes 1.2kW.



Tesseract said:


> I don't recall ever seeing breakdown torque exceed 3x full load torque, and it is closer to 2x in the Siemens motors that Jack Rickard is hawking these days, but, well... I'll give you this one.


See below.




Tesseract said:


> Sure, as long as you can agree that you have increased copper losses by 4x to 16x, and iron losses by 3x by running at twice the voltage and frequency and at 2x to 4x the current. Ergo, efficiency has taken a nosedive.


Absolutely. Thats why I estimated 70% effiency in my example.



Tesseract said:


> Nope, this is where you depart from reality.


Yes, I might be taking the concept too far. Thats for John to find out.



kennybobby said:


> Where did you come up with this formula? You have reduced the magnetic flux by 1/3 and will not reach the same torque. Torque goes by I^2, so it will be reduced by a factor of 9 at that speed.


Actually I might have gotten confused on the exact rewinding practise. As I don't want to repeat an existing discussion I shall link here: http://www.diyelectriccar.com/forum...nduction-motor-rewinding-questions-77776.html

The point is: you can somehow reduce the required terminal voltage at an expense of the terminal current by rewinding the stator.



major said:


> I haven't seen any drive actually tolerate BDT. While you can call BDT the maximum for a particular IM design, your inverter will achieve only 80, maybe 90% of that figure.


Agreed.



major said:


> You claim 200Nm from your motor. What is the highest actual you have measured?


I have never measured this, its taken from the data sheet.

http://www.lenze.com/fileadmin/lenz...ogue_MF_MH_MD_three-phase_AC_motors_en-GB.pdf
Page 27, motor MF----132-22.



major said:


> Inductance is proportional to the square of the coil turns. Not that that entered into any of your calculations here, but it certainly is a bitch to contend with when you start reducing turns by 10 factor.


 Ok, I will stop making any specific statements about rewinding techniques and refer to the existing thread(s).


----------



## jackbauer (Jan 12, 2008)

First full system logic power up. Drawing 250mA at 12.5v. All igbt gates at -15v! Woohoo

The schematic pinout on jp5 seems a little confusing. Either I have inserted the header backwards .......


----------



## Stiive (Nov 22, 2008)

jhuebner said:


> Practise speaks for itself.
> So did you increase the speed at all? Or did you actually manage to ten-fold torque? How did you hack?


Hack was by placing the four pole coils in parallel in each phase. Motor then can be run at 4x speed with same input voltage.(1400*4=5600RPM for a 4pole in Aus).

No idea what the torque/RPM was at max power, but was reading electrical output power from a generator which was reading about ~10.5kW. Assuming with efficiency loss somewhere just under 10kW mech.

BUT before John thinks he can do the same with his Siemens - he cant. You can only get big gains out of industrial motors because they are so conservatively rated to allow for 24hr operation in 50degC mine sites in the desert for 20+ years. That's a long duty cycle in harsh conditions. That Siemens EV motor has already taken shorter duty cycles into acocunt on its nameplate, and they're max torque rating is already breakdown torque, whereas torque on an industrial motor is listed as nominal.

I agree with Major, you're not going to get much/any more than the 200kW rated max. Maybe 250kW if your controller and motor parameter model is faultless - which it wont be. Things heat up so quickly at breakdown torque its hard to keep track of the changing parameters.
Considering that frame is similar to a ~12.5kW industrial motor - thats already a 16x overlcock for the same amount of iron (diameter and length)! The only addition is the water cooling which would allow it to be run at higher power for longer, and it knows itll be powered by a vector VSD and not off the line. It most likely also has higher grade laminations and possibly a copper rotor (but I don't think the latter).

Now buy a 100kW continuous IM like we have in the bus, and run that at 1MW... only problem is its 400kg+. High powered motor also have much lower inductance (this has <10uH), making it hard to control.

Best power to weight option would be getting a good PM motor and staying within its limits.

OR get some cheap aluminium frame industrial motors, rewind for lower voltage and abuse the %#* outta them. I'd assume roughly a 10x overclock max for 10s. But your not going to get good power or near breakdown torque reliably with slip control.

OR run your Siemens @ 250kW each. They are already overclocked for you, are well built, and well balanced. They spin hard, so you can have a mean reduction on them geared for your projected top speed. 
Then just concentrate on weight reduction while still maintaining power to the ground. Power isn't everything. Or if you absolutely need more, put two smaller high power PMs with different gear ratio on the front axle as well and just use the IM overload to get you off the line and when they hit field weakening, the PMSM are starting their CPSR.


----------



## John Metric (Feb 26, 2009)

Tesseract said:


> My name is Jeffrey and like it says in my sig, I'm in charge of herding the electrons 'round these parts (which is to say, I am the EE). And yes, we have met. Nice to see I am so memorable in person...


Jeffery Jenkins, yes I remember you.
What the heck is "TESSERACT"?


----------



## jhuebner (Apr 30, 2010)

Stiive said:


> Hack was by placing the four pole coils in parallel in each phase. Motor then can be run at 4x speed with same input voltage.(1400*4=5600RPM for a 4pole in Aus).


Ok, thats pretty straight forward and takes the N² out of the equation.



Stiive said:


> That Siemens EV motor has already taken shorter duty cycles into acocunt on its nameplate, and they're max torque rating is already breakdown torque, whereas torque on an industrial motor is listed as nominal.


I noticed they weaken the field at around 3000rpm. If you manage to maintain that 530Nm up to 15000 that has quite some potential and gets you in the 800kW range only with additional stator losses. And John has two of them.


----------



## major (Apr 4, 2008)

jhuebner said:


> I noticed they weaken the field at around 3000rpm. If you manage to maintain that 530Nm up to 15000 that has quite some potential and gets you in the 800kW range only with additional stator losses.


That would require a 3250 Volt battery. 

BTW, how fast have you been able to operate your drive?


----------



## aeroscott (Jan 5, 2008)

how much of the 3250 volts is back emf . Very interesting


----------



## aeroscott (Jan 5, 2008)

If 15000 rpm / 60 sec. =250 hertz X 10 pules =2500 on/off cycles /sec. 
is this what you meant?


----------



## major (Apr 4, 2008)

15000 RPM on that 4 pole motor needs 500 Hz plus slip; call it 502 Hz. And bemf is not a quantity usually associated with induction motor operation although it certainly is in there somewhere


----------



## aeroscott (Jan 5, 2008)

major said:


> 15000 RPM on that 4 pole motor needs 500 Hz plus slip; call it 502 Hz. And bemf is not a quantity usually associated with induction motor operation although it certainly is in there somewhere


 I forgot the 2X for 4pole . I didn't know about bemf not associated with im's thanks


----------



## major (Apr 4, 2008)

aeroscott said:


> I didn't know about bemf not associated with im's thanks


It is just not a quantity normally used in the calculations, modeling or characterization with IM. Just like all motors, there is a generated voltage when it rotates in the field and that opposes the applied potential. I just don't know why you inquire of it  Take a look at the equivalent circuit for the IM. It resembles that of a transformer. Example: http://www.vias.org/kimberlyee/ee_20_12.html


----------



## aeroscott (Jan 5, 2008)

My understanding is that torque is reduced because as speed is increased bemf causes the effective input voltage to drop also reducing the amps so torque is reduced . From the Aussie IM over clocking experiments.


----------



## Tesseract (Sep 27, 2008)

aeroscott said:


> My understanding is that torque is reduced because as speed is increased bemf causes the effective input voltage to drop also reducing the amps so torque is reduced . From the Aussie IM over clocking experiments.


Yes, if one does not increase voltage while increasing frequency then torque output drops, but our intrepid experimenters intend to overdrive the motor both in RPM - that is, increase voltage and frequency - and in torque.

The general consensus - which our intrepid experimenters seem unwilling to accept - is that you certainly won't be running a motor at 5x base speed and full flux, much less at the same time as demanding breakdown torque from it. Also, the Siemens motors are already "up-rated", as Stiive pointed out, so it is unlikely much more power can be extracted from them than the peak stated in their datasheet.


----------



## gunnarhs (Apr 24, 2012)

jhuebner said:


> you manage to maintain that 530Nm up to 15000 that has quite some potential and gets you in the 800kW range only with additional stator losses. And John has two of them.


Hi Johannes, nice try but this is impossible with this motor. As Johns motors are already wound for high voltage you can only slightly increase voltage (20% maximal). This gives you about 600 Nm at 3000 RPM and (max) 500 Nm at 4000 RPM. The motor draws something like 400 Amps (seen on input) but it can not fully use it. There are stupid things like efficiency and power ("cos")-factor which limit the effective power -output experienced is much less than you see going in .
It will be the same when seeing a standard motor overclocked powerwise 10x. this means only you are putting 10x the power in, not that you are really getting it out.


----------



## Hollie Maea (Dec 9, 2009)

Excuse my ignorance but what is it about series DC motors that makes it so you can get seemingly endless amounts of power from them (until they melt)?


----------



## Tesseract (Sep 27, 2008)

Hollie Maea said:


> Excuse my ignorance but what is it about series DC motors that makes it so you can get seemingly endless amounts of power from them (until they melt)?


Simple: it's because the field current is the same as the armature current and is directly supplied. The only thing that happens during saturation is that field strength increases linearly with current, rather than with the square of current. Oh, and the effective inductance of the motor drops quite a bit (which is what gives the creaky old Curtis 1231C such problems).

Note that BEMF also shifts from a square to linear relationship at saturation, so efficiency doesn't take a sudden huge drop.


----------



## toddshotrods (Feb 10, 2009)

Tesseract said:


> ...The general consensus - which *our intrepid experimenters* seem unwilling to accept...


I resemble that remark, but I have heard you and Major loud and clear. I am sticking with my little series-DC for a while, as a result, but also planning to experiment with and learn more about trying to develop power with AC.

If any of you care to give me a proper lashing about the impossibility of what I am considering as an initial learning lesson, I started a thread to examine the potential (or lack thereof) of the motor I have. Lemme have it. 

It's relative to this discussion, because I would be using one of these kits to drive it, but didn't want to take this thread off on yet another detour...


----------



## major (Apr 4, 2008)

Hollie Maea said:


> Excuse my ignorance but what is it about series DC motors that makes it so you can get seemingly endless amounts of power from them (until they melt)?


I addressed this about 8 pages ago.



major said:


> jhuebner said:
> 
> 
> > I don't buy it.
> ...


----------



## jackbauer (Jan 12, 2008)

It
Fracking
Works!!


----------



## John Metric (Feb 26, 2009)

Tesseract said:


> Yes, if one does not increase voltage while increasing frequency then torque output drops, but our intrepid experimenters intend to overdrive the motor both in RPM - that is, increase voltage and frequency - and in torque.
> 
> The general consensus - which our intrepid experimenters seem unwilling to accept - is that you certainly won't be running a motor at 5x base speed and full flux, much less at the same time as demanding breakdown torque from it. Also, the Siemens motors are already "up-rated", as Stiive pointed out, so it is unlikely much more power can be extracted from them than the peak stated in their datasheet.


Jeffery Jenkins, yes I remember you.
I don't visit this blog very often, what the heck is "TESSERACT"?

I promise not to break any of the laws of physics.
I haven't said anything about 5X base speed.... yet.....
Please be advised all I have mentioned so far is a "test mule". BTW, What did you use for a test mule for the Shiva? Have you actually pushed the claimed 1.2MW into a motor off of batteries yet? I will bet so far no Shiva EV customer has actually been able to make rated power from batteries. I don't plan to do max Vdc bus power times max IGBT current out of my controller either, EVER... I am sure there are better AC motors to be test mules, like three tesla S motors. How about three Siemes 85kW or four, once I have the controller I can just parallel more identical motors, I think.? My development budget and race car engine bay space right now is two. I don't think I have made any assumptions so far that you guys have changed. And if I shoot for 1MW and can only demonstrate 800kw controller. OMG that's still pretty awesome. and if put that in my current car specs it would make it the fastest door slammer of all time(right after my DC powered car) that would be a side benefit(and a marketing SOQ).
In business development , you can be pessimistic and kill the project yourself or you can be optimistic and learn something when the assumption fails, its costly but you learn ways not to do something which becomes your intellectual property. At least your learning. Trick is to get to market and make money or fame. Never starting you are sure to never get either. (jumps down)

BTW, I am talking with a guy named Scott MacDonald in TX who just took delivery from Steve Clunn of a DC Sepex motor powered semi tractor trailer truck, he hauls gravel in it. Now that's what I call a conversion. Amongst, other things he wants to drag race it and I think we should explore the real possibility of electric semi trucks, or at least a government grant to build some prototypes... For longevity, I think an AC motor or four of them, is much better suited to drive around in gravel pits than an open frame DC motor is. Just trying to be prepared for anything....

Johannes, I just received the kit today. I expect my IGBT's any day. I think I will pull the trigger on Jeff's kind offer and congratulations to Jack Bauer who got his siemens running with your kit.


----------



## Tesseract (Sep 27, 2008)

John Metric said:


> Jeffery Jenkins, yes I remember you.
> I don't visit this blog very often, what the heck is "TESSERACT"?












*That* is a tesseract. From Wikipedia, btw. Also, my name is spelled Jeffrey, not Jeffery. 



John Metric said:


> I promise not to break any of the laws of physics.


Yet that is what you are expecting to do if you think that cramming more current through an AC motor beyond what it takes to achieve breakdown torque will get you even more torque. 



John Metric said:


> I haven't said anything about 5X base speed.... yet.....


And given that you would need over 3kV to push the Siemens motor to 5x base speed, I rather think you won't be saying much about it in the future, either.



John Metric said:


> BTW, What did you use for a test mule for the Shiva? Have you actually pushed the claimed 1.2MW into a motor off of batteries yet? I will bet so far no Shiva EV customer has actually been able to make rated power from batteries.


Acknowledging that this is wildly off-topic, of course no Shiva customer has even come close to reaching the 1.2MW power rating, but at least one customer (who goes by DIYguy here) routinely hits 3000A with his. I did test the prototype at 450V and at 3500A on our dyno, just not both at the same time. 



John Metric said:


> How about three Siemes 85kW or four, once I have the controller I can just parallel more identical motors, I think.?


Nope, you can't parallel AC motors. Well, maybe if you run them in open-loop V/Hz (aka "scalar") mode you can, but not with any form of closed-loop control (e.g. - slip, field-oriented current vector, etc.). 

Now, you might be able to drive two PMAC motors from one inverter if their shafts are locked together and their rotors are at the exact same position relative to their phase windings - and their phase windings are electrically very similar - but this is pure conjecture on my part. Crusty ol' major can speak with more authority on that than me.



John Metric said:


> In business development , you can be pessimistic and kill the project yourself or you can be optimistic and learn something when the assumption fails...


I'm not being pessimistic and, actually, I am a big fan of insane levels of power - I designed the Shiva, after all, as well as a quadruple 650V/1600A drive system for locomotives - it's just that what you are proposing to do with an ACIM is simply not possible. Induction motors have a very definite torque limit; end of story.


----------



## tomofreno (Mar 3, 2009)

major said:


> It is just not a quantity normally used in the calculations, modeling or characterization with IM. Just like all motors, there is a generated voltage when it rotates in the field and that opposes the applied potential. I just don't know why you inquire of it  Take a look at the equivalent circuit for the IM. It resembles that of a transformer. Example: http://www.vias.org/kimberlyee/ee_20_12.html


 Yes, and the flux from the secondary (the rotor in the case of a motor) induces an emf in the primary (the motor field) by Faraday's law, which opposes the original voltage across the primary and is generally called the back emf. The mechanical work done by the motor is proportional to this back emf.


----------



## John Metric (Feb 26, 2009)

Tesseract said:


> I'm not being pessimistic and, actually, I am a big fan of insane levels of power - I designed the Shiva, after all, as well as a quadruple 650V/1600A drive system for locomotives - it's just that what you are proposing to do with an ACIM is simply not possible. Induction motors have a very definite torque limit; end of story.


What was so "insane" about what I said I was going to "cram" into these test mule motors? 


John Metric said:


> "150% or 200% of nameplate current rating"


Neither have I said anything about 5X base speed, that was someone else. I am designing a generic 1MW AC controller. Like you designed the shiva without a motor to actually and probably never run "full power". I have found some cheap test mules rather than first building a motor capable of the full power. I, like you, probably won't be able to test the full limits at the same time and don't intend to. I however, probably won't put that in my "Specs" since I will have never tested it, just how I am. I think you are confusing Johannes' and/or hotrod guy's enthusiasm and commenting like I said it. I applaud enthusiasm, discourage pessimism and can engineer a thing or two. We are going to succeed, ooh rah! Perhaps we can race a shiva someday? Who is running one now a days?

I have other information on locking AC motors together. Does anyone else want to weigh in on that?


----------



## jackbauer (Jan 12, 2008)

Got the siemens spinning for the first time yesterday. Having a few issues with the parameters to get it running up and down in speed smoothly.

https://www.youtube.com/watch?v=ELOZIeuFvy0


----------



## gunnarhs (Apr 24, 2012)

jackbauer said:


> Got the siemens spinning for the first time yesterday. Having a few issues with the parameters to get it running up and down in speed smoothly.
> 
> https://www.youtube.com/watch?v=ELOZIeuFvy0


Congrats to that. And I hope you will put it on your ATM soon, look forward to see that


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> Got the siemens spinning for the first time yesterday. Having a few issues with the parameters to get it running up and down in speed smoothly.
> 
> https://www.youtube.com/watch?v=ELOZIeuFvy0


Thats great!

So about the issues you're having:
- as long as no encoder is connected, you won't get up to speed in slip mode. Currently, by pushing the throttle you're varying phase voltage and slip frequency. You get up to 12Hz if you set pole pairs to 4, because the maximum slip defaults to 3Hz and (I know this is odd) the slip setpoint is multiplied by the polepairs

- You can use manual mode "start 2" and then set fslipspnt to the frequency you want (again, note its multiplied by "polepairs").

- You might need to set "ampnom" to 30% or something, that gives you 30% of the V/Hz ratio.

- The reason why the motor stalls when you give full throttle must be the parameter "potmax". If you exceed this by more than 50, this is considered implausible and 0 throttle is commanded.

Re max speed: I accidentally span my motor to 12000rpm once. Usually I limit to 6000rpm.


----------



## jhuebner (Apr 30, 2010)

Ok, no more comments on the overclocking topic from my side, as at that point everybodys opinion can only be changed by the outcome of experiments.



Tesseract said:


> Nope, you can't parallel AC motors. Well, maybe if you run them in open-loop V/Hz (aka "scalar") mode you can, but not with any form of closed-loop control (e.g. - slip, field-oriented current vector, etc.).


Slip control absolutely allows as many identical shaft coupled motors as you want. They should all have their own power stage to avoid current sharing issues (this wasn't mentioned before).
Then you're running identical motors at the same slip (at similar rotor temps) and the same terminal voltage. Minor differences might cause uneven torque distribution but to no greater degree than shaft-coupling DC motors.

The algorithms that take motor current into account (foc, dtc) might run into problems.


----------



## Arlo (Dec 27, 2009)

jhuebner said:


> Ok, no more comments on the overclocking topic from my side, as at that point everybodys opinion can only be changed by the outcome of experiments.
> 
> 
> Slip control absolutely allows as many identical shaft coupled motors as you want. They should all have their own power stage to avoid current sharing issues (this wasn't mentioned before).
> ...


This Is interesting. Maybe a motor per wheel and they can slip a different amount in the corners so you will have good traction. But if one wheel looses traction and it starts spinning it would only spin a bit... as long as every power stage has the same pwm signal.


----------



## aeroscott (Jan 5, 2008)

jhuebner said:


> Ok, no more comments on the overclocking topic from my side, as at that point everybodys opinion can only be changed by the outcome of experiment.


 even facts from experiments won't change a
" good formula." lol keep up the good work .


----------



## jhuebner (Apr 30, 2010)

Arlo said:


> This Is interesting. Maybe a motor per wheel and they can slip a different amount in the corners so you will have good traction. But if one wheel looses traction and it starts spinning it would only spin a bit... as long as every power stage has the same pwm signal.


In a curve the inner wheel would produce more torque than the outer wheel because it runs at higher slip. Not sure if thats desirable.


----------



## Arlo (Dec 27, 2009)

jhuebner said:


> In a curve the inner wheel would produce more torque than the outer wheel because it runs at higher slip. Not sure if thats desirable.


I think it will allow some slip... And this will be torque dependnt. If you left off the throttle it will allow the motors to slip more...  
My quafe diff in my ICE does it this way now more power locks the diff together.


----------



## toddshotrods (Feb 10, 2009)

jhuebner said:


> In a curve the inner wheel would produce more torque than the outer wheel because it runs at higher slip. Not sure if thats desirable.





Arlo said:


> I think it will allow some slip... And this will be torque dependnt. If you left off the throttle it will allow the motors to slip more...
> My quafe diff in my ICE does it this way now more power locks the diff together.


The chassis is loaded the other way, with weight transfer to the outside wheels. The new active handling and/or torque vectoring systems generally put more torque on the outside, combined with braking or "negative torque" on the inside front wheel, to help the vehicle sort of pivot around a theoretical apex.


----------



## jackbauer (Jan 12, 2008)

Well , have an encoder plug on the way for the Siemens motor. It has two 5v 64ppr outputs and is a 4 pole motor. Once i have one of those connected into the control board we should be go for slip control


----------



## jhuebner (Apr 30, 2010)

I dug out my old inverter and upgraded it to the new control hardware to be able to test basic stuff without having to sit in my car 










Reminder, the old version looked like this, with the control board in the white box:










I added support for the KTY84 temp sensor which is used in the Siemens 1PV motors.

I'm planning to make a little web interface to make things easier to handle than with the text terminal.

I'm also planning to use the park/clark transformation of FOC to be able to display reactive and real power and the power factor.

I'm still hesitant of actually using FOC for motor control as I think its results may be less predictable. The factors of a PI regulator are just way more abstract to me than slip and voltage. Also since the sensorless approach doesn't seem to work for traction applications it looses its largest actual advantage.
Transient response is not really a requirement in traction unless you expect your cruise control to be rock steady in hilly terrain.

Heres a funny article (which reveals that slip control wasn't invented on this forum - unfortunately)
http://industrial.embedded-computing.com/articles/the-versus-field-oriented-control/


----------



## Arlo (Dec 27, 2009)

jhuebner said:


> - under voltage lockout: A3120 supports that
> - desaturation detection: will be replaced by a hardware current limit, AC currents will be measured anyway


IM trying to read this thread again and follow it to see what you are using now.

Are you saying you are using the phase current sensors for Desaturation detection? If you get a shoot through the current will not flow through the current sensors.


----------



## jackbauer (Jan 12, 2008)

Got the encoder plug sorted but what a battle! While waiting on the correct plug from evtv I tried my luck with RS. Same pinout , same size , same manufacturer etc. Will it fit? Hell no. Seems the little locating tab was a few mm out on this one so I had to grind the thing off. Perfect fit after that but of course the pin numbers are totally different. Solved that by using the Siemens manual and soldering the wire with the plug plugged onto the motor. I really have a pathological hatred for these type of connectors.


----------



## jhuebner (Apr 30, 2010)

Arlo said:


> Are you saying you are using the phase current sensors for Desaturation detection? If you get a shoot through the current will not flow through the current sensors.


I'm using the current sensors for over current detection, thats right. Important difference between that and desat: Over current protection can be set as low as 1A, desat always kicks in at 3-5x the IGBTs nominal current.

No protection from shoot-through but thats nothing that just randomly occurs.
Shoot-through happened to me once when connecting the gate drivers (one twisted). Since this all happens in development stage the bridge is powered with a lab power supply so nothing is destroyed.

If you power up freshly built power electronics with serious current without prior testing you might learn a lesson.

Over current can occur when you set your V/Hz too high and on many other user errors. So its more important to catch during normal operation.


----------



## jackbauer (Jan 12, 2008)

6000RPM 

https://www.youtube.com/watch?v=u35q0AFa96c


----------



## jhuebner (Apr 30, 2010)

Cool 

You can get the speed by typing "get speed" 
It looks like you should really shield your AC cables and the encoder cable. I had a similar waveform before I did that. Also since the sensor is open collector you can plug it into the inverter as is. Theres a pull-up resistor on board.

The DC switch rattling must be caused by your start signal. I intended that to be a pulse from a cars key switch in "starter" position rather than a permanent on signal. Try that and you should get a clean shut down on over current.

The parameter for overcurrent is called "ocurlim" and defaults to 100A.


----------



## jhuebner (Apr 30, 2010)

Tested the web interface today:










I really need more than one plot 

The time axis is roughly 10s per 100.

So this was a little test drive starting full-throttle up hill (x-axis 0-150). The AC current decreases due to battery sag, then because of field weakening that starts at 90Hz. Actually I don't use V/Hz but sine amplitude/Hz.
Then follows activating 50% regen via brake pedal (150-180), then foot-off regen that is derated towards lower frequencies (180-210).

After that is mostly downhill with a frequency peak at 150Hz. 900-1150 is a steep hill climb at a more or less constant 35kph/55Hz.

The temperatures hardly change at all but they badly jitter. Especially the motor temp as that is burried in the motor windings.


----------



## John Metric (Feb 26, 2009)

jhuebner said:


> Tested the web interface today:
> 
> 
> 
> ...


So do I see there, you were at full throttle, you reached a peak of 74 amps on the DC bus and then during regen you reached a peak of minus 24 amps?
Is that during mechanical disc brakes being applied or is that a combination of mechanical brakes an regen braking?

Is the -30 throttle your "neutral" point? How does it feel compared to like the car is in gear but dieseling? What variable is capping the regen out at -24amps?

Congrats to Jack Bauer. I am ready to start my journey too. I have transistors, caps now. Thanks Jeff Major.
I am thinking of going with the OEM gating drivers.


----------



## Jaesin (Mar 6, 2011)

jackbauer said:


> 6000RPM
> 
> https://www.youtube.com/watch?v=u35q0AFa96c


Damien, that's awesome. 

Hilarious: "Whoa Nelly!".

Good work. Getting pretty close.


----------



## jhuebner (Apr 30, 2010)

John Metric said:


> So do I see there, you were at full throttle, you reached a peak of 74 amps on the DC bus and then during regen you reached a peak of minus 24 amps?


Yes



John Metric said:


> Is that during mechanical disc brakes being applied or is that a combination of mechanical brakes an regen braking?


Just touched the brake pedal so the switch comes on. No friction braking happening.



John Metric said:


> Is the -30 throttle your "neutral" point? How does it feel compared to like the car is in gear but dieseling? What variable is capping the regen out at -24amps?


Yes by default -30 is the "foot off" point. Braking effect is similar to a petrol engine, diesel brakes stronger. At -50 the braking is quite considerable, like diesel in 2nd gear.
Regen on break pedal is set by "brknompedal". Regen always happens at "slipmin" - 1.5 Hz for my motor. Acceleration uses up to 3 Hz slip (slipmax).



John Metric said:


> Congrats to Jack Bauer. I am ready to start my journey too. I have transistors, caps now. Thanks Jeff Major.
> I am thinking of going with the OEM gating drivers.


Any plan on how to interface them?
Maybe you can rig something up with the original drivers as they provide a 15V signal.


----------



## jhuebner (Apr 30, 2010)

For those currently building I published a parameter reference:
http://johanneshuebner.com/quickcms/index.html?en_parameters,24.html

Also updated the BOM to better match the part's label


----------



## subcooledheatpump (Mar 5, 2012)

jhuebner, sorry if I missed it posted somewhere, but what bus voltages are your kits good up to? 

I saw your recommendation of 1200 v 400 a IGBT modules. I'm considering the kit and I'm wondering if they will work from 600-750 bus volts? 

are the drivers/ cpu bus powered or 12 V powered?


----------



## jhuebner (Apr 30, 2010)

The electronic part is mostly independent of the bus voltage. Your power stage decides.
So yes, 750V should be fine.

The main board/drivers are powered from 12V


----------



## subcooledheatpump (Mar 5, 2012)

anything else I need? shaft encoder? 

Thanks


----------



## jhuebner (Apr 30, 2010)

The shaft encoder is mandatory.
It is ideally open collector type, like the one used in the Siemens 1PV. Personally I use a optical encoder similar to this: http://sensing.honeywell.de/_onelink_/honeywell/en2de/pdfs/50417_DE.pdf

I use a 30 pulse encoder wheel and before used a 60 pulse wheel. Jack Bauer uses the 64 pulse encoder from the Siemens. They all work well. Don't go for something like a 4096 pulse encoder or similar order of magnitude as that exceeds the cutoff frequency of the encoder input (about 60kHz)


----------



## John Metric (Feb 26, 2009)

_"Multiple Motor Operation (From a Common Controller) - An adjustable frequency AC motor controller is ideally suited for simultaneous control of multiple motors in process line applications. All motors are operated at a common frequency and are therefore synchronized at a common speed. Tracking accuracy between the individual motors varies only by the difference in their loads, typically 0.5% to 3% with standard NEMA Design B motors and 0.0% with synchronous reluctance types."_
http://www.joliettech.com/motor_selection.htm


----------



## jackbauer (Jan 12, 2008)

first look at the web interface :

https://www.youtube.com/watch?v=F6s1S8bVE5U


----------



## jhuebner (Apr 30, 2010)

Looking good. I'm glad you're running linux. Tried the web interface on windows which didn't work at all.

I'm a bit puzzled by the speed oscillating that slowly. But of course the motor won't be very torquy with 60V, maybe thats why.

Looking forward to the plot working


----------



## jackbauer (Jan 12, 2008)

Well , the plot works. Had a strange issue. Started the inverter and pressed the throttle. No response. All inputs correct and contactor closed. Then noticed the "pot" parameter was lower then potmin so changed that. Still no rotation. A clamp meter on the dc line indicated a max of 300mA at full throttle. clamp meter on the AC side indicated 4A rms per phase. Still no rotation. On a hunch I floored the throttle , held it there and spun the shaft by hand. The AC current slowly began to climb and the shaft pickup speed then it ramped up normally to 6k rpm. Regened to a stop and then refused to start without a spin.

I'm guessing the low dc voltage (60v) and the cold effect on the hall current sensors may have played a role. At 4A rms ac the current sensors indicated 6.5A.


----------



## jhuebner (Apr 30, 2010)

Nice you got the plot to work.

Whats the value of fmin and boost?
Or did it spin up with the same parameters earlier?


----------



## jackbauer (Jan 12, 2008)

Fmin is 1hz.Not sure about boost. It spun fine with those params at the weekend.


----------



## John Metric (Feb 26, 2009)

toddshotrods said:


> Actually the cost can come down, significantly, for drag racing. A lot of what you're paying for there is EVDrive's engineering. A drag racer probably doesn't need the oil cooling system (case is designed specifically to make that work effectively), so just buy the Remy cores - four of them - and Rinehart drives - four of them. Put all four cores in a big, long, air-cooled, case, with the drives mounted close by...
> 
> I would say figure out how to make the jhuebner kit run them, but those motors are IPM - not sure what would be involved in that. You're also paying for EVDrive's investment in having Rinehart tune their drives to work with the Remy cored EVD motors - Rinehart says about two week$ on the dyno for that.


Can an industrial permanent magent motor be hooked up "across the line", meaning, turn on the 60HZ and 3 phase 480V and bring it up to speed. Or do all PM motors require a drive?

Can you guys speculate on what it would take to build the simplest permanent magnet motor controller that wouldn't over drain the battery pack?


----------



## major (Apr 4, 2008)

John Metric said:


> Can an industrial permanent magent motor be hooked up "across the line", meaning, turn on the 60HZ and 3 phase 480V and bring it up to speed. Or do all PM motors require a drive?
> 
> Can you guys speculate on what it would take to build the simplest permanent magnet motor controller that wouldn't over drain the battery pack?


Permanent Magnet AC motors are a type of synchronous machine. Synchronous motor have zero starting torque when dumped across the line. Some with very small rotor inertia will catch it so to speak and start, but large synchronous motors require special techniques to start, like amortisseur windings found on wound rotors.

So basically, yes, PMAC motors require drives. The inverter portion of these drives is the same as the inverter for induction motors. The control of that inverter will differ.


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> Fmin is 1hz.Not sure about boost. It spun fine with those params at the weekend.


Ok, maybe friction was a bit higher because of the cold weather. Try increasing boost to 6000-9000 as long as the 60V batteries are connected.

EDIT: the current sensors do NOT influence the control loop


----------



## jhuebner (Apr 30, 2010)

I took some steps to get accustomed to the Park and Clarke transformation of FOC.

Here, I calculated id and iq and from that calculated the power factor:










It was recorded from standstill to about 60Hz going uphill.

Other values that are available courtesy of the transformation: actual power, reactive power, apparent power


----------



## jhuebner (Apr 30, 2010)

I have a question: I found that iq (the torque producing current) is higher by a factor of 1.4 than the RMS current and DC current at full modulation.
Is there an error in my transformations or do I need to divide iq by sqrt(2) to get an effective current?

Now that I plotted it, when I calculate the apparent current at time 250 (sqrt(120²+50²) = 130) the factor between rms current and apparent current is 1.73. Which looks like sqrt(3). I'm confused.
What also confuses me is regen. I would have expected id to be always positive and iq positive on acceleration, negative on regen. But here (time 550), iq is hardly negative, id becomes positive. id is negative while generating positive torque. Ok, that might be a sign problem somewhere. But still, with my amp meter I measured a regen current of 25A at 60kph but iq is hardly negative at all.


----------



## gunnarhs (Apr 24, 2012)

jhuebner said:


> I have a question: I found that iq (the torque producing current) is higher by a factor of 1.4 than the RMS current and DC current at full modulation.
> Is there an error in my transformations or do I need to divide iq by sqrt(2) to get an effective current?
> 
> Now that I plotted it, when I calculate the apparent current at time 250 (sqrt(120²+50²) = 130) the factor between rms current and apparent current is 1.73. Which looks like sqrt(3). I'm confused.


Not sure about your first statement but remember that for delta connection
I (rms,line) = sqrt(3) * I (rms,phase), 
where I (rms,line) is what you see when adding a clamp-meter to one line going from Inverter to motor and I (rms,phase) is the current used for calculation. 
There is no way that Iq can be higher than I(rms,line). 
In the vector model total stator current Is is near to I(rms,line) inducing rotor current Ir and "loosing" magnetizing current Im.
So Is = Im (+) Ir as also seen from the trafo-model.
In stator reference frame (putting d and q - axis on a frame rotating with stator flux) and being in motor-mode 
Iq(s) ~ -(Ir) and Id(s) ~ Im.



> What also confuses me is regen. I would have expected id to be always positive and iq positive on acceleration, negative on regen. But here (time 550), iq is hardly negative, id becomes positive. id is negative while generating positive torque. Ok, that might be a sign problem somewhere. But still, with my amp meter I measured a regen current of 25A at 60kph but iq is hardly negative at all.


 Remember that you are using slip control where Im is lower than in DTC (when not under full load)
As slip frequency w ~ Iq(s)/Id(s) having a lower Im means a lower Id.
When adjusting slip and voltage, your Iq will not be that high either I assume during regen (again assuming your load is not overwhelming the existing stator voltage)
When looking at your diagram I am not sure about the exact values for Id and Iq (in what reference frame are you working?) but the proportion of these two seems consistent. 
Meaning id and iq look more coupled than in FOC (or DTC) which is ok for an induction motor when efficiency and low ripple is the target rather than high dynamic response


----------



## jhuebner (Apr 30, 2010)

So you're saying sqrt(3)*ilXrms is my total AC current. 

Thus, sqrt(3)*ilXrms = sqrt(id²+iq²). In this case 1,73*75=sqrt(120²+50²) which is correct. Cool 

The voltage is transformed from the DC-side to the AC-side by a factor of 1/sqrt(2) assuming full SVPWM amplitude. So the AC-current should be transformed to the DC-current by 1/sqrt(2). 
In this case 120/1,41=85A. My clamp meter showed only 80A, but is doesn't update very quickly and once the field weakening point is reached the current declines. So it could be correct.

So to calculate...


real power: udc/sqrt(2)*iq
reactive power: udc/sqrt(2)*id
apparent power: udc/sqrt(2)*sqrt(id²+iq²)


----------



## jhuebner (Apr 30, 2010)

I updated the sensor board to be able to accommodate either the Tamura or LEM HTFS current sensors. 

I also updated the voltage sensing circuit to Pauls proposal:










I simulated it and it seems to work for single supply voltage opamps as well. Thanks Paul 

I plan to deploy this in the next batch.


----------



## toddshotrods (Feb 10, 2009)

What is the approximate physical size of the current controller, if you put it in a case?

Is the physical layout of the components locked, or is there room for _ interpretation _?

Trying to squeeze 10lbs into my 5lb bag (Scrape).


----------



## jhuebner (Apr 30, 2010)

Since I only supply electronics you can set up the power stage however you want.

This is my wasteful version:










The largest part being the heatsink and the second largest being the caps. And of course a whole lot of unused space.


----------



## toddshotrods (Feb 10, 2009)

jhuebner said:


> Since I only supply electronics you can set up the power stage however you want.
> 
> This is my wasteful version:...
> 
> The largest part being the heatsink and the second largest being the caps. And of course a whole lot of unused space.


Thanks. So, if necessary, I could locate the electronics and power stage separately? How wide are your IGBTs, or more specifically, how narrow could I make the enclosure around what you have pictured there?

Or - would it be possible to reorient the caps, say on a buss bar or something, to bring the height down?

Sorry for all the questions.

I'm trying to figure out if it's possible to squeeze at least the power stage into a 9x8x4" box or, if not, what the smallest size enclosure I can get it in. I know it would depend on the actual components I choose, but using the one(s) that has/have been built as examples can give me an idea if it's even possible.


----------



## jhuebner (Apr 30, 2010)

toddshotrods said:


> Thanks. So, if necessary, I could locate the electronics and power stage separately? How wide are your IGBTs, or more specifically, how narrow could I make the enclosure around what you have pictured there?


You could separate electronics and power stage. The gate drivers should be right on the gates. But I've seen twisted pair connected drivers over a distance of 20cm. The TVS diode should be right on the module.

The diameter of the bus cap is 9cm and the height of the igbt module is 3cm. So even if its mounted lying down the sandwich will take up 12cm (4.7"). So with this very capacitor it will not fit height-wise.

Each module is about 6cm wide. I suspect the inverter will run fine with just one cap. With a bit of machining effort you can make a busbar that allows the cap to lie down. See jackbauers first video featuring the DMOC inverter.
With just 1 cap you can put the igbts closer together so they should cover a total width of about 20cm (8").
The length of the module is about 11cm or 4.3". The gate driver adds another 2" unless you manage to mount it standing up.
So area-wise its possible.


----------



## toddshotrods (Feb 10, 2009)

Awesome! Thank you so much! Sometimes I have a hard time getting the info I need because I ask unordinary questions, but you made that really painless. TThanks again!


----------



## PStechPaul (May 1, 2012)

jhuebner said:


> I updated the sensor board to be able to accommodate either the Tamura or LEM HTFS current sensors.
> 
> I also updated the voltage sensing circuit to Pauls proposal:
> 
> ...


Just be aware that the values of the resistors and their tempcos are very important for common mode rejection (CMRR). What really counts is the ratio of the inverting and non-inverting dividers.


----------



## jhuebner (Apr 30, 2010)

toddshotrods said:


> Awesome! Thank you so much! Sometimes I have a hard time getting the info I need because I ask unordinary questions, but you made that really painless. TThanks again!


Good to hear 



PStechPaul said:


> Just be aware that the values of the resistors and their tempcos are very important for common mode rejection (CMRR). What really counts is the ratio of the inverting and non-inverting dividers.


Ok, so I should use 1% parts and try mounting them next to each other?
I can live with static gain errors as they can be canceled out in software. Temperature dependent errors would suck.


----------



## PStechPaul (May 1, 2012)

Here is a simulation with one of the resistors 4.75k and the other 4.70k, showing the effect of a common mode voltage sweep from 50V to 250V, while measuring a 250V DC source.










The source file is http://enginuitysystems.com/pix/Diff_Amp_CMRR.asc in case you want to play with it.

The output voltage of the op-amp changes from 874.988 mV to 882.315 mV for the 200V CM range, so that is 7.327 mV or 0.8%. Fortunately you have a gain of much less than 1, so the error is just about the same as the tolerance of the resistor over a common mode range equal to the normal mode measurement value. 

I use 1% resistors for all purposes 1/4 watt or less, and usually a tempco of 50 or 100 ppm is fairly standard and inexpensive (less than $0.01 each). They are usually about 0.5% or better.


----------



## jhuebner (Apr 30, 2010)

Keeping in mind that I don't even have issues with the current non-differential version, this should be rock stable. I even put a capacitor from B- to the vehicles chassis to burn up some spikes. It doesn't effect the voltage reading.

Thanks for the simulation, I saved it for future use.


----------



## John Metric (Feb 26, 2009)

PStechPaul said:


> That's a very impressive capacitor. How much does something like that cost? I could not find any pricing on their website:
> http://www.sbelectronics.com/


Price list for SBE rings in the US.

http://www.futureelectronics.com/en/Search.aspx?dsNav=Ny:True,Rpp:20,Arpp:20,Ro:0,Aro:0,Nea:True,N:4294896662-4294917467


Manufacturer Name	SBE INC	SBE INC	SBE INC	SBE INC	SBE INC
Description	1100 V 1500 uF ±10% Metallized Polypropylene Power Ring Film Capacitor	900 V 1500 uF ±10% Metallized Polypropylene Power Ring Film Capacitor	700D Series 900 V 425 uf 10 % Metallized Polypropylene Power Ring Film Cap	700D Series 1200 V 225 uF ±10 % SMT Power Ring Metallized Polypropylene	700D Series 1200 V 115 uF ±10 % SMT Power Ring Metallized Polypropylene
Mfr Part Number	700D158911...	700D15899-...	700D42799-...	700D227912...	700D117912...
Package Style 
Mounting Method SurfaceMount	StudMound
ROHS	Y	Y	Y	Y	Y
Lead Free	Y	Y	Y	Y	Y
Style:	Metallized Polypropylene	Metallized Polypropylene	Metallized Polypropylene	Metallized Polyester	Metallized Polyester
Capacitance:	1500 µF	1500 µF	425 µF	225 µF	115 µF
Rated Voltage:	1100 V	900 V	1200 V	1200 V	
Tolerance (%):	±10 %	±10 %	±10 %	±10 %	±10 %
From	$405.00	$405.00	$225.00	$185.00	$185.25


----------



## Tomdb (Jan 28, 2013)

I just ordered a full Kit from Johannes, cant wait to build it and play around with some power electronics. 

I have an old Think city at my work i can mess around with, this will become my test bed.


----------



## Tomdb (Jan 28, 2013)

I took delivery of the kit today all looks good.

I have started a thread of my own not to pollute this one with my ranting.

http://www.diyelectriccar.com/forums/showthread.php?p=385532#post385532


----------



## dcb (Dec 5, 2009)

Question about caps, I've seen before where folks will put a foil cap in parallel with an electrolytic to absorb some of the ripple, any ideas on if/how to make that work and sizes? 

The motor is an AC24ls, still deciding if 312v is in budget:

Motor Winding Configuration
@156VDC, @312VDC
delta, wye
Peak Torque Nm 87, 92
Continuous Torque Nm [email protected], [email protected]
Nominal Speed rpm 3750 4600
Maximum DC Current ADC 268, 165
Maximum Motor Phase Current Apk AC 400,250


----------



## jhuebner (Apr 30, 2010)

dcb said:


> Question about caps, I've seen before where folks will put a foil cap in parallel with an electrolytic to absorb some of the ripple, any ideas on if/how to make that work and sizes?


If you parallel them on the same busbar, the elcap will see most of the ripple due due its larger capacity. What I can see is the elcap being attached with some inductance

bat+ --|---/\/\/---|--- busbar+
...... _ . elcap . - filmcap
...... - ......... -
bat- --|---/\/\/---|--- busbar-

to form a DC input filter.
Maybe a few cm of wire are enough inductance? simulate...


----------



## Tony Bogs (Apr 12, 2014)

You can parallel elcaps and a DC link foil cap on the same DC link busbars. 

The ripple current distribution between them depends on the ESR values of the caps and the inductances of the bus bar. 
A 470uF/450V elcap has a typical ESR in the range of 400 mOhms, a DC link foil cap 4 mOhms. 

In a AC model caps are shorts. The ESRs and bus bar inductances remain. 
If you parallel 10 elcaps and 1 DC link foil cap, the foil cap will take about 90% of the ripple current. 
But only if you use a proper large 2 plane busbar design with very low inductances. 

If you use small busbar strips, the ripple current evens out more between foil en elcaps, 
but the the ripple voltage increases significantly due to the high busbar inductances.

Edit: you can very easily analyze the circuit with f.i. gschem/gnucap. All caps are series C - ESR - L ; L ~= 20 to 50 nH 
Connect to a AC current source


----------



## Jaesin (Mar 6, 2011)

PMAC and the Nissan Leaf. It's technically described as an "Interior Permanent Magnet Synchronous Motor (IPMSM)" in the service manual.

The Leaf is a PMAC motor it uses a VR resolver. Explained Here: http://www.evaluationengineering.co...e-in-the-loop-testing-for-hybrid-vehicles.php

I have yet to explore this inverter project in any detail but I am wondering if it has the capacity to drive a resolver which looks like it needs a sinusoidal AC signal to start with and 4 analog inputs for decoding the sine + cosine input signals. 

Would it be better to use an external resolver driver and a RD (digital) converter. Does anyone know of one?

There is a Nissan Leaf hackathon in a couple of weeks. I have my kit but am unsure if I'de be able to drive this motor with the hardware included. 

All that said, how about driving without an encoder for a bit. What are the challenges there?


----------



## jhuebner (Apr 30, 2010)

There is an unused 3.3V ADC-pin (throttle2) that you might be able to connect the resolver to. In software you'd have to replace the inc_encoder module by a resolver module.

Then use a slip setpoint of 0 to (maybe) drive the motor. I'm sure it will spin, I'm not sure about the torque output.

You can also spin it open loop with a speed ramp.

In two weeks I will finally be conducting tests with a PMAC and the incremental encoder. The outcome being unknown


----------



## jhuebner (Apr 30, 2010)

Problem with 6 kits

In the last 6 kits that I shipped, I'd replaced the 74F132 with a 74HC132 as it was easier to source. Now I realized, that the high level threshold is 3.15V for the HC device.
This causes the PWM to be constantly inhibited when the two signals *DIN_MPROT* and *DIN_EMCYSTOP* are below 13.5V. There are three solutions:
a) Replace the 74HC132 with a *74F132N* or a *SN74AHCT132N*
c) Keep the voltage on said pins above 13.5V if you easily can
b) Change the input voltage divider.
The latter is done by soldering a 12k-15k resistor across RN1 *pin4* to *pin13* and *pin7* to *pin10* (the one that looks like a 16DIP IC).
The STM32 input pins are 5V tolerant so they can take the extra voltage.
You can use SMD resistors on the back of the PCB so that the mod remains invisible.

I'm really sorry about the inconvenience.


----------



## Tomdb (Jan 28, 2013)

is my kit one of them?


----------



## jhuebner (Apr 30, 2010)

Yes, I'm afraid so.

To find out just check part #30. If it says 74F132 you're fine, when it says 74HC132 then its the wrong part.

Another possible (and more common) replacement is the 74F00 or 74ALS00.


----------



## jhuebner (Apr 30, 2010)

If sourcing the replacement causes headaches I can offer to send a replacement part via mail.

If you've already soldered the IC you'll find it hard to get out again. In that case I'd recommend the b) route.


----------



## jhuebner (Apr 30, 2010)

Me again.
I fixed the regen oscillation bug. Under regen at low speeds the car could start oscillating depending on the slope of the street.

It turns out this was down to my filtered frequency calculation. Whenever a pulse was detected the time taken since the last pulse is updated. To smoothen out uneven distribution of the teeth of the pulse encoder I use an IIR low pass filter. The time is used for angle interpolation between two pulses and for calculating the rotor speed / frequency.

The phase delay of this filter increases as less pulses are generated. At some point it becomes so large that the system oscillates.

I am now updating the filter on every PWM cycle keeping its phase delay constant. That fixed the problem.

I also use DMA now for counting the number of pulses since the last PWM cycle. Therefor the pulse rate can now be higher than the PWM frequency.

I also added another PWM frequency: 1.1kHz


----------



## Jaesin (Mar 6, 2011)

jhuebner said:


> Yes, I'm afraid so.
> 
> To find out just check part #30. If it says 74F132 you're fine, when it says 74HC132 then its the wrong part.
> 
> Another possible (and more common) replacement is the 74F00 or 74ALS00.


Is this the one we need?

http://www.mouser.com/ProductDetail/NXP/N74F132N602/?qs=/ha2pyFadujNCZqmpQ//wJv5mhU4HNnq17Z3Dkwnax8=


----------



## jhuebner (Apr 30, 2010)

Yes, the positive going threshold is <2.0V so its fine.


----------



## Jaesin (Mar 6, 2011)

It's not difficult to switch out the IC. Just cut the leads first with a pair of snippers. Then apply heat with a soldering iron and remove each lead individually with a pair of tweezers. Lastly, use a solder sucker on one side and apply heat to the other side to clear the holes for the new IC. 

That's the easiest way to remove a through-hole IC that I know of.


----------



## John Metric (Feb 26, 2009)

Jaesin said:


> It's not difficult to switch out the IC. Just cut the leads first with a pair of snippers. Then apply heat with a soldering iron and remove each lead individually with a pair of tweezers. Lastly, use a solder sucker on one side and apply heat to the other side to clear the holes for the new IC.
> 
> That's the easiest way to remove a through-hole IC that I know of.


Like....

Metric


----------



## Jaesin (Mar 6, 2011)

I'm having a problem getting the inverter enabled.

The problem I am having is that I get "1.00" for din_ocur even though il1 and il2 are both near 0.00 amps. Both offsets are near 2005.

On the 74HC132, I have 0v on pin1and 5v on pin 2.
That gives me 5v on pin 3. I'm assuming this needs to be 0v to enable the inverter.

On the LM339n:
Pins 1, 2, 12, 13, 14 = 0v
Pin 3 = 5v
Pins 5, 8 = 1.82 v
Pins 7, 10 = 1.78 v
pin 4, 6 = 2.35v
Pin 9, 11 = 1.35 v

I did check the R25, It has 5v on the other side of it.


Any thoughts on what's gong on here?


- Jaesin


----------



## jhuebner (Apr 30, 2010)

The polarity is a bit of weird right now. Try setting the ocurlim to -100A (or whatever) amps. The gain factors (il1gain, il2gain) should be negative as well. That even makes sense because the opamp is inverting.


----------



## Jaesin (Mar 6, 2011)

That worked. Thank you Johannes. I have a nice 50/50 signal now.

I have many questions about this motor control algorithm but i'll read up before posting here.


----------



## broadcastcentral (Jul 6, 2008)

Hello. With an ACIM, when running the motor in regen mode, the RPM of the stator field should be less than the actual rotor RPM. So, to get this working, you would detect the rotor speed and then produce a stator field RPM that is slightly less.

When operating the ACIM as a motor, the voltage and frequency can be applied at a constant ratio, delivering relatively uniform flux to the rotor at all times.

So when I program my controller to produce a stator field for regen mode (lower RPM than actual rotor RPM) I know what to set the frequency as, but I don't know what voltage to provide it. Do I use the same voltage as if the motor was operating in motor mode? (v/hz ratio)

example:
Car with 10hp ACIM motor, sync speed 1800 rpm, nominal voltage 230v;
Driving down the road, the rotor is spinning 875 RPM. Power is delivered to the stator at a 900 RPM rotating magnetic field. The stator's voltage is 115v and is produced using a PWM signal with an 8khz carrier signal.

I start driving down a hill. car speeds up to 950 RPM. I take my foot off the throttle and press the regen brake. Now the controller is feeding the motor a 900 RPM stator field (50 RPM less than the rotor speed). Should I apply the 115v voltage through IGBT's on an 8khz pwm signal to get regen to work? Car is using lithium ion battery bank. 

Thanks


----------



## dcb (Dec 5, 2009)

fyi, here is a link to the source code and schematics and etc.

http://johanneshuebner.com/quickcms/index.html?en_downloads,14.html


----------



## jhuebner (Apr 30, 2010)

Hi,

the regen case is completely symmetrical to the acceleration case.

As you described, the negative torque is generated by a negative slip frequency.

The amount of negative torque is controlled by the V/f ratio and the slip frequency.

So a slip frequency of -1Hz at a ratio of 4V/Hz creates 4 times as much negative torque than -1Hz and 1V/Hz

And a slip frequency of -2Hz creates roughly twice as much negative torque than -1Hz.


----------



## broadcastcentral (Jul 6, 2008)

Thanks guys.

So when this negative torque is produced, it causes excess current to be fed back into the battery bank.. The thing that confuses me is if I have, for example, 4 volts / hz being fed into the stator.. but the stator is feeding back -6 volts to the battery bank because of the regen effect. The net effect will be 2 volts being fed back to the battery.. is this correct? Seems like it wouldn't work or something...


----------



## subcooledheatpump (Mar 5, 2012)

The voltage fed to the stator excites a field in the stator and rotor. whether current is flowing into or out of the inverter is determined by whether the rotors field is lagging the stator field or leading the field. Under acceleration, a stronger field (V/Hz) will cause more torque output and more current to flow out of the inverter. Under Braking, the same thing happens, the only thing that changes is the direction of current flow. A stronger field (V/Hz) will cause more torque input and more current to flow into the inverter. The voltage you can expect during braking is related to the batteries resistance. If your batteries are full, then very high voltages can be produced. If they are empty, the voltage may not reach normal levels. Of course, this also depends on braking torque. Obviously, more braking torque will lead to higher currents, which lead to higher voltages.


----------



## major (Apr 4, 2008)

broadcastcentral said:


> So when this negative torque is produced, it causes excess current to be fed back into the battery bank.. The thing that confuses me is if I have, for example, 4 volts / hz being fed into the stator.. but the stator is feeding back -6 volts to the battery bank because of the regen effect. The net effect will be 2 volts being fed back to the battery.. is this correct? Seems like it wouldn't work or something...


Hi broad--,

I am having difficulty understanding what you're talking about. Is English your native language? Would please go to the user CP and fill in your location so readers can see where your coming from geographically speaking. Also, on your other thread I asked you to show us what you have, essentially. Do you have an operational inverter? Can you post pics or video of it running? Screen shots of scope showing the waveforms? What motor you're driving? What battery you're using? 

This would help greatly. I can't figure out what you mean by feeding back -6 volts to the battery 

Regards,

major


----------



## major (Apr 4, 2008)

jhuebner said:


> So a slip frequency of -1Hz at a ratio of 4V/Hz creates 4 times as much negative torque than -1Hz and 1V/Hz


You actually run a 4 to 1 ratio of V/f on the same motor?


----------



## broadcastcentral (Jul 6, 2008)

Hey guys thanks for the replies. I don't want to hijack this thread so I'm gonna continue my questions on the other thread I started. Here's the link:
http://www.diyelectriccar.com/forums/showthread.php/induction-motor-regen-mode-question-95882.html


----------



## jhuebner (Apr 30, 2010)

major said:


> You actually run a 4 to 1 ratio of V/f on the same motor?


More than that.
The software lets you program a minimal percentage for the V/f at 0% throttle (well a bit above 0 throttle). I ended up setting this to 10% because otherwise its hard to do parallel parking or any precise maneuvers.
So at small throttle values the V/f ratio is 10x less than at full throttle in this example. 100% is about the motors nameplate V/f ratio.
The slip starts out at the nameplate value (or whatever you program) and linearly increases with the throttle to some maximum value. For my motor I set this from 1Hz to 3Hz.


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> More than that.
> The software lets you program a minimal percentage for the V/f at 0% throttle (well a bit above 0 throttle). I ended up setting this to 10% because otherwise its hard to do parallel parking or any precise maneuvers.
> So at small throttle values the V/f ratio is 10x less than at full throttle in this example. 100% is about the motors nameplate V/f ratio.
> The slip starts out at the nameplate value (or whatever you program) and linearly increases with the throttle to some maximum value. For my motor I set this from 1Hz to 3Hz.


I've been reading this topic with some interest. Very informative. Thanks for sharing.

I noticed you have a few libraries on the tumanako repository. Are you a developer for them by any chance?

Also regarding V/Hz any reason you are not using FOC? ST have an aplication note on this for the SMT32F103, which I believe it is similar to the one you are currently using and can be found here http://d1.ourdev.cn/bbs_upload782111/files_11/ourdev_459355.PDF

Other than this I would like to know how to load this files into the SMT, do you have any toturial?
PS: I know how to load the files, simply there is more than one binary.

Kind Regards


----------



## jhuebner (Apr 30, 2010)

cts_casemod said:


> I noticed you have a few libraries on the tumanako repository. Are you a developer for them by any chance?


Yes, I developed the so called "sine" project.



cts_casemod said:


> Also regarding V/Hz any reason you are not using FOC? ST have an aplication note on this for the SMT32F103, which I believe it is similar to the one you are currently using and can be found here http://d1.ourdev.cn/bbs_upload782111/files_11/ourdev_459355.PDF


Currently, because slip control works so well I couldn't be bothered. I will experiment with closed loop FOC as I have the Park/Clarke transformations already working.



cts_casemod said:


> Other than this I would like to know how to load this files into the SMT, do you have any toturial?
> PS: I know how to load the files, simply there is more than one binary.


This may come close: http://johanneshuebner.com/quickcms/index.html?en_schematics-and-instructions,9.html (section "Software Installation").

Of course you need a toolchain and stuff, this isn't explained yet.

Sorry for not following up on your last mail btw... got shifted out of my mind.


----------



## jhuebner (Apr 30, 2010)

Onto another topic.

Last week I tested the inverter on a testbench with a synchronous motor.

First test was running it open loop. This works fine at first, but even a 2Hz jump in frequency gets you out of sync and the motor stalls.

Next we tried closed loop operation with an incremental sensor. I started with 1Hz until I picked up 1Hz from the incremental encoder. Then I switch over to synchronous mode. 
The problem was that not much torque was produced because the angle between stator and rotor field was close to 0°.

I tried normal slip control with 0.2Hz. This leads to a "torque ripple" with 0.2Hz. I.e. the motor speeds up then looses speed, then speeds up again. When I set the slip to 0Hz during the acceleration phase the motor ran fine in synchronous mode. It produced the nameplate torque.

So the only issue with synchronous motors and an incremental encoder is finding the right angle when starting up.

I can picture an encoder with an additional 0-signal that fires once per turn.

(because I can't interface resolvers with the current hardware)


----------



## Jaesin (Mar 6, 2011)

I'de think you would want to use something like this.

http://www.tamagawa-seiki.com/english/position/post-1.html


----------



## eldis (Sep 3, 2013)

jhuebner said:


> Onto another topic.
> I can picture an encoder with an additional 0-signal that fires once per turn.
> (because I can't interface resolvers with the current hardware)


This is exactly the type of encoder I have on my Siemens servodrive (asynchronous). A,B and 1turn signals. Company that makes them is called Heidenhain. The one that I have installed is good for >8k RPM continuous.


----------



## jddcircuit (Mar 18, 2010)

jhuebner said:


> Onto another topic.
> 
> Last week I tested the inverter on a testbench with a synchronous motor.
> 
> ...


I am using a version of FOC and my own resolver decoder to control my synchronous motors out of a Toyota Prius.

I did however push a car around the block not using FOC with this motor. In this mode I was just applying a voltage synchronous to rotor angle. This would be like using your 0Hz slip I assume. I didn't have any phase current feedback to do FOC at the time.

The reason I think FOC is beneficial for me is that I want to maintain a very specific Id to Iq relationship in order to get maximum torque per amp. This motor prefers to have a negative Id unlike normal BLDC motors that I have used in the past.

In my application the rotor flux angle is based on the resolver angle so I don't have to try and approximate it using a bunch of motor parameters as with ACIM. So in my case FOC is very straight forward.

One experiment I am planning is to see if there is a difference between my FOC calculated voltage angle with respect to my rotor angle. If they always track each other or with a fixed offset than there isn't much advantage using FOC and I could go back to simply applying voltage synchronously to the resolver output.

Regards
Jeff


----------



## jhuebner (Apr 30, 2010)

jddcircuit said:


> One experiment I am planning is to see if there is a difference between my FOC calculated voltage angle with respect to my rotor angle. If they always track each other or with a fixed offset than there isn't much advantage using FOC and I could go back to simply applying voltage synchronously to the resolver output.


Thats an interesting one. Let us know the outcome


----------



## John Metric (Feb 26, 2009)

My first osciliiscope measurement since I used to repair tv tuners in high school, 1980?

What is the funny Bottom driver waveform shape all about? Its the same on all three gate drivers.


----------



## PStechPaul (May 1, 2012)

That looks like two overlapping waveforms, possibly with one channel inverted, and a lot of overshoot on transitions. Without more information about where and how the measurement was taken, it's difficult to analyze further. Are both probes properly compensated?


----------



## Tesseract (Sep 27, 2008)

John Metric said:


> ...
> What is the funny Bottom driver waveform shape all about? Its the same on all three gate drivers.


It looks like you have the scope inputs set to AC coupling.


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> Yes, I developed the so called "sine" project.
> 
> 
> Currently, because slip control works so well I couldn't be bothered. I will experiment with closed loop FOC as I have the Park/Clarke transformations already working.
> ...


Hi,

The only reason i might want to look into FOC is "part-load" efficiency. I am looking at the ST libraries for the STM32F103 but havent got the time to investigate the matter yet.

Having said this, I've read somewhere that the you control the V/Hz profile with the accelerator for parking for example. is this used also while driving? An example: Supose I have the motor at synchronous speed, however I want to cruize and desire little or no torque. Is it possible to feed it with only 1/4 of the V/Hz ratio (about 100V instead of 400) while keeping the same frequency?


I've looked into your code.
I have an ST link which i use to load the software.
If i got this right, the "stm32_sine" file is the actual code and the "stm32_loader" is some sort of linux binary to load the firmware trough the serial port, can you confirm this?

Regards


----------



## jhuebner (Apr 30, 2010)

cts_casemod said:


> Hi,
> 
> The only reason i might want to look into FOC is "part-load" efficiency. I am looking at the ST libraries for the STM32F103 but havent got the time to investigate the matter yet.
> 
> Having said this, I've read somewhere that the you control the V/Hz profile with the accelerator for parking for example. is this used also while driving? An example: Supose I have the motor at synchronous speed, however I want to cruize and desire little or no torque. Is it possible to feed it with only 1/4 of the V/Hz ratio (about 100V instead of 400) while keeping the same frequency?


Thats exactly what I do, yes. Its what FOC ends up doing as well if you set a low id and iq setpoint.



cts_casemod said:


> I've looked into your code.
> I have an ST link which i use to load the software.
> If i got this right, the "stm32_sine" file is the actual code and the "stm32_loader" is some sort of linux binary to load the firmware trough the serial port, can you confirm this?
> 
> Regards


Almost. stm32_sine is in fact the firmware, stm32_loader is a boot loader that resides in the first 4k of flash.
The source code for the linux binary isn't on github yet.



John Metric said:


> My first osciliiscope measurement since I used to repair tv tuners in high school, 1980?
> 
> What is the funny Bottom driver waveform shape all about? Its the same on all three gate drivers.


Since all 3 gate drivers do this I dare say its got something to do with your scope/probe. I don't think the AC setting is the problem, as 8khz is like DC for a scope. At least I often measure the PWM with the AC setting.
Please verify the scope with a known signal, usually the scope provides some sort of square wave. Is the probe properly grounded?


----------



## Tesseract (Sep 27, 2008)

jhuebner said:


> ...Since all 3 gate drivers do this I dare say its got something to do with your scope/probe. I don't think the AC setting is the problem, as 8khz is like DC for a scope....


Perhaps, but the waveform is heavily differentiated, just as you would expect if the AC coupling capacitor was too low in value (e.g. - dried out/damaged), or the loading exhibited by the scope was much lower than the typical 1M (ie - also a sign of damage to the "front-end").


----------



## cts_casemod (Aug 23, 2012)

What exactly does your bootloader differ in regards to the hardware bootloader on the STM32? After burning it into the chip how do I upload the sine code?

Regards


----------



## jhuebner (Apr 30, 2010)

cts_casemod said:


> What exactly does your bootloader differ in regards to the hardware bootloader on the STM32? After burning it into the chip how do I upload the sine code?


The built in boot loader needs to be activated using a boot pin. Thus it requires an extra pin from your uart adapter. But the biggest problem is that it is hard coded to use USART1 which shares pins with TIM1, the PWM timer.

So the custom one I wrote uses USART3 and a custom protocol.

1. After reset it sends an "S"
2. If within 300ms after reset you sent a byte containing the number of pages of the new firmware, it enters update mode
2.1. otherwise it starts the existing firmware
3. Bootloader sends a "P" requesting the first page to be sent
4. Updater sends the page
5. Bootloader sends a "C" requesting the CRC32 for that page
6. Updater sends CRC
7. If CRC matches the page is burned to flash and operation continues with step 3 if more pages are expected
7.1 If CRC doesn't match an "E" is send and operation continues with the same page at step 3
7.2 If all pages were received a "D" is sent and the new firmware is started

In the zip file there are binaries that do exactly that.


----------



## jhuebner (Apr 30, 2010)

cts_casemod said:


> The only way I coud get the thing working in first place was to place a transducer in the front of the car. The output is a 0-10V signal proportional to the motor frequency, given by a 18PPR encoder ([email protected]), that goes to the inverter on the back. I got lots of problems using the digital signal.
> 
> Would making and ADC reading instead of using the timer to read the frequency be something easy to do?


First I don't get your math. A 18PPR encoder should give you 4000/60*18=1200Hz at 4000 rpm. Using the ADC to count pulses sounds a bit awkward, but you're the experimenter 
So what I do is
1. Use shielded twisted pair cable (I use CAT5 ethernet cable)
2. Load the encoder with a current. Mine is loaded with 7mA by a pull-up resistor
3. RC filter. I use 120R, 22nF
4. Digitally filter. I use the highest filter setting (never calculated the cutoff frequency)

Since I implemented all of these measures I never saw a false pulse again.



cts_casemod said:


> In regards to the software, the web interface, when I am setting the values, does it still use USART 3?


The web interface uses the very same protocol as the text console. So yes, still USART3.

Just out of curiosity: Are you actually using the "Huebner Inverter" meanwhile?


----------



## jhuebner (Apr 30, 2010)

Ok, we're going a little off topic here, could you move this to a different thread and place a link?


----------



## jhuebner (Apr 30, 2010)

I just love making those plots 










Some full acceleration uphill and some full regen downhill. p and q are interchanged for some reason.
The power factor during acceleration is always >0.9 and reaches 0.95 at higher revs.
During regen the power factor doesn't look so good, it is mostly <0.7 . Regen is always done at the motors nominal slip frequency so I don't quite understand why the power factor is so poor.










id and iq (also interchanged) during full acceleration and full regen. You can see that the magnetizing current is much higher during regen explaining the poor power factor.










Udc during a normal drive cycle with some full accel and regen. Dips to about 457V and goes up to 522V while idle voltage is 500V.
In winter it went down to 420V and thus I had a power loss at the upper end.


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> Ok, we're going a little off topic here, could you move this to a different thread and place a link?


If you can clarify exactly what the off topic is I can create a suitable topic, the only that comes to mind is asking if the encoder input can be selected as an an analog reference signal, which would actually be a feature implementation as most industrial equip. works with a 4-20mA signal, converted to 2-10V to allow detection of a failed wiring (and low impedance). All others as technical stuff about the inverter

Now looking at your graphics above, have you tried to reduce the field voltage (V/Hz ratio) while regenerating? This should have a positive inpact on the PF. Where's your Part Load / Cruize on the graph?


----------



## jhuebner (Apr 30, 2010)

cts_casemod said:


> If you can clarify exactly what the off topic is I can create a suitable topic,


Its just that this thread isn't a general home built VFD thread but its specifically on the inverter I designed. Now stuff is getting mixed up if you start asking questions about an inverter you built with an entirely different approach.
Why don't you create a topic on your device where you specify what you've done, how you did it and the problems you are currently having.



cts_casemod said:


> the only that comes to mind is asking if the encoder input can be selected as an an analog reference signal, which would actually be a feature implementation as most industrial equip. works with a 4-20mA signal, converted to 2-10V to allow detection of a failed wiring (and low impedance). All others as technical stuff about the inverter


Like said, this is a question specific to your implementation, as I've already decided on pulse counting.
Anyway, the analog solution might suffer the same problems as the digital one if not sufficiently filtered and shielded.
Broken wire and low impedance is no security threat when pulse counting. You simply won't see anymore pulses and the motor won't move. So thats not really an argument for the analog version. But who am I to judge; just try it.



cts_casemod said:


> Now looking at your graphics above, have you tried to reduce the field voltage (V/Hz ratio) while regenerating? This should have a positive inpact on the PF.


Yes, if I change the according parameter or press the throttle a little bit exactly that is done to reduce braking torque. Like said, the slip is fixed so the field voltage is the only quantity left to control. I have never looked at the PF with reduced braking torque though. Maybe the slip is even too low?



cts_casemod said:


> Where's your Part Load / Cruize on the graph?


You can see some part load on the beginning of the p/q/s graph. I could make a part load id/iq plot as well, but it won't really be surprising: the currents will be smaller, both magnetizing and torque producing current.


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> Its just that this thread isn't a general home built VFD thread but its specifically on the inverter I designed. Now stuff is getting mixed up if you start asking questions about an inverter you built with an entirely different approach.
> Why don't you create a topic on your device where you specify what you've done, how you did it and the problems you are currently having.


I see your point. I am not questioning any of my problems, I am questioning how your inverter works to see if it matches exactly what I am looking or what issues I will face while upgrading. I only posted the details since you asked me what setup I was using.



jhuebner said:


> ... as I've already decided on pulse counting.


Surelly I can see that.
My original question was if it was hard or possibke to make the implementation just because I asked to, since as I said I am looking at doing things a certain way with what I already have in the car. Surelly I could pay for your time to do so if it is not a ridiculous ammount. 



jhuebner said:


> Broken wire and low impedance is no security threat when pulse counting. You simply won't see anymore pulses and the motor won't move.


Then I guess you found a different way to avoid the controller to see the motor at standstill and command a ridiculous ammount negative torque (braking) if that ever happens?



jhuebner said:


> Yes, if I change the according parameter or press the throttle a little bit exactly that is done to reduce braking torque. Like said, the slip is fixed so the field voltage is the only quantity left to control. I have never looked at the PF with reduced braking torque though. Maybe the slip is even too low?


Something to think about. I only use 1/2 of the slip to brake (compared to that used on acceleration), I can tell you exactly how much It is set up to now next time I charge the car.


----------



## jhuebner (Apr 30, 2010)

Ok, lets not get hung up on that



cts_casemod said:


> Then I guess you found a different way to avoid the controller to see the motor at standstill and command a ridiculous ammount negative torque (braking) if that ever happens?


Yeah meanwhile I found out what happens: the motor does exactly as you say but within a few ms the over current limit is hit. So do don't feel the braking effect anymore.




cts_casemod said:


> Something to think about. I only use 1/2 of the slip to brake (compared to that used on acceleration), I can tell you exactly how much It is set up to now next time I charge the car.


Ok, do you have a chance to measure the power factor on your setup?

Right now my full acceleration slip frequency is 2.5Hz and the braking slip frequency is 1.3Hz (the motors nominal value)


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> Ok, lets not get hung up on that
> 
> 
> Yeah meanwhile I found out what happens: the motor does exactly as you say but within a few ms the over current limit is hit. So do don't feel the braking effect anymore.
> ...


No worries, I cleared unnecessary posts.

Good to know that. 

Under regen 0.8 to 0.9 down to 400RPM decreasing between 400 and 200. Below 100 ceases to generate anything and uses a few amps to slow down the car to a standstill. 

My guess is that perhaps you are underloading the motor while regenerating, which could explain the low PF.

I am still curious... Do you use a constant slip and vary the voltage or you actually change the slip as well as the voltage? Whats the relashionship between V/Hz ratio, slip and throttle %?


----------



## jhuebner (Apr 30, 2010)

Ok, thats pretty good.

I have 2 parameters, fslipmin and fslipmax.
I use fslipmin for regen.
For accel I start with fslipmin at light throttle and linearly ramp up to fslipmax at full throttle while also ramping up the V/f ratio.

I will make some more measurement with different slip and V/f values.


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> Ok, thats pretty good.
> 
> I have 2 parameters, fslipmin and fslipmax.
> I use fslipmin for regen.
> ...


So I am guessing you have slip min to simulate engine braking as with an ICE and slip max when you press the brake? Can it be set linearly just as acceleration?


----------



## jhuebner (Apr 30, 2010)

cts_casemod said:


> So I am guessing you have slip min to simulate engine braking as with an ICE and slip max when you press the brake? Can it be set linearly just as acceleration?


Always fslipmin with different V/f ratios. I could try as you say.


----------



## cts_casemod (Aug 23, 2012)

jhuebner said:


> Always fslipmin with different V/f ratios. I could try as you say.


Oh, I got it now.

Yes that will result in a lower power factor, since the rotor is under powered in relation to the stator. 

You could either reduce the max V/Hz ratio or ideally increase the slip at higher revs, but they still need to be proportional if the braking torque is adjustable. One exception at lower revs where the voltage must be kept below the original V/Hz ratio to intentionally increase the slip, otherwise parking may be dificult, so that would basically be what you have now.


----------



## John Metric (Feb 26, 2009)

Look out for King Ghidorah. Here is a shot of the plasma shooting out of two of it's heads. OK, this was really just 12V output from two of the three phases and through a low pass filter, but I am impressed I have made it this far. Next thing is to turn a motor with it. I built a small 3 phase 50A IGBT prototype before trying the 1400A/2800A units. I brought home my 20V 500A power supply from my lab, I think I will use that instead of the batteries, its got nice VDC and Amp readouts.









Notice the similarities....Ghidorah-three phase AC








Godzilla - Just single phase DC


----------



## jhuebner (Apr 30, 2010)

Godzilla has some stray losses going on.

Good thing you're starting with the smaller modules. And congrats on the sine waves. What frequency is it?


----------



## John Metric (Feb 26, 2009)

jhuebner said:


> Godzilla has some stray losses going on.


Assault and Battery has some losses too.


----------



## jhuebner (Apr 30, 2010)

I worked on the web interface a bit. The plot can have 2 axes and you can save a plot into the current page.
All operations are done via ajax, so the page never needs reloading.

I updated the zip file.

I also worked on the actual firmware a bit:
- ADC samples faster and the extra values are used for interpolation.
- Interpolation takes 4 median values out of 3 samples and then takes the average of those 4 medians. This was the best compromise between spike suppression and and cpu time. A true 12 sample median takes too long (10µs)
- Updated the slip angle calculation so now fslipmax and fslipmin represent the true slip frequency, no longer multiplied with the pole pairs.
- Changed the regen ramp to go all the way down to 0 instead of ampmin
- Added value "t" which is the motor torque calculated out of actual power over speed. Of course this is only an estimate.










According to that the motor generates a peak torque of 170Nm. I don't really understand why the torque should be lower at lower rpm. It just doesn't feel that way, especially on regen.

Apart from that I'll be off the internet the next 3 weeks. So I hope people who are currently building can help each other out.

@cts: I tried different slip values on regen, the power factor even got worse. Somehow I don't trust my d/q transformation yet, maybe I'm chasing a phantom. Here is a plot for fslip=2Hz, the former was at fslip=1.3Hz


----------



## cts_casemod (Aug 23, 2012)

Surelly this is just calculated, but the torque seems to reach its peak at maximun RPM, near 4200RPM. Should the motor not be working in constant HP region at some point before that?

It would be interesting if you could plot acceleration, say on a straight line, using same gear, as that would be a better indicator of where the motor efficiency starts to drop. 

Now back to our last discussion, I have been checking efficiency of the regeneration.

I forgot my initial tests where done regenerating to a resistive load. When I regenerate to the battery the IGBTs act as a synchronous rectifier that converts AC power from the motor into DC to the batteries, and hence the resulting power factor is going to be low, since the rectified current flows to the battery on the peaks of the sine wave. I appologize for the confusion.


----------



## major (Apr 4, 2008)

cts_casemod said:


> Surelly this is just calculated, but the torque seems to reach its peak at maximun RPM, near 4200RPM. Should the motor not be working in constant HP region at some point before that?


I think you are referring to this curve: 










The red trace is RPM. So the power and torque peak at about 2400 RPM.

As this motor is running at or near peak output, there is no *constant HP* region. Ref: http://www.diyelectriccar.com/forums/showpost.php?p=409369&postcount=19


----------



## cts_casemod (Aug 23, 2012)

major said:


> The red trace is RPM. So the power and torque peak at about 2400 RPM.


Yes, thats the one, Bad interpretation on my side.


major said:


> As this motor is running at or near peak output, there is no *constant HP* region. Ref: http://www.diyelectriccar.com/forums/showpost.php?p=409369&postcount=19


With the above clarified, it seems CP is above 2400RPM, power is almost constant, I am guessing the small reduction comes from the fact that the slip goes down, hence less power delivered to the rotor, untill he starts reducing speed at 90 (horizontal x axis).


----------



## major (Apr 4, 2008)

cts_casemod said:


> ... it seems CP is above 2400RPM, power is almost constant, ....


Power drops 45%, and that is almost constant in your opinion  



major said:


> The constant power region is a relic of rating specifications for continuous operation. When dealing with peak output, it becomes a singularity (peak point) as shown on the curve I referenced. Below the graph you reference, notice this comment:
> 
> 
> > The fact that the peak power decreases as speed is increased by field weakening is the most "inherent" limitation to the "constant power speed range" of an AC drive.


----------



## cts_casemod (Aug 23, 2012)

major said:


> Power drops 45%, and that is almost constant in your opinion


Power goes down at an almost constant rate, with the decrease of slip (and torque) is what I meant with the last post.


----------



## John Metric (Feb 26, 2009)

shouldn't the torque be infinity at zero power if acceleration is present? I would review the calculation again. The acceleration slope looks constant under 2400rpm I would expect to see a constant torque during that period.

Unless you have built in a ramp into the software?
What is the file that contains the program?


----------



## major (Apr 4, 2008)

John Metric said:


> shouldn't the torque be infinity at zero power if acceleration is present?


Well not infinity, but usually a constant value below base speed if he had it floored. It does look funny at the launch  Good eye


----------



## cts_casemod (Aug 23, 2012)

John Metric said:


> shouldn't the torque be infinity at *zero power* if acceleration is present? I would review the calculation again. The acceleration slope looks constant under 2400rpm I would expect to see a constant torque during that period.
> 
> Unless you have built in a ramp into the software?
> What is the file that contains the program?



You mean zero speed?


----------



## PStechPaul (May 1, 2012)

There has to be torque to cause acceleration starting a zero speed. I am surprised that the torque does not jump just about to maximum just before the speed starts to go up. Output power will be zero until there is any speed, but power from the battery pack and into the motor will be significant, in the form of inevitable losses.


----------



## jhuebner (Apr 30, 2010)

The display values must be a bit wacky, fortunately it's only display values.

It is true that torque is generated at 0rpm and as John points out that would yield a division by zero using the p/speed formular.

> Unless you have built in a ramp into the software?
No ramps. My butt definitely does not agree with the torque curve. It feels constant acceleration up to the power peak, than decreasing acceleration.


----------



## major (Apr 4, 2008)

jhuebner said:


> It is true that torque is generated at 0rpm and as John points out that would yield a division by zero using the p/speed formular.


I think it is the other way around. Power = Torque * RPM. So with zero RPM, power is zero regardless how much torque is present. The torque at the start is typically at or near the maximum with induction motors but power is zero until it starts to rotate. 

If there was power there at zero speed, then the torque would be infinite and stuff would break real fast


----------



## jhuebner (Apr 30, 2010)

major said:


> I think it is the other way around. Power = Torque * RPM. So with zero RPM, power is zero regardless how much torque is present. The torque at the start is typically at or near the maximum with induction motors but power is zero until it starts to rotate.
> 
> If there was power there at zero speed, then the torque would be infinite and stuff would break real fast


Yes, I rearranged that to torque=power/speed. But that doesn't really work when there is no speed and no power 

Torque is also proportional to id - the torque generating current. I had done another experiment but that turned out wacky as well. Torque*speed hardly ever matched the power.

I can try calculating the scaling factor (Nm per Amp) from the nameplate current, torque and power factor.

c = t_n/(I_n*pf_n)
Then t=c*id


----------



## jhuebner (Apr 30, 2010)

I made a new sensor board:



















The improvements to the old one are:
- More accurate footprints for the current sensors
- 3 Types of current sensors supported: Tamura L01Z (up to 600A, the one I used up to now), Tamura L06P (up to 800A), LEM HTFS (up to 1200A)
- Differential bus voltage measurement
- Vcc decoupling with LC lowpass to filter noise from the 5V buck regulator

The silkscreen has one error: the labels for R9 and R12 are interchanged. 

I will ship new orders with the new board.

I need some opinions on the default current sensor:
800A L06P or 400A L01Z or 600A L01Z?

The LEM HTFS is a bit harder to source right now so I'm not considering it a default option.


----------



## John Metric (Feb 26, 2009)

They are all very cheap, and the holes are so small, I would use the largest one available.

Even at 800amp continuous rating the diameter of that hole is only 22mm. That's not much of conductor pulling a continuous 800amps, unless it's a water-cooled copper bus tube.


----------



## MitchJi (Dec 14, 2007)

Hi,

You might be interested in the work, Arlin is doing on a Leaf controller here:
http://endless-sphere.com/forums/viewtopic.php?f=30&t=35387&start=1675#p940054


----------



## Nathan219 (May 18, 2010)

Not all of the conductor needs to go through sensor


----------



## jhuebner (Apr 30, 2010)

Do you mean bypass some of the current? Would that be linear?


----------



## eldis (Sep 3, 2013)

That sounds like a bad idea.. You would not manage to split it evenly, so every cable would have to be individually calibrated. Plus if you don't pull apart individual wires but start soldering something in parallel to divert some current, it will be very dependent on the temperature and drift in time.

I think that 800A LEM is not meant to be used for 800A RMS current, no? You should keep some overhead for peaks (btw, you guys are really getting 800A RMS on your cables?)


----------



## jhuebner (Apr 30, 2010)

I'm running 80A rms and have to set the current limit to 160A. 113A is the sine peak and the remaining 47A must be some spikes.

So judging by that example, the 800A sensor (1200A peak) should only be used up to 600A rms.

There are current sensors for the kA region but no 5V models. In that case an additional +-/15V power supply is needed with -15V tied to the main boards ground and the output divided down to fit the sensor boards input range of 0-5V

That said I want to emphasize again, that slip control does not need current sensors. They are only used for the over current protection.

If the current sensors turn out to be a problem, there are other ways to do over current protection.


----------



## John Metric (Feb 26, 2009)

Well since I have such a huge potential amp draw to two motors in parallel I am planning on skipping the amp sensors and going to the OEM gate drivers. I have one pair on order to check fit, cause I may have to enlarge my inverter case now.

The OEM gate drivers will have built in short circuit protection.

Now I need to find a HEX voltage step up board(level shifter) for the 6 gate signals.
Need to go from 3.3V to 5V (FOUND THE 5V to 15V converter, now just need the 3.3V to 5V which should be more common)
"The control pins must be pulled low with a buffer that is capable of sinking 15mA in order to turn on the high speed opto coupler inside the VLA500 series driver. A CMOS buffer that actively pulls its output high is recommended for maintaining good common mode noise immunity in the off state. Open collector type drive is not recommended."


Need a 12V to 5V and 15V 6amp power supply also.

Is there a quick level shifter board available for just such an application.


----------



## jhuebner (Apr 30, 2010)

Here is a 12 to 15V module:
http://www.ebay.com/itm/DC-DC-12V-t...548?pt=LH_DefaultDomain_0&hash=item3f31b02ae4

Try running the logic with 3.3V it often works as is. Otherwise put a SN74ACT244 (http://media.digikey.com/pdf/Data Sheets/Toshiba PDFs/TC74ACT240,244.pdf) on a prototype board.

How much current do you need on the 5V rail? The one on the main board provides 3A.


----------



## dcb (Dec 5, 2009)

*build notes (success finally)*

been slow on this project, brand new to stm32. But I finally got it to build (and diff shows the output matches the released stm32_sine.bin.

ubuntu 14, 


expanded https://launchpadlibrarian.net/177524816/gcc-arm-none-eabi-4_8-2014q2-20140609-linux.tar.bz2 to a private directory

gcc-arm cross compiler, CHECK



Added the bin dir therein to the path

followed:
https://github.com/libopencm3/libopencm3-examples

ran make on the top level directory, 

libopencm3 headers and objects, CHECK


grabbed the original zip with the flash/etc utilities:
http://johanneshuebner.com/quickcms/index.html?en_downloads,14.html

expanded it into my arm tree

got sources, CHECK


scratched head for a long time. finally realized that the .cbp files were for a C/C++ ide called codeblocks, more digging,
settled on http://hivelocity.dl.sourceforge.ne...codeblocks-13.12-1_amd64.debian.stable.tar.xz

brought up codeblocks, tweaked the default compiler to point to my private 
arm-none-eabi-gcc and added arm-none-eabi- to the front of the other tools

opened the project sinus.cbp

viewing source in IDE, CHECK


hit build, saw include errors
Modded the CFLAGS and CPPFLAGS lines in Makefile (added -I for libopencm3)

CFLAGS = -Os -Wall -Wextra -Iinclude -I/var/arm-eabi/proj/libopencm3-examples/libopencm3/include/ -fno-common -fno-builtin \
-mcpu=cortex-m3 -mthumb -std=gnu99 -ffunction-sections -fdata-sections
CPPFLAGS = -Os -Wall -Wextra -Iinclude -I. -I/var/arm-eabi/proj/libopencm3-examples/libopencm3/include/ -fno-common \
-ffunction-sections -fdata-sections -fno-builtin -fno-rtti -fno-exceptions -fno-unwind-tables -mcpu=cortex-m3 -mthumb


hit buid, saw linker problems, added -L flag to a libopen ld file directory:
LDFLAGS = -L$(TOOLCHAIN_DIR)/lib -L/var/arm-eabi/proj/libopencm3-examples/libopencm3/lib/ -T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections,-Map,linker.map


Hit Build, SUCCESS!


ran diff, no differences between original bin and newly compiled bin, CHECK


TODO: flash

scratched head some more, wondering how programmer connects.
opened the bootloader project in codeblocks firmware_loader.cbp

Saw UART3 referenced.

reviewed:
https://www.olimex.com/Products/ARM/ST/STM32-H103/resources/STM32-H103.pdf page 10.

hooked up the pl2303mdl to the EXT2 port on the olimex (useful for upgrades even if you don't build)

gussing this should work:
pl2303mdl pin, STM32-H103 EXT2 pin
GND, 6 GND
RX, 14 PB10/UART3.TX
TX, 15 P11/UART3.RX 
VCC, 23 +5V USB

Maybe not the ideal setup, but if it works. I plug in the pl2303mdl and the olimex starts blinking anyway... will try actual flashing later.


Edit, wound up using sudo to flash for now. some various flashes, and the green light is back to steady fast flash, so apparent success 
sudo ./updater /var/arm-eabi/proj/tumanako-inverter-fw-motorControl/src/sine/stm32_sine.bin /dev/ttyUSB0


----------



## dcb (Dec 5, 2009)

oh a little shortcut for the web interface (ubuntu), instead of installing the whole LAMP stack, you can just use the internal server in php 5.4+

sudo apt-get install php5-cli

then cd into the "web interface" directory and run:

sudo php -Slocalhost:8000

then browse on the same machine to http://localhost:8000/

At some point I hope to look at actual control code


----------



## Jaesin (Mar 6, 2011)

It would be great to get this project converted to be compatible to work with the LeafLabs Maple IDE: https://github.com/leaflabs/maple-ide


----------



## dcb (Dec 5, 2009)

Why do you say that? Arduino (and presumably clones) are horrible for serious development, codeblocks is lightyears ahead for managing a multi-file project and knows how to find declarations and usage of variables for you (though netbeans or eclipse would also integrate the php side, leaning towards netbeans these days). 

Plus a controller is kinda "mission critical", bare metal is the only way to go there, you don't want a lot of frills that could cause unexpected delays or bugs or hangs, or impede core development, better to offload bells and whistles to another $3 processor. But he does use a library that abstracts a lot of the IO and whatnot (libopencm3).

Personally I hope to find something like avrstudio for stm32 with a built in chip simulator (and separate assembler files for the occasional timing critical routine without all the gnu asm gobbledygook).


----------



## jhuebner (Apr 30, 2010)

dcb said:


> Why do you say that? Arduino (and presumably clones) are horrible for serious development, codeblocks is lightyears ahead for managing a multi-file project and knows how to find declarations and usage of variables for you (though netbeans or eclipse would also integrate the php side, leaning towards netbeans these days).
> 
> Plus a controller is kinda "mission critical", bare metal is the only way to go there, you don't want a lot of frills that could cause unexpected delays or bugs or hangs, or impede core development, better to offload bells and whistles to another $3 processor. But he does use a library that abstracts a lot of the IO and whatnot (libopencm3).
> 
> Personally I hope to find something like avrstudio for stm32 with a built in chip simulator (and separate assembler files for the occasional timing critical routine without all the gnu asm gobbledygook).


I agree here.
Personally I never do on-chip debugging because its pointless within the real time routines.
I develop the more complex routines on my PC and run them using stubs. You'll also notice that many routines don't access the hardware directly but return some values that are then passed on to the hardware.

E.g. I can call the sine function and print its results to a file to verify that its doing the right thing.



dcb said:


> oh a little shortcut for the web interface (ubuntu), instead of installing the whole LAMP stack, you can just use the internal server in php 5.4+
> 
> sudo apt-get install php5-cli
> 
> ...


Thats great! It'd be good to come up with some bootable disk image that does exactly that. Just kernel+libs+php. Should be reasonable small.


----------



## dcb (Dec 5, 2009)

jhuebner said:


> Thats great! It'd be good to come up with some bootable disk image that does exactly that. Just kernel+libs+php. Should be reasonable small.


Just thinking out loud on this fyi, At some point I was thinking of experimenting with connecting my $5 bluetooth adapter to the controller. It *might* work with php for sl4a, but almost certainly I can get to the command interface with an android phone terminal that way (and have lots of gui options). As a developer a laptop is nice, but as a user not so much (and even as a developer having a wireless connection is nice). But make sure you change the pin at least (and the baud). Though a boot disk could be a useful option too for many. Though it is working just fine for now 

Edit, maybe this for android: https://play.google.com/store/apps/details?id=com.esminis.server.php&hl=en


----------



## dcb (Dec 5, 2009)

update, I know it is silly, but I did get my hc-05 to connect directly to the olimex

first I had to change the baud (had to leave the default pin), but set the baud to 115200 using the pl2303mdl to connect to it with the key high (and 38400 baud) over minicom.

and issued
AT+NAME=MCONTROL
AT+UART=115200,0,0
which modifies it from factory defaults

then I plugged the hc-05 into the olimex instead of the pl2303mdl (and used 3.3v this time).

I then fiddled with hcitool scan and rfcomm and bluetooth config till it paired in ubuntu and I could issue commands. Ubuntu sort of got off the rails on needing a specific response when using a custom password.

Then modified the php config and could see the webpage connected to the olimex via bluetooth.

Then tried update over bluetooth using /dev/rfcomm0, seemed to work.

have not been able to have a conversation with the controller via android bluetooth terminal, might be a linefeed thing or something.


----------



## jhuebner (Apr 30, 2010)

This is definitely sounding good.
I'm having a constant struggle with the line feed. The \r character works best in most terminals but apparently not on your android.


----------



## dcb (Dec 5, 2009)

Thanks, "android bluetooth terminal" was a braindead terminal with zero translation options, I tried "blueterm" and was seeing results right away, I went into options and changed the incoming LF character (0A, \n) to ODOA and everything lines up on the left now. 

FYI, you have a stray \r in terminal.c line 68
term_send(usart, "Unknown command sequence\r");

\n seems to be ubiquitous otherwise.

most serial terminals need both 0D (/r, carriage return) and 0A (/n, new line) to display correctly, it is useful as a primitive form of cursor control, i.e. a status line that changes without scrolling the whole screen would just send /r.

Last note, I don't envision interacting directly with the motor controller in my final projects, but rather some user facing controller that can talk to the motor controller (i.e. via usart3) and the bms and the charger, but for development it is good stuff, I can tweak the motor controller with my phone!


----------



## Jaesin (Mar 6, 2011)

dcb said:


> Why do you say that?


Basically it's about inclusion and getting others to participate but I get your points as well. I haven't tried codeblocks yet but I will. 

Normally, I would create a vagrant file and a puppet manifest to create a sharable build environment then use sublime text for editing and auto-rsync and and auto-build script.

As far as netbeans and eclipse, I've abandoned them both at this point. I'm writing PHP all day these days so I've switched to PHPStorm and eagerly removed both.


----------



## dcb (Dec 5, 2009)

well the IDE and compiler work fine, and the source and schematics are available and functioning, so no need to change platforms, that is a different agenda all-together (and not the raison d'etre, and not anything I would expect the author who has done so much already to get excited about). The Capacitors were a bit of a gotcha for me though, and bus design is still a mystery to me.


----------



## jackbauer (Jan 12, 2008)

Well am back in the saddle with the controller. Did a first run with the Siemens motor and ZF 5HP24 gearbox today. Worked great. Am wondering would a motor idle function be possible?


----------



## dcb (Dec 5, 2009)

jackbauer said:


> Am wondering would a motor idle function be possible?


I don't see a good quick fix for that, basically it becomes a PID speed controller below "idle" rpm, and doesn't try to regen on a brake signal. (Ive been looking at it with an eye on having it rpm match for clutchless shifting). One "hack" is to intercept the throttle (and brake) signal, and PID the throttle output to the controller (arduino is probably suitable for intermediate PID controller) and feed it the rpm (and vehicle speed in my case).

Whenever the PID intermediate controller notices the rpm getting too low it:

disables the brake signal to the slip controller:

bumps up the output throttle pwm (in a PID loop) based on motor rpm
(might be able to use a fixed value, but variable loads like AC will make the RPM wobble, EDIT: or changing gears).

disengages when the input throttle is greater than the controlled output throttle (that is to say it passes through the brake signal and throttle signal directly).

or something like that.


Edit:, here is someone using an arduino as a cruise control on their bike controller , it seems similar to what I mentioned:
http://endless-sphere.com/forums/viewtopic.php?f=2&t=51879 so you might add cruise control in the same controller with idle control.


----------



## dcb (Dec 5, 2009)

also, the throttle has to be at 0 for the controller to go into run mode, so maybe that is based on a "start" signal from the ignition switch.


And under the heading of silly, with throttle and brake and cruise control switches connected to it, you can consider doing a prius style secret handshake on the intermediate to enable the controller, or perform some other function.

I have a personal interest in the intermediate controller approach (assuming arduino for now) so let me know if you are interested in persuing it and could use some help sorting it out. It "could" be integrated into the main code base, but the level of implementation difficulty goes up, it is quite counter to efficient slip mode and not many of us have an automatic trans 3 phase land yacht to test stuff on  OF course if anyone else wants to make it happen, that is fine w/me too...

looking for:
idle control
cruise control
rpm matching (for clutchless shifting)

Of course if Johannes says it is easy to integrate a speed control command then please disregard (i.e. a non-zero value on an auxillary adc input)  Though I think there is more value in him focusing on stuff like FOC without hackers hacking on the core controller code.


----------



## jhuebner (Apr 30, 2010)

Well, well, I _think _a simple speed control loop should be inexpensive to add. I was thinking earlier about it because of cruise control.

Heres what I'd do: continuously run the speed control loop. Compare its output to the actual throttle command and use the greater one of the two.

Theres also one digital input left in case you want to switch it on and off.

Theres an ISR that fires every 10ms. Thats where I'd put it.


----------



## dcb (Dec 5, 2009)

That could work, just tweak CalcThrottle() basically.

Would need some new parameters though, and a vehicle speed signal for cruise (plus some more inputs for cruise/gear selections).

What adc/digital pins are open (and which of those are you wanting to use for future efforts)?


----------



## jhuebner (Apr 30, 2010)

Theres a secondary throttle input that is yet unused.
It could be used for fault detection with two way throttles.

The theres an "On" input that is unused and doesn't make sense. That could definitely be remapped.

The BMS input is not used yet but I plan to.

The forward/reverse signal is mapped to two pins, could be mapped to one as an option leaving another one free.

For cruise control I only thought about a constant speed loop to be used with a single speed gearbox/gearbox that is in the same gear most of the time.


----------



## jackbauer (Jan 12, 2008)

Obviously very interested in a new firmware that supports this function! I was thinking today it doesnt even have to be closed loop really. Carburettor cars with automatics are open loop. A little dip in rpm when selecting drive is no problem.


----------



## dcb (Dec 5, 2009)

Idle/Cruise/RPMMatch needs a couple refinements (which also help enable rpm matching FYI), If you don't mind me commandeering some pins and patching CalcThrottle, I'd like to look into it more.


general:
need speed control algorithm.

Idle specific:
override min throttle and ignore brake under certain rpm (parameter), do not engage till start signal received, disable with ignition off.


Cruise specific:
It needs to disable if the brake is tapped.
(easy one)

It needs to disable if the clutch is engaged or transmission put in neutral
(add parameters for overall gear ratios, vehicle speed sensor input, at least one set button).  If the motor rpm to vehicle speed doesn't match a known gear ratio then we are in neutral, clutch out. (or possibly out of lockup, will have to think about that more, looking at load might help).

Needs to allow the user to command more speed with the throttle temporarily.

It needs to be tied to vehicle speed in the case of torque converters as well as detecting driveline disengagement.

OEM cruise buttons are all over the map. I think if users could use at least one button from the stalk to set the cruise at the current speed, then tap the brake to cancel it they would be happy.


RPM match:
need an adc for gear selection.
vehicle speed/known ratios (from cruise control).
continually adjust rotor speed based on changing vehicle speed to be suitable for engagement into the gear selected (which can also change).


I'm really in this for the rpm match personally. If I can remove a 30 lb lump of rotating mass and have good driveability, I'd be happy. Cruise would be nice too.

I could really use 2 adc, or one adc (for rpm match gear selection) and 1 encoder channel (for vehicle speed, like 5000 pulses/mile).

Tracking vehicle speed/distance also enables KW/mile reporting (except for a fixie).

I don't know if multiple gears are going to go away, even tesla saw some benefit on paper in trying to make it happen (but failed in execution and favored time to market).

As usual, I'm probably over-thinking it. But if anything is on an adc/encoder pin that doesn't need to be, I would like to look at moving it.


Or go with the $10 arduino intermediate, which is a bit more universal, can be put in front of a lot of different controllers to provide these functions.



@Jack, what is your comfort level? you building from source? or ok with flashing a patched binary on to the olimex? Or are you more comfortable with an intermediate controller (i.e. arduino)? It looks like just getting idle is reasonably simple patch in any event. 

Basically add a parameter to the list (idle_speed, 0=disabled) and modify CalcThrottle to enable a minimum rpm once we are in (VALUE_opmode, MOD_RUN) mode by tweaking the throttle reading up or down.


----------



## dcb (Dec 5, 2009)

Ok, just saw your post, really all you need is a minimum throttle setting once you are in run mode, that is pretty trivial, add parameter idle_min_throttle (0=disabled).


----------



## dcb (Dec 5, 2009)

here's my stab at idle if you are in a hurry:


```
inserted into line 69 (param_prj.h)
    PARAM_ENTRY(idlepotmin,      "dig",     0, 4095,  0,      50  ) \


inserted into line 220 (stmt32_sine.cpp)
   int idlepotmin = parm_GetInt(PARAM_idlepotmin);
   if(parm_GetInt(VALUE_opmode)==MOD_RUN && idlepotmin != 0 &&idlepotmin >potnom) //idle speed fix
       potnom=idlepotmin;
```
Hopefully it doesn't bang shifting into reverse  Please start low with the setting (idlepotmin), i.e. whatever potmin is +5 till you find an acceptable idle speed, you probably don't need much to keep the transmission primed.


----------



## dcb (Dec 5, 2009)

update, on a whim I tried the web interface with the new binary. It hosed the sine app (seemed fine from the command line/minicom), so don't use the web interface with the new idle parameter build if you are so inclined to use the new idle parameter build for now.

Edit, web interface seems ok now, not sure if something was cached, or maybe another program was messing with the port, but it seems ok now.


----------



## dcb (Dec 5, 2009)

I lied, can't save values to flash from the web interface, regardless what build (hitting enter does nothing). Hopefully you aren't offended, but I don't need any more php in my life, so I'm happy with the serial console.


----------



## dcb (Dec 5, 2009)

lol, sorry, newbie blather.

Anyway I cleaned up the carriage returns to make serial console life more liveable and attached the affected source file and associated .bin (with idlepotmin fix)


```
get idlepotmin                                                                  
0.00                                                                            
set idlepotmin 5                                                                
Set OK                                                                          
save                                                                            
Parameters stored, CRC=af4c16c8                                                 
get idlepotmin                                                                  
5.00
```
(edit: removed attachment, glitch found)


----------



## jhuebner (Apr 30, 2010)

Hi dcb,

thats a nice and easy solution. Yes newlines are a constant source of trouble. The web interface doesn't use a hard coded parameter list, it reads the list from the inverter.

When changing the parameter list you need to do a full rebuild because the make program doesn't seem to realize what it needs to recompile.


----------



## dcb (Dec 5, 2009)

thanks, I do hope you will pull in the linefeed changes in the above zip file, pretty sure that is how it is supposed to be done, that is the behavior most terminals expect.
EDIT: it does require a simultaneous change to InverterTerminal.class.php to get the return codes in the web interface:
all 3 instances of explode("\n"... need to be explode("\r\n"


Also, I found the problem with the web interface (chrome/ubuntu):
in index.js you have 
if ("Enter" == e.key)

and key is undefined for me.

so I changed it to:
if ((e.keyCode || e.which) == 13) //most reliable method

and it is all better. Pretty sure you can rely on keyCode.

I did notice that the php serial is kinda persnickety, it might be part of the problem I saw earlier (and I just happened to be using my own build, complete rebuilt).


----------



## jackbauer (Jan 12, 2008)

Please forgive my ignorance here. So I just upload the stm32_sine.bin the to the inverter via serial and I'm all set?


----------



## jackbauer (Jan 12, 2008)

Also kinda interested to know how is the software compiled?


----------



## dcb (Dec 5, 2009)

*flashing instructions*

I don't know if I can exactly explain how I got the compiler working, but I put my notes in post 452
http://www.diyelectriccar.com/forums/showpost.php?p=478826&postcount=452

I also mapped out what pins on the usb thingie in the kit need to be connected to the olimex board to program it there. But I'll put it here for posterity, he included a 4 wire jumper too:
pl2303mdl pin (usb thingie), STM32-H103 EXT2 pin
GND, 6 (GND)
RX, 14 (PB10/UART3.TX)
TX, 15 (P11/UART3.RX) 
3.3V, 5 (3.3v)

you connect your usb thingie to the olimex H103 then plug the usb thingie into your linux computer (not the olimex)

He has a zip file with a custom uploader (for ubuntu, hope that works for ya).
http://johanneshuebner.com/quickcms/files/inverter.zip
expand that zip file somewhere, that gets you some binaries for reflashing

put the stmt32-sine.bin file in the zip file I created in the tools directory you created from johannes zip.

go to a terminal screen and cd into the tools directory (under where you expanded the zip from johannes and which is also the directory where you put the stm32_sine.bin from the zip in post 475)

if you run "ls -latr" it should look like this:

```
[email protected]:/var/arm-eabi/proj/tumanako-inverter-fw-motorControl/tools$ ls -latr
total 124
-rwxr-xr-x 1 dave dave 62143 Jan 24  2013 stm32flash
-rwxr-xr-x 1 dave dave 10496 Mar  5  2014 updater
drwxr-xr-x 4 dave dave  4096 Mar  5  2014 src
-rwxr-xr-x 1 dave dave  9732 Mar  6  2014 updater32
drwxrwxr-x 9 dave dave  4096 Sep 20 20:40 ..
-rwxrwxr-x 1 dave dave 18732 Sep 29 19:34 stm32_sine.bin
drwxr-xr-x 7 dave dave  4096 Sep 30 08:51 web interface
drwxrwxr-x 4 dave dave  4096 Sep 30 15:41 .
```

run: 
sudo ./updater stm32_sine.bin /dev/ttyUSB0

(or updater32 if you are not 64 bit).

and hopefully see something like this:

```
[email protected]:/var/arm-eabi/proj/tumanako-inverter-fw-motorControl/tools$ sudo ./updater stm32_sine.bin /dev/ttyUSB0
[sudo] password for dave: 
File length is 18732 bytes/19 pages
Resetting device...
Sending number of pages...
Sending page 0... Sending CRC CRC correct!
Sending page 1... Sending CRC CRC correct!
Sending page 2... Sending CRC CRC correct!
Sending page 3... Sending CRC CRC correct!
Sending page 4... Sending CRC CRC correct!
Sending page 5... Sending CRC CRC correct!
Sending page 6... Sending CRC CRC correct!
Sending page 7... Sending CRC CRC correct!
Sending page 8... Sending CRC CRC correct!
Sending page 9... Sending CRC CRC correct!
Sending page 10... Sending CRC CRC correct!
Sending page 11... Sending CRC CRC correct!
Sending page 12... Sending CRC CRC correct!
Sending page 13... Sending CRC CRC correct!
Sending page 14... Sending CRC CRC correct!
Sending page 15... Sending CRC CRC correct!
Sending page 16... Sending CRC CRC correct!
Sending page 17... Sending CRC CRC correct!
Sending page 18... Sending CRC CRC correct!
Update done!
```
if it looks good, you might as well go into it and set some parameters. So then run:
sudo minicom -b 115200 -D /dev/ttyUSB0

and do get/set/save/list/all etc. You should be able to see idlepotmin if you do an "all" now (and let me know if the carriage returns look right for you.

to exit minicom, hit ctrl +a, then x


----------



## jackbauer (Jan 12, 2008)

Thanks very much will let you know how i get on with it!


----------



## jackbauer (Jan 12, 2008)

Here is a video of the first run :
https://www.youtube.com/watch?v=dFN8kg5pt7I


----------



## PStechPaul (May 1, 2012)

By George, I think he's got it! Well done.


----------



## gunnarhs (Apr 24, 2012)

jackbauer said:


> Here is a video of the first run :
> https://www.youtube.com/watch?v=dFN8kg5pt7I


 Nice! Motor has very good sound, very full no whining there.
Look forward to more!


----------



## jhuebner (Apr 30, 2010)

dcb said:


> thanks, I do hope you will pull in the linefeed changes in the above zip file, pretty sure that is how it is supposed to be done, that is the behavior most terminals expect.
> EDIT: it does require a simultaneous change to InverterTerminal.class.php to get the return codes in the web interface:
> all 3 instances of explode("\n"... need to be explode("\r\n"
> 
> ...


Thanks, will fix that. I thought \r\n was a stupid Microsoft thingy but minicom seems to expect it as well. So I'll just stick with it.



dcb said:


> I did notice that the php serial is kinda persnickety, it might be part of the problem I saw earlier (and I just happened to be using my own build, complete rebuilt).


Yeah, I haven't quite figured it out but its the only way to talk serial without compiling extra php modules from source.




jackbauer said:


> Here is a video of the first run :
> https://www.youtube.com/watch?v=dFN8kg5pt7I


What is your current limit set to? It seemed to trip rather easy.


----------



## jackbauer (Jan 12, 2008)

jhuebner said:


> What is your current limit set to? It seemed to trip rather easy.


It was set to 100 amps. Silly me. Cranked up to 300amps now I can launch the assembly off the bench if I get serious with the pedal


----------



## jackbauer (Jan 12, 2008)

Ok loaded the idle code but its not closing the contactor.it does try to idle though as my poor precharge resistor just found out reloaded normal code and contactor closes fine and runs the motor. Any thoughts?


----------



## dcb (Dec 5, 2009)

jhuebner said:


> Thanks, will fix that. I thought \r\n was a stupid Microsoft thingy but minicom seems to expect it as well. So I'll just stick with it.


It is part of http1.1 also fyi
http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2


> HTTP/1.1 defines the sequence CR LF as the end-of-line marker for all protocol elements except the entity-body (see appendix 19.3 for tolerant applications). The end-of-line marker within an entity-body is defined by its associated media type, as described in section 3.7.





jackbauer said:


> Any thoughts?


Just curious, did you load from the command line or the web interface? Also are your other parameters affected by adding a new parameter?


----------



## jackbauer (Jan 12, 2008)

I tried both. The idlepotmin appears on the web interface. I did find some parameters changed following the upgrade. udcsw was one such change. I did change it to a correct value but the contactor did not close. Reverting to the normal software restored function.


----------



## dcb (Dec 5, 2009)

Ok, thanks for clarifying. I'm taking a look at the DC contactor logic and fault logic. My initial guess is that it goes into run, but "faking out" the throttle is causing a udc fault which puts it back into off.

Also, I would be curious to know if setting idlepotmin to 0 disables it if you are bored.


----------



## dcb (Dec 5, 2009)

I really need to get it connected to a motor so I can test basic functionality.

Noticing a few other things I'm missing:

I noticed a timer loop in the 10ms code, so thought it might help to make sure that the timer expired before changing the throttle setting (a user wouldn't be so quick to change the throttle after going into RUN mode, since they are trained to stay off of it.

Which also begs the question, should the brake be on before it will start idling? (assuming auto trans)?

I'm gonna hold off on further changes till I have at least a desktop sized motor hooked up (or at least a microcontroller motor simulator with a torque knob)


----------



## jackbauer (Jan 12, 2008)

Latest update:
https://www.youtube.com/watch?v=A9T01yZnl8s


----------



## jhuebner (Apr 30, 2010)

Nice running, good to see no more over current trips.

So I think the problem with the idlepotmin is that the throttle is manipulated and then:

if (udc > parm_Get(PARAM_udcsw) && parm_GetInt(VALUE_potnom) <= 0)
{
//Close contactor code
}

So the contactor never closes because it sees a pressed throttle pedal.

Also regen won't work with that kind of logic. I think we need some kind of speed regulation.

I'll look into it later.


----------



## jackbauer (Jan 12, 2008)

Thanks Johannes! Would be great to have an idle function.


----------



## Quezacotl (Sep 23, 2014)

Hello!

I'm thinking of building this controller, or well, i'm positive that i'll build it, since it seems that it can be used very well on end user on this stage?

While i build this, should i use the schematics that are in the website?
Meaning that are the boards ready enough so i don't have to tweak them(other than maybe some relay or current sensor prints).
That i have understood, the schematics are ready and the software is all that needs improving?

I was thinking about building it without the STM32 board. Integrating it on the controller board.

And was thinking about bluetooth, but i saw dcb has tested it already. I think i'll do it "bt-ready".


For connecting the IGBTs and caps along with them, i have some basic thought that how to connect them properly, but i'm not entirely sure. Anyone care to explain the connections or have a good link?
And what i should take in account when designing the board, or installing/testing the IGBTs/controller?

I have a thread here about my project: http://www.diyelectriccar.com/forums/showthread.php?t=126146


And i got an advice that i should ask in this thread that is my motor compatible with this controller?
ABB Motors M2AA 132 M (3G AA 132 002-ADA)
-AC three phase
-380-420V/15,3A, 50Hz, 1450rpm, 7,5kW (delta)
-660-690V/8,8A, 50Hz, 1450rpm, 7,5kW (Y)
-440-480V/15,1A, 60Hz, 1750rpm, 8,6kW (delta)
-cos = 0,83


----------



## major (Apr 4, 2008)

Quezacotl said:


> And i got an advice that i should ask in this thread that is my motor compatible with this controller?
> ABB Motors M2AA 132 M (3G AA 132 002-ADA)
> -AC three phase
> -380-420V/15,3A, 50Hz, 1450rpm, 7,5kW (delta)


Do you realize this infers a 600 Volt battery?


----------



## dcb (Dec 5, 2009)

Also, the webinterface doesn't work so well over bluetooth (it is expecting an end to end 115200 connection or something in php) but terminal mode is fine.

Minor hardware tweaks are still ongoing, check the errata page.

It does not include IGBT's or mosfets or caps, you select those yourself based on system voltage/current/etc.

cadsoft eagle schematics are in the zip.

I personally wouldn't be interested in a olimex free design at this stage (though make sure you consider the h103 circuitry), getting experience with another development board/platform does have value for me though. And with the number of people wanting to play with their favorite platform, it is conceivable that someone might want to put a pic or an avr (or??) on a pcb and plug it in instead of the stm32-h103, though I'm not one of them (the st/arm architecture is proving to be very interesting).


----------



## Quezacotl (Sep 23, 2014)

major said:


> Do you realize this infers a 600 Volt battery?


Oh. I've never made or studied any inverter circuit, i've only seen those 12V/24V to 230V car inverters, and without a doubt, i assumed this boosted the voltage too. And i saw only grid voltage motors on "ac selection guide", i must have overlooked it. What an error 
Well, is there any boost converter circuit, or rewinding guide? Whick would be better?


And yea dcb, i read that you got problems with php and bluetooth. Terminal is enough for me.
I know it does'nt include IGBTs or caps. I was just asking for advice with IGBTs.


----------



## dcb (Dec 5, 2009)

Quezacotl said:


> ...
> Well, is there any boost converter circuit, or rewinding guide? Whick would be better?


More batteries is better. It is all a balance of what size vehicle you want, how much performance (range and acceleration and top speed) you want, and what kind of money you have to spend, and how much you can do yourself.

I'm currently messing with a 156 volt ac24ls that was like $250 on ebay, an old chain drive bike, and 11 used leaf batteries, and some older $20 igbts, so I'm gonna be on the low end of cost, in the middle on performance, and on the high end of diy (custom charger/bms/controller/instrumentation/reconfiguring leaf modules for 15v/etc) plus a bit of fabrication.


----------



## jhuebner (Apr 30, 2010)

Hi Q,

The software is stable and runs induction motors smoothly.
Currently some new requirements spawned, that are not yet implemented. Like the idle speed feature.

You can "reconfigure" high voltage motors as opposed to rewinding them.
They usually have a couple of independent coils per phase (e.g. 8) and in 400V motors they are all connected in series. If you open it up and connect them in a parallel/series fashion you can change the working voltage (and current!). With said example (8 coils per phase) if you connect the coils 4s2p the nominal voltage will drop to 200V and the nominal current will double. Each individual coil will see exactly the same current as before and the coils are never removed.
I've tried this with a small 1.5kW motor and it works as expected.

If you attempt to go this hardcore diy route, you need to know what you're doing to end up with a working motor.

The STM32 is pretty "advanced". That means you can offload many things to dedicated hardware if you know how to it.
Atmels AVR are a lot easier to get started with but lack features like DMA, fully automatic ADC sequencing etc.

Since I managed to harness the STM there is no motivation for me to move to a different controller.


----------



## jhuebner (Apr 30, 2010)

I have done an experimental speed controller. I'm away from my lab right now so I couldn't test it.

Here is what I changed:

param_prj.h:

```
PARAM_ENTRY(idlespeed,   "rpm",     -100,   1000,   -100,   52  ) \
    PARAM_ENTRY(idlekp,      "",        0,      100,    1,      53  ) \
```
stm32_sine.c CalcAmpAndSlip:

```
int idlespeed = parm_GetInt(PARAM_idlespeed);
   int speed = Encoder::GetSpeed();
   int speederr = idlespeed - speed;
   s32fp idlekp = parm_Get(PARAM_idlekp);
   s32fp potreg = MIN(FP_FROMINT(50), idlekp * speederr);
   s32fp potnom = MAX(potreg, parm_Get(VALUE_potnom));
```
So its a simple P-controller. It can assert a maximum of 50% throttle. As soon as the speed drops below idlespeed the controller will output a value that is larger than the current pot value and thus take over. The default value will always output a very negative pot value and therefor essentially disable the controller. potnom is no longer modified globally so the start inhibit logic will work.
The controller is configured by idlekp. Set it to a value that does not oscillate.

I left the newline unchanged for now.
You can download the binary here: http://johanneshuebner.com/stuff/stm32_sine_2.71.bin


----------



## jackbauer (Jan 12, 2008)

It works


----------



## dcb (Dec 5, 2009)

yah but he cheated  If he ever starts FOCing around then idle will have to be re-implemented. But working is good too! 

I don't know, but I'm not sure it is technically a P-controller if it doesn't remember some more information about previous errors/adjustments, I think idlekp goes under the heading of fudge factor 

P Proportional Band = 100/gain
I Integral = 1/reset
D Derivative = rate = pre-ac


Disregard, you did say P-controller (not PID), never knew all my fudge factors had a fancy name 
http://www.controlguru.com/wp/p62.html


----------



## jhuebner (Apr 30, 2010)

Yep, don't do PID if P does the job 

Good to hear it works without prior testing


----------



## jackbauer (Jan 12, 2008)

Not sure if it saved the idle speed value. did a quick test yesterday evening and it didnt idle when powered up. Will check today and report back. Have some video on the way also.


----------



## Tony Bogs (Apr 12, 2014)

Finally, speed control! That's more like it. 

I disagree on Arduino. The Arduino Due has an Atmel ARM chip on board with all the major hardware goodies needed for an EV controller: sophisticated DMA, multi phase PWM with H/W protection, timers, it's all there. 
The top Arduino software layer, that most engineers despise, is really very thin. Below it is a complete open source C/C++ ARM software framework. 

And then there is the UDOO board www.udoo.org. It is a Ubuntu / Android mini PC combined with an Arduino Due on a single PCB. 
Isn't it a ideal combination for a development system with a local PHP web interface? 

Porting the software may take some effort. It's not that well documented. 
But on the other hand, it also provides a great opportunity for speed control review, modification and reorganization. 

Speed control. I like it.


----------



## dcb (Dec 5, 2009)

I'm glad to see atmel catching up in the ARM department, but there are good reasons why engineering types don't like arduino for serious development.

But as far as doing web-style development on an android that talks to a microcontroller, that might be better served with a simple bluetooth/local port proxy. The php side isn't so interesting that interesting that it would be terribly missed, yet all the javascript functionality (graphing) can be retained.

That udoo is kinda ridiculous. Just need an apk or a jar file that is packaged nicely and a $5 bluetooth adapter (done).

You want to pull it into arduino, other folks want to pull it into mapleleaf, others want PIC, St has their own online arduino (on steroids) ide which plays with their neutrino...

I think you are at the point where you simply don't wanna learn a new toolchain, been there. But force yourself to get through it and make some binaries and you'll feel better, trust me, it is liberating. You won't feel like an arduino hostage come minion anymore, single-system-itis sucks.

http://www.diyelectriccar.com/forums/showthread.php?p=478826&highlight=notes#post478826


----------



## Tony Bogs (Apr 12, 2014)

Sure, for me no STM32/ bluetooth for development or torque control for normal driving. 

Also, no IGBTs anymore.

Recently Cree presented this SiC mosfet module as a replacement for IGBT: 
http://www.cree.com/Power/Landing-pages/62mmhalfbridgemodule

It can handle up to 1500A, limited bij the juction temperature. 
Translates to up to 200 microsecs at 25 degrees C case.

Specified potential 183 kW at 850Vdc, 3phase, pf=0.98, 15 kHz, air cooled. Check it out.

Only negative point so far:
The gate requires +20/-5V voltage converter. But that's an easy fix.


----------



## Tony Bogs (Apr 12, 2014)

O, and by the way, I'm an engineering type.


----------



## dcb (Dec 5, 2009)

if you have the budget for brand spanking new cas300m12b2s then go for it. You probably don't need a diy controller in that case.

Not sure what you have against stm except unfamiliarity or some other agenda though, the speculative returns (kumbaya?) on the effort on porting it are hardly convincing though, and it isn't clear who does the porting and who gets the "benefits", or that all the cons of porting are even remotely being considered.


----------



## dcb (Dec 5, 2009)

I agree that bluetooth can be a little unnerving in a controller (though I like the idea of using my phone as a proximity key, though more handshaking is in order, and perhaps offloaded from the motor controller). 

It seems like if you have an android there are OTG cables that can do things like host a ftdi cable. Of course if you have linux then you just use that.

https://www.youtube.com/watch?v=QSR7IAAWL1c

warning, android is not written in arduino 

oh, and of course the android CPU's HAVE uart, but you have to hack your way into them a bit.
https://code.google.com/p/android-serialport-api/


----------



## jackbauer (Jan 12, 2008)

Video of the first idle run test:

https://www.youtube.com/watch?v=ZpgbCqbHet4


----------



## jackbauer (Jan 12, 2008)

Just to confirm parameter "idlespeed" is not being saved to flash and reverts to default upon powerup.


----------



## jhuebner (Apr 30, 2010)

Ok, just saw another parameter also has id 52. Will fix it tomorrow.


----------



## dcb (Dec 5, 2009)

For the bluetooth averse, testing android -> otg usb cable -> ftdi232rl -> olimex via ftdi uart terminal program, success. (sorry, the pl2303 folks didn't provide pl2303hx android support).

El-cheapo 7" mid tablet running 4.0.4.


----------



## Tony Bogs (Apr 12, 2014)

> Originally posted by
> if you have the budget for brand spanking new cas300m12b2s then go for it. You probably don't need a diy controller in that case.
> 
> Not sure what you have against stm except unfamiliarity or some other agenda though, the speculative returns (kumbaya?) on the effort on porting it are hardly convincing though, and it isn't clear who does the porting and who gets the "benefits", or that all the cons of porting are even remotely being considered.


The big $$$ is in the battery. It will take a few years before the $/kWh has dropped substantailly, say below $200/kWh. The SiC price will probably have gone down also by that time. 

I've read somewhere that Johannes thought that the software could use a a review/cleanup/reorganization or whatever you want to call it. Why not also port it to a platform that is more appealing to non-techies. Besides, the software still uses copyrighted/non open source libraries or am I mistaken? Arduino is all open source.


----------



## dcb (Dec 5, 2009)

Because it does things like grab timers and other resources, and it is in a constant state of flux, and is a PITA for serious development. Have you ever tried to do a complicated timing critical assembler function in arduino?!? And non-techies aren't going to contribute much to the core anyway except distractions. I consider myself very techie and already I destroyed one of Damiens components. You would have to be completely insane to open up a vehicle motor controller project to the art club.

Besides olimex and gcc are both completely open source as well, (though I'm not married to the olimex). You really should force yourself to do something besides arduino so you have personal experience to draw from. I still borrow from arduino examples a lot, but use a wide variety of atmel chips (not all arduino friendly) and am glad to be getting some stm exposure, this was a good opportunity for me. If you want to contribute then bring it.


----------



## Tony Bogs (Apr 12, 2014)

I've done quite a bit a timing critical assembler programming on a range of early controllers. In the early years programming microcontrollers was considered to be a bit of an art. On the Arduino Due timing critical functions are off-loadable to hardware. The Arduino Due M3 Cortex is very easy to program in C/C++. 

And don't get confused about the "educational" software top layer of the Arduino family. It's easy to bypass to get at the underlaying C/C++ software framework.

I'd be very supprised if art people are interested in EV controllers.

How about those closed source STM32 libraries?


----------



## dcb (Dec 5, 2009)

You don't know what you are talking about here, have a nice day.

Edit, sorry if that sounds harsh. I have had lots of bad experiences with arduino everytime I try to push a chip to its limits, for all the reasons noted and then some. It always finds a way to consume my time, even now.

(and I don't know what closed source library you are referring to that would have used in the toolchain here)


----------



## CKidder (Dec 12, 2009)

Tony Bogs said:


> I disagree on Arduino. The Arduino Due has an Atmel ARM chip on board with all the major hardware goodies needed for an EV controller: sophisticated DMA, multi phase PWM with H/W protection, timers, it's all there.
> The top Arduino software layer, that most engineers despise, is really very thin. Below it is a complete open source C/C++ ARM software framework.


I see you've taken a lot of crap from certain people over this viewpoint. The thing is, when people think of Arduino they think of the old ATMega based boards that were junk. At that point the Arduino library did take over all sorts of resources and was kind of a pain to work with. I don't think that many people realize that what you said is true: On the Arduino Due the Arduino library is just a thin shim over the core ARM libraries. Much of the dumb stuff that happened on the ATMega chips isn't relevant any longer. There are still a couple of issues:

1. The Arduino library code disables the watchdog and you cannot re-enable it.
2. It does automatically set up a bunch of stuff still. You get something like 4 serial ports automatically configured. You can use the ARM library functions to disable this stuff again but it's a little bit of a pain
3. The Arduino IDE still sucks. Use something else. Visual Micro for Visual Studio is a reasonable choice.

I actually have used the Arduino library with the Due for a big project (GEVCU). We did step around the Arduino core for some things. All in all I've never really seen the Arduino library slow anyone down on the Due. If it gets in the way we just don't use it or reconfigure behind its back.

So, is the Due viable for a wide range of projects? Sure. Even large, complicated projects can be done. But, you'll end up writing a lot of code directly against the ARM libraries and pushing the Arduino stuff out of the way. So, one might argue that it'd be better to just use the ARM libraries directly. Perhaps. However, the Arduino core stuff still does a good job of setting up the hardware for you for the most part. There's a lot of code in there that you'd either end up stealing or having to rewrite. I suppose my point is that it makes a reasonably decent springboard for development. Once you outgrow a section of it you just quit using that section and do it yourself.

And, I'm not just saying all of this because I'm dead set on ARM development. I've done projects on PIC, ATMega, ARM, and STM32. They all have their uses. I don't think that it is helpful to have pissing matches about processors. Each one has a use.

But, I'm not advocating for anything here. Use STM32, use a CortexM3 / Due, doesn't matter to me. I'm just explaining why the Arduino Due is potentially a better choice than people sometimes think.


----------



## dcb (Dec 5, 2009)

If ease of use for non techies is a project priority though, MBED is worth a look too. The IDE and compiler are all online (and appears to be an ok ide, easily mixed cpp and asm files), you just log in with your browser, edit/compile, and download the bin files to your usb device.

list of supported platforms (plenty of $10 options):
https://developer.mbed.org/platforms/

available targets in:
Freescale Semiconductor, Inc.
STMicroelectronics
NXP Semiconductors
Nordic Semiconductor ASA

Making the easy things easier often means making the hard things harder, so it isn't for everything, though you could probably make a bin from your cellphone with it.


----------



## jhuebner (Apr 30, 2010)

Tony Bogs said:


> I've read somewhere that Johannes thought that the software could use a a review/cleanup/reorganization or whatever you want to call it.


I might have said so on the tumanako list a few years back. But meanwhile the code is like 95% clean. Just look at it.



Tony Bogs said:


> How about those closed source STM32 libraries?


Nope, the libopencm3 is used. It really is a true open source project.

But I don't want to pour oil in the ongoing platform discussion. I chose the STM32 because the tumanako crew had decided on it. As far as I know they decided on it because:
- the hardware suits the needs
- It was the only platform supported by an open source HAL lib (libopencm3) back then
- It is supported by the open source arm gcc

Maybe today they'd decide to go with Arduino. I don't know enough about Arduino to decide whether is suitable or not.

A lot of code is platform independent and could be used on any MCU. If any one feels like porting it to Arduino - go ahead.


----------



## Tony Bogs (Apr 12, 2014)

Thanks. I took a look at the software. But could not get a definitive answer. Good to know it's all open source. 

The port to Arduino Due is not going to start soon. Maybe halfway 2015. 
The major part is hardware related. And maybe a different control strategy. 
As a driver I'm primarily interested in the right speed and its first derivative in time. Torque is just the the means. 

By the way, just finished soldering the prototype of the 12V to 20/-5V converter for the Cree SiC. Using a current mode controller chip.
Hardware is my nr 1 priority.


----------



## jhuebner (Apr 30, 2010)

Tony Bogs said:


> As a driver I'm primarily interested in the right speed and its first derivative in time. Torque is just the the means.


Thats making a simple thing complicated.

ICE cars have had torque control for a century. Little pedal - little fuel - little torque; Pedal to the metal - a lot of fuel - a lot of torque. Speed is just the result of that. Even a bicycle follows that principle.


----------



## Tony Bogs (Apr 12, 2014)

Sorry, I don't agree. On the opposite. 

You're simplifying things bij leaving speed out of the equation. 

Pedal = power = speed * torque.

12V to 20/-5V converter works. Now testing under extreme condiotions.


----------



## major (Apr 4, 2008)

jhuebner said:


> Thats making a simple thing complicated.
> 
> ICE cars have had torque control for a century. Little pedal - little fuel - little torque; Pedal to the metal - a lot of fuel - a lot of torque. Speed is just the result of that. Even a bicycle follows that principle.


Bingo, you got that right. I don't see how people think cars drive in speed control. Well they do when the cruise control is on. Can you imagine driving the car using only the cruise control and never the pedals?

About 20 years ago we worked with big name VFD manufacturer for a 200+ kW drive for a competition EV. They claimed to have torque control. In fact, their ads claimed "true torque control". But what it really was, was speed control with torque limit. Let me tell you, driving that thing in speed control was a break-neck experience. Almost literally. They had their best engineer all over it but never could get an acceptable control. We had to abandon their control card and install a control capable of torque control. That is where the command input from the operator (driver's foot position) sets a torque reference for the drive and result is smooth responsive control of the motor torque in all 4 quadrants. 

Keep life simple: Use torque control


----------



## Tony Bogs (Apr 12, 2014)

The driver is in the feedback path from a control systems point of view if a car is driven at a certain fixed speed with the pedal as power input. Under those specific conditions it's a closed loop speed control system. 

It's not bad to simplify things. Yust as long as you aware of the limitations.


----------



## major (Apr 4, 2008)

Tony Bogs said:


> The driver is in the feedback path from a control systems point of view if a car is driven at a certain fixed speed with the pedal as power input. Under those specific conditions it's a closed loop speed control system.


You can call it that, but the motor control is "torque control". The pedal controls torque. If you use a speed control motor controller, you'll have a hellofatime. Go ahead and try it


----------



## Tony Bogs (Apr 12, 2014)

On the topic of the ICE:

Throttle = air (valve). Not fuel. How much air is sucked into the engine depends on the engine *speed* and the air intake parameters. Described mathematically by a differential equation. The speed dependency is there.


----------



## major (Apr 4, 2008)

Hold the gas pedal in a fixed position in your ICE car while driving on a flat road of zero incline in zero wind. You go a constant speed. Now encounter a grade (uphill incline). Without changing the gas pedal position, what happens? The vehicle slows as it climbs the hill. There is insufficient engine torque to maintain that speed at that gas pedal position input. So to maintain a constant speed when encountering the hill, the operator must depress the gas pedal further (as you eluded to having the driver in the loop). But the operator has increased the torque command to the engine. The engine has its torque controlled via the gas pedal. Any speed control is accomplished by a higher level loop like the driver's eyes, foot and brain.

What we're talking about in this thread, I think, is the motor controller for the EV and that is best accomplished with torque control. Like I said, go ahead and use speed control. I don't care. Or listen to reason and experience of others.


----------



## jhuebner (Apr 30, 2010)

I have updated the git repo and zip file with the speed control enabled version.

http://johanneshuebner.com/quickcms/index.html%3Fen_downloads,14.html

The idlespeed parameter should be savable now.

Here is the complete changelog:
Added support for active low PWM signals 
Fixed number parsing 
Increased limit of ocurlim to 1000A 
General refactoring 
Added experimental boost mode for battery charging
Changed newline to \r\n in console
Added idle speed controller


----------



## jackbauer (Jan 12, 2008)

Idlespeed now saves correctly Am I right in thinking the inverter has a tachometer output?


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> Idlespeed now saves correctly Am I right in thinking the inverter has a tachometer output?


Good 

It has a PWM output. Right now that is used to drive a temperature gauge. Of course you can make it output the motor rpm instead with a few lines of code.


----------



## jackbauer (Jan 12, 2008)

That would be very useful. Perhaps in the next code release?


----------



## Tony Bogs (Apr 12, 2014)

Tacho for a speedometer. That would be a nice driver friendly feedback signal. 
It is much, much safer than a laptop screen on the passenger seat. 

No spare PWM channels? 
The LTC1257I is a high resolution DAC on a SPI port. 
All the necessary functions in a single SO8 package.


----------



## dcb (Dec 5, 2009)

FYI, I've got the 100 pin version of the cpu on an el-cheapo dev board on order. (too bad that doesn't look like an ftdi chip, re: android otg, not to optimistic about a CH340G)

http://www.ebay.com/itm/ARM-Cortex-...337?pt=LH_DefaultDomain_0&hash=item3a9a5d0bf1

What tool do you happen to use to load the bootloader johannes?


----------



## dcb (Dec 5, 2009)

I guess that is another arduino due "gotcha", got a 144 pin cpu and only exposes 54 pins :/


----------



## jhuebner (Apr 30, 2010)

dcb said:


> What tool do you happen to use to load the bootloader johannes?


I use openocd and an Olimex JTAG adapter.

Before that I used the onboard bootloader and a cheap serial adapter. But its kindof tedious because you have to make flying leads to the boot0 pin.


----------



## dcb (Dec 5, 2009)

Ah, ok. It looks like this board has jumpers for bootx fyi. (and I goofed, that is a max232, not a CH340G).


----------



## John Metric (Feb 26, 2009)

Using the Powerex gate drivers with saturation protection, but they require inverted outputs.
can we get that or did you already do that with "active low" item?


----------



## jhuebner (Apr 30, 2010)

Yes, active low gives you inverted outputs. Test it with the scope before applying power. I don't have these drivers so I couldn't test myself.


----------



## jhuebner (Apr 30, 2010)

I hacked up a python update script which is more portable than the binary. I tested it in windows. It runs slower than on linux but it does the job.

I added it to the zip-file in the tools directory

start it by typing

python updater.py -d COM<X> -f stm32_sine.bin
x is the com-number. In linux it is called /dev/ttyUSB0

To use python in Windows download it here
You also need pyserial
They provide an installer but it crashed on my Windows7 installation.

I used the tar.gz-file instead. Extract it to ....\Python\Lib . Then open a root cmd (type cmd in the start menu, right click, Run as Admin). Change to the pyserial directory and type 
python setup.py install

Also described here: http://petrimaki.com/2013/04/28/reading-arduino-serial-ports-in-windows-7/


----------



## dcb (Dec 5, 2009)

*14% more battery voltage for "free"?*

Hello, I was thinking through the three phase stuff a bit, and was wondering how the switching occured. The "obvious" way is to sine encode all the gates, but I realized that leaves some unused voltage. Assuming that the difference between the motor leads is all that really matters, I wonder if this is doable (or already being done). I'm sure its been done before, but thought I'd ask, as it also seems to eliminate 1/3 of the switching losses, and extend rpm range. Or maybe there is a serious flaw in it.

Basically I took a 3 phase graph, then slid the columns (on a part of it, painstaking) down till the lowest voltage was at the bottom of the graph, then scaled it back up to full pack voltage (8/7 I think).

Thoughts?


----------



## jhuebner (Apr 30, 2010)

Yes, this is being done and does exactly as you say. Decrease switching and increase max AC voltage.


----------



## dcb (Dec 5, 2009)

Cool, good to know, you should update your avatar


----------



## Tony Bogs (Apr 12, 2014)

Yust FYI.
In stead of computing the overmodulation every time the PWM registers are updated, there's the lazy man's way: use a modified saddle back look up table. Only takes about 20 simple lines of script to create the table. I've used PHP.

Modified saddle means: not the usual third harmonic with the gradual transition between the the two humps, but the sharp pointy version.


----------



## dcb (Dec 5, 2009)

Do you mean encode 120 degrees of a phase (from lower phase crossing to peak) in the lookup table (using the normalized/scaled version) and mirror/scale/zero from there? Or are there other modifications to the table to eliminate the harmonic (i.e. slightly exaggerated values near the peaks)? I'm trying to understand if this harmonic is some sort of computational lag or "rounding error" or if it is a manifestation of the switching/inductance/etc that needs compensation.


----------



## Tony Bogs (Apr 12, 2014)

As mentioned, it's all about better usage of the available DC bus voltage. Basically, it's trying to use to energy storage capability of the phase inductances. 
Bonus is is a better efficiency. 
If you do a duckduck search for AP1609710 and Infineon you'll find an application note that describes the different methods. 
It shows that a modified saddle back lookup table gives the same phase output voltages as the complex space vector control. 
With a pointy transition between the two humps in the output voltage. 
Both give a 15% better usage of the DC bus and a lower total harmonic distortion (THD). 
There are no higher harmonics that contribute to the ouput waveform, just amplitude and phase shifts of the fundamental.

There are mirror points in the waveform, so it is possible to use a smaller lookup table and compute the total table if memory space is an issue.

Added: The waveforms you posted are very similar to modified saddle back. It looks like the amplitude scaling is different at certain phase angles.


----------



## dcb (Dec 5, 2009)

Thanks Tony (still trying to get my head around all of it). AP1609710 is very interesting. I assume that triangle wave stuff is if you are trying to compute the switching in hardware, but frankly I can't imagine doing it with anything but a lookup table/interpolation (or a good fpu, tess also hinted at fpga), it is bound to be less components that way.

edit: re: Amplitude scaling at phase angles, the difference may be that their waveform is bumpy on the top and bottom, but the relationship between phases should be the same (and if the lowest phase is pulled to b-, you save on 1/3 switching losses).


----------



## Tony Bogs (Apr 12, 2014)

The triangle wave generator is standard in PWM modules of modern microcontrollers. 

The basis for the PWM is almost always comparison with a scaled lookup table. Johannes uses a standard sinus table and cpu time to calculate the necessary modifications of the output waveform every time the PWM registers need updating. I remember something about shifting the neutral point from the comments in the software.

I find it much easier to start with a modified table and just scale it to the desired output voltage. Very transparant and it saves valuable cpu time.


----------



## dcb (Dec 5, 2009)

Absolutely, reducing it to a table of duty cycles/angle (integers as a percentage of maxint, or max period) and scaling to voltage would be very quick. But max switch frequency is sub 10khz on these igbts (and a 72mhz processor, 7200 cpu cycles per pulse min) so it is probably good enough. But if not the modified table would be the first thing I would look at.

edit: there was some discussions about improving switching frequency (*maybe* the igbts are getting shut off too hard or something) so there might be reason to revisit such optimizations. I don't really understand why the frequency is low as compared to manufacturer claims though. You'd think that getting rid of some switching losses would help though.

Oh, and perhaps Silicon Carbide mosfets could be a motivator too  Though I do think this project was meant to be somewhat budget oriented (to enable more folks using surplus parts).


----------



## Tony Bogs (Apr 12, 2014)

The original open source kiwi project used a very expensive Semikron mosfet power module. 

It's very easy to run out of cpu cycles, even on a STM32. But with a SiC mosfet @ 50kHz it certainly is a design consideration. 

The budget approach is great for experiments. But IMO not enough if one is serious about using it for a EV conversion.

That said, I was very impressed by the video that Johannes made of a test run with his VW on the open road.


----------



## PStechPaul (May 1, 2012)

I have wondered about the possibility of using a programmable buck converter to set the bus voltage to that corresponding to the peak voltage based on the RMS value of the voltage at the drive frequency (based on the V/F constant). Then the PWM could be applied at a variable frequency with wider duty cycle at the lower frequency and voltage. It might take longer to accelerate because the bus voltage would have to increase along with the frequency, but for normal automotive use there should be no problem with several seconds delay over the full speed range.

There is probably no reason to use a 10-20 kHz carrier when synthesizing a 10 Hz waveform at 20 volts, for instance. Even with a constant carrier, a lower bus voltage would dictate a corresponding higher PWM width, and the dV/dT would be much less and efficiency might be improved along with lower radiated EMI from high voltage switching. 

It would even be possible to use an EPROM with the PWM code and a variable frequency clock to determine the effective frequency. A voltage-to-frequency converter could be coupled to the bus voltage and the entire PWM drive could be produced with hardware only and no processor resources would be needed.


----------



## Tony Bogs (Apr 12, 2014)

*EV conversion: speed feedback and instrument panel*

Back to the speedometer, instrument panel and serial bus analog I/O components for a EV conversion. 

Many gasoline cars still use current instruments in the instrument panel. These instruments can be reused. 
One can use PWM or timer outputs to drive these instruments but in an inverter they're usually needed for other functions. 
Also, the averaged output value is not very accurate (fed by a supply voltage, not a volt reference).

In general, high frequency "noisy" CPU cores and analog parts don't mix very well. Sometimes parts of the core have to be shut down to use an "on chip" ADC.

In a previous post I mentioned the Linear Tech 1257 DAC. It uses a very simple serial bus (SPI) and it should be able to drive the instruments with minimal external components. 
If the CPU doesn't have dedicated SPI I/O, bit banging is an option if cpu cycles are available.


----------



## dcb (Dec 5, 2009)

Tony Bogs said:


> The budget approach is great for experiments. But IMO not enough if one is serious about using it for a EV conversion.


Well DIY means different things for different people. Most of my long history of learning to do things myself were because of the huge costs of having someone else do them for me (and I enjoy learning). If I can take DIY down to the component level and save money to boot, that is what its all about (for me).




PStechPaul said:


> buck converter to set the bus voltage to that corresponding


It is doable, but I'm not sure it adds anything except complexity.



PStechPaul said:


> There is probably no reason to use a 10-20 kHz carrier when synthesizing a 10 Hz waveform at 20 volts


But all that triangle stuff is done for you in the stm32 already. 

But there may be a synergy here if you are using a fat igbt for a battery cutoff (as I am considering), the stm32 can pwm that as well (it already knows V/hz), though you are probably trying to save cpu cycles, but I would rather save not adding a big-ass inductor 

But the golden rule on optimizations is to only do it if it is actually needed. And short of looking at opcode timings or measuring, always use a profiler, we are bad guessers on the whole as to where the slow bits are. I think johanne put a current cpu load figure somewhere, can't remember at the moment.


----------



## onegreenev (May 18, 2012)

Continuing with the inverter that Daniel built. I now have the inverter running my AC Induction ForkLift motor at 12 volts. No encoder installed yet. Just a basic setup and its working. I also had some difficulty getting the computer to communicate with the inverter. We found that the CP210x was too close to the aluminum plate and that if you wiggle it even slightly it looses communication with the computer. The weenine little ribbon cable is just too sensitive. The main board needs to be connected to the CP210x hard wired. Soldered to the pins on both sides. Being so sensitive is already a headache. But, even with that, with Daniel's help we had a long trouble shoot session and got it working. Now the motor spins. The encoder is not connected yet. That is another issue. Its a medium sized forklift motor. Should be fine for the project. So with the help of all that want to participate I will get this project fully off the ground. It is not intended to use this inverter at this time to actually drive a car. It is to drive a generator.

I did take off the caps that came with the inverter and swapped them for a different set. A better connection of the caps to the main buss bar as well was done. 

So for now we have the motor and inverter working and using windows 7 virtual pc on my MacBook Pro. Step one is done.


----------



## jhuebner (Apr 30, 2010)

Thanks for the video. Cool project 

So what happens with the motor voltage is something like a transformer. The current and voltage is transformed by the modulated sine amplitude. Say you're running the motor at 20Vac with a 200Vdc battery pack and the motor is producing a current of [email protected] then you'll see [email protected] on the DC side (I might be skipping some sqrt(2) or sqrt(3) here but thats the principle)

I have not implemented voltage setpoints yet. So regen never stops unless it is commanded by the throttle.
That said it should be a simple task to do so. The idle controller was only a few lines of code. Same thing for a voltage controller.

EDIT: just realized that I missed the ongoing discussion on optimization. There is a "stopwatch" that measures the time consumed by the PWM ISR. It is 13µs right now. At my favorite PWM frequency of 8.8kHz that is 10% CPU load. So the frequency could be increased to 35kHz @ ~50% CPU load.

The VW mentioned by Tony has passed all road-worthiness tests of the German TÜV. That includes the EMC tests.
That said the project is indeed targeted at people who want to build and understand a decent AC controller. It is not targeted at technology perfectionists who will spend sleepless nights over the last missing 1% of efficiency.


----------



## Boxster-warp (Jun 22, 2014)

Helle
In Germany a homebrew controller with tüv?
Respect.
Greetings Greenboxster


----------



## jhuebner (Apr 30, 2010)

Yes it's possible


----------



## Tony Bogs (Apr 12, 2014)

The EV regulations are mostly about safety. 
Distances, emergency HV disconnect plug, colour of HV leads, warning stickers on HV parts, battery housing. 
All very important stuff for the open road.
The EMC tests are more recent.


----------



## onegreenev (May 18, 2012)

Had some success after connecting the encoder. When I set the pulses to either 32 or 48 once the motor came on line I'd loose all control and the motor would just spin up to max rpm and then there was no throttle control. All that was needed was to shut off the inverter with the stop command. At 64 or 80 the motor would run and would remain within control of the throttle. Since there is no load the throttle off would stop the motor like right now. If I had the pulse number higher the throttle off regen would lessen but the max speed would also lessen. I have not done many parameter changes yet. Just starting. Tonight was the first spin up with then encoder connected and in Start 1 mode. I still can't get the motor to spin in Start 2 mode. 

I am well pleased with the results so far with the inverter and the Forklift motor. It is quite promising. Even for someone wanting to power a smaller vehicle the ForkMotor should do quite nicely. Being AC there are no brush issues and the torque will still be good. 

Pete 

More vide will come from testing with the encoder connected. I will also be trying out a different throttle. I don't like the little pot that is in use currently.


----------



## onegreenev (May 18, 2012)

A little more success with the motor settings. I needed to set a few things differently and that took care of the pulsing of the motor. I have it set to 64 pulses per revolution. I still have lousy control with the pot that was included but going out now to try a different one. Once I get good throttle control I will move forward with getting some sort of load on the motor and increasing the voltage. Im very impressed with this controller. With the results I'm getting so far I may even try it out driving a vehicle. So this controller would be good for many applications. It would even work with my old Cushman Truckster. Now Im thinking of doing a small induction motor and this controller to drive that little truckster. Now to take on that project. It would be fun. Take to shows and drive around when in Sac at the Bug-O-Rama. Now for a mini electric truck. Just so many things could be done. DIY is back on the radar.


----------



## chong (Sep 17, 2014)

Hi
I'm new to this thread, i just run into this device, would it be a good choice for a gate driver? 

http://www.analog.com/static/imported-files/data_sheets/ADuM3220_3221.pdf


----------



## PStechPaul (May 1, 2012)

I have no experience with it, but it seems OK for a $4 part.
http://www.mouser.com/Search/Refine.aspx?Keyword=ADuM3220

You may also want to look at these single channel 4A drivers for a little over $1:
http://www.mouser.com/ProductDetail/Silicon-Labs/Si8261BBC-C-IS/?qs=sGAEpiMZZMtWwmEy22T5Yaa4JhdPpRBi


----------



## dcb (Dec 5, 2009)

the magnetically isolated couplers are good at high speed (though they can be influenced by magnetic fields). To take advantage of that though you need higher power DC-DC converters and high power/voltage/frequency mosfets instead of surplus IGBT bricks. So they wont add much of anything without revamping the whole power section, which is gonna be a bit pricey.


----------



## dcb (Dec 5, 2009)

Hello, I decided my ac24ls (delta) needed bigger igbt's than 300A so I procured 6x CM600HA-24H. I think the gate driver DC converters will be fine if I keep the pwm frequency @2.2k or below, Rg=2.1 ohm, but I could use something beefier than the HCPL3120. It looks like the ACNW3190-000E is a 4-5 amp drop in if I break off pin 6. Any thoughts/suggestions? Do I need moar pawr? bigger caps? Should I bump rG to 3 ohms?

Sisn't see the gate driver on the site, so attached.


----------



## MPaulHolmes (Feb 23, 2008)

I am using a 2.5amp output driver part sort of like that one, but is a 16 pin version (FOD8316)
http://www.mouser.com/ProductDetail...OD8316/?qs=sGAEpiMZZMvh4wEfREVcMVUAyWQG%2brzT

There are several out there that are basically the same part, and in one of those datasheets, they added pnp/npn "totem pole" to boost the output drive current, and preserves the desaturation detection, which I copied, and it works very well driving my 600v 600amp IGBTs with 3.3Ohm gate resistors at 10KHz.


----------



## dcb (Dec 5, 2009)

Thanks, wow, that has a lot of goodies for about the same price as the HCPL3120. Probably need more cpu pins to take advantage of it though. Totem keeps desat, got it.


----------



## MPaulHolmes (Feb 23, 2008)

You can tie all desat outputs (on the microcontroller side) together, and pull them all down with a 1k or whatever resistor. Then, you can just monitor one desat fault line rather than 6. You won't know who the naughty IGBT was though. You can also clear all 6 desat faults with one micro pin. So, it's really just 2 extra pins.


----------



## dcb (Dec 5, 2009)

could do that, or put an led anode on each fault by the gate, then tie the cathodes together and feed an led on the dash (and the cpu). Reset button on the dash is nice, but I'm know for holding them in, so maybe just a jumper by each gate, less wires is nice too. Though drop-in 5a is nice too. Will mull it over a bit. Maybe I'll socket 'em for now (and come up with a plug-in later).

edit: page 13 here has something useful re: totem pole. Though different chip
http://www.mouser.com/ds/2/38/AV02-4390EN_DS_ACPL-337J_2014-05-09-315814.pdf

Under what conditions would you see a fault/desat? (edit, I think I have a handle on faults).

edit: I will need to consider the gate layout better with single igbt modules, want those switches right on top of the gates, but the gate pcb doesn't divide easily (feature request?) though it looks fungeable.


----------



## PStechPaul (May 1, 2012)

There are a lot of new devices that are better and cheaper than the HCPL-3120. This 2.5A isolated driver is less than $1.50:

http://www.mouser.com/ProductDetail...=sGAEpiMZZMvQcoNRkxSQkkzOzLbhwV/BNiU8U9Jbkkc=

http://www.mouser.com/ds/2/368/Si8220-21-258603.pdf

Here is a little 10A driver for less than $0.50 each:

http://www.mouser.com/ProductDetail...GAEpiMZZMvQcoNRkxSQkuprlmO3q//3gOebfApv%2bU0=

http://www.mouser.com/ds/2/115/ZXGD3006E6-476224.pdf


----------



## dcb (Dec 5, 2009)

those SOT26 might make a tidy looking patch for more output. Though I should probably bite the bullet and cadsoft up a custom driver board, since the layout is for dual igbts and I switched to singles. Would definately consider that FOD8316, great driver feature set. The si-labs chips are nice and fast, but they don't add anything here (but would be good for a 100khz+ buck converter).


----------



## jhuebner (Apr 30, 2010)

PStechPaul said:


> There are a lot of new devices that are better and cheaper than the HCPL-3120. This 2.5A isolated driver is less than $1.50:
> 
> http://www.mouser.com/ProductDetail...=sGAEpiMZZMvQcoNRkxSQkkzOzLbhwV/BNiU8U9Jbkkc=
> 
> http://www.mouser.com/ds/2/368/Si8220-21-258603.pdf


Yes, I read about these earlier in a newsletter. They aren't available in DIP8 format otherwise I would have swapped it.



PStechPaul said:


> Here is a little 10A driver for less than $0.50 each:
> 
> http://www.mouser.com/ProductDetail...GAEpiMZZMvQcoNRkxSQkuprlmO3q//3gOebfApv%2bU0=
> 
> http://www.mouser.com/ds/2/115/ZXGD3006E6-476224.pdf


Non isolated though. But maybe can be chained with a fast low current opto.


----------



## jackbauer (Jan 12, 2008)

My latest adventures with the controller for those interested :

https://www.youtube.com/watch?v=h3f...ment_id=z13qs3cwntyqwffgn04cd1e5zvjlvttrklg0k


----------



## dcb (Dec 5, 2009)

awesome! and good to know about the acnw3190, I'll look at the power supply circuit more closely. You kept the 2w dc converters? What switching frequency? what gate resistor?

Nice work Damian, inspirational, I need to make more progress myself, weather is nice!


----------



## jackbauer (Jan 12, 2008)

4R7 2w gate resistors , 8.8khz switching , 2w converters.


----------



## jhuebner (Apr 30, 2010)

Switching looks so nice I should think about a driver redesign when I get back.


----------



## jhuebner (Apr 30, 2010)

Some News:

Silicon Labs finally released a DIP8 version of the digital isolator gate driver:
http://www.mouser.de/ProductDetail/...GAEpiMZZMvQcoNRkxSQkhxEI6u/J4/%2bw37ArQlubOo=

It has 5A max drive capability.

So I'll ship the next batch with these.

The other news is: I'm back home. So development will continue as you'll soon find out.


----------



## onegreenev (May 18, 2012)

Thanks goes out again to Johannes Huebner for all his help in teaching and guiding me along in the process of reloading software onto the Olimex stm32 board. I now have a working inverter board again. It is now time to go test the inverter once again on the motor. If it works a video will soon follow. 

Thanks again Johannes. You rock. 

Pete


----------



## onegreenev (May 18, 2012)

Finally got this sucker to move again. Some long hours of trouble shooting. Lots of help from Johannes Huber.


----------



## eldis (Sep 3, 2013)

onegreenev said:


> Finally got this sucker to move again. Some long hours of trouble shooting. Lots of help from Johannes Huber.


Congratulations!

Jerky movement and/or high current peaks can be caused by the encoder signal being too noisy - definitely something to check out. Since you had some harmonics even in the open loop, you could be having problems with the quality of the current signal - not sure if that is the source of your trouble, but your cables looks very long..


----------



## onegreenev (May 18, 2012)

I was running stuff through my head and took a look at the encoder diagram I have and I think I reconnected it up wrong, hence the jerky motion and noise. I'll fix it later as I already know this sucker runs fine when parameters and hardware are correct.


----------



## onegreenev (May 18, 2012)

Encoder is connected properly. Getting ready to recheck potentiometer.


----------



## onegreenev (May 18, 2012)

Changed out the cheap pot for a nice TPS. That helped. My motor is smooth and quiet but not fast. I want to get some speed without the added voltage.


----------



## Tomdb (Jan 28, 2013)

What voltage is your current setup?


----------



## onegreenev (May 18, 2012)

Only 12 volts. Not expecting a great amount of speed but much better than what Im getting right now. It has tons of torque. Just no speed. I need to re-check the encoder connections.


----------



## dcb (Dec 5, 2009)

the 36v (6.3kw?) motor is probably an rms value. What is the base rpm at 36v?

a 12v battery is going to make about maybe 8 volts rms after the inverter?

No telling if you have the v/hz set up right either.

you probably need 48v pack before you can say much about speed. But will you clamp that thing down first!?!?


----------



## jhuebner (Apr 30, 2010)

Without load you can get to speed with very little voltage.

My 380V test motor almost reached base speed with 25V.

So yes, clamp it down


----------



## z_power (Dec 17, 2011)

I'd mount the motor in a solid way before any high speed test; imagine for example full braking torque commanded with fast ramp when rotor spins at high rpm... what a mess


----------



## onegreenev (May 18, 2012)

You mean you don't want to watch a video of me launching it off the table top and dragging all the stuff to the floor? 😜


----------



## onegreenev (May 18, 2012)

A little update. Not much better but it is strapped down but the speed is just way too slow for what I had seen it do before. The day it did jump to the floor it did jump to a much higher speed. It was not clunky either. Same encoder cable as well. The only difference in the encoder cable is that it was not zip tied together like it is now. It is better. Having Johannes look at the settings for me. 

Pete


----------



## Tomdb (Jan 28, 2013)

Strange, however I also have not gotten my regen to work properly. 

I had to remove my "off throttle regen" In order to get my motor to stop spinning at a zero torque command, so some thing must be off also in my settings.

I hope you are able to figure it out with Johannes so I can gather some knowledge of where to look next.


----------



## jackbauer (Jan 12, 2008)

Is a circuit diagram available for the new current sensor board?


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> Is a circuit diagram available for the new current sensor board?


Yes, one the sensor boards description page
Only change is the inductor for the supply voltage and the differential high voltage input.



Tomdb said:


> Strange, however I also have not gotten my regen to work properly.
> 
> I had to remove my "off throttle regen" In order to get my motor to stop spinning at a zero torque command, so some thing must be off also in my settings.
> 
> I hope you are able to figure it out with Johannes so I can gather some knowledge of where to look next.


Sounds like either pole pairs or numimp does not match reality.



onegreenev said:


> A little update. Not much better but it is strapped down but the speed is just way too slow for what I had seen it do before. The day it did jump to the floor it did jump to a much higher speed. It was not clunky either. Same encoder cable as well. The only difference in the encoder cable is that it was not zip tied together like it is now. It is better. Having Johannes look at the settings for me.


In your case I know that numimp=64 which is your setting. What about polepairs? Is it a 2 pole motor?

Also the pulse input is very prone to induced noise. Proper shielding is a must.

Pete I also realized that your not using the current sensors. That means no over current protection at all!


----------



## onegreenev (May 18, 2012)

jhuebner said:


> Yes, one the sensor boards description page
> 
> In your case I know that numimp=64 which is your setting. What about polepairs? Is it a 2 pole motor?
> 
> ...


I found one problem. Then fslipmax setting. I had it set at the default setting of 3. I decided to move it up to see what happened. Well what do you know, it spins much better. I then moved it to 50 and then 75 and now at the max of 100. It works great. Im going to set my numimp back to 64. As for pole pair, you know the motor does not say if its a 4 or 8 or what ever pole. Motor. I will do some digging for this particular motor. 

Pete


----------



## jhuebner (Apr 30, 2010)

I'll just copy my email here for everyones reference:

Yes, setting fslipmax to 100Hz allows you to raise the inverter frequency to 100Hz with no encoder connected at all. So basically you're doing open loop operation with no torque control. If you say setting either 80 or 64 does not make a difference then I reckon the encoder is not working at all. Please check with a scope while the encoder is connected to the inverter.


----------



## onegreenev (May 18, 2012)

Not worried about overcurrent with the 12 volt pack. If I go up more then I will be concerned. I will be setting up the sensors very soon. At least I can have some protection. I don't plan to see more than 300 amps anyway. Most likely around 150 or 200 for the project at hand.


----------



## onegreenev (May 18, 2012)

jhuebner said:


> I'll just copy my email here for everyones reference:
> 
> Yes, setting fslipmax to 100Hz allows you to raise the inverter frequency to 100Hz with no encoder connected at all. So basically you're doing open loop operation with no torque control. If you say setting either 80 or 64 does not make a difference then I reckon the encoder is not working at all. Please check with a scope while the encoder is connected to the inverter.


I'll do that.


----------



## onegreenev (May 18, 2012)

What would a trace look like on the scope when checking the encoder?
Scopes are new to me.


----------



## Tomdb (Jan 28, 2013)

a nice square wave, 0-3.3V


----------



## jhuebner (Apr 30, 2010)

Almost, since it feeds to the base of an npn bipolar transistor it's just 0.7V.


----------



## Tomdb (Jan 28, 2013)

jhuebner said:


> Almost, since it feeds to the base of an npn bipolar transistor it's just 0.7V.


Damm, that explains it. Thats what I got too.


----------



## jhuebner (Apr 30, 2010)

Good! Can you post a trace for Petes reference? I'm currently out-of-lab...


----------



## Tomdb (Jan 28, 2013)

Dont have my motor hooked upright now, Im working on building a case and propper wiring. I got some nice examples off google. I searched "encoder" oscilloscope" 










and a nice link

https://quantumdevices.wordpress.com/tag/oscilloscope/


----------



## onegreenev (May 18, 2012)

jhuebner said:


> Almost, since it feeds to the base of an npn bipolar transistor it's just 0.7V.


Where would that be? Im just connected directly to the plug. Anyway, let me make my quickie video and I'll show you what Im getting and what the motor is doing. I did change the numimp to a low number and there is a huge difference. It also runs faster if the encoder is connected vs when I disconnect. But remember, I am only running 12 volts. 

Pete


----------



## onegreenev (May 18, 2012)

Tomdb said:


> Dont have my motor hooked upright now, Im working on building a case and propper wiring. I got some nice examples off google. I searched "encoder" oscilloscope"
> 
> 
> 
> ...


Mine looks nothing like that.


----------



## Tomdb (Jan 28, 2013)

Wat you get for speed?

"get speed"

pin 3 for your encoder input into the inverter, so measure beteween this pin and ground.


----------



## onegreenev (May 18, 2012)

Tomdb said:


> Wat you get for speed?
> 
> "get speed"
> 
> pin 3 for your encoder input into the inverter, so measure beteween this pin and ground.


Get Speed said 502 and I did that at two different speeds. And then 496 at 5 different speeds. Not a good sign Im guessing. 

Question on the scope. My old scope has a two prong plug and not the three prong plug and it has a ground post on the front that looks like there should be an earth ground or something connected to it. 

When I connect the probe to the calibrator it gives me a great square wave. But not when I connect to pin 3


----------



## jackbauer (Jan 12, 2008)

About 3 mins in you will see the siemens encoder signal :

https://www.youtube.com/watch?v=u35q0AFa96c


----------



## jhuebner (Apr 30, 2010)

Great examples!

So thats what you want.

Always 500 rpm is indeed very suspicious.


----------



## onegreenev (May 18, 2012)

jhuebner said:


> Great examples!
> 
> So thats what you want.
> 
> Always 500 rpm is indeed very suspicious.


Good news. Figured out how to connect up the o scope and I do have a clean square wave on both outputs of the encoder bearing. But I don't get a clean square output when when running.


----------



## onegreenev (May 18, 2012)

Here is one more short video of the trace signal of the encoder bearing while running. Without running I get a clean looking square wave on both outputs. When running it looks like lots of noise. What would one use as a shield for noise?


----------



## PStechPaul (May 1, 2012)

Looks like a LOT of noise, so the scope can't sync to the true signal. At the end of the clip it seems that a more reasonable waveform can be seen, probably when drive power is removed and the motor is coasting to a stop. 

If you can determine the frequency of the noise it may help to track down its source. It looks like it might be the carrier frequency which is probably 4-20 kHz. It may very well be a ground loop problem where the motor current is causing spikes as switching occurs. 

You need some form of isolation between the main power section (12 VDC) and the electronics associated with the sensors, and also the scope as well as the frame of the motor need to be well grounded. The scope probe ground needs to be clipped close to the sensor as well. Try clipping the probe tip to the ground point where you are measuring. If you still see lots of noise, you have a ground loop or high levels of radiated EM noise.


----------



## eldis (Sep 3, 2013)

I agree with PStechPaul - if you can't see the signal, your electronics will not see it either.

The noise looks much worse than it actually is, since your probe is most likely a good antenna. You need to lose that grounding alligator plug and use the springs to touch directly the output of an encoder and the ground.

The shielded and short cable for your encoder is a must. Of course the only way how to eliminate this problem completely is to transport the signal differentially (basically an RS485 transceiver on both sides), which is probably out of the question for you (additional components on both sides). 

If you still have the possibility, you can try to load the output of the encoder a bit more (by a resistor to the ground on the receiving side).


----------



## onegreenev (May 18, 2012)

Ok, I had changed over my power supply back to the battery that was also running the motor. No isolation. I did have it on my stationary power supply earlier but that was before I got the O-Scope setup proper. I forgot to think about putting it back to the power supply. When I did that I got a nice clean square wave. I did however run down the battery pack to 2.6 volts per cell and some rather sluggish performance. Im charging it now and will get a video of the clean square wave output when the battery is charged. 

Thanks for all the help guys
Pete


----------



## Tomdb (Jan 28, 2013)

That explains it. When your battery get a high drain form your motor you will get crazy voltage fluctuations. Wierd thing is the controller didn't restart (under the lower voltage threshold). 

There is a reason to keep your HV and LV supplies isolated as you can see.


----------



## jhuebner (Apr 30, 2010)

eldis said:


> Of course the only way how to eliminate this problem completely is to transport the signal differentially (basically an RS485 transceiver on both sides), which is probably out of the question for you (additional components on both sides).
> 
> If you still have the possibility, you can try to load the output of the encoder a bit more (by a resistor to the ground on the receiving side).


By default the encoder is loaded with 500R by resistor R1. You can try lower values if you still run into problems. Just put something in parallel to the 500R. Stay above 100R to not overload the 3.3V regulator.

That said, good shielding usually fixes the problem.


----------



## onegreenev (May 18, 2012)

Here is a pic of a clean square wave output from the encoder. Same long crappy connection to the encoder. So I guess not so noisy after all once I got the inverter to be powered from my Vicor MegaPac.


----------



## jhuebner (Apr 30, 2010)

Thats better, so do you have smooth operation now? Regen?


----------



## onegreenev (May 18, 2012)

Yes, operation is smooth. If I let off the throttle fast it nearly stops but there is a bit left over for coasting. At really low speeds it does not seem to have regen. It does not seem to have great regen but some. One other thing. When I turn the throttle all the way up real fast the motor takes a long time to catch up. Even when I have the ampmin turned up it is still quite sluggish. If I slowly ramp up the throttle it works fine. Check it out at 7:18 seconds into the video. 






Pete


----------



## jhuebner (Apr 30, 2010)

Ok, does "speed" show meaningful values now? Do you still have fslipmax set to 100Hz? If so, try 3Hz that has to be enough.

Regen is taken back towards lower speeds. By default ramping starts at 10Hz. You can change parameter brkrampstr to change that.


----------



## PStechPaul (May 1, 2012)

Congrats! Much better, especially considering it's still 12V. I am wondering why the IGBTs are getting hot, however, because at no load the motor should not require much power - perhaps 10-20 watts or so. Perhaps it is because of the low bus voltage, which would dictate a higher PWM duty cycle to achieve magnetization. It could also be the power factor of the motor under such conditions, where much higher phase currents may be seen.

It would be good to measure the voltage and current from the battery to see how much power is being drawn, and also observe the switching waveforms (voltage and current) on each motor leg (across each IGBT) to make sure they are not desaturating. I think most 3 phase motors of that size (5-10 HP) would draw only a few amps under no load, so each IGBT should see an average current of 2-5 amps and maybe 10 watts each, which should make even small heat sinks only comfortably warm. You may need liquid cooling (or at least forced air) in the vehicle where you may be asking for 15 kW and losses may be easily 1 kW, but nothing near that on a no-load bench test.


----------



## onegreenev (May 18, 2012)

jhuebner said:


> Ok, does "speed" show meaningful values now? Do you still have fslipmax set to 100Hz? If so, try 3Hz that has to be enough.
> 
> Regen is taken back towards lower speeds. By default ramping starts at 10Hz. You can change parameter brkrampstr to change that.


I did not check speed values again. I'll do that when I get home and I'll play with the ramp rate as well. Yes, I believe fslipmax is at 100Hz still, I'll dial it back then I'll do a quick video update. 

Pete


----------



## onegreenev (May 18, 2012)

jhuebner said:


> Ok, does "speed" show meaningful values now? Do you still have fslipmax set to 100Hz? If so, try 3Hz that has to be enough.
> 
> Regen is taken back towards lower speeds. By default ramping starts at 10Hz. You can change parameter brkrampstr to change that.



No meaningful change on speed. The last check I got the below numbers and all were at different speeds. First was real slow then up until full. 

482.00eed
482.00eed
482.00eed
482.00eed

Throttle ramp up speed did not change by setting brkrampstr and I tried all from default to 400. Regen seemed ok but not throttle acceleration. It seems rather sluggish still. Actually no change if I just mash the throttle. 

Pete 

O-Scope signal is not as clean this evening. still a square but like static on the line. Will get video tomorrow.


----------



## jackbauer (Jan 12, 2008)

Has anyone noticed the STM card locking up on power on? It seems I have to press the reset button on the card now to get the green flashing heartbeat led.


----------



## onegreenev (May 18, 2012)

jackbauer said:


> Has anyone noticed the STM card locking up on power on? It seems I have to press the reset button on the card now to get the green flashing heartbeat led.


I've noticed nothing like that on mine.


----------



## dcb (Dec 5, 2009)

It uses a bootloader, so it *might* be getting hung up there (maybe an interaction with something connected to the comm port?). I'm sure there are ways to avoid the bootloader and program the stm32 directly. We got a hint in post 538.

might want to throw some progress messages out the serial port (may already be there) or at least flash the led a certain way at the top of main.

Edit: another thought is that it is going into a "brownout" state, if turn-on isnt really clean. Maybe more capacitor on the 12v input would help?


----------



## onegreenev (May 18, 2012)

When I got mine programmed I had uploaded the boot loader that Johannes provided in the package of downloadable files. So my boot loader is not the default boot loader I used the JTAG to erase the chip then upload the boot loader. I then used Ubuntu and the TTL to upload the firmware.


----------



## jackbauer (Jan 12, 2008)

Well I found my problem. The USB lead I received in the last kit is a 5V output. Probably damaged the device at this stage.


----------



## onegreenev (May 18, 2012)

Got another short update. I decided to check the AC side with the motor running. I also tightened up the encoder plug to allow for a cleaner output. I have changed some parameters but still have the weird sound when I crank up the pot and the motor struggles to gain speed. If I go a bit slower on the ramp up it will do pretty good. Regen is actually pretty good. I have it strapped down so its hard to tell exactly how hard its working. For 12 volts its pretty good but I still know I can do the acceleration better but for now I mostly wonder what that funky sound is coming from the machine. Anyway, the encoder signal is good. I tested the AC out at the motor and at the IGBT. No change from at the IGBT to the motor via the long cables connecting the IGBT's to the motor. 

Im assuming the AC signal is a sudo sine wave rather than a square wave. 

Anyway here is the video I did this evening. Short and to the point.


----------



## PStechPaul (May 1, 2012)

Are the IGBTs still getting hot? What is the waveform you show that has the pseudo-sinusoidal shape? The clicking sound seems almost mechanical, like the rotor striking the stator, but it could also be something like an overcurrent limit being activated and PWM shutdown. I think we need more data, such as current and voltage waveforms with their actual amplitude and period, and the corresponding RPM. Also DC current and voltage from the source.

The poor acceleration may be from the low source voltage (12V) being unable to fully magnetize the stator, or problems achieving a proper PWM to create a good synthesized sine wave. A rectangular or trapezoidal waveform can be used to run an induction motor, but it will likely cause considerable torque ripple and resultant noise.


----------



## onegreenev (May 18, 2012)

The IGBT's are heating up the heat sink, yes, but not real fast. By the time I run the battery down they get the sink plenty warm. As expected. Even at 12 volts. I am running decent current. I'll see if I can set up my current sensors to keep track of that issue. As for the sudo wave form you can see it on the video. I have no clue about wave forms or the O-Scope so I must do things then ask about them. Im venturing where I should not be going but what the heck, Im game if you all are game to help me muck through the mire. The clicking in the motor is a mechanical thing. I have not taken the motor apart yet. I will be getting a different motor soon. The AC-35 I think has some issues that were not mentioned when I purchased it. But so far I have been unsuccessful at getting the connections correct for any encoder reading. Nothing but flat line. The encoder and wires going to it look great. There are only 4 so how hard can it be. I do have schematics but the schematics do not show the same color coding. My next move on that is go direct to HPEVS for some help. I'll ask them about the other issue I found. The AC35 does spin up. 

As for the Forklift motor, Im concerned about that funky whine when I mash the pedal and it tries to keep up. Im just more wanting to know what that is or what is causes that sort of behavior. 

Im sure that the O-Scope wave form you see is not a sudo sine but then again there are strange things. Thats what this is all about. Finding out and learning from. I'll try to get you as much data as possible. As for speed, the numbers showing are just that. One set of numbers no matter the speed. The encoder works according to the O-Scope. So why is there not any good speed recording? Im hunting. 

Im pumping out more than a few amps. 

You know, maybe there is some sort of short internally. Maybe I should take it apart. Im game for that. I'd like to do more before going that route first.


----------



## jhuebner (Apr 30, 2010)

If "speed" does not make sense you need to fix that before doing anything else. Without a proper feedback neither acceleration nor regen will work properly.

Put the inverter in mode 1 with the DC bus not connected to the battery.
Turn the shaft with a drilling machine or something to take inverter EMI out of the equation.

See what "speed" does.

Find R4 on the main board and attach the scope to it, that shows the encoder signal after amplification. Maybe something became loose after the motors dive.

From what I can tell from the motor whine you're still in open loop mode by setting a high value for fslipmax.


----------



## jhuebner (Apr 30, 2010)

onegreenev said:


> Throttle ramp up speed did not change by setting brkrampstr and I tried all from default to 400. Regen seemed ok but not throttle acceleration. It seems rather sluggish still. Actually no change if I just mash the throttle.


brkrampstr is not throttle ramp up speed. There's nothing like that.

It is the frequency at which the regen torque is derated as it's rather annoying to have regen all the way down to 0Hz.

So if set to 10Hz you have full regen torque for operating frequencies >= 10Hz, 1/2 regen torque at 5Hz and no regen torque at 0Hz.


----------



## onegreenev (May 18, 2012)

jhuebner said:


> If "speed" does not make sense you need to fix that before doing anything else. Without a proper feedback neither acceleration nor regen will work properly.
> 
> Put the inverter in mode 1 with the DC bus not connected to the battery.
> Turn the shaft with a drilling machine or something to take inverter EMI out of the equation.
> ...


I understand that. I'll do some more checking tonight. Thanks for the heads up on where to look. If needed I'll even change out the encoder bearing. 

Thanks
Pete


----------



## jackbauer (Jan 12, 2008)

Can someone please point out which JTAG programmer is best to use with the Olimex board?


----------



## dcb (Dec 5, 2009)

just guessing, maybe green or johannes can confirm:
https://www.olimex.com/Products/ARM/JTAG/ARM-USB-OCD-H/

this doc mentions 
JTAG connector with ARM 2x10 pin layout for programming/debugging with ARMJTAG, ARM-USB-OCD, ARM-USB-TINY

ARMJTAG is a $14 parallel port thingie. 

The CPU has a bootloader on com1 in system ROM also.
http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf


----------



## jhuebner (Apr 30, 2010)

dcb said:


> just guessing, maybe green or johannes can confirm:
> https://www.olimex.com/Products/ARM/JTAG/ARM-USB-OCD-H/


Yes thats the one I use.



dcb said:


> The CPU has a bootloader on com1 in system ROM also.
> http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf


Used that before, it's not really comfy though. Some makeshift soldering is required to hook up the RTS signal to reset and to tie the BOOT0 pin high.


----------



## onegreenev (May 18, 2012)

https://www.olimex.com/Products/ARM/JTAG/ARM-JTAG-COOCOX/open-source-hardware

This is what I purchased and this one will only upload .bin files. I used it to erase and then upload the bootloader then moved to my Ubuntu OS to finish loading the firmware using the TTL. 

I don't know if the JTAG tiny will upload the .hex.


----------



## dcb (Dec 5, 2009)

just curious, is there a bootloader for the h103 that uses the built in usb port as a virtual serial port? (not that it is compatible with your uploader, one thing at a time)

edit: *maybe* the maple bootloader, would need to figure out serial comm over usb as well in the main app. No more usb uart adapter though might be worth it. Just a usb cable for bootloading and hopefully normal computer communications.

edit2: took the liberty of compiling it, attached. Says it supports openocd.

edit3: sigh, always a billion options, there is also a usb bootloader in:
libopencm3-examples/examples/stm32/f1/stm32-h103/usb_dfu (somehow dfutool is on my system, maybe there are a couple jtag pins that could be jumpered for bootloader mode)
and in:
libopencm3-examples/examples/stm32/f1/stm32-h103/usb_iap

and something that looks like a virtual serial port in:
libopencm3-examples/examples/stm32/f1/waveshare-open103r/usbserial that *might* work on the h103


----------



## onegreenev (May 18, 2012)

jhuebner said:


> If "speed" does not make sense you need to fix that before doing anything else. Without a proper feedback neither acceleration nor regen will work properly.
> 
> Put the inverter in mode 1 with the DC bus not connected to the battery.
> Turn the shaft with a drilling machine or something to take inverter EMI out of the equation.
> ...


I checked the speed with the inverter on but no throttle input. I turned the motor by hand and got proper reading of speed. As I turned it faster the numbers went up. As I slowed down the numbers went down. I have not yet done the O-Scope check of R4. Where should I connect the ground reference when I check R4? Im still getting a harsh clunky start and when the motor smooths out the speed readings are high but not changing with actual speed changes. I did wiggle some of the wires that I have the encoder connected to and got the scope to see some strange outputs. When I wiggled them again the scope cleaned up. 

Im thinking I may have some wired connected that should not be. I need to go through all the wires needed and what does what and try again. 

So I need to know what the ground reference I should use when I connect the scope to R4. I'll check the wires and connections again. I may clean up the wires and put new ends on them. Again, I really hate those ribbon cables.


----------



## jhuebner (Apr 30, 2010)

onegreenev said:


> So I need to know what the ground reference I should use when I connect the scope to R4. I'll check the wires and connections again. I may clean up the wires and put new ends on them. Again, I really hate those ribbon cables.


The reference would be the ground of your logic power supply.


----------



## onegreenev (May 18, 2012)

Here is another quick vid on the trace of the encoder taken off the R4 Resistor. Both a trace by turning the motor by hand and powered up. The top of the square wave directly from the encoder is a bit raggy but after some setting changes I have pretty much gotten the hard clunky starts and stops smoothed out. Still using 12 volts. 

Little at a time. 

Pete 

I shortened the encoder cable and braided it but the original issue was still present until I made some adjustments to the software. The long encoder cable or short did not make any real difference.


----------



## onegreenev (May 18, 2012)

So I took down the Forklift AC Induction motor and connected up my AC-35. I even got the encoder setup to recognize that there is an encoder connected but the speed numbers were no different than my other motor. The motor spun up exactly like the Forklift motor. Same whine and same slow start if I mashed the throttle. I can't imagine both being bad for the same issue. The AC motor was connected to a vehicle with less than 100 miles or so from what I recall. Project was abandoned and I purchased the motor and controller and components. 

Im stumped. 

The encoder that is used on the HPEVS AC-35 motor is this: 
http://www.usdigital.com/products/e6

I can't get it to show a trace but I can get the software to recognize it has an encoder. Maybe the encoder number is wrong. 

But the motors both operate exactly the same.


----------



## PStechPaul (May 1, 2012)

It would help to see a schematic of the circuit you are measuring. From JHuebner's web page I found this for the sensor board:










And this is the main board, where I think the R4 you are probing is in the upper left:










If that is the case, it explains the waveform with a typical R-C rise and a quick fall time due to the switching action of transistor T1. The RC time constant is 12k and 22nF for 264 uSec and thus would be appropriate only for signals up to about 1 kHz. I seem to remember that your encoder has 64 pulses per revolution so the signal will start to become distorted at 20 revolutions per second or 1200 RPM. It's hard to tell just what you are showing on the scope without amplitude and time base, but I think you are seeing excessive filtering and eventually loss of usable signal above a certain RPM.

[edit] From the BOM I see that R3 is actually 1.2k so it should be OK up to 10,000 RPM as specified. But perhaps a component value is wrong?


----------



## jhuebner (Apr 30, 2010)

I just realize my RC filter design is not as intended, of course the major R-contributor is R3, not R4. Anyway the slope is a bit shallow, could it be that C1 is 1µ instead of 22n? They almost look the same. Can we get a close-up image of C1?

Since your signal looks clean you can try to remove C1 alltogether and test without it.

EDIT: the resistor R3 and R4 look correct.

EDIT2: The time base of his scope is 2ms/div. Thus the filter time constant is about 2/5 div=800µs, i.e. cutoff frequency is 1250Hz.

As he spins up the amplitude becomes so low that the MCU only just sees it.

I'll scope my own encoder tomorrow.


----------



## onegreenev (May 18, 2012)

jhuebner said:


> I just realize my RC filter design is not as intended, of course the major R-contributor is R3, not R4. Anyway the slope is a bit shallow, could it be that C1 is 1µ instead of 22n? They almost look the same. Can we get a close-up image of C1?
> 
> Since your signal looks clean you can try to remove C1 alltogether and test without it.
> 
> ...


I did not have good light this morning to do a close up of C1 but I did look at the two boards. The one I did and the one Daniel did. It looks like maybe I did get that one wrong as I found a package in the bottom of the box thats labeled 1 and has one cap inside and it looks exactly like the ones on the board. I may have also gotten another one wrong as well but I will double check that later. 

I can take that off the board and try without it. Ill have more time this evening to mess with it all. 

Thanks
Pete


----------



## jackbauer (Jan 12, 2008)

Fired up the Siemens in Der Panzer today for the first time with new sensor board. Smooth as silk :

https://youtu.be/nQSYnyKJFOo

Working on a new Designspark layout for the control board complete with an Ampseal 23 connector.


----------



## Tomdb (Jan 28, 2013)

A good through board connector will be alot better then what is connected now. Also the flat cable for the main connection is quite a headache when searching for the pins and getting good connections.


----------



## onegreenev (May 18, 2012)

Damien, 

Nice work. Glad to see you have movement. I look forward to a new design. 

Pete


----------



## onegreenev (May 18, 2012)

Made a great move forward thanks to Johannes. I went ahead and just changed out C1 and it changed the whole way this thing ran. The O-Scope trace is cleaner and more stable. I now get speed. What I no longer get is full up and down throttle control. Its back to just jumping up to speed but I do have regen. I played with some settings. One odd thing I found but never mentioned was with some settings the drive end of the motor shaft got real hot. Like almost hot enough to burn you. The far end of the shaft was cold as was the case around either end. It is when I turn the frequency up real high. Amazing how fast the shaft end gets hot. Almost like an induction heater. At least I can control that issue.


----------



## jhuebner (Apr 30, 2010)

Looking very good!

The shaft heating could be a result of the high slip frequency of fslipmax=10Hz. Go down to 3 or 4Hz and oberserve.

You won't have more throttle control as long as theres no load on the motor. Maybe ampmin=0 and veeery light throttle might get you there.

The "pumping" is a result of the bang-bang type rev limiter.


----------



## jhuebner (Apr 30, 2010)

There is a new firmware version (2.78)



I changed the throttle pedal algorithm:
First 50% throttle drive the V/f from ampmin to 100%
50%-100% throttle keep V/f at 100% and drive fslip from fslipmin to fslipmax
Therefore the motor runs at optimal slip frequency most of the time when cruising.
I added a cruise control function. It is activated using Pin 5 and disabled via the brake input on Pin 9.
I added a BMS throttle limit that is activated with the according Pin 19. You can program separate regen/accel limits that limit the throttle when the bms input is high.
This also comes in handy when reversing in the actual reverse gear. Just hook up your reverse light to the BMS input and make your car less jumpy when reversing.
I know some of this needs some refinement. Like disabling the cruise control only with the brake pedal is a bit limited. I will also add a parameter for the BMS input to be inverted for wire brake safety.


If anyone plays with this let us know. I will hook up the according switches sometime this week to test it on my own conversion.

As usual download here


----------



## onegreenev (May 18, 2012)

I am trying to load up the new software. Im having no luck. It does not recognize the updater. I loaded up everything like before and now Im hung up again. Using the JTAG I can erase and then load the boot loader. I can even load up the blink test successfully but stall out on the Linux side at not recognizing ./updater. Nothing has changed. Same ttyUSB2 and the same thing to type in the terminal. Im going to sleep on it again. Then try again tomorrow. I did change directories. 

cd Desktop
cd firmware
./updater stm32_sine.bin /dev/ttyUSB2

updater command not found.


----------



## jhuebner (Apr 30, 2010)

updater is the executable file. Linux says the file is not there. So put it there


----------



## onegreenev (May 18, 2012)

Done, forgot to add that one thing to my instructions I put together. So its easiest to just put a copy of the stm32_sine.bin in the tools directory/folder (for us mac guys). I put that bit of information in my directions. 

Now to play with this thing on my days off. Getting taperloc bushing and pulley so I can connect a load which will be another DC generator motor for the time being. Being able to play with parameters is important and since you really need a load to have throttle control I figured the easy way would be to make an adjustable stand and put two motors together and use one for the load. That way I can play on the bench and not have to mount this motor in a vehicle.




Operating system: Ubuntu

In the terminal (xterm)
Cd (or change directory (folder for us mac guys)) until you get to tools 

example:
cd Desktop
cd tools or where ever you have placed the files. 

Navigate this way until you are in the same directory/folder as your needed files. 

Get your files together:
In the tools directory/folder you will find the files update and update32
In the firmware directory/folder you will find stm32_sine.bin

You can leave them there and move the file stm32_sine.bin from the firmware directory/folder into the tools directory/folder or you can move a copy of the needed update or update32 depending upon your needs, into the firmware directory/folder. 

Either way, be sure you have the executable file update or updater32 in the same directory/folder as the stm32_sine.bin file. 

I found that its easiest to place a copy the file stm32_sine.bin in the tools directory/folder 

Now:
sudo ./updater stm32_sine.bin /dev/ttyUSB2 or what ever your tty device shows up as. 

Look in /dev/ to see the device listing. It will be the one that says ttyUSB...

Search for the directory/folder dev. Open it and check to see if your ttyUSB device shows. How ever it shows up as 

Example: ttyUSB2 or ttyUSB0 or ttyUSB1. Mine shows as ttyUSB2


----------



## jhuebner (Apr 30, 2010)

Thanks, that could be helpful for others.

So I tested the new software today in my car. The bms limits work as expected, reversing is no longer dangerous.

The cruise control will need more work. It works fine on the straight and uphill but oscillates terribly downhill when it uses regen to regulate the speed. It works downhill when reducing the feedback amplification but then the steady state error becomes rather large.









From 200-350 I go uphill with an increasing inclination. You can see potnom increase accordingly to keep the speed.

At around 600 you see the problematic downhill sections. The car feels exactly like the plot looks. I quit the cruise control because I was afraid something might break.

Anyone know how to stabilize this?

It is a P-regulator only.


----------



## onegreenev (May 18, 2012)

Got the chip programmed with the new version. Did a few settings and noticed that the motor shaft still gets hot. But only on the drive end. Such an ODD thing. But wanted to do another screen shot of the settings. Im going to build a platform to mount two motors so I can test the motor with a load. What better than to use another motor as a generator for a load. I can keep it small enough to move around and put on the work desk for testing and video. Work will commence this evening on that part of the project. I hope to get around that motor shaft heating issue. 

Pete


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Thanks, that could be helpful for others.
> 
> So I tested the new software today in my car. The bms limits work as expected, reversing is no longer dangerous.
> 
> ...


Hi J

Have you considered programming lower possible slip for regen in case cruise control is active. Like with reduction when reversing.
I guess i still dont know what you use for slowing the motor down, negative slip or regen region slip or both?

With my wifes petrol car (it has cruise control) i noticed that in case of heavy downhill car actually goes a bit out of speed range but slowly returns in the region of preset speed. It works so slowly that i dont even notice i went 10km/h out of range, because in cca 5s i am back inside preset speed range. 

I guess you dont need very fast speed corrections when cruising. Can you dampen the slip response loop? You could maybe only allow up to nominal slip when in cruise mode. 
If incline requires more slip than nominal, inverter should drop out of cruise anyway, because of energy consumption and motor overheating. 

When i suggested cruise control with your inverter i did it with my highway driving in mind. I really drive long distance every day. Usually EVs drive more localy or at various speeds. So driver performs the function of cruise control, as it should be . 


A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> I guess you dont need very fast speed corrections when cruising. Can you dampen the slip response loop? You could maybe only allow up to nominal slip when in cruise mode.
> If incline requires more slip than nominal, inverter should drop out of cruise anyway, because of energy consumption and motor overheating.


Good ideas here. I'll put a filter before the cruise controller and see what that does. I can add a parameter which sets the maximum throttle the cruise control can assert.

The cruise control doesn't work at the level of slip frequency. It just commands -100% to +100% torque which is then converted to V/f scaling and slip.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Good ideas here. I'll put a filter before the cruise controller and see what that does. I can add a parameter which sets the maximum throttle the cruise control can assert.
> 
> The cruise control doesn't work at the level of slip frequency. It just commands -100% to +100% torque which is then converted to V/f scaling and slip.


Hah! Then you absolutely have to reduce this 100% torque value, or you have to implement full PID control to reduce oscillation. 

Maybe it would be good to have a factor less than 1 in front of control response to outside pulse and proportionally extend time this response is applied. That would reduce power surges and dampen response to outside disturbance.

Hm all this is speculation since i dont know how programming works...

A


----------



## arber333 (Dec 13, 2010)

Last 3 years i made 50000Km on 140VDC LiFe cells on 28kW german ACIM motor and ZAPI industrial inverter. 
Since i bought kit from Johannes in february 2015 i am trying to convert my car to 300VDC 300A. 
I made most of the hardware and connections. Now i have to connect 12V and test it before i test spin motor. I decided to test one small 3phase motor, since my EV motor is fixed and it needs 2kW to spin up the flywheel and gearbox.
Inverter will be water cooled and i am thinking of changing the motor jacket to water cooled too.

Here are some pictures of controler being built:









































Arber


----------



## jhuebner (Apr 30, 2010)

Good mechanical work 

Whats the relay card for?

Can you shrink the pictures a bit so they fit on smallish monitors?


----------



## arber333 (Dec 13, 2010)

Yes sorry i was just pasting urls so pics were the large versions... 
Will correct.

Er.. relay is for precharge. I still have to setup one 220R resistor. You think that relay will be enough? Relay will suffer only when turning ON, when turning off voltage will be on level with caps. No current should flow then. There is still one more relay if i choose to use it for something else... 

I have another Sci Fi question...

Could i use this controller with encoder and PMSM motor in future?
http://www.ebay.com/itm/400-Pulses-...02?pt=LH_DefaultDomain_15&hash=item58c453d9b2

Let me explain.. I would setup motor with this encoder to read position of rotor. It has 400ppr with phase A and if i would use phase B also it would report 1200ppr! This would probably be too much for STM32.
For reporting direction of rotation i could still use FWD/REV function. That way motor couldnt turn backwards accidentally yes?

You think it would work with this motor?
http://www.enstroj.si/Electric-products/emrax-228-motorsgen.html

It is 10 pole pairs PMSM water cooled motor that could just slide inside my transmission. No clutch, 60kg less mass and i could shift with it easily since its rotating mass is very light.

A


----------



## jhuebner (Apr 30, 2010)

I used to have a smaller relay for precharge. It did okay until one day it "precharged" into my heater core. I used 100R for my 500V system so with 220R and 300V you should be fine.

Currently I'm not very motivated to add PMSM support because I'm not convinced that PM motors offer enough advantage compared to their more expensive and complex design.

It's not so much a matter of complicated software changes but a matter of buying a motor for testing, designing a converter from resolver to a pulse signal and testing. If anyone feels like supporting/funding that let me know.

EDIT: wow that emrax demo is very exciting, why don't they just build an induction version


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> I used to have a smaller relay for precharge. It did okay until one day it "precharged" into my heater core. I used 100R for my 500V system so with 220R and 300V you should be fine.
> 
> Currently I'm not very motivated to add PMSM support because I'm not convinced that PM motors offer enough advantage compared to their more expensive and complex design.
> 
> ...


OK 

I intend to buy this PMSM motor and couple it with one pulse encoder. 

As i talked with Roman he said that maybe controler would work with setting slip to 0 and driving with defined forward/back setting.
In any case i intend to buy this motor because its watercooled, its light and powerfull and because it is Slovenian design. We should support our industry .

In August i will buy it and then we can try if my theory works...
EDIT: With this motor i could also transform my manual transmission to automatic, a sort of robotic transmission. Should be fun...

Anyway, can you tell me what value throttle potentiometer do you use for testing?
I have Hall sensor on my pedal, but i cant just take it out of car. Would 5K pot work? Maybe 10K?

tnx

A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Anyway, can you tell me what value throttle potentiometer do you use for testing?
> I have Hall sensor on my pedal, but i cant just take it out of car. Would 5K pot work? Maybe 10K?


Either is fine, in fact anything >1k is ok to use.


----------



## Hollie Maea (Dec 9, 2009)

jhuebner said:


> EDIT: wow that emrax demo is very exciting, why don't they just build an induction version


Axial flux induction machines...is that even possible?


----------



## arber333 (Dec 13, 2010)

Hi J

I will be connecting dev board to my laptop and i noticed you say 5V from USB should not be connected to the board. Should i make quick and dirty voltage divider or do i simply leave Vin pin unconnected? 

Hm, i could add 5V to 3V3 linear reg. but i suspect it would be hard to get...
What do you suggest?

A


----------



## jhuebner (Apr 30, 2010)

Can't you just power up the board with the 12V supply?

The 3.3V output is merely intended for supplying a bluetooth or zigbee module, not so much for supplying the Olimex.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Can't you just power up the board with the 12V supply?
> 
> The 3.3V output is merely intended for supplying a bluetooth or zigbee module, not so much for supplying the Olimex.


I guess we dont understand each other. I will supply 12V to the board, but i need to connect to PC.
I taught JP6 should be connected to USB cable you supplied. There is a 3V3 INPUT pin 1.
But in your site i found this: 
"The recent USBTTL cables have a 5V output. DO NOT connect it to the 3.3V input of the mainboard!" So how should i connect the board to laptop then? 

tnx

A


----------



## jhuebner (Apr 30, 2010)

I see. Connect GND, RX, TX but NOT the 5V cable. Just leave Pin 1 unconnected.


----------



## arber333 (Dec 13, 2010)

TNX i will do that...

Her is my progress so far
https://mazdamx3ev.wordpress.com/2015/05/29/kontroler-za-300v/

I think i will start to write in english now . In any case use google translate from Slovenian, youll get the basic meaning.

A


----------



## arber333 (Dec 13, 2010)

Another question...

I am now making wiring of main 24pin connector to outside devices. I came across throttle and brake sensors. Mainboard requires 3V3 signal, but i have to power sensors at 5V. My question is:

1. are both analog pins 6 and 8 powered from pin 4 (3V3)? If so, i will have to change this pin to +5V supply from sensor board.

2. What do you think should i add one 12V to 5V regulator supply to provide enough 5V for auxilliar things as precharge relay sensors and encoder? 

tnx

A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> 1. are both analog pins 6 and 8 powered from pin 4 (3V3)? If so, i will have to change this pin to +5V supply from sensor board.


Both pins have a 0-3.3V input range. Pin 4 provides 3.3V in case a normal pot is used. If your pot requires 5V you can indeed use the sensor board connector.



arber333 said:


> 2. What do you think should i add one 12V to 5V regulator supply to provide enough 5V for auxilliar things as precharge relay sensors and encoder?


The integrated regulator is rated 3A and the inverter needs at most 1A. So 2A to play with. Maybe you'll have to attach a small heatsink to the regulator.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Both pins have a 0-3.3V input range. Pin 4 provides 3.3V in case a normal pot is used. If your pot requires 5V you can indeed use the sensor board connector.
> 
> 
> The integrated regulator is rated 3A and the inverter needs at most 1A. So 2A to play with. Maybe you'll have to attach a small heatsink to the regulator.


Ah, ok so no need for additional 5V converter then. I will assemble drive circuit today and try to run software. I have to refresh my linux knowledge some .

tnx

A


----------



## jhuebner (Apr 30, 2010)

I will put a word on space vector modulation here to not spam eldis thread.

We assume a DC bus voltage of Udc=200V

So first, pure sine wave modulation:









The individual phase voltages are within +-100V , the DC bus voltage

And the resulting phase to phase voltages









You can see the peak value is about 175V resulting in an rms value of 175/sqrt(2)=123V

Now we add an offset to each phase that looks like this (min(U_L1,U_L2,U_L3)+max(U_L1,U_L2,U_L3))/2:









and multiply the result by 1.15

This results in the "space vector modulation":








The individual phase voltages still don't exceed -+100V

The resulting phase to phase voltages are sinusoidal again but with a peak value of 200V. The resulting rms value is now 200/sqrt(2)=141V









So only SVM makes full use of the bus voltage while pure sine modulation does not. Udc/sqrt(2) cannot be exceeded because it would require a peak value greater than Udc.


----------



## PStechPaul (May 1, 2012)

I have seen something like that before, way back in 2004 or so when I attended the Microchip MASTERS conference and a session on ACIM control. 

It may not directly apply here, but I found this paper about pure sine wave inverters quite interesting:
http://www.wpi.edu/Pubs/E-project/A...-190851/unrestricted/PWM_Techniques_final.pdf


----------



## arber333 (Dec 13, 2010)

Hi J

A question about throttle pot or hall sensor since i have one....

Could you program in code so we could configure slope of throttle pedal effect? 

Let me explain. Since i use hall sensor it is pure linear. If i wanted slope i would have to setup kinematic links to get logarithmic effect. 
Btw we figured logarithmic pot is the best for EV, since start is very quick, later power is added more slowly. 
What i would like is some lines in code that describe the curve, zero point from cca 5% pot movement and maybe two points where throttle changes slope.

ie.: throttle value starts at X=10%, Y=0% and at X=30% has Y=40% effect and at X=60%, Y=80%

A bit slower logarithmic curve. Picture attached.









tnx

A


----------



## arber333 (Dec 13, 2010)

I connected +12 wrong!!!

It seems that when i prepared cables i switched colour of two wires, DOH!
When i connected 12V went to 3V and current jumped to 2A as PSU was limited. Do you think main PCB board is ok? I didnt put Olimex in yet at the time. 

I will try again later today if you think it is good?

tnx

A


----------



## jackbauer (Jan 12, 2008)

Quick little update. The inverter is now installed in the E31 and starting up :

https://youtu.be/5MQSt1Hp_xo


----------



## PStechPaul (May 1, 2012)

Pretty cool, but as someone said in the video comments, your "check engine" light is on. However, it's probably nothing serious. It just seems to be "missing"...


----------



## jhuebner (Apr 30, 2010)

Can't wait to see it off the leash


----------



## PStechPaul (May 1, 2012)

Have you seen this motor control evaluation kit from TI, for $25?

http://www.ti.com/tool/LAUNCHXL-F28069M


----------



## arber333 (Dec 13, 2010)

I have connected USB and interface. As per instructions. I havent noticed that there are instructions in "web interface" folder also. 

You have to allow communication trough serial port
sudo usermod -G dialout www-data
and restart service
sudo service apache2 restart

Then everything starts to work....

Also i connected driver boards now. I get 12.6V and 0.25A from my psu. Can you guys tell me if that is ok? I wouldnt like to leave some things unconnected.

A


----------



## arber333 (Dec 13, 2010)

Yay! I repaired the main PCB and put it back. 
I then connected one pump motor and according to your instructions start inverter. Motor started at 10Hz with cca 1A consumption from 30V 8S pack LiPo cells. Great stuff. I will borrow one 6pole servo motor from a friend to try from 300V. Then i will connect my car .


There is one issue though J. 

Voltage reading is off by 12V. I gave 32V in and i got 19V return on sensor board. Is this still good since there is resistor reading? 


















Check start on youtube...

https://www.youtube.com/watch?v=MC5ZW1kvVh8&feature=youtu.be

tnx


A


----------



## arber333 (Dec 13, 2010)

I was skimming trough parameters and i noticed that there is no way for the inverter to know what power IGBTs are in. Can you limit Amps with some parameter?

I found "ocurlim" parameter. Is that limiter? Why then would i give it -500A value. How would that apply to me? 

I have 300A IGBTs, would i input -300A then? Does - matter?

What do you use for "deadtime" at 9kHz PWM? Should i keep 800ns?

tnx

A


----------



## jhuebner (Apr 30, 2010)

Congratulations on your first spin 

You can calibrate the DC voltage reading using the udcgain parameter.

ocurlim as you discovered is for the current limit and deadtime... yes thats all the inverter needs to "know" about the power stage.

I set the deadtime parameter to 63 (1.5µs) for my 1200V/400A modules.

Can you repost the motor question here? And a datasheet of the position sensor?


----------



## arber333 (Dec 13, 2010)

I have a problem!

I connected my traction motor now and tried to spin it. 
The first time i connected the inverter to 12V and i connected START pin precharge relay dropped out and transistor T2 blew spectacularly! What was that?

I disconnected the relay and tried to run without precharge.
I got nowhere. I setup 120VDC and parameters for my motor. When i tried to spin there is din_ocur=1. This remains so trough the whole test. Do you kow what would cause this signal being high? Inverter will not start with this parameter ON.

A


----------



## jhuebner (Apr 30, 2010)

T2 is for the DC contactor and closes as soon as precharge opens. It is on Pin 12. Did you connect anything to that? Like accidentally connect it to 12V? 

din_ocur high means the over current limit is currently active and shutting down the inverter. Did you change ocurlim? Or ilXgain or ilXofs?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> T2 is for the DC contactor and closes as soon as precharge opens. It is on Pin 12. Did you connect anything to that? Like accidentally connect it to 12V?
> 
> din_ocur high means the over current limit is currently active and shutting down the inverter. Did you change ocurlim? Or ilXgain or ilXofs?


No i didnt connect anything to Pin 12. However i noticed before that when precharge reached voltage it reset relay but at that time voltage on PSU dropped. Something was pulling 12V towards GND. I guess now we know what...
Do you think there is a short on main PCB?

Also i managed to connect 5V to encoder and i totally forgot to add resistor devider DOH! I hope i havent destroy the receiving transistor... What do you think?

A


----------



## jhuebner (Apr 30, 2010)

The 12V trace is quite far away from the digital outputs so I don't think it's a short circuit on the PCB.

Can you unplug JP5 and check if Pin 12 is short circuit to Pin 11 or 13?

If Pin 3 is at around 0.7V then the transistor is still ok.

Is V/Hz mode working again or still din_ocur=1?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> The 12V trace is quite far away from the digital outputs so I don't think it's a short circuit on the PCB.
> 
> Can you unplug JP5 and check if Pin 12 is short circuit to Pin 11 or 13?
> 
> ...


You are correct. I got some time today and i measured like you said. 
Pins 11 and 12 were not short... rather it was the wire in main connector that i soldered short. So 12V ran directly towards transistor that pulled it to GND. With PSU that was no problem (1A setting) but as i connected to 12V battery poor ZTX was toast...

Encoder pin 3 though... i got a signal on it, 2,9V towards GND. Is that bad? HUH i intended to make interface to lower voltage on signal pin from 5V to 3.2V. But i checked and my encoder needs 12V! So i have to lower signal from 11V to some 3V pulse. Do you think i should order another Olimex board? 

Do you think i could use optocoupler? From one side i would power led from signal, on the other opto side i would transmit 3V towards pin 3
You think it would work? Like this: http://www.ebay.co.uk/itm/371296480644.

tnx

A


----------



## jhuebner (Apr 30, 2010)

It sounds like you damaged T1 but the Olimex should still be ok. Yes, the optocoupler solution should work. You can just connect the receiving side to GND (Emitter) and Pin 3 because Pin 3 is pulled up on the main board.


----------



## jackbauer (Jan 12, 2008)

Johannes , your inverter works 

https://youtu.be/aWPgEf6abUo


----------



## jhuebner (Apr 30, 2010)

That is thrilling to see 

Congratulations and thanks so much for sharing!


----------



## PStechPaul (May 1, 2012)

I'm looking forward to my next EV grin! You are right, the feeling of designing, building, and operating a unique creation is an incredible feeling that money can't buy. It can come from a simple circuit or software, or a mechanical device, but probably an EV ranks at the top because it is so visible and tangible, essentially an extension of yourself. I hope you are now motivated to "git 'er done" with the cooling system and instrumentation and finally a victory loop on the highway!


----------



## onegreenev (May 18, 2012)

jackbauer said:


> Johannes , your inverter works
> 
> https://youtu.be/aWPgEf6abUo


Thanks for the video.


----------



## arber333 (Dec 13, 2010)

Hi J

As i said it is a success! Motor was spinning in car, in neutral of course, because i havent built encoder 5V - 3V level interface yet. 
All in all this inverter works on 120VDC unloaded motor and quite good on basic settings, like you suggest on website. Speed change is done via 5k pot and V/Hz works. The problem is, if i load motor it starts to wobble and cant accelerate without encoder. I will try with encoder soon.

I noticed that overcurrent protection is very effective. Very good.
Can you explain why the parameter has to be -200 for the inverter to operate? I tried to set to 200 and it just kept switching off.

I set fweak at 150Hz, Fslipmin is 3 and i found out Fslipmax at 6 causes motor to rotate very slowly and draw lots of amps. Then i changed it to 50Hz! Motor went spinning instantly. Why? I taught this parameter shouoldnt be higher than 2xFslipmin.

tnx

A 

Also i saw that changing boost value can increase engine speed, but can throw overcurrent protection. I have it set to 2400.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Hi J
> 
> As i said it is a success! Motor was spinning in car, in neutral of course, because i havent built encoder 5V - 3V level interface yet.


Congratulations 



arber333 said:


> I noticed that overcurrent protection is very effective. Very good.
> Can you explain why the parameter has to be -200 for the inverter to operate? I tried to set to 200 and it just kept switching off.


Yes, on the very first hardware version the sensor polarity was not inverted, now it is because of the inverting opamp. So I had that old hardware buried in my car and new hardware on my desk (and "out in the field").
To be able to use the same software on both, I made the parameter bipolar. Negative value for the new boards, positive value for the old one. Seeing it now that was a silly decision.
If I change it now, then everybody who does a software update will have to correct the parameter.




arber333 said:


> I set fweak at 150Hz, Fslipmin is 3 and i found out Fslipmax at 6 causes motor to rotate very slowly and draw lots of amps. Then i changed it to 50Hz! Motor went spinning instantly. Why? I taught this parameter shouoldnt be higher than 2xFslipmin.
> 
> tnx
> 
> ...


Fslipmin and max only have their actual meaning once an encoder is connected.

Right now, without encoder, you can vary the output frequency between 3 and 6 Hz. Once the encoder is connected the shaft speed will be added on top of that and the motor will spin up quite rapidly.

In idle you will have the feeling that you can't control the motor, it only starts to make sense when you put a load on it.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Right now, without encoder, you can vary the output frequency between 3 and 6 Hz. Once the encoder is connected the shaft speed will be added on top of that and the motor will spin up quite rapidly.
> 
> In idle you will have the feeling that you can't control the motor, it only starts to make sense when you put a load on it.


OK great

That is exactly how my old controller was working. When i reved it unloaded motor would spin to 200Hz, but with load everything was steady.

What is your power to spin wheels up at 3000 motor rpm? My motor requires 2,5kW to rotate flywheel, transmission and wheels. I would like to see if that is only because of poor settings or losses in transmission.

A


----------



## arber333 (Dec 13, 2010)

Have you tried to change PI control for cruise? Was it good?

A


----------



## arber333 (Dec 13, 2010)

Hi

I am trying to make good level change and i made it like this








I would like to connect all GND to single point. Can you tell me if the Throttle and Encoder GND is the same as supply GND? 

Also can i tie ENC and Throttle +3V3 together to form one VCC connection to supply sensors? Are they the same?

tnx

A


----------



## jhuebner (Apr 30, 2010)

This one will not work, the input resistance for the encoder is 500 Ohm. 

Simply connect the Emitter of you opto to GND and the collector to the encoder input.

Yes, both throttle and encoder GND are the same.


----------



## arber333 (Dec 13, 2010)

OK i figured it doesnt work DOH! I had some problems with 12V supply. I think i will have to finish my connection in car and then experiment. If not those cables will give me more trouble.

To top it off one DCDC started to give up smoke. I disconnected power and drained caps. I checked and i found one DCDC burned. I will replace it in a few days. I also checked IGBTs and they are ok.
However when i went to check rest of drivers they were ok, BUT i then connected 5V supply to driver and i got something strange. All boards were putting out -15V on GE. But two were showing cca -14V. I checked amps and i got 24mA consumption on this pcb while the rest was 11mA. Huh! 
It seems that TVS diodes are shunting before they reach 15V! I think i will replace them. 

A


----------



## jhuebner (Apr 30, 2010)

That sounds serious. So the TVS where the DC/DC broke, has that failed shorted?

Can you show a picture of you gate driver connections? And scope one of the gate signals while running the motor?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> That sounds serious. So the TVS where the DC/DC broke, has that failed shorted?
> 
> Can you show a picture of you gate driver connections? And scope one of the gate signals while running the motor?


No it seems that one is still good. As it seems driver chip also survived.
Both shunting TVS diodes were on the second driver PCB after the burned one. 

Here are some of the pictures of drivers and with scope when i get one from a friend.








A


----------



## jhuebner (Apr 30, 2010)

Ok, gate connection is supreme.

What PWM frequency are you running?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Ok, gate connection is supreme.
> 
> What PWM frequency are you running?


I see where this is going... yes i run inverter at 8,8kHz with 10R resistors. This shouldnt be a problem since energy for turning the IGBT on is still lower that DCDC supplies. I suspect that driver IC takes more than its share, since it is 4A driver Si8261BBC-C-IP. It is one tough mother... since it survived two IGBTs dying in my charger . 

On monday i expect new DCDCs to arrive and i will replace the poor thing that released smoke.


----------



## jhuebner (Apr 30, 2010)

Yes 8.8kHz is fine. I thought it might be 17.6kHz which could explain an overload.


----------



## arber333 (Dec 13, 2010)

I loaded TVS diodes with 15V and increased to 18V. They opened normally... Hm, then i went on and measured DCs on driverPCB without load. Sure, one DCDC was shunting 15mA and the other only 7mA! That means the first is probably near death. I will replace it also. 
I guess when i connected 12V i overloaded something with all those wires lying around... I will have to tidy up my installation next time.

A


----------



## PStechPaul (May 1, 2012)

For TVS diodes you need to look at the rated voltage Vbr) as well as the standoff voltage and maximum clamping voltage at rated peak current. A 1.5W 15V bidirectional TVS has a Vbr of 14.3 to 15.7V (for the tighter "A" version), and a reverse standoff voltage Vwm of 12.8V at 5uA leakage. Its maximum clamping voltage is 21.2V at 78A. According to the rating curves, the incremental clamping voltage will add about 0.3V to the usual 10A or less IGBT drive current.

The unregulated 15V DC-DC converters generally are OK with a common 15V zener diode to limit its output to 15V or below, and the IGBT driver will usually drop the voltage by another volts, so the TVS should not draw very much current when the drive is ON. The breakdown voltages are specified at 1 mA. The drivers are rated into a heavy capacitive load and should be current limited, and the DC-DC converters should have fairly large (20-50 uF) low impedance capacitors on the output and across the driver supply, so they will supply the surge current and not the DC-DC. So the cause of the failure may be something else.

[edit] BTW, TVS diodes do not "open normally". They only open when subject to excessive power and overheating, and do not exhibit the aging/use effect of MOVs, which gradually reduce their breakdown voltage until they start drawing excess current at rated voltage and then trip a protective device or blow open spectacularly.


----------



## Tony Bogs (Apr 12, 2014)

Great progress in 6 months. Still got a bit of catching up to do.
I really like Damien's videos. 

This question by arber333 to J, a few pages back, caught my attention:


> Could you program in code so we could configure slope of throttle pedal effect?


How about this pedal map below? Basically square functions, so a few fast multiply instructions in code should do. 

Map:

http://forums.aeva.asn.au/forums/uploads/690/PedalMap3.gif

Part of this topic on an Australian ev site:

http://forums.aeva.asn.au/forums/ac-drive-programming-and-pedal-mapping_topic1859_page3.html

Insideevs.com used the map pic about six months ago as a thumbnail for a topic on controller basics:

http://insideevs.com/ev-nerdgasm-basic-ev-motor-controllers-part-2/


----------



## jhuebner (Apr 30, 2010)

PStechPaul said:


> For TVS diodes you need to look at the rated voltage Vbr) as well as the standoff voltage and maximum clamping voltage at rated peak current. A 1.5W 15V bidirectional TVS has a Vbr of 14.3 to 15.7V (for the tighter "A" version), and a reverse standoff voltage Vwm of 12.8V at 5uA leakage. Its maximum clamping voltage is 21.2V at 78A. According to the rating curves, the incremental clamping voltage will add about 0.3V to the usual 10A or less IGBT drive current.
> 
> The unregulated 15V DC-DC converters generally are OK with a common 15V zener diode to limit its output to 15V or below, and the IGBT driver will usually drop the voltage by another volts, so the TVS should not draw very much current when the drive is ON. The breakdown voltages are specified at 1 mA. The drivers are rated into a heavy capacitive load and should be current limited, and the DC-DC converters should have fairly large (20-50 uF) low impedance capacitors on the output and across the driver supply, so they will supply the surge current and not the DC-DC. So the cause of the failure may be something else.
> 
> [edit] BTW, TVS diodes do not "open normally". They only open when subject to excessive power and overheating, and do not exhibit the aging/use effect of MOVs, which gradually reduce their breakdown voltage until they start drawing excess current at rated voltage and then trip a protective device or blow open spectacularly.


Ok, good to check. So I'm using 18V bidirectional TVS
Breakdown @17.1, Reverse Standoff 15V
Capacitors are 100µF, 200mA RMS ripple current. Not explicitly Low-ESR types.



Tony Bogs said:


> Great progress in 6 months. Still got a bit of catching up to do.
> I really like Damien's videos.
> 
> This question by arber333 to J, a few pages back, caught my attention:
> How about this pedal map below? Basically square functions, so a few fast multiply instructions in code should do.


Absolutely, if you guys fancy that it is an easy feature to add.

Check attachment


----------



## Tony Bogs (Apr 12, 2014)

ICE tuners surely will think it's easy. ICE controllers are stuffed with all kinds of 3D maps. Basically a 2D array in flash.

But the Australian pedal map has simple square functions. 
Can be implemented with the simple equation b = a * a or MUL R1,R0,R0 I guess (have to check the stm32F1 programming manual for the exact assembler syntax) 
Followed by a few other simple artmetic functions for the speed dependency.

The map I posted is an ICE like map. 
A set of functions that closely match the solutions to the differential equation 
that governs the combustion in an ICE in relation to the throttle position (valve opening) and engine speed.

Btw, the nonlinear function in throttle.png looks like it is also a close match to two square functions, partly negative.


----------



## jhuebner (Apr 30, 2010)

Yeah I guess its not that useful to have anything other than linear in the regen region. Thats why I'd prefer the yellow curve.

The slope becomes steeper for regen to waste less throttle travel. But thats configurable, if you want fine regen control you could even make it more shallow than the acceleration curve.

If you end up having to do assembler you clearly picked the wrong MCU. Those days are long gone, luckily.


----------



## jhuebner (Apr 30, 2010)

Made another video of my own build:


----------



## Tony Bogs (Apr 12, 2014)

Assembler is always there. Maybe hidden in inline statements in a library or part of the compiler. 
For instance, the ST library contains a function to reverse the bit order within a 32 bit word with the inline assembler RBIT instruction. 
It's very important to know the limits of the compiler and higher languages. Try reversing the bit order with standard C.
The RBIT instruction is very useful if you want to use an USART as a SPI master. 

A square function gives fine grained torque control around the point where the pedal position matches the actual speed. 
Most drivers want that. But the difference with linear probably isn't that big.


----------



## jhuebner (Apr 30, 2010)

Hmm, I might have not quite understood the pedal map you provided. How does "pedal position match speed"?

Right now, say a pedal position of 50% would result in 100Nm of torque. On a straight that results in a higher steady state speed than uphill. No matter if the pedal map is linear or something else.



Tony Bogs said:


> Assembler is always there. Maybe hidden in inline statements in a library or part of the compiler.


Yes, and thats where it belongs. Hidden away from the application developer. I've seen a Clarke transformation written in assembler. It was probably coded that way out of performance limitations of some 20 year old CPU. And it was absolutely unreadable. I'm glad these days are over and you can write a*b when you mean a*b.

The current software loads the STM32F1 to about 25% at 17.6kHz PWM. So no need for optimization just yet


----------



## Tony Bogs (Apr 12, 2014)

If one relates the square function pedal map I posted to the current software one could say that the PARAM brknom (~ torque zero crossing point) shifts with momentary speed. 
So at low speeds brknom has low values and due to the square function so have changes in torque as the potval changes. 
The maximum regen brake level is also low. This gives fine grained torque control. 
As the speed of the car increases, the maximum regen braking level and the torque to pedal response also increase proportionally to the kinetic energy (square function of speed) of the car. 
And that's just right. A driver wants plenty of torque at high speeds.

In some cases the only way to get efficient and/or fast (enough) code is to use assembler. That's just how it is. 
Of course, one prefers higher level languages for readability. __INLINE and comments do help.

The readability of RBIT in C is questionable. 

I really like the idle speed control. No external pump for the auto tranny.

ADDED for clarity.
Pedal to speed match: pedal is somewhere close to the point where the torque and speed are in balance for maintaining a certain speed. 
The map in the insideevs.com link is the right map. With negative torque values in the regen area.
The direct link to the Australian pic has positive regen torque values, which might be confusing.
Of course, the PARAM (brkmax?) for max regenerative braking also shifts with speed. Low values at low speed and matching low pedal value.


----------



## Boxster-warp (Jun 22, 2014)

Hello from Germany
Nice Video and the Polo ist fast, congratulation.
Greetings Boxster-warp


----------



## jhuebner (Apr 30, 2010)

I get it, thats pretty clever.

Would also eliminate the need for the brkrampstr parameter, i.e. the frequency where regen is ramped down as it would be inherently "ramped down".

Now, some news
I just updated the web interface. It now allows you to save and restore parameters from a file (plain JSON).


----------



## Tomdb (Jan 28, 2013)

Anyone got the web interface working on a windows pc?


----------



## Tony Bogs (Apr 12, 2014)

Exactly. 
This is what CalcThrottle looks like when I add the shifting of brknom and brkmax with speed. 
Makes the PARAM brknompedal and probably brkrampstr obsolete.
The map stays linear. Some prefer it that way. But with dynamic (speed shifted) zero crossing and slope.


> int Throttle::CalcThrottle(int potval, bool brkpedal, int speed)
> 
> {
> int potnom = 0;
> ...


----------



## jhuebner (Apr 30, 2010)

Great! I'll test it onboard as soon as I can.


----------



## dcb (Dec 5, 2009)

jhuebner said:


> If you end up having to do assembler you clearly picked the wrong MCU.


[soapbox]
I'm surprised at how pervasive this attitude is. Nothing wrong with knowing exactly how a chip works and how to talk to it more-or-less natively when the need arises. Who wants their timing/size critical bits of code to break when someone changes compiler versions or compile flags?

Nothing wrong with mixing asm and whatever. I'd glibly counter that if one can't deal with a little assembler when needed they have chosen the wrong hobby/profession. Sometimes a layer of C/C++ only gets in the way and you waste your time learning one programmers version of compiler optimization theory rather than the actual hardware.

With a decent set of macros assembler can be very language-like, even OO-like.

I've seen the arduino folks gutting asm routines, then rewrite them in C, then look at the asm output and hope it is good enough, then put a big disclaimer (buried in the source) about what compile flags you can or can't use in order for it to work right (and they need one for compiler versions it was tested with). That is insanity, asm-phobia.

I've yet to recompile a C program for another chip where I didn't have to tweak a bunch of code anyway, it isn't all that portable when the register names are all over the place. Or you have a metric ton of defines (which can be done with macros) for every conceivable MCU, even if YAGNI. And for a purpose built controller, YAGNI.

I really fail to understand what peoples problem with the occasional bit of assembler is. Especially on something as common as an arm cortex m3. You can optimize a few routines and use a chip that costs 1/2 as much? Or just ensure performance and reliability on a given chip? Makes a big difference in production. Sure, use the highest level language that will do the job, but there's plenty of spots where a bit of asm is really the only sane approach.

Being afraid of assembler is like being afraid of a transistor.
[/soapbox]


----------



## eldis (Sep 3, 2013)

dcb said:


> I'm surprised at how pervasive this attitude is. Nothing wrong with knowing exactly how a chip works and how to talk to it more-or-less natively when the need arises. Who wants their timing/size critical bits of code to break when someone changes compiler versions or compile flags?


That is why at work we use on our boards only FPGAs  At the end there is nothing a state machine and a good pipelined signal chain design wouldn't solve. Plus it runs in parallel! True, sometimes even Xilinx Virtex 7 starts to be too crowded..

Sorry, that was just to lighten the mood. Anyway, I have nothing against a good old hidden macro somewhere, but I guess that what Johannes means is that once you need to do this regularly, you really did pick a wrong microcontroller.


----------



## dcb (Dec 5, 2009)

Not sure I get it, so since Assembly makes a lot of sense sense in some spots, perhaps within a C program, we should do FPGA everywhere? It wouldn't surprise me in the least if instaspin had some bits of assembler in it because the developers got tired of trying to get the compiler to do the right thing and do it reliably.


----------



## eldis (Sep 3, 2013)

dcb said:


> Not sure I get it, so since Assembly makes a lot of sense sense in some spots, perhaps within a C program, we should do FPGA everywhere?


I'm an RF engineer - with high speed digital processing systems you don't have a choice. DSPs would not be fast enough, even with assembler. Plus it's difficult running many instances of some processing in parallel (imagine many fast ADC and DAC channels). And once you have such a beast there, why not just go all the way and have SPI, I2C and similar done in the same chip.

I was talking about my work, not that you or anyone else should use FPGAs everywhere. Anyway, off-topic, I better shut up


----------



## dcb (Dec 5, 2009)

havent had need for FPGA or PSOC yet in any projects (considered a cypress for an SDR), but it is definitely interesting stuff. 

http://www.researchgate.net/publica...ms_for_electric_AC_motors_developed_for_FPGAs

As well many of the grain of rice sized CPUs just don't have room for a compiled binary, but still a much more flexible approach than an array of logic chips.

I guess the general statement "if you are using assembler at all (or "too much"), you have the wrong CPU" is generally objectionable, that should be self evident. Sorry if folks don't like assembler, people have been trying to claim it is dead for decades, but it isn't, and won't be for the foreseeable future. The assumptions that go into relying on a compiler to make something faster, smaller, or even portable, are routinely invalid, and the less you understand the machine underneath, the less options you have.


----------



## jhuebner (Apr 30, 2010)

I started live as a programmer doing opcode level programming of a Z80. So sort of one layer below assembler. So I do know what it is and I do know that development can never really focus on the actual task because you're obstructed by "compiling by hand".

I have not had to do assembler ever since (in 20 years), with one exception: a CPU register test.

If you vote for assembler, you vote against abstraction. The latter is the most powerful method in computer science to manage the complexity of large software systems. There'd be hardly any GUI programs if it wasn't for the abstraction layers called "Windows" or "X.org".

I do agree that there are some 64-byte flash MCUs out there with only registers, no RAM. Thats where assembler still plays a role.

In the BMS project I ended up with 2.5k of code for a 2k MCU. Simple solution: I got the 4k version.

If anyone where to contribute assembler code to the inverter project I'd tell them to go rewrite in C. It's just not necessary.


----------



## dcb (Dec 5, 2009)

jhuebner said:


> If you vote for assembler, you vote against abstraction.


It isn't all or nothing. Sometimes it does make sense, in large volumes or when there is no sane way to do something otherwise (i.e. with cycle level precision). And nobody these days is saying ditch C completely for assembler, yet plenty of folks are too willing to ditch assembler even when it does make sense to use it.



jhuebner said:


> The latter is the most powerful method in computer science to manage the complexity of large software systems.


An inverter or a charger isn't a large software project.



jhuebner said:


> If anyone where to contribute assembler code to the inverter project I'd tell them to go rewrite in C. It's just not necessary.


I cannot think of an absolutely necessary reason for assembler on your particular inverter project. 

But you and I had the benefit of learning assembly at some point, and as a result we know how CPU's "think". Younger programmers are often not able to bridge the gap between the abstraction and reality if we constantly deter them, for no good reason, except abstraction, which is occasionally divorced from reality. 

Besides, a bigger faster CPU generally consumes more power, throw more hardware at it is rarely the right answer if a software solution exists. I see little problem in adding ram, but there is no good universal fix for timing slop except to narrow it down to actual CPU cycles. 

Besides, C is really good at mixing the two. 

an impressive demonstration of what can be done with an atmega88 and assembly (it is admittedly madness, but demonstrates lots of precise timing solutions and space utilization):
https://www.youtube.com/watch?v=sNCqrylNY-0


Voting for complete prohibition of assembler is voting for ignorance.

I've actually seen something of a resurgence of assembler in microcontrollers recently, and given the totalitarian attitudes of the last decade, that is a good thing.


----------



## dcb (Dec 5, 2009)

I guess the absolutism is what gets me. It would be like someone saying:
you shouldn't use codeblocks, there are "better" IDE's
you shouldn't use STM, because arduino DUE.
if you solder on your controller, you have the wrong controller.

Etc. etc. An endless stream of preferences being presented as dogma. And with each generation, we have less understanding of what is going on, and more costs and overhead.


----------



## PStechPaul (May 1, 2012)

That demo apparently did the sound processing during the horizontal blanking periods, and other processing during vertical blanking. That is reminiscent of the old Clive Sinclair's ZX80/81, which did that in "slow" mode on a 3.25 MHz CPU with only 1k RAM and 4k EPROM. It used some of the extended 8 bit ASCII characters as tokens for assembler commands.

https://en.wikipedia.org/wiki/ZX80

I think all programmers should learn the basics of logic (NAND, NOR, NOT) and basic hardware functions (flip-flops, adders, shift registers), and the basic assembler code for simple programming. Just as it is important for most people to learn basic number theory, manual addition, subtraction, multiplication, and division, and also learn how to use a slide rule (and why it works). There is a recent movement (reform math) that assumes everyone has access to a calculator and no need for manual processes, but I think it's important to know the basics. 

It is already evident that the proliferation of cell phones has largely compromised peoples' ability to think for themselves and converse face-to-face, and the "drive by wire" and collision avoidance measures may eventually eliminate the ability to drive safely and perform maneuvers like parallel parking. I think it is similar in the case of programming. 

Of course, writing a Windows GUI program requires a high level language with a great deal of abstraction from bit-banging code, but for microcontrollers I contend that you should refer to a copy of the chip's data sheet for details on registers and architecture, unless you are doing hobby-level work on a BASIC Stamp or Arduino. I do most of my PIC programming using C, especially since I have a good optimizing compiler, but occasionally I need to fine tune timing of ISRs or reduce latency and overhead, or make sure certain code is located in a particular place in flash memory, and that generally requires some assembler and a deeper level of knowledge.


----------



## jhuebner (Apr 30, 2010)

dcb said:


> I guess the absolutism is what gets me. It would be like someone saying:
> you shouldn't use codeblocks, there are "better" IDE's
> you shouldn't use STM, because arduino DUE.
> if you solder on your controller, you have the wrong controller.
> ...


That might be down to my communication skills  Sorry about that.
Optimization is a topic that can get a rise out of me because I have seen so much ugly code being excused like "oh there are no subfunctions out of performance reasons". And developers being too focused on (often pointless) optimization instead of a clean, maintainable software structure.

Regarding CodeBlocks: you won't see me defending it, I'm still using it out of pure laziness 



PStechPaul said:


> I think all programmers should learn the basics of logic (NAND, NOR, NOT) and basic hardware functions (flip-flops, adders, shift registers), and the basic assembler code for simple programming. Just as it is important for most people to learn basic number theory, manual addition, subtraction, multiplication, and division, and also learn how to use a slide rule (and why it works). There is a recent movement (reform math) that assumes everyone has access to a calculator and no need for manual processes, but I think it's important to know the basics.


Absolutely agree.
I regard the knowledge of assembler as a useful skill especially when things go wrong. The faulty register of a CPU (I mentioned that test earlier) could only be found by stepping through the assembler code. And that requires understanding that code.
Using the STMs timer hardware is not going to happen without looking into the data sheet for hours and hours 

But programming in assembler in the first place is a bit like analyzing your electronic circuits by hand instead of using spice, just because you can. Yes, you should know whats going on under the hood but that doesn't mean you have to do it manually.

So, to make this discussion a bit less off topic and return to the inverter: the project in its current state does not require any hand optimization what so ever because the CPU is mostly idle. The focus can lie on functionality and beauty of code (still work to be done...)


----------



## jhuebner (Apr 30, 2010)

Tomdb said:


> Anyone got the web interface working on a windows pc?


Yes, I just have. I will fix the php_serial class and let you know. In the meantine you can get some apache/php stack for windows (e.g. EasyPHP) plus the dio library for php 5.4 
Unpack the php_dio.dll to the php extension directory (on my machine: c:\Program Files (x86)\EasyPHP-DevServer-13.1VC9\binaries\php\php_runningversion\ext\)

Register the extension by opening binaries\conf_files\php.ini and add the line

```
extension=php_dio.dll
```
 where the other extensions are (line 900 in mine)

Now check if EasyPHP still starts and you're good to install the update.


----------



## jhuebner (Apr 30, 2010)

Ok, updated the web interface and the readme file.


----------



## jackbauer (Jan 12, 2008)

Epic day. Went out this morning to fire up Der Panzer. Turned the key to start and the motor gave a lound thump and stopped. No more response to the key. Connected laptop to find UDC very low. 160A fuse blown on the HV side. Replaced fuse and went to reconnect. FLASH,BANG,KERPOW! Both of the Panasonic contactors from my trustyFluence pack that I had used on the controller had welded closed resulting in no precharge. Yes I should have checked before attempting a reconnect. So : One channel had its transorb , ACNW3190 driver and DC DC converter blown. Replaced these and ran some tests with a lightbulb in series to prevent any more fireworks. No motor action and the inverter whine sounded "wrong". Got out the scope. All 6 transistors were driving fine on the gates but what's this .....the channel thad had blown was ringing slightly on the gate where the other 5 were solid square waves. Broke out the HV differential probe and looked at the C-E on all 6 IGBTS when running at Fslip 10 ampnom 10 in manual mode with light bulb current limiter on the HV. The bad one was displaying a funny sort of "double dip" on it's C-E. Replaced the module and rewired everything and we are back in business.

Has anyone ever experienced and IGBT to half fail? I can test this on the bench with a 12v lamp and it switches it on and off no problem. 

More critically , what the heck caused those Panasonic contactors to weld. Cause or effect? One thing I don't like is the idle ramp up is super fast. With the torque converter and flexplate on the shaft it takes an almighty surge when starting up. 220A at 275v on my Fluke! IS there any way to slow the ramp up when starting up on idle?

Also the throttle is very coarse. Perhaps my settings? I disabled idle selected R to reverse out of the shed and gave it a little gas. The motor wound up and I headbutted the steering wheel

Thoughts?

P.S. anyone have any CM600DY 12NF IGBTs spare?


----------



## jhuebner (Apr 30, 2010)

I only have a crude theory about the IGBT failure. I think something caused the DC/DC to fail which leaves only the voltage in the 100µ caps to supply the driver. As that only starts to lock out at 11V Vcc-Vee you are operating the IGBT with only 5.5V for at least one cycle which is dangerously close to its threshold voltage. Linear region - bang. The root cause for the DC/DC failure is till to be determined. Over temperature? Current surges? (Unlikey with the 100µ caps)



jackbauer said:


> One thing I don't like is the idle ramp up is super fast. With the torque converter and flexplate on the shaft it takes an almighty surge when starting up. 220A at 275v on my Fluke! IS there any way to slow the ramp up when starting up on idle?
> 
> Also the throttle is very coarse. Perhaps my settings? I disabled idle selected R to reverse out of the shed and gave it a little gas. The motor wound up and I headbutted the steering wheel


Concerning the idle ramp you can lower idlekp. There is no ramp, just a simple P-controller. If that doesn't help I'll have to think of something else.

Concerning throttle I can't tell how much of it is caused by the motor and how much by the transmission. Is just as bad with the idle loop enabled? How about the forward gears?

You can use the BMS input to limit throttle. I have connected the BMS input to the reverse gear contact and am limiting throttle to 30%. That function requires an update to the recent software.


----------



## Weisheimer (May 11, 2009)

Damien,

Your failures were most likely started by a failed DC/DC and then cascaded from there.

As regards the throttle sensitivity and ramp up rate, did it change after the failure, or was it always that way?


----------



## jhuebner (Apr 30, 2010)

Any failed DC/DC on the EMW charger? It's the exact same part and the gate driver design is the same also, except for the extra TVS diode.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Any failed DC/DC on the EMW charger? It's the exact same part and the gate driver design is the same also, except for the extra TVS diode.


Yes, when on EMW charger i used HCPL-3120 and same DCDC Recom modules. Everytime when DCDC, IGBT or driver were gone they left together.... Now when i use 4A Si chips it seems that driver can take the short of the DCDC and survive. Just now one DCDC went up in smoke and when i replaced it i figured i unknowingly applied 12V on 5V power line. Normaly 5V DCDC was toast. I was surprised other DCDCs were ok, and Also IGBTs are ok... 

A


----------



## PStechPaul (May 1, 2012)

The DC-DC in the EMW charger I'm working on was blown, but the IGBT and A3120 were OK, although they may have been replaced by the owner. I have seen various DC-DC converters in these chargers, and I replaced this one with an NMV1215SC (which is only 1W but has 3kV isolation). Here is the spec sheet for the Recom, showing only 1000V isolation. The short circuit safe duration is 1 second, but they have a version that can withstand continuous short:
http://www.recom-power.com/pdf/Econoline/RD.pdf

There is a Murata MGJ2 DC-DC specifically made for IGBT drivers and it has 5200 V isolation as well as continuous short circuit protection. The output is +15/-5 with other versions of +15/-8.7 and +20/-5.
http://www.mouser.com/ProductDetail/Murata/MGJ2D121505SC/?qs=%2fha2pyFaduhVE7q8JK1y6fBvHiYxaT0%252bpBXkXrgKvnM8m5y3mYefNt8jnbbdR2E1

Remember that the 1kV isolation is only a test voltage and the actual working voltage is generally about 1/4 of that. The device should have a special "hardened" insulation system to be safe and reliable at high power levels. See page A-3:
http://www.recom-power.com/fileadmin/Media/Folder-Flyer/App_Notes_27112014.pdf


----------



## arber333 (Dec 13, 2010)

PStechPaul said:


> The DC-DC in the EMW charger I'm working on was blown, but the IGBT and A3120 were OK, although they may have been replaced by the owner. I have seen various DC-DC converters in these chargers, and I replaced this one with an NMV1215SC (which is only 1W but has 3kV isolation). Here is the spec sheet for the Recom, showing only 1000V isolation. The short circuit safe duration is 1 second, but they have a version that can withstand continuous short:
> http://www.recom-power.com/pdf/Econoline/RD.pdf
> 
> There is a Murata MGJ2 DC-DC specifically made for IGBT drivers and it has 5200 V isolation as well as continuous short circuit protection. The output is +15/-5 with other versions of +15/-8.7 and +20/-5.
> ...


Very good!!! I will totaly buy couple of those to power my new 3phase charger!!!

TNX

A


----------



## jhuebner (Apr 30, 2010)

Thanks for that one Paul 

Here is the 5V (input) version:
http://www.mouser.de/ProductDetail/...GsmoEFRKS8O6J06AyJhRcBm1O81hhHcpX8p20SqA27Q==


----------



## dcb (Dec 5, 2009)

as a general rule, would it make sense to use 12v input dc-dc converters? since the 12v system is tyically fairly high capacity already?


----------



## jackbauer (Jan 12, 2008)

I have ordered some MEJ2D0515SC parts as replacements. Hopefully they will work out better.


----------



## jackbauer (Jan 12, 2008)

Just reading the data sheets I've ordered some MGJ2D051505SC parts as they look to be designed for the application specifically as Paul says.


----------



## jhuebner (Apr 30, 2010)

dcb said:


> as a general rule, would it make sense to use 12v input dc-dc converters? since the 12v system is tyically fairly high capacity already?


Assuming that the inverter is run with 12V anyway, it would be an option. Would also take some load off the 5V regulator.
I made this choice back then because I though some might run the inverter at different voltages and the 5V is a regulated, known voltage.
EDIT: just checked the data sheet again and the input range is 10.8-13.2 . So if you're running with lead acid and 14.4V you're above that..



jackbauer said:


> I have ordered some MEJ2D0515SC parts as replacements. Hopefully they will work out better.


Ok cool. They should also run at 4/9 lower power. 20²=400 vs. 30²=900 for the coefficient of P=Ug²/Rg*(ton+toff)*fPWM


----------



## jackbauer (Jan 12, 2008)

So I decided to bite the bullet and redesign the driver board to use the SMD version of the ACNW3190 driver and the IGBT drive rated Murata DC-DC. Please see attached photo and comments welcome I'll fire the pcb files off to SEEEDStudio tomorrow and get 10 or 20 pieces. Anyone interested can have them at cost as I'll have a few spares

The holes are spaced for the CM600DY-12NF igbt but will work with other I'm sure.


----------



## jhuebner (Apr 30, 2010)

One comment: there is no clear split plane between the LV and HV section. The gate contacts will match any module, never seen a different arrangement.


----------



## jackbauer (Jan 12, 2008)

Good point! I'll do some re tracking tomorrow


----------



## arber333 (Dec 13, 2010)

OK now we are spinning again. 
Tomorrow i will mount encoder and prepare connections in car. I still have to prepare water lines and pump to get any real power out of the controller.
300VDC calls... .


----------



## AntronX (Feb 23, 2009)

jackbauer said:


> So I decided to bite the bullet and redesign the driver board to use the SMD version of the ACNW3190 driver and the IGBT drive rated Murata DC-DC.


I don't like how your routing job looks. Make driver power supply traces wider. Move decoupling caps closer to the driver chips. Maybe even pour ground planes to protect drivers from EMF.

Edit: *Put some distance between R6 and R3!* There will be pack voltage potential between them.


----------



## PStechPaul (May 1, 2012)

You also might be able to put all the tracks and pads for the high voltage portion on the top side, and the low voltage circuitry on the bottom, although there will be some thru-holes that will be on both sides. It would probably not be cost-effective to ship boards to the US from Ireland, or I might be interested in a couple pieces. 

Anyway, I plan to make a new driver board for the EMW charger and I'll offer them locally. I don't think I'll use the QC PCB connectors, as they are made from unobtainium and I don't trust them as the only means of mounting the driver board to the power board.


----------



## dcb (Dec 5, 2009)

fyi, this is what I'm using for my cm600 igbt's (need 6 driver boards since they aren't duals)
http://dirtypcbs.com/

they work with eagle files directly, and $14 for ~10 boards is unbeatable, will post an eagle file when I get to it.


----------



## jhuebner (Apr 30, 2010)

Awesome! I pay 5x that. Made in Germany which rather ensures high employer standards I presume...


----------



## dcb (Dec 5, 2009)

I don't know that they are production quality, but useful for keeping prototyping costs down (assuming enough of them are useable upon inspection).


----------



## jackbauer (Jan 12, 2008)

Decided if I was doing a redesign to go all the way! Using the Avago ACPL337J chip with lots of nice protection features. This should result in a board that is still simple at heart with low component count but offer the features of much more complex expensive solutions. PCB in progress....

Plan to use the Fault and UVLO o/p to trigger the E-Stop on the main board.


----------



## PStechPaul (May 1, 2012)

I was wondering about the formula for determining the power needed to drive an IGBT gate:

P=Ug²/Rg*(ton+toff)*fPWM

For a 30V gate voltage swing, with 10 ohms gate resistance, 100 nSec ton and toff, and 20 kHz PWM, I get:

(900 / 10 ) * 0.2uSec * 0.02MHz = 0.36W

Is this correct? Otherwise the ton and toff might be better calculated as the TC of the gate resistor and gate capacitance, which typically about 6nF for a TC of 60 nSec, which is even less than my estimate above. And the current through the resistor would need to be integrated over the charge and discharge times, making power even less. 

There will also be whatever power is consumed by the gate driver, and that may be greater than that in the gate resistor. The A3120 appears to have a power dissipation less than 300 mW. So I think a 1W DC-DC should be adequate for under 20 kHz. Its current capacity is not an issue because the current for the charge and discharge pulse is taken from the output filter capacitors which are many times larger than the gate capacitance.


----------



## jackbauer (Jan 12, 2008)

Thinking about the driver schematic , is it fair to use the top side kelvin emitter as the bottom side collector connection for the bottom side desat?


----------



## jackbauer (Jan 12, 2008)

Take two


----------



## jackbauer (Jan 12, 2008)

Boards ordered from Seeedstudio. Should be here in about 10 days. Next move is to make a 6 way board. IE a full three phase driver card.


----------



## Tomdb (Jan 28, 2013)

Are you going for direct mounting to the igbt's? 

Why bunch all the boards togethor? I believe you want a short a path as possible from the gate driver to the IGBT and when making a single board this make you less flexible. 

But what I am really interested in is the total parts cost, with or without pcb.


----------



## PStechPaul (May 1, 2012)

I would at least lay out the board so that the drivers could be cut and separated and then connected with ribbon cable or similar means. That would provide more flexibility.

Here is a simulation of an IGBT gate drive using 10 ohms and 6800 pF at 20 kHz and +/-15V. Power seems to be well under 100 mW:










However, adding series resistance to the gate capacitor and 1 ohm to the source, plus a filter capacitor with ESR, the power exceeds 1 watt:


----------



## jackbauer (Jan 12, 2008)

I have ordered 15 pieces of the dual board so will try that first.


----------



## kennybobby (Aug 10, 2012)

jackbauer said:


> Take two


Is this intended to mount to the CM600DY-12NF igbt? If this is to scale, then the spacing for the terminals doesn't look right.

These igbt are duals and have both a top and bottom transistor--are you just using half of each device for some reason?


----------



## jackbauer (Jan 12, 2008)

It's a dual driver. High and low side.


----------



## EVElvis (Jun 20, 2009)

Hi

Sorry to change the subject a bit. Im not as far advanced with my kit. Greatly appreciate the help provided on this thread. 

Please can anyone suggest why I cannot install the firmware? Tried Lubuntu and my raspberry Pi. Both give me the error shown in the attached picture.
Any suggestions greatly appreciated.

Cheers
Tim


----------



## jhuebner (Apr 30, 2010)

EVElvis said:


> Hi
> 
> Sorry to change the subject a bit. Im not as far advanced with my kit. Greatly appreciate the help provided on this thread.
> 
> ...


You are using a binary compiled for i386 cpus on an ARM CPU. Thats causing the error.

You can use the python version of the updater:

```
python updater.py -f stm32_sine.bin -d /dev/ttyUSB0
```


----------



## EVElvis (Jun 20, 2009)

Thanks Johannes
Never have worked that out myself. 
Not quite there yet and get another error as shown in attached. 
Ill try again after dinner. 
cheers
Tim


----------



## arber333 (Dec 13, 2010)

I ve been busy this weekend. I made a shelf to install components to AND provide cooling air flow across the motor.
Also i made encoder hub and encoder disk. This will be optical encoder also and will use 60 slots. 
Its so hot here i have to wait till 8pm to work in my dungeon... Hence progress is slow.


----------



## kennybobby (Aug 10, 2012)

arber333 said:


> I ve been busy this weekend. I made a shelf to install components to AND provide cooling air flow across the motor.
> Also i made encoder hub and encoder disk. This will be optical encoder also and will use 60 slots.
> .


From the picture it looks like there is already some sort of encoder/speed sensor on the end of that motor, maybe a magnetic pickup device with a toothed wheel?


----------



## arber333 (Dec 13, 2010)

kennybobby said:


> From the picture it looks like there is already some sort of encoder/speed sensor on the end of that motor, maybe a magnetic pickup device with a toothed wheel?


Yes, its toothed wheel and magnetic pickup sensor, but currently it does me no good, since it is quadrature encoder phase A,B and signal powered by 12V. I would have to design a circuit that would change power level to 3V3 and change signal to collector low pulse. 
I am ME first and for me it is easier to design new encoder than convert signals...

A


----------



## jhuebner (Apr 30, 2010)

EVElvis said:


> Thanks Johannes
> Never have worked that out myself.
> Not quite there yet and get another error as shown in attached.
> Ill try again after dinner.
> ...


Ok, a py-serial is missing. You'll have to do something like

```
sudo apt-get install python-serial
```


----------



## jackbauer (Jan 12, 2008)

Some modifications to the main board :
1)Replaced IDC input with 35 pin PCB mount right angle Ampseal connector.
2)Deleted opto encoder components. Now just straight npn open collector.
3)IGBT drivers now on 6 way individual Molex SL connectors to be compatible with new ACPL-337J driver boards. Just plug and go.
4)Connection to sensor board via 8 way Molex SL. Plug and go.
5)UVLO and FAULT signals from driver boards commoned and routed to spare pins on Olimex board.

To Do : Add parts to trigger an E-Stop on Fault or UVLO. Add pull up for encoder. Layout PCB.


----------



## jhuebner (Apr 30, 2010)

Hey Damien,

thats some great improvements!

I've recently done some small changes to the BOM if you're interested:

R3=R4=500R (removes the asymmetry in the encoder low pass)
Remove R20, make R19=10k
C13=C14=1nF
R8=R10=3.3k

You could use the remaining NAND-gate to add the UVLO and FAULT signals to the PWM inhibit. That would require to all connect them to one common pull up i.e. you could no longer distinguish which of the signals fired. Otherwise use a hex AND tree.

While you're at it you may want to add 5V to JP5


----------



## jackbauer (Jan 12, 2008)

Good idea! Also have to bring the serial port out on the Ampseal and add throttle scaling to use BMW hall effect pedal or any other 0-5v throttle source.


----------



## jackbauer (Jan 12, 2008)

I would also like to add a tacho drive output. I appreciate this would require some coding but from a hardware perspective is there any pin preference?


----------



## jackbauer (Jan 12, 2008)

Layout in progress... 

UVLO and Fault signals from the IGBT driver boards now enable the PWM inhibit system. Throttle has scaling resistor and serial lines brought out to the Ampseal. GND and 5V will be on planes.


----------



## Tomdb (Jan 28, 2013)

Very nice, you make it seem so easy. Hope this will all work as planned.


----------



## jackbauer (Jan 12, 2008)

Ordering PCBs this weekend so if anyone wants one ....


----------



## EVElvis (Jun 20, 2009)

jhuebner said:


> Ok, a py-serial is missing. You'll have to do something like
> 
> ```
> sudo apt-get install python-serial
> ```


Thanks again Johannes, your a star!
sorted now. 
Copied file here:
https://pypi.python.org/pypi/pyserial
Then followed:
Using 'file manager'
Copy the file into /home/pi
Double click on pyserial-2.7.tar.gz
Choose 'Action'
Choose 'Extract'
double click on pyserial-2.7.tar0
Choose 'Action'
Choose 'Extract'
Open LXTerminal
type cd pyserial-2.7
press Enter
type sudo python setup.py install
press Enter

Then as you said:Code:
python updater.py -f stm32_sine.bin -d /dev/ttyUSB0


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> I would also like to add a tacho drive output. I appreciate this would require some coding but from a hardware perspective is there any pin preference?


That would have to be TIM4_CH1 on pin PB6 and that is already in used as an input pin. All other timers are already in use.

The next software release will give you choice for the PWM output: tmpm, tmphs or speed


----------



## jackbauer (Jan 12, 2008)

jhuebner said:


> The next software release will give you choice for the PWM output: tmpm, tmphs or speed


Excellent! I'll just add an optional pullup on that pin to +12v. Will it be configurable for impulses per revolution? ie 2ppr for 4 cylinder , 4ppr for 8 cylinder tach etc?


----------



## jackbauer (Jan 12, 2008)

Or as a possible alternative , Is Sig_On used? Could this become Sig_Start thus freeing up PB6?


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> Excellent! I'll just add an optional pullup on that pin to +12v. Will it be configurable for impulses per revolution? ie 2ppr for 4 cylinder , 4ppr for 8 cylinder tach etc?


It's not like that. The frequency is fixed and the pulse width varies. Frequency must stay fixed because the same timer is used for the over current reference voltages.



jackbauer said:


> Or as a possible alternative , Is Sig_On used? Could this become Sig_Start thus freeing up PB6?


I recently assigned it to cruise control. You can always remap stuff but the software wouldn't run 1:1 on that.


----------



## jackbauer (Jan 12, 2008)

Ok....might not be possible so. Pity.


----------



## jackbauer (Jan 12, 2008)

Layout done! Now just make a last few tweaks then order some boards


----------



## PStechPaul (May 1, 2012)

Looks pretty good, but I don't understand the need for the 35 pin connector with only a few pins connected to anything, and needing such fine traces with little clearance from track to hole. I assume it must be to maintain compatibility with some sort of standard, and I don't have much familiarity with this product, so there must be a good reason. Looking closer, there might be only 10 unused pins, and those may be ground, so my initial assessment may be flawed. 

A 37 pin two-row D-sub would have more space between pins, although perhaps too wide for the board, but perhaps the hole size and pad diameter could be reduced on your design to allow for heavier tracks and better clearance. Also maybe the tracks could be "necked down" only where needed between pins, and the pads could be made octagonal to get more space between while maintaining adequate surface for soldering.

Also, many of the connections could be rerouted to avoid going between pins. It's often better to have a few more feed-thrus and longer runs, than run tracks between pins. And the tracks to the inner row of pins can be zig-zagged to utilize the full clearance between pads at 45 degrees rather than the straight run which has very little clearance.


----------



## AntronX (Feb 23, 2009)

jackbauer said:


> Layout done! Now just make a last few tweaks then order some boards


It looks like your copper pour to trace spacing is 6 mil (0.152 mm). You should increase your spacing to 12 - 16 mil to be safer. I usually try to keep it at 14 mil (0.35mm) when using Oshpark PCB service. There is no reason why you need to be operating at the spacing limit of many 2 layer board houses. If you are sending this design to China, good chance your boards will have shorts.


----------



## arber333 (Dec 13, 2010)

YAY!

Controller works fully with encoder support. I put 60ppr and motor starts good. For 5V to 3V3 conversion i used optocoupler wired like on the picture:

Motor is very powerful however and i can easily trip OC protection. It seems that is because of motor wiring 75VRMS er phase. Now that i will run it at 300VDC should i expect lot of OC tripping?

I tried it first with 120VDC up to 250A OC limit. Next i have to connect all batteries to make 300VDC! That should be interesting.

A


----------



## jackbauer (Jan 12, 2008)

Thanks for the tips folks. Ordering boards in a day or so...


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> YAY!
> 
> Controller works fully with encoder support. I put 60ppr and motor starts good. For 5V to 3V3 conversion i used optocoupler wired like on the picture:
> 
> ...


Sounds very promising!
What did you set ocurlim to?
It should be you expected RMS current times 2.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Sounds very promising!
> What did you set ocurlim to?
> It should be you expected RMS current times 2.


Huh so much! Now i set it to 250A. Do you think i should set my OC limit to 500? I have 300A Fuji 2MBI300S-120 IGBTs and i think they will manage....BUT motor has low inductance and fat wire and i think it could regularly pull 500A if i let it.

Hm and how to set "boost"? Is there some equasion or rule of thumb how much boost voltage you need to start?

Oh i have to ask about "dead time". Now i use value 28, you think i should set it longer? 

A


----------



## jackbauer (Jan 12, 2008)

With the Main and IGBT drive boards sorted it's time to look at the sensor board. As much as I love the simplicity of the resistor divider method of reading the HV bus voltage I'd prefer isolation. Very simple to achieve using the Avago ACPL C87a. It's designed for the task and easy to use the existing quad opto for the diff mode voltage. Yes it is SMD but in a very easy to solder wide SOIC package. I'm going to lay out the card for the Tamura 800A current sensor. Go big or go home


----------



## PStechPaul (May 1, 2012)

If you have room, you may want to double track the board so you can alternatively use a differential amplifier, and it may be possible to use a line side simple resistor and zener power supply if the 15-20 mA at 350 VDC (5-7 watts) does not cause a problem. I like having contingency plans and simple, if not maximally efficient, solutions to a requirement.

Another possibility is using a little switching supply off the 350V bus. I bought a 12V 5W supply that runs off AC or DC up to 370V and they are only about $4:
http://www.ebay.com/itm/12V-400mA-5...-Module-12V-Switch-Power-Supply-/191151066858

And here is a 5V 3.5W supply (30x20x18mm) for $2.30 including shipping (how do they do that?):
http://www.ebay.com/itm/5V-700mA-3-...r-Module-AC-DC-Step-Down-Module-/201073789345

Maybe some crazy ideas - maybe not.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Huh so much! Now i set it to 250A. Do you think i should set my OC limit to 500? I have 300A Fuji 2MBI300S-120 IGBTs and i think they will manage....BUT motor has low inductance and fat wire and i think it could regularly pull 500A if i let it.
> 
> Hm and how to set "boost"? Is there some equasion or rule of thumb how much boost voltage you need to start?
> 
> Oh i have to ask about "dead time". Now i use value 28, you think i should set it longer?


The over current protection works with the peak current value. So if you run 250A RMS that is 352A peak. Since there can always be short transients you need to add a little head room. May 2x is a bit too generous but I hope you get the idea.

You could probably try to measure the ohmic resistance of your motor by applying some DC current and measuring the voltage drop. That voltage drop would be your boost. In addition I think the IGBT saturation voltage play a role in that. So best thing is to try and get your controller not to run into over current when starting up at ful throttle and on the other hadn provide good starting torque.

deadtime=28 is 800ns. Maybe increase it a bit to have some headroom. I'm running with 64 (=1.5µ) but that is with 1200V/400A igbts and 2.5A drivers.


----------



## jackbauer (Jan 12, 2008)

Sensor board done. Using a 1W 5.2kV isolated DC DC on the DC link monitoring. Decided to settle on the LEM HTFS current sensor as it comes in a variety of sizes , is cheap and was originally used on the DMOC anyway. I have layed out the board to have the current sensors on 62mm centers as this is what I need for the DMOC heatsink. Ordering full sets of boards tomorrow.


----------



## Tomdb (Jan 28, 2013)

Great work Damien. 

Are you going to make the bom lists and pcb files available?


----------



## kennybobby (Aug 10, 2012)

Is that layout drawing supposed to be the 'done' version? If so then i think you are a few traces short of playing with a full deck.


----------



## Tomdb (Jan 28, 2013)

Top layer is Vcc plane fill and bottom is ground plane fill.

So some components appear to float 

Damien why mix and match smd with through hole?


----------



## jackbauer (Jan 12, 2008)

kennybobby said:


> Is that layout drawing supposed to be the 'done' version? If so then i think you are a few traces short of playing with a full deck.


The 5V and GND are on the planes!

I will indeed post the design files and BOMs as soon as I verify the boards work. I don't want anyone going off and building a board with a design flaw.


----------



## jackbauer (Jan 12, 2008)

Tomdb said:


> Damien why mix and match smd with through hole?


The ACPL C87A is only available in SMD. I chose SMD decoupling caps in order to keep them as near the pins of this part as possible. While I could have made the card full SMD I'm conscious of the fact that not everyone is comfortable soldering these parts.

My next move here is a single board design and that will be SMD as I want to get them made at a PCBA house.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> That would have to be TIM4_CH1 on pin PB6 and that is already in used as an input pin. All other timers are already in use.
> 
> The next software release will give you choice for the PWM output: tmpm, tmphs or speed


I figured i would like to use TMPM PWM output with differential voltmeter LED. 
http://www.ebay.co.uk/itm/12v-24v-L...531?pt=LH_DefaultDomain_3&hash=item2edd85e9f3
It changes color from green at 13V to yellow at 12V and red at cca 11V and below 10V it flashes red. How do you suppose your PWM drives the output? Is it 12V output? Would it show cca 10V at 130°C? That would be great.

Also another question regarding cruise mode. Can you set the program up so that we could use a button. That would mean that controller would change state when this is pressed and will hold this for as long as any negating impulse comes along eg. brake input or error... It would be much easier than using actual switch.

TNX


----------



## jackbauer (Jan 12, 2008)

Boards ordered. Now to get the BOMs done and get ready to build. Thanks to all who made suggestions. Any mistakes are my own


----------



## Tomdb (Jan 28, 2013)

Mind telling us which board house you decided to go with and why?

(going to be ordering my own soon so doing some research)


----------



## jackbauer (Jan 12, 2008)

Went with Seeedstudio. Have used them in the past with good results. 2 weeks to my door , good quality , good price and no customs nonsense.


----------



## jhuebner (Apr 30, 2010)

Quote isn't working...

> I figured i would like to use TMPM PWM output with differential voltmeter LED.

The output is open collector. So you connect the positive of you LED to 12V and the negative to the output. Put about 100µF in parallel to suppress the 8kHz ripple.

The duty cycle formular is dc=tmpgain*tmpm + tmpofs where 4096 is 100%

tmpgain would have to be negative (which is currently out of range, can fix that). So you would set tmpofs to 4596 and tmpgain to -10. That gives you 100% or [email protected]°C assuming a LiFePo4 aux battery and 80% PWM / [email protected]°C

> Also another question regarding cruise mode. Can you set the program up so that we could use a button.
> That would mean that controller would change state when this is pressed and will hold this for as long as any negating impulse
> comes along eg. brake input or error... It would be much easier than using actual switch.

Thats what it currently does. Although I'm currently in doubt whether the cruise control is reset on error


----------



## jhuebner (Apr 30, 2010)

Here is a new version of the firmware


```
- Added automatic current offset calibration, parameters ilXofs removed 
- Added choice for PWM output: tmpm (as before), tmphs or speed. Controlled by pwmfunc 
- Parameters tmpgain and tmpofs renamed to pwmgain and pwmofs, respectively 
- Added filter before cruise control, controlled by speedflt 
- Added heatsink temperature derating, below 85°C 100% power, between 85°C and 87°C 50% power and no power above 87°C 
- Reset cruise control in stop mode 
- Added some more comments - Refactoring
```
I haven't tested it on board yet so the former version remains the latest stable one. For anyone interested in testing, here it is:
http://johanneshuebner.com/quickcms/files/inverter-2.82.zip


----------



## Tomdb (Jan 28, 2013)

I would love if the temperature derating could be "tune-able" So a parameter that can be calibrated after Firmware flashing. 

Have not looked at your new code, how are you implementing it, especialy which part of the calculation this happens and what kind of funciton?


----------



## jhuebner (Apr 30, 2010)

Yes, can do that.

Here's the code:


```
int Throttle::TemperatureDerate(s32fp tmphs)
{
    if (tmphs < TMPHS_MAX)
       return 100;
    if (tmphs < (TMPHS_MAX + 2))
        return 50;
    return 0;
}
```


----------



## jackbauer (Jan 12, 2008)

So I think I might be able to explain the welded contactors. Was running some pre charge tests this evening using a filament lamp. Pack voltage 280v , reading 282v in the inverter. UDCSW set at 250v. Placed a 100w 240v filament lamp in place of the pack fuse. At key on the negative contactor and precharge relay close (pre charge resistor is 10R 100w) and the lamp illuminates and begins to dim as the caps charge. Less than a second later the main contactor closes with lots of brightness left on the lamp so that over a period of cycles would have hurt the contactors. So i played with the parameters for UDCGAIN and UDCSW a bit where I could get the inverter to read 275v and set udcsw at 240v. Again with the lamp in place it statrs off bright and ran to fully extinguished but the main contactor never closed and inverter state equalled OFF. So I quickly recycled the key , not giving the bus caps time to discharge and all contactors close and inverter is in RUN mode. Is there a precharge time out somewhere in the code?

Once I got that sorted I started playing with the idle speed and idle kp. Had idlekp set at 1. Any larger number causes the motor to hunt between rpm. The startup at key on and 500rpm idle is very abrupt and my fluke clamp meter caught a 150A surge. Is there any way to have an idle soft start?

In other news , the new PCBs are processing hapilly I should have them in about 10 days. BOMs underway also.


----------



## jackbauer (Jan 12, 2008)

I can confirm that the precharge will not engage the main contactor if the precharge time is more than a few seconds. Currently using a 10R resistor from a 280v pack into 6 x 1800uF caps yields a max surge of 4.3A. Quite acceptable. Setting idle speed to 500rpm will cause a 120A surge on spin up. Not so good. Dropping this to 300rpm gives less than 20A surge and seems to be able to give satisfactory pump pressure in the gearbox to engage the clutches.

Is there anyway to change the throttle ramp? I seem to have a pot value of -30% at idle and indeed the first 30% of the throttle pedal does nothing.


----------



## Tomdb (Jan 28, 2013)

Currently not however some small adjustments with new values in throttle.cpp might do the trick 

Unless the changes discussed of shifting from speed to fslipnt throttle control.


----------



## jackbauer (Jan 12, 2008)

guess I'll have to figure out how to compile the source code


----------



## Tomdb (Jan 28, 2013)

From the potnom the following gets done to set Slip and Amp


```
{static void CalcAmpAndSlip(void)

   s32fp fslipmin = parm_Get(PARAM_fslipmin);
   s32fp fslipmax = parm_Get(PARAM_fslipmax);
   s32fp ampmin = parm_Get(PARAM_ampmin);
   s32fp potnom = parm_Get(VALUE_potnom);
   s32fp ampnom;
   s32fp fslipspnt;
   u32fp brkrampstr = (u32fp)parm_Get(PARAM_brkrampstr);

   if (potnom >= 0)
   {
      ampnom = ampmin + 2 * potnom;

      if (potnom >= FP_FROMINT(50))
      {
         fslipspnt = fslipmin + (FP_MUL(fslipmax-fslipmin, 2 * (potnom - FP_FROMINT(50))) / 100);
      }
      else
      {
         fslipspnt = fslipmin;
      }
   }
   else
   {
      ampnom = -potnom;
      fslipspnt = -fslipmin;
      if (Encoder::GetFrq() < brkrampstr)
      {
         ampnom = FP_TOINT(FP_DIV(Encoder::GetFrq(), brkrampstr) * ampnom);
      }
   }
   if (ampnom > FP_FROMINT(100))
   {
      ampnom = FP_FROMINT(100);
   }

   parm_SetFlt(PARAM_ampnom, IIRFILTER(parm_Get(PARAM_ampnom), ampnom, 3));
   parm_SetFlt(PARAM_fslipspnt, IIRFILTER(parm_Get(PARAM_fslipspnt), fslipspnt, 3));
}
```


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> I can confirm that the precharge will not engage the main contactor if the precharge time is more than a few seconds


Here is the start code. There is no programmed delay.


```
/* switch on DC switch above threshold but only if
    * - throttle is not pressed
    * - start pin is high
    * - motor protection switch and emcystop is high (=inactive)
    */
   if (udc > parm_Get(PARAM_udcsw) && parm_GetInt(VALUE_potnom) <= 0)
   {
      if (DigIo::Get(Pin::start_in) &&
          DigIo::Get(Pin::emcystop_in) &&
          DigIo::Get(Pin::mprot_in))
      {
         DigIo::Set(Pin::dcsw_out);
         DigIo::Clear(Pin::err_out);
         DigIo::Clear(Pin::prec_out);
         parm_SetDig(VALUE_opmode, MOD_RUN);
      }
   }
```
So, 5 conditions:
1. udc > udcsw
2. potnom <= 0
3-5. start, emcystop and mprot high

Then, 4 actions:
1. Close DC contactor
2. Open precharge contactor
3. Clear error output
4. Enter run mode

Precharge is closed when inverter starts without conditions. Maybe are you introducing a delay in you start signal somehow?

Have you tried setting idlekp/speedkp to a value < 1? I think 0.12 is the smallest possible value. You could also try decreasing boost a bit as you don't need full zero speed torque.


----------



## jackbauer (Jan 12, 2008)

That makes sense. I'll run a few more tests tonight. Does the start signal need to be high for the full precharge time? I think this is where I was having a problem.


----------



## jackbauer (Jan 12, 2008)

IGBT driver boards arrived. This is the first batch with the incorrect pitch for the DC DC but no matter it will do to test the circuit. Have new rev with the correct pitch and some extras on the way including tuning the desat blanking time and trigger level to suit more transistors.


----------



## PStechPaul (May 1, 2012)

It looks like you have a rather large footprint for your DC-DC converters, indicating that they may be 2 watts or greater. I think the actual power required may be much less, as I explained in a post a couple weeks ago:



> I was wondering about the formula for determining the power needed to drive an IGBT gate:
> 
> P=Ug²/Rg*(ton+toff)*fPWM
> 
> ...


I also ran a simulation which showed that it might be about 1 watt, depending on various parameters. Can anyone confirm or refute my findings, and determine an actual power requirement for the DC-DC? The IGBT-specific DC-DC supplies I found are 2W, and are reasonably enough priced not to be an issue, but I'd like to know what's really needed and how to determine the power requirement.


----------



## PStechPaul (May 1, 2012)

For some reason I can't edit my last post - it comes up with a blank. I just wanted to add a link to my previous post about the gate drive power:

http://www.diyelectriccar.com/forums/showthread.php/another-homebrew-ac-controller-45909p76.html


----------



## jackbauer (Jan 12, 2008)

Success! It works. Something very interesting happened. I built one side of one board as a test as can be seen in the pictures. Connected it to my "blown" Cm600dy module that I removed from the inverter figuring it would do for a test. The board would not drive the gate and kept tripping the "Fault" output. Now this transistor can be switched on and off just fine on the bench but would not run in the inverter in the E31. Changed to a know good CM600dy and it burst into life. So it would seem the ACPL-337J could detect the damage in the "blown" module. Desat detection works fine on the bench also.

Paul , I am indeed using the Murata gate drive part that you recommended. It is physically bigger than the 2W 1kv isolated parts I had used.


----------



## Tomdb (Jan 28, 2013)

Nice to see it coming along so fast. Keep up the good work, but dont forget to take the breaks you deserve.


----------



## jhuebner (Apr 30, 2010)

PStechPaul said:


> Can anyone confirm or refute my findings, and determine an actual power requirement for the DC-DC? The IGBT-specific DC-DC supplies I found are 2W, and are reasonably enough priced not to be an issue, but I'd like to know what's really needed and how to determine the power requirement.


I studied an 8A concept driver a while ago and they are also using a 1W model. So I think you do have a point.

Good work with the drivers!

I did a first shut of an assembly video. I noticed that I mumble terribly. Comments apart from that welcome


----------



## Tomdb (Jan 28, 2013)

Have to see quite clear and understandable. Even without a personal Mic.


However when showing computer things a screen capture is easier with voice over.


----------



## jhuebner (Apr 30, 2010)

Tomdb said:


> Have to see quite clear and understandable. Even without a personal Mic.
> 
> 
> However when showing computer things a screen capture is easier with voice over.


Yes, good one. Should be easy to reproduce.


----------



## jackbauer (Jan 12, 2008)

I watched the video while eating dinner. Very well done and informative. I have had some good results with the car. Changed boost from 1700 to 750 , idlekp from 1 to 0.7 and deadtime from 28 to 50. Starting surge on 500rpm idle is now an easy 20A. Changed brake param from 30% to 10% and throttle now feels much better. That Siemens motor is a beast. even at only 280V and with the gearbox running in emergency mode (4th gear) , it moves that big 840CI as well as any V8

I am very happy with the drivers. Going to do a few more tests over the weekend and run one all day at 8Khz to make sure no heating problems. When the new boards arrive I will build a complete set.


----------



## jackbauer (Jan 12, 2008)

So as it looks like my IGBT driver is at least working on the bench , here are the design files as promised. Format is DesignSpark PCB 7 but you don't need this as BOM and gerbers are included.


----------



## jackbauer (Jan 12, 2008)

Attached PDFs of schematic and pcb. Forgot to include in the zip.


----------



## Gurgel (Jul 22, 2015)

to : J. Huebner . This video is very important, very good at good resolution, the audio should be amplified in the next post (this is common in the youtube videos), after my kit arriving, I immediately I'll get the powerful IGBTs


----------



## arber333 (Dec 13, 2010)

Hi Johannes

As i said before, i have motor wound for 75VRMS! I was using it at 120VDC from battery and it ran fine albeit with huge RMS current demand.
Well now i tried your inverter at 300V and it works in a car! Yay! But... this was when i was running with wheels up. 
Yesterday i went and set up for drive testing. It went as follows:
1. I connected battery and phase cables.
2. I gave inverter 12V and i got communication with linux
3. I set up parameters relevant for 300V. Min slip i put at 3.2Hz as i calculated, Max Slip=6Hz, Fweak=180Hz and Fmax=240Hz. Min slip Freq=1Hz I had it set at 3Hz but it caused more oscillation. 
Boost worked best at 2400.

4. I tried to start and inverter worked. But when i pushed the pedal, car jumped forward and then stopped and the oscillation continued...
No matter what parameter i changed it either got worse or was the same as this.

I fear that my motor has less phase resistance than controller can manage. Probably i should get someone to rewind it to 180VRMS.
In the end i was trying to control RPM with clutch and i lost one phase, DCDC brick, driver and its caps! I will have to repair that...


What do you think?

A


----------



## jackbauer (Jan 12, 2008)

That is almost the exact failure mode i encountered. You have probably killed the IGBT also. In my case the inverter required a HUGE surge current on startup to get to 500rpm idle. My hope is with the new driver boards we can detect this and just shutdown without damaging hardware.


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> That is almost the exact failure mode i encountered. You have probably killed the IGBT also. In my case the inverter required a HUGE surge current on startup to get to 500rpm idle. My hope is with the new driver boards we can detect this and just shutdown without damaging hardware.


Well that is true, for surge protection you have better/faster detection. However this doesnt change anything, since my car would still be non-drivable because my motor requires too much current to spin. 
Now that i started to think about it again, i figure motor wants to spin to higher RPM than i want. I guess it is natural with having low resistance coils with 300VDC...

A


----------



## PStechPaul (May 1, 2012)

I have often heard about problems with low resistance and low inductance motor windings, but I don't understand why they cannot be dealt with. The peak current of each PWM pulse before saturation depends on the winding inductance, applied voltage, and time, so I can see where a low voltage motor driven from a high voltage source could quickly see current rise to the point of saturation, at which point only winding resistance (and the rest of the circuit) limits the current.

The construction and operating conditions of the motor may have some effect on the inductance. If the gap between the rotor and the stator is wide, the inductance will be lower, so for a rewound motor it may be important to choose one that has a tight fit. I would think such close spacing would also provide higher torque, but it may also contribute to friction at higher speeds due to the "windage" or resistance of air. Then again, it may act as an "air bearing".

The effective inductance is also influenced by the coupling of the stator to the rotor, and the inductance and resistance of the rotor squirrel cage will be reflected as a complex impedance at the motor's windings. 

In any case, however, there should be a practical lower limit to the possible inductance and resistance that can be presented to the controller by a motor and its connections, and the controller also should be able to withstand a short circuit. For that to be possible, there may need to be internal resistance and inductance that limit the di/dt of the current as well as its maximum value so that internal sensors have time to shut down the system before damage is done. 

Adding inductance to the motor lead connections, along with some capacitance, may be able to filter out the PWM carrier frequency to some extent and improve efficiency as well as reduce radiated noise and losses in the cables, motor windings, and bearings. I don't think such inductors would need to be very large or costly. Probably some ferrite, powdered iron, or even tape steel toroids, with a few turns of wire, would be sufficient.

Another idea I had was to make an adjustable voltage bus so that, at low speeds, a higher PWM value could be used, and a much lower dV/dt would be imposed on the motor windings. This could be accomplished with a simple buck converter front end that could reduce the bus voltage from, say, 350 VDC, to 180 VDC or even 90 VDC. The converter need not handle the maximum power requirement, as that could be accomplished by bypassing it entirely with a power relay. Another alternative would be a relay matrix that could connect two or four battery packs in combinations of series and parallel depending on need. Transition may be difficult, but there may be ways to smooth out the doubling or halving of the bus voltage.

This might be a topic for a separate discussion, if anyone thinks it may have merit. I think I have seen articles on something similar, and I may have even proposed it elsewhere some time ago. It may or may not be practical or even feasible, but it may be interesting to talk about.


----------



## Tony Bogs (Apr 12, 2014)

For an IGBT to survive this kind of short circuit (probably saturation at low PWM freq, no back EMF) slow turn-off is necessary. 
Otherwise the resulting voltage surge at the collector (-L dI/dt, L= bus bar inductance, dI/dt extremely high) will almost certainly exceed the allowed max Vce. 
Unlike mosfets, that have high energy avalanche capability, IGBTs are fried by overvoltage.
ACPL-33xJ family gate drivers have slow turn-off built in, so Damien's new gate driver should prevent IGBT failure if the bus bar inductance and other parts of the HV layout are within the limits for the power rating.
For more information on HV layout requirements: Semikron IGBT module application notes (chapter 5 of the Semikron power electronics manual). 

A dV/dt filter introduces additional inductance in the phase lines. For more information and design procedure: application note AN-1095 irf.com.

Forgot: if the overcurrent (sensor board) kicks in before the IGBT desaturates, the 33xJ desat detection and slow shut-off are inactive and the result could be the potentially deadly hard turn-off at high amps.


----------



## jhuebner (Apr 30, 2010)

Very sorry to read about those mishaps.

I can't see any problem with the parameters, except perhaps boost. 2400 (=19V) seems a bit much for a 75V (@50Hz?) motor. What other values did you try?

Seems like I might have to admit that over current detection reaches it's limits here. That said, with the boards that Damien has designed the current sensors could be made redundant.


----------



## jackbauer (Jan 12, 2008)

Got the full set of pcbs today. I think I'd like to keep the current sensors even if it's just to monitor current.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Very sorry to read about those mishaps.
> 
> I can't see any problem with the parameters, except perhaps boost. 2400 (=19V) seems a bit much for a 75V (@50Hz?) motor. What other values did you try?
> 
> Seems like I might have to admit that over current detection reaches it's limits here. That said, with the boards that Damien has designed the current sensors could be made redundant.


Yes but i tought i could make better start since slip is 3.2Hz. 

I also tried boost with 700, 1400, 2400, 3000, 4000! 
At 700 motor just threw OClimit, when pedal reached 30%, it didnt even turn. At 1400 it was turning but with too much force. With larger boost things just went worse...
I also varied with slip, max slip from 4Hz to 6Hz and i tried even low slip from 1.5Hz to 4Hz.

It just seems my motor is reacting to high voltage with acceleration that requires lots of amps. I can spin the motor in neutral but when loaded motor jumps dangerously.

A


----------



## Tony Bogs (Apr 12, 2014)

Contrary to what one might expect, inverter power devices are subject to high thermal stress peaks at low speed.
Source : Semikron power devices application manual. 

Fig 5.2.14 in chapter 5 (IGBT module application) shows the peaks in the junction temperature at startup (low phase frequency).

Fig 5.2.13 shows the huge steady state differences in junction temperature at very low freq (close to 0 Hz), 5 Hz and 50 Hz. Simulation result.

So it's better to think twice before running a setup at low phase freqs without checking the cooling.


----------



## jackbauer (Jan 12, 2008)

Boards are here. Now to get soldering. The 35 way Ampseal connector is a perfect fit on the new main board.


----------



## EVElvis (Jun 20, 2009)

Hi All
Just powered up the board and tested all ok as described in Johannes video. Just connected up to power with olimex board connected up to main board. Web interface opens up ok - localhost:8000.
Please can anyone tell me why my web interface does not show the parameter tables when connected up to board with olimex on? Software went on ok and green LED flashes.
Sure its something simple, but I am very green when it comes to this.
Any pointers appreciated.
cheers
Tim


----------



## arber333 (Dec 13, 2010)

EVElvis said:


> Hi All
> Just powered up the board and tested all ok as described in Johannes video. Just connected up to power with olimex board connected up to main board. Web interface opens up ok - localhost:8000.
> Please can anyone tell me why my web interface does not show the parameter tables when connected up to board with olimex on? Software went on ok and green LED flashes.
> Sure its something simple, but I am very green when it comes to this.
> ...


Hi

In folder Web Interface inside software you have one readme file that has instructions how to install PHPS (apache) server. When you do this then you should be able to start your interface.

You should start PHP server from console in web interface folder
sudo php -Slocalhost:8000

Keep the console open...

then you can start your browser and type
localhost:8000

Warning! I found out that in Lubuntu firefox browser remembers your input and suggest the address to you. If you just hit enter then web interface will not work completely. You should truly write "localhost:8000" and then hit enter!

It works for me...

A


----------



## EVElvis (Jun 20, 2009)

Thanks

Ill try later tonight, hopefully.

I run Lubuntu, after trying Ubuntu (Too much for my old laptop)

I did wonder whether I should have had the sensor board connected?

Now I have asked it should work 

Cheers

Tim


----------



## jhuebner (Apr 30, 2010)

Any error message?

I have had some problems with timeouts on my zigbee connection, maybe it can happen on the normal connection as well.

You can try downloading the current version of the web interface.

Also try connecting with a serial console program (like gtkterm) to narrow down the error.

You don't need any other board for the comms to work.


----------



## jhuebner (Apr 30, 2010)

Here is an updated assembly video:





Damien, I hope your new gate drivers fix the issues that are currently arising.

My 500V/100A setup is still spinning happily. I guess the rather high motor inductance helps a lot there.


----------



## Tomdb (Jan 28, 2013)

Nice video update.

Also Damien posted a good video on his adaptation. 

One quick question, when trying to power up my inverter via the IO's does it need to have HV connected to the sensor in order to run precharge, or can i just set these values at zero? as i don't wish to measure or run precharge via the controller.


----------



## jhuebner (Apr 30, 2010)

Tomdb said:


> One quick question, when trying to power up my inverter via the IO's does it need to have HV connected to the sensor in order to run precharge, or can i just set these values at zero? as i don't wish to measure or run precharge via the controller.


Yes, you can set udcsw to 0.

Where can we find Damiens video?


----------



## onegreenev (May 18, 2012)

jhuebner said:


> Yes, you can set udcsw to 0.
> 
> Where can we find Damiens video?


Here is where you can watch.


----------



## arber333 (Dec 13, 2010)

arber333 said:


> Yes but i tought i could make better start since slip is 3.2Hz.
> 
> I also tried boost with 700, 1400, 2400, 3000, 4000!
> At 700 motor just threw OClimit, when pedal reached 30%, it didnt even turn. At 1400 it was turning but with too much force. With larger boost things just went worse...
> ...


Well i made post mortem...

It seems that BANG was a killing blow. Top half of of middle IGBT was dead, nothing special...but, when i checked the last IGBT it broke apart in my hand! I guess i know now what that bang was. 

I still have to repair driver PCBs, but i have material now. Those IGBTs need to be replaced. I got a good deal on some Fuji 2MBI450U4E-120 igbts but they have Rg 0,68R!!! Does anyone have any experience with such low resistance gates? Thats almost nothing! 
Huh I think I will use 6R8 Rg with Murata +15/-8 2W modules, because then i can use my drivers to 4A fully. Back to the dungeon then.

A


----------



## PStechPaul (May 1, 2012)

That 0.68 ohms appears to be the test conditions for the turn on/off specifications:
http://www.europowercomponents.com/media/uploads/2MBi450UE-120.pdf

Looks like 6R8 would increase the switching times from about 400 nSec to 800. One graph shows a lot more switching energy for turn-on using the higher resistance, so maybe you can use a diode across the resistor to get a fast turn-on and slower turn-off.

http://www.pwrx.com/pwrx/app/PCIM99.pdf

http://www.ixys.com/Documents/AppNotes/IXAN0010.pdf (shows diode for slow turn-on, fast turn-off)

http://www.semikron.com/dl/service-...inciples-and-applications-en-2007-11-12-rev00


----------



## jackbauer (Jan 12, 2008)

almost there on the first prototype build of the revised main board. Already highlighted a few pcb layout changes that will be required but no show stoppers. Just component spacing. I have boards for the new gate driver available. First one built and tested ok.


----------



## jhuebner (Apr 30, 2010)

Beautiful


----------



## onegreenev (May 18, 2012)

jackbauer said:


> almost there on the first prototype build of the revised main board. Already highlighted a few pcb layout changes that will be required but no show stoppers. Just component spacing. I have boards for the new gate driver available. First one built and tested ok.


Excellent. Does your main board take pretty much the same components as the other boards? I still have components for another main board that I have not built yet. Looks good and solid. Just like I wanted.


----------



## jackbauer (Jan 12, 2008)

Mostly uses the exact same parts. A few additions in the line of transistors and obviously the 35 pin ampseal connector. BOM will be done later in the week.


----------



## arber333 (Dec 13, 2010)

PStechPaul said:


> Looks like 6R8 would increase the switching times from about 400 nSec to 800. One graph shows a lot more switching energy for turn-on using the higher resistance, so maybe you can use a diode across the resistor to get a fast turn-on and slower turn-off.
> 
> http://www.ixys.com/Documents/AppNotes/IXAN0010.pdf (shows diode for slow turn-on, fast turn-off)


Hm, i think i can go up to Rg 4R7 max because of +15V/-8V DCDC regulators and 4A driver. This would mean that gate gets little more than 3A for on pulse and 2A for shutoff. Can you tell which should have the sharper curve?

I could put one Rg 4R7 and one parallel another 4R7 with one superfast diode in series reversed so one slope would be sharper. Which one would be better? 

A


----------



## jackbauer (Jan 12, 2008)

First power up test of the new main board complete. communicated with the PC no problem. I am going to change the pin header on the board to be compatible with standard FTDI cables. Will eliminate a lot of messing about. Got started on building the sensor board. No problems so far. With luck I will have the prototype ready to test at the weekend.


----------



## Tony Bogs (Apr 12, 2014)

The gate resistor determines the switching speed of the IGBT or MOSFET as PstechPaul mentioned. 
The IGBT turn-on switching time affects the losses in IGBT and in the diode in the other half of the inverter leg. 
Decreasing the IGBT loss increases the diode loss. There are many of those Rg related interactions (trade-offs).
Sometimes different on/off Rg values are needed for the desired design result. There are many application notes available online about Rg related issues that can provide guidelines.
Device ratings are always limiting factors when determining Rg. 

In my SiC mosfet setup I choose the lowest Rg for fastest switching, since there's no SiC diode trade-off (vey low reverse recovery losses). 
Great for effiiciency, but less for ringing (EMI) and overvoltage. 
Low gate resistor values (switching time below the resonant frequency of the parasitic elements in the HV circuit) can cause high ringing voltages. 
Potentially deadly for the SiC when it enters the high dissipation avalanche region. 
The Cree CAS300M SiC brick is not avalanche rated, but it should be able to withstand a relatively low energy single avalanche event when a fault condition occurs.
Cree has published an Rg related application note on this subject: CPWRAN08, understanding the effects of parasitic inductance.

So in my SiC setup the overcurrent threshold in the current sensor circuit will be set at the level at which ringing voltages due to high dI/dt can exceed the maximum drain source voltage Vds.


----------



## Tomdb (Jan 28, 2013)

Some software progress on my end.

Got the Firmware updated to the latest. Took my some trying, got to re-install xp on my laptop its getting too slow.

However, now I can read all values on the web interface on xp. Yet the inverter does not go into opmode 1. 

Set udcsw to 0, would not start on a pulse on sig_start. Mprot and EMC are both high. 

I will dig into the software tomorrow to get this sorted, maybe some conflict with the UDCMIN(tried this at 0 but still no change). It would help a lot if anyone has got the inverter running before with out connecting the high voltage sense connection.


----------



## jackbauer (Jan 12, 2008)

Sensor board built and tested. Due to the crappy offset in the LM324 op amp we can't read DC bus voltages below 90v but 90V to 500v is perfect and linear. If someone needs to go lower just use a better quality op amp. All 6 pwm channels firing perfectly. Now to build two more IGBT driver boards ...


----------



## Tomdb (Jan 28, 2013)

In the action Ms10Task udc has to be LARGER then udcsw. This will never but really never allow you to turn the inverter on without the sense leads for HV connected.


```
if (udc > parm_Get(PARAM_udcsw) && parm_GetInt(VALUE_potnom) <= 0)
   {
      if (DigIo::Get(Pin::start_in) &&
          DigIo::Get(Pin::emcystop_in) &&
          DigIo::Get(Pin::mprot_in))
      {
         DigIo::Set(Pin::dcsw_out);
         DigIo::Clear(Pin::err_out);
         DigIo::Clear(Pin::prec_out);
         parm_SetDig(VALUE_opmode, MOD_RUN);
      }
   }
```
Johannes, mind changing it to ">=" this way people can choose to run the inverter without the precharge and main contactor controlled by the inverter.
I preffer to control these via a BMS/vehicle master, because of charging configurations and other users on the HV bus.

Update 31-7-15 after testing:

My suspicion is confirmed. She lives, or atleast goes into opmode run oh boy im getting close now.
Guess ill just have to bias the voltage measurement to the 12 volt rail then 
Voltage monitoring will be done at the battery not at the inverter.


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> Sensor board built and tested. Due to the crappy offset in the LM324 op amp we can't read DC bus voltages below 90v but 90V to 500v is perfect and linear. If someone needs to go lower just use a better quality op amp. All 6 pwm channels firing perfectly. Now to build two more IGBT driver boards ...


Good work, nice plot 
Maybe time to defend the resistive voltage sense (again): Which problems has it actually spawned?
And, a recursive argument: the world leading brand for solar inverters uses the same sort of voltage sensing.



Tomdb said:


> In the action Ms10Task udc has to be LARGER then udcsw. This will never but really never allow you to turn the inverter on without the sense leads for HV connected.
> 
> 
> ```
> ...


Yeah, thats a silly bug. Will fix this weekend I hope.


----------



## jackbauer (Jan 12, 2008)

jhuebner said:


> Good work, nice plot
> Maybe time to defend the resistive voltage sense (again): Which problems has it actually spawned?
> And, a recursive argument: the world leading brand for solar inverters uses the same sort of voltage sensing.
> 
> ...



I do love the simplicity of the resistor divider option however in an automotive environment I do prefer to have galvanic isolation. The ACPL C870 system introduces no problems as far as I can tell other than a bit of simple SMD soldering. I will track the pcb for both options so the builder can choose the one best suited.

Tested with one driver board attached this morning. Interface between UVLO and FAULT outputs from the driver boards and the hardware PWM interlock working perfectly.


----------



## jackbauer (Jan 12, 2008)

Soooo...I have my new inverter built and the hardware seems fine , igbts driving perfectly. Only problem : no AC output. It seems the drive signals are not giving any overlap so no current flows to the motor. any thoughts? No shorts on the pcb etc and all channels seem to be on the correct pins.


----------



## jhuebner (Apr 30, 2010)

Will reply here again:
I think no direction is selected, i.e. neither FWD nor REV high.

All three signals look exactly the same on your scope, so no voltage difference between them.

Yes, "neutral" mode is a bit silly right now, I should shut down the PWM all together.


----------



## jackbauer (Jan 12, 2008)

That did the trick


----------



## Tomdb (Jan 28, 2013)

Still quick en dirty 

However, the mode selection should be made more robust. 
How many times is the "opmode" code polled?


----------



## jackbauer (Jan 12, 2008)

Here we have a first cut at the pinout for the ampseal 35 connector.


----------



## jhuebner (Apr 30, 2010)

Tomdb said:


> Still quick en dirty
> 
> However, the mode selection should be made more robust.
> How many times is the "opmode" code polled?


What do you mean by more robust? I can see some things that are not exactly straight forward, so I'd appreciate some input.

if by opmode-code you mean the code you posted earlier: runs every 10ms.

Re Pinout:
I have some corrections/questions:
Pin 6 throttle: 0-3.3V (or did you change that?)
Pin 16: has become over/undervoltage output (udcmin/udcmax)
Pin 26: 12V square wave or NPN open collector like the others?


----------



## jackbauer (Jan 12, 2008)

I have added an optional resistor to allow scaling of a 0-5v throttle signal to 0-3.2v. This is to accommodate hall effect throttle pedals like the BMW units I use which are typically 0.4v to 4.8v.

RPM output on pin 26 has a pullup to 12v as most tachs need this. It can of course be omitted if not required.

The inverter is now running MG2 in my Lexus hybrid gearbox. Admittidly only in open loop....so far  Video and pics to follow.


----------



## jhuebner (Apr 30, 2010)

Updated the firmware:

- Added support for speed output on PC9
- Ignoring pulses when time difference between the last pulse and the new pulse is a factor > 4 (basic debouncing)
- Added parameter speedgain to configure pulse frequency on speed output
- Changed udc > udcsw to udc >= udcsw to allow 0V start
- Limited max regen of cruise control to brkmax


----------



## jackbauer (Jan 12, 2008)

Fantastic news Johannes Is the speed output a variable frequency fixed width or a fixed frequency variable width signal? Here are some quick photos of the test setup, Video processing.


----------



## jackbauer (Jan 12, 2008)

And some video as promised 

https://youtu.be/LqC4TSZdoTg


----------



## jhuebner (Apr 30, 2010)

Wow, nice work 

Output is fixed duty cycle (50/50) variable frequency up to 500Hz.

Untested yet, thats your job here 

Maybe we should spawn the PMSM discussion here, as it is currently going on via various emails.

So my take was to not support PMSM motors at all because I think they're stupid  (no, not to be taken serious). Now I must admit that there's a lot of synchronous motors around and it could be a real gain for the project to support them.

Of course the plan is to control them in a similar fashion as the async motors, i.e. without FOC and the need for good current sensing.

The differences to async motors in a nutshell:


No slip needed/wanted
Absolute rotor angle is of importance
current lagging voltage must be accounted for
Accelerating torque generated by setting the electrical angle to the rotor angle + 90°
Decelerating/regen torque generated by setting the electrical angle to rotor angle - 90°
Torque amount controlled by only stator V/Hz
So the idea is to leave out one tooth on the encoder disk to detect the 0° position. Or, more straight forward, to add an additional signal that fires once per turn.
Whenever the signal fires, we set the angle to a fixed (configurable) offset that account for the current lag.
Whether this is all going to work must be seen in practice.


----------



## jackbauer (Jan 12, 2008)

That sound reasonable. The Lexus / Toyota gearbox has 2 IPM motors with resolvers. I'll come up with a resolver to digital board and we can do some tests. 

I need to fit an encoder to my test motor then I can do some tacho tests


----------



## jackbauer (Jan 12, 2008)

Although somewhat unrelated , here is a video of the Toyota gearbox MG2 spinning in open loop mode : 
https://youtu.be/sP4eG-ipOu8


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Wow, nice work
> 
> Output is fixed duty cycle (50/50) variable frequency up to 500Hz.
> 
> ...


OK J you forced my hand 

While i wait on rewiring of my ACIM motor I got one PMSM on loan and have made test setup to see if i can drive this beauty with our DIY controller.
This is 40kW nominal PMSM sine comutated axial flux motor. It has 10 pole pairs! and is currently wired to 500VDC at 6000RPM. Oh its weight is cca 13kg....beat that!



Basicaly my intention is next:

1. Run the motor with variable speed control
2. Run the motor, put some load on it and see it software can hold RPM with load
3. Put the thing in a car and drive if feasible.

Load will consist from two wood poles hooked under the motor with ends overlaping motor axis. When i squeeze this setup should load motor at least with 10kW.

@jackbauer
If you can manage resolver to pulse conversion that would be great! 

Up till now i havent succeeded. I am running basic software and it seems motor wouldnt start by itself. I managed however to start it by adding 1Hz slip, but it quickly fell out of sync and started vibrating terribly.
I hope Johannes can come up with software which can force rotation so motor can find 0 pulse.

TBC...


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Up till now i havent succeeded. I am running basic software and it seems motor wouldnt start by itself. I managed however to start it by adding 1Hz slip, but it quickly fell out of sync and started vibrating terribly.
> I hope Johannes can come up with software which can force rotation so motor can find 0 pulse.
> 
> TBC...


Ok, maybe you should start like Damien did, leave the encoder disconnected for now.

Interesting video (at least for us folks ). I don't understand why it doesn't draw more amps at higher speed. Whats fweak?


----------



## Ai! (May 9, 2014)

well arber, emrax motor here)


----------



## dcb (Dec 5, 2009)

arber333 said:


> I am running basic software and it seems motor wouldnt start by itself. I managed however to start it by adding 1Hz slip, but it quickly fell out of sync and started vibrating terribly.


Is 0 slip an option, and trying different rotor starting positions? You pretty much need the resolver (or other position information) to start a PMAC properly AFIK. speed Pulses won't do it from a dead stop (unless you know the rotor starting position already, somehow). And any slip other than 0 is guaranteed to get out of sync. Though it would be interesting to see if it stays in sync once it gets moving at 0hz slip. There is some "get it moving" code that may keep it from working from a dead stop too, it overrides v/hz and possibly slip, havent looked.


----------



## arber333 (Dec 13, 2010)

dcb said:


> Is 0 slip an option, and trying different rotor starting positions? You pretty much need the resolver (or other position information) to start a PMAC properly AFIK. speed Pulses won't do it from a dead stop (unless you know the rotor starting position already, somehow). And any slip other than 0 is guaranteed to get out of sync. Though it would be interesting to see if it stays in sync once it gets moving at 0hz slip. There is some "get it moving" code that may keep it from working from a dead stop too, it overrides v/hz and possibly slip, havent looked.


Well the idea is to start motor in unknown position with clutch and when rotating find the 0 point and keep motor synced to it. Shouldnt be hard since then you know the angle of each hole in encoder. I now have 90 holes. I will plug one with alu tape and see if it makes a difference...

The other way would be to make encoder disk with 360 small holes to get really accurate speed feedback. Since motor poles are at 36° from each other then i could plug every 36th hole to make it a mark. Controller can choose which pole will be the 0. Than it could start with clutch depresed and quickly find 0 pulse. In fact every pole would have its 0 pulse. Would that work for a start? 

EDIT: I could synch encoder disk to the motor since i see stator windings trough the casing. I could make the 0 of each pole just before the pole comes in position. Makes sense?

A


----------



## jackbauer (Jan 12, 2008)

I had little trouble getting the motor turning in open loop mode. Just added current at 5Hz until it got moving. As i eased on the current the rotor oscillated until it synced then it spins up fine. You can see near the end of the second video as I test MG1. It didnt like a direct 15hz start but started at 5hz no problem.


----------



## jackbauer (Jan 12, 2008)

Ordered one of these to try some closed loop control on my test motor :

http://www.ebay.com/itm/NEW-Encoder...r-6mm-Shaft-/221379149398?hash=item338b39be56


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> Ordered one of these to try some closed loop control on my test motor :
> 
> http://www.ebay.com/itm/NEW-Encoder...r-6mm-Shaft-/221379149398?hash=item338b39be56


Hm... that is nothing more than incremental encoder, giving A and B phase shifted signal. We dont need phase shift, since we set direction of rotation. 
I think we need to use some encoder that can output cca 180PPR or 360PPR and make a reference signal each turn. That way we would know position of each magnet. Of course this encoder would have to be set exactly to pole positions.


----------



## jackbauer (Jan 12, 2008)

Sorry for the confusion. I mean to use this with a standard ACIM for testing the inverter hardware. Currently looking at options for a resolver to digital converter. Most are horribly complex.


----------



## jackbauer (Jan 12, 2008)

The AD2S1205 seems to offer what we need. Ignoring the digital interfacing side of things it gives two 1024 pulse encoder outputs , a direction output and perhaps most critically , a North Marker pulse at 0 degrees. My question would be : Can we just ignore the digital interface and use the encoder emulation?


----------



## jackbauer (Jan 12, 2008)

One way to find out :
http://ie.rs-online.com/web/p/analogue-development-kits/8316132/

Johannes , If I get this eval board and get it wired up could you write the code?


----------



## dcb (Dec 5, 2009)

I'm confused already, maybe the PM stuff is for another thread? Also, anything toothed will not start properly with a PM, PM needs a resolver (or via "sensorless" resolver), and the olimex is tight on spare pins IIRC.

Jack, doesn't the siemens have a speed signal? type: Differential gear tooth?


----------



## Tony Bogs (Apr 12, 2014)

*ACCURACY *

Damien's VDC iso amplifier circuit drew my attention back to accuracy.
The ACPL-C87x seems to have it all: high iso voltage, SMT, high accuracy that matches the other FOC sensor (LEM). 
I'll modify my main board layout to free up an ADC input (PC5, ADC15). 

The FOC control system in SW is based on an observer. Accurate measurement of the phase currents and the bus voltage is critical. 
Measurements are done with the STM32-H103 on chip ADC. 
It uses a LM1117 adjustable voltage regulator as supply and as a voltage reference. 
The accuracy is no way near the 1% accuracy of the sensors. 
The LM1117 has 2% base accuracy over temperature (-40 to 85 degrees C) and the resistors in the divider to set the output voltage are 1% with unknown temperature drift. 
The STM on chip voltage reference (ADC17 input) is even worse: 5% base. 
And there's no option to connect an external reference to replace the LM1117. 

But there is a way to fix the accuracy. 
It does require HW and SW mods: connect a precision voltage reference to an ADC input for calibration in SW. 
I've already modified my main board layout: ADC input PC2 ( ADC12) is connected to a LT1461AIS reference (0.04% base accuracy). 

*SPEED SENSOR*

How about a common magnetic pickup. That's the one I'll try first.
Often used on AT in- and output shafts and the ICE crankshaft. The output is a sine wave. Nothing simpler than that. 

The LM1815 is the workhorse for zero crossing conversion to digital in noisy environments. 
It has been used in huge numbers in cars and it's simple, straight forward and readily available.

An AT with a suitable disc and sensor on the input shaft shouldn't be too hard to find on the scrapyard. 
Usually 60 pulses/360 degrees (frequency matches shaft RPM)

*MISHAPS*

Since there have been mishaps, I'll try a low power setup first with cheap but fast PT IGBTs (high PWM freq) and a low cost, low power (few kW) standard motor.


----------



## jackbauer (Jan 12, 2008)

I would like the PM stuff to remain on thread but that is up to Johannes. Yes , the Siemens motor has an encoder that works fine. I am trying to adapt a common industrial ACIM with an encoder for some tests. I don't want to invest a lot of time in this so an off the shelf solution is preferable but thanks for the suggestions.


----------



## dcb (Dec 5, 2009)

Tony Bogs said:


> *SPEED SENSOR*
> 
> How about a common magnetic pickup. That's the one I'll try first.


If you still have the starter gear, this might do it with a quick fab job. (might be too many pulses, require division, or remove some teeth or?) 

http://www.mouser.com/ProductDetail...GAEpiMZZMs29kr3d%2bndI4OPdCdzrfug2RHPCTozkik=









technical data
http://sensing.honeywell.com/index.php?ci_id=4128&la_id=1&Ntk=si_all_products&N=1235&Ntt=1GT101DC

edit: maybe not, it is a bit on the slow side, i.e. 12 teeth @ 5000 rpm? (up to 15us rise and 1us fall)
http://sensing.honeywell.com/index.php?ci_id=50300&la_id=1


----------



## jhuebner (Apr 30, 2010)

PM stuff can stay here as it's still got to do with the inverter.

Yes, you can run a PM motor with an incremental encoder if you find out the 0-position once.

The startup code needs no great engineering either, simply dump 1Hz (at an amplitude set by the throttle) at the motor until you pick up the 0-pulse. If in a vehicle the motor will start moving sooner or later even without a clutch.

That eval board is larger than the main board  Anyway, good enough for experiments. We'd still need to find a suitable input for the 0/north signal. Maybe one of the digital inputs with the low pass filter cap changed.

The 1024 ppr resolution is a bit much, [email protected] But of course the low pass filter for the pulse signal can be omitted or changed if the converter board is close enough to the main board. The smallest time frame the current code can measure is 1µs, so that shouldn't be an issue. 

The digital filter introduces a delay of 3.5µs because I programmed it to it's highest setting. But thats not god-given either, just all optimized towards noise immunity.

I don't have a whole lot of time to spare as I'm working on two customer projects. But I can see this being done with only a few 10 lines of code.

I would like to start with a separate north signal instead of detecting a missing hole on the disk. We can still do that later.

So first question: which digital input could be sacrificed for PM operation:
1. cruise control
2. FWD
3. REV
4. BMS
?


----------



## Tomdb (Jan 28, 2013)

I vote for BMS. Or the cruise control.

However, you could decide to kick the motorprot input, and later on implement a temperature throttle back via the motor temp sensor.


----------



## dcb (Dec 5, 2009)

ok, now I get the clutch comment...

but I like all those things  (and I don't like clutches, so I need fw/reverse)

how about more pins? does st have anything with a resolver built in that wouldn't require a complete rewrite? I mean it is probably ok to "graduate" to an on-board processor at some point, especially if the scope has changed.

like maybe a higher pin count STM32F303?
http://www.st.com/st-web-ui/static/...aterial/magazine/Motor Control Ecosystem .pdf

or maybe something with 16 bit adc?

edit: $10 discovery board with a fair number of pins if you are avoiding smd in a kit. (STM32F303VCT6)
http://www.mouser.com/ProductDetail...ISCOVERY/?qs=sGAEpiMZZMt6peTohPPdu3cQUhI1hfuT

edit2: a $10 64 pin nucleo in the f303 family too, with mbed support (all the development tools are online, you just log in, nothing to set up on your pc)
http://www.mouser.com/ProductDetail...=sGAEpiMZZMsuSxY5Q00ZeRbK1lPkKWfe/1tBfM8Gs1w=

I could see if I can get the code to compile in mbed if anyone is interested. I anticipate it won't be seamless though, maybe I'm wrong.


----------



## jhuebner (Apr 30, 2010)

Tomdb said:


> I vote for BMS. Or the cruise control.
> 
> However, you could decide to kick the motorprot input, and later on implement a temperature throttle back via the motor temp sensor.


Ok. motorprot input is connected to hardware logic, so thats out.



dcb said:


> ok, now I get the clutch comment...
> 
> but I like all those things  (and I don't like clutches, so I need fw/reverse)
> 
> ...


Oh the F103 still has a couple of pins left, but I only routed 8 to the input array of the current board. So on a board redesign I could easily add a pin.

It sounded rather complicated to interface a resolver directly, i.e. exciting it and making sense of it's feedback... If anyone can clear the mist it might be an option though.


----------



## jackbauer (Jan 12, 2008)

I've just ordered the board. Should have it by the weekend. I can divide down the pulse count later if required. Don't worry about the board size. I'll design the resolver circuit to be much smaller and fit the main pcb. So just so I'm clear : We feed the North Marker signal in on a digital input (I also vote BMS or MPROT but whatever works) and on of the emulated encoder channels in on the normal encoder input and we can torque control any IPM? This at least to my mind is very cool and easy to achieve at least in hardware


----------



## jackbauer (Jan 12, 2008)

Ok I forgot about MPROT being on the hardware shutdown. Personally , for the small amount of hardware involved I prefer the Resolver to digital converter. Let it do the heavy lifting. We also have a few nice optional failsafe signals from that chip that might be useful.


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> I've just ordered the board. Should have it by the weekend. I can divide down the pulse count later if required. Don't worry about the board size. I'll design the resolver circuit to be much smaller and fit the main pcb. So just so I'm clear : We feed the North Marker signal in on a digital input (I also vote BMS or MPROT but whatever works) and on of the emulated encoder channels in on the normal encoder input and we can torque control any IPM? This at least to my mind is very cool and easy to achieve at least in hardware


Yes, thats the plan  No guaranty for it to work though, we might be overlooking something at this stage. But for async the simple plan worked out quite well 
To make it clear: If you were to do another redesign no input needs be sacrificed. There's still quite a few pins unused, analog and digital.



jackbauer said:


> Ok I forgot about MPROT being on the hardware shutdown. Personally , for the small amount of hardware involved I prefer the Resolver to digital converter. Let it do the heavy lifting. We also have a few nice optional failsafe signals from that chip that might be useful.


I'd agree to that. So are you thinking of putting it on board or as an extra card?


----------



## arber333 (Dec 13, 2010)

Tomdb said:


> I vote for BMS. Or the cruise control.
> 
> However, you could decide to kick the motorprot input, and later on implement a temperature throttle back via the motor temp sensor.


I definitely vote for cruise control, as i was the one that i suggested it!
I think that as a driver i will do a perfectly good job f replicating cruise control  so there is no reason for that button.

Please DO NOT! take away BMS input since the safety of my LiPos will depend on it!!! I am inclined to drive until something gives...usually cells give up first. 

A


----------



## jackbauer (Jan 12, 2008)

jhuebner said:


> Yes, thats the plan  No guaranty for it to work though, we might be overlooking something at this stage. But for async the simple plan worked out quite well
> To make it clear: If you were to do another redesign no input needs be sacrificed. There's still quite a few pins unused, analog and digital.
> 
> 
> I'd agree to that. So are you thinking of putting it on board or as an extra card?


Well , I can safely say the ACIM side works great with the Siemens in the E31. It will punch me in the back if I give it throttle. And that's only on 280v and an unlocked torque converter with a 3k rpm stall. If we have some success with the Eval board I will design a separate board for tests with just the minimum components we need and get that working. Then my preference would be to design it onto the main board as an option to populate these parts if using an IPM. they will be SMD though. No option I'm afraid. For tests we can use any input. I can just solder a wire to the back of the PCB.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> I definitely vote for cruise control, as i was the one that i suggested it!
> I think that as a driver i will do a perfectly good job f replicating cruise control  so there is no reason for that button.
> 
> Please DO NOT! take away BMS input since the safety of my LiPos will depend on it!!! I am inclined to drive until something gives...usually cells give up first.
> ...


Yes but I started to love cruise control  I use it a lot on my 120km journey that I currently do every weekend. But see below, we might not need to sacrifice a pin.



jackbauer said:


> Well , I can safely say the ACIM side works great with the Siemens in the E31. It will punch me in the back if I give it throttle. And that's only on 280v and an unlocked torque converter with a 3k rpm stall. If we have some success with the Eval board I will design a separate board for tests with just the minimum components we need and get that working. Then my preference would be to design it onto the main board as an option to populate these parts if using an IPM. they will be SMD though. No option I'm afraid. For tests we can use any input. I can just solder a wire to the back of the PCB.


Yeah, I like that. Here is a few pins that are free
PC5/ADC15
PA0/ADC0
--PC12-- no, thats the LED
PA7/ADC7
PC9 (the speed signal of your new design)
PA1/TIM2_CH2

That said I will fork a version only for PM development and if it works merge it back later on.


----------



## jackbauer (Jan 12, 2008)

Sounds good. Anything but PC9 as I want my tach signal 

On a side topic , are there any good books on motor control that A) Don't cost a fortune and B) don't head off into complex numbers on page 2 ?


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> Sounds good. Anything but PC9 as I want my tach signal


Alright 
Why don't we make it PC5. I'm wondering if we need to track it by interrupt or if the north signal stands long enough to be polled by the 4-8kHz timer ISR.

EDIT: On page 16 of the AD2S1205 the signal looks rather short. So interrupt it is...



jackbauer said:


> On a side topic , are there any good books on motor control that A) Don't cost a fortune and B) don't head off into complex numbers on page 2 ?


Or C) divide the world in V/f and "vectors" 
I'm having that same issue


----------



## jackbauer (Jan 12, 2008)

I'll run a few tests as soon as I get the eval board. I can run the motor open loop and scope the north marker and encoder outputs.


----------



## jhuebner (Apr 30, 2010)

Software is almost done. I don't have any means to test it as I'm not home right now.

I've mapped the north signal to PA0 which is also the button. So at least I could verify that the interrupt fires.

Not sure how to limit the rpm yet. Could do it with 0 slip for acim...


----------



## arber333 (Dec 13, 2010)

WOW! I managed to drive today!!!
After i uploaded newest software started playing with PMSM motor and i got it to rotate up to 60Hz. It was singing terribly there, also drawing cca 150A, although only 12A from battery...

Then i packed it up and rewired phases to ACIM. I then tried it freewheeling. The feeling was very good, lots of precision. I then tried to drive and it worked. I drove up to 70km/h in 2nd and 3rd. Although in 3rd it often throws OCLIMIT and i had to reset. But drive is very pleasant. I still have to connect brake signal and brake pot. Also i have to sort out my BMS.

I think something is different from the first few versions. Is it the throttle pedal?

tnx johannes i hope to be driving soon normaly


----------



## arber333 (Dec 13, 2010)

Hi Johannes

I was wondering if the boost parameter plays any role after motor starts? Can it be it is used also to supply additional voltage to spin up motor when accelerating?

Also what to do if my fweak parameter is ridiculously large @316Hz? I will never reach that point. Should i set it at 200Hz then? What would happen to Fslipmin then? 

Now i had it set at fslipmin 1.5Hz and fslipmax 4,7Hz. Boost 1400 and ampmin 10%. Oclimit at 450A.

Motor starts steady and with minimum throttle it is easy to reach 5000rpm. But if i suddenly add throttle inverter throws oclimit. Should i limit max slip and increase ampmin and boost?

Inverter gets hot quickly because i dont have any fan on radiator and speed is low .

A


----------



## jackbauer (Jan 12, 2008)

jhuebner said:


> Software is almost done. I don't have any means to test it as I'm not home right now.
> 
> I've mapped the north signal to PA0 which is also the button. So at least I could verify that the interrupt fires.
> 
> Not sure how to limit the rpm yet. Could do it with 0 slip for acim...


Cool I'm guessing we will need to have a routine to monitor RPM and just limit the stator frequency. That said , Can we not just set FMAX anyway? We can determine the relationship between Frequency and RPM quite easilly at low speeds.


----------



## jackbauer (Jan 12, 2008)

Nothing too exciting today. Still waiting on the eval board for the R to D converter so decided to map out the resolver connections for MG2 and MG1. The temp sensor reads 71.2k at about 20c ambient. Exciter winding is 11R , Cos is 18R and Sin is 20R.

This AD app note seems useful. If we can eliminate a discrete driver for the resolver exciter so much the better :
http://www.analog.com/en/design-cen...circuits-from-the-lab/CN0317.html#rd-overview


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> WOW! I managed to drive today!!!
> After i uploaded newest software started playing with PMSM motor and i got it to rotate up to 60Hz. It was singing terribly there, also drawing cca 150A, although only 12A from battery...
> 
> Then i packed it up and rewired phases to ACIM. I then tried it freewheeling. The feeling was very good, lots of precision. I then tried to drive and it worked. I drove up to 70km/h in 2nd and 3rd. Although in 3rd it often throws OCLIMIT and i had to reset. But drive is very pleasant. I still have to connect brake signal and brake pot. Also i have to sort out my BMS.
> ...


Well thats great news!
Yes, the throttle logic is changed. Up to 50% throttle only the v/f ratio is scaled, beyond 50% the slip is scaled.



arber333 said:


> Also what to do if my fweak parameter is ridiculously large @316Hz? I will never reach that point. Should i set it at 200Hz then? What would happen to Fslipmin then?
> 
> Now i had it set at fslipmin 1.5Hz and fslipmax 4,7Hz. Boost 1400 and ampmin 10%. Oclimit at 450A.
> 
> ...


Well you're running a low voltage motor on a high voltage battery. So fweak must be high. 
fslipmax of 4.7Hz is quite a lot, might explain the current limit being hit. Limit to 2Hz and increase slowly from there.



jackbauer said:


> Cool I'm guessing we will need to have a routine to monitor RPM and just limit the stator frequency. That said , Can we not just set FMAX anyway? We can determine the relationship between Frequency and RPM quite easilly at low speeds.


fmax is only a parameter, that does nothing by itself. This code does the trick:
if (frq > fmax)
fslip = 0;

Have tried the same with ampnom but that didn't work smoothly. So with the sync motor fslip is always 0. So I have to limit something else. Maybe the V/f ration can be ramped down.


----------



## jackbauer (Jan 12, 2008)

Ah ok I understand. I should have the resolver to digital board tomorrow.


----------



## EVElvis (Jun 20, 2009)

Hi All
I am still struggling with the web interface where for some reason the parameters do not show. 
This is the terminal output:
[email protected]:~/Desktop/Inverter Software/tools/web interface$ sudo php -Slocalhost:8000
[sudo] password for toshiba: 
PHP 5.6.4-4ubuntu6.2 Development Server started at Thu Aug 6 13:41:19 2015
Listening on http://localhost:8000
Document root is /home/toshiba/Desktop/Inverter Software/tools/web interface
Press Ctrl-C to quit.
[Thu Aug 6 13:41:40 2015] PHP Notice: Undefined variable: enumVals in /home/toshiba/Desktop/Inverter Software/tools/web interface/index.php on line 156
[Thu Aug 6 13:41:40 2015] 127.0.0.1:48563 [200]: /
[Thu Aug 6 13:41:40 2015] 127.0.0.1:48564 [200]: /css/jquery-ui/jquery-ui.css
[Thu Aug 6 13:41:40 2015] 127.0.0.1:48565 [200]: /js/base/jquery-latest.min.js
[Thu Aug 6 13:41:40 2015] 127.0.0.1:48566 [200]: /js/base/jquery-ui.js
[Thu Aug 6 13:41:40 2015] 127.0.0.1:48567 [200]: /js/index.js
[Thu Aug 6 13:41:40 2015] 127.0.0.1:48568 [200]: /tee/src/teechart.js
[Thu Aug 6 13:41:40 2015] 127.0.0.1:48569 [200]: /tee/src/teechart-extras.js
[Thu Aug 6 13:41:40 2015] 127.0.0.1:48570 [200]: /tee/src/date.format.js
[Thu Aug 6 13:41:40 2015] 127.0.0.1:48571 [404]: /favicon.ico - No such file or directory

Any ideas, much appreciated.
cheers
Tim


----------



## arber333 (Dec 13, 2010)

EVElvis said:


> Hi All
> I am still struggling with the web interface where for some reason the parameters do not show.
> This is the terminal output:
> [email protected]:~/Desktop/Inverter Software/tools/web interface$ sudo php -Slocalhost:8000
> ...


It happened to me also. I just pressed reset button on MCU so all functions restarted and tried to start everything again. This time it went without trouble. In any case you must manually type "localhost:8000" in browser, if you just hit enter when browser offers you to finish your typing it will not work. I dont know why... Also do you have PHP support in linux?

Hope it helped...

A


----------



## EVElvis (Jun 20, 2009)

Problem solved! 
But im feeling a bit stupid! Beginners error. 
Guess what I did wrong...?

When connected to the main board I had Rx and Tx the wrong way round. Doh!
Now works as it should!!!
Works in Firefox and Chrome browsers.

Hopefully soon Ill spin a motor and make an interesting post for once.
Thanks for all the help guys!


----------



## jackbauer (Jan 12, 2008)

I've done that myself so many times. The next rev PCB will have a standard FTDI header to remove this issue. In IPM news , my AD2s1205 resolver to digital eval board arrived today and I hooked it up. Worked out of the box Encoder emulator signals working perfectly, Chans A , B ,NM and DIR. The North Marker is an extremely short pulse. 95us on the scope. May need a pulse stretcher?


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> I've done that myself so many times. The next rev PCB will have a standard FTDI header to remove this issue. In IPM news , my AD2s1205 resolver to digital eval board arrived today and I hooked it up. Worked out of the box Encoder emulator signals working perfectly, Chans A , B ,NM and DIR. The North Marker is an extremely short pulse. 95us on the scope. May need a pulse stretcher?


Great!
95µs is plenty, as I'm doing sampling via interrupt.
Couldn't work on the software the last 2 days, hope I can finish it over the weekend.


----------



## jackbauer (Jan 12, 2008)

Sounds good. No rush as I'm away myself until Sunday. A brief video:
https://youtu.be/phKXWQZUf14


----------



## Tomdb (Jan 28, 2013)

Would not the part of the code in the stm32_sine just need an extra if function, which checks a flag/parameter set by the north marker signal be enough? 
That is if you leave out the acceleration/deceleration phase shift which would require some over ruling in Sine_core.


```
stm32_sine

static void CalcNextAngle()
{
   static uint16_t slipAngle = 0;

   uint16_t polePairs = parm_GetInt(PARAM_polepairs);
   uint32_t ampnom = parm_GetInt(PARAM_ampnom);
   s32fp fslip = parm_Get(PARAM_fslipspnt);
   s32fp fmax = parm_Get(PARAM_fmax);

   Encoder::Update();
   uint16_t motorAngle = Encoder::GetAngle();
   s32fp frq = polePairs * Encoder::GetFrq() + fslip;

   if (frq > fmax)
      fslip = 0;

   slipAngle += FP_TOINT((fslip << SineCore::BITS) / pwmfrq);

   if (frq < 0) frq = 0;
   angle = polePairs * motorAngle + slipAngle;

   uint32_t amp = MotorVoltage::GetAmpPerc(frq, ampnom);
   SineCore::SetAmp(amp);
   parm_SetDig(VALUE_amp, amp);
   parm_SetFlt(VALUE_fstat, frq);
}
```


```
SineCore

void SineCore::Calc(uint16_t angle)
{
    int32_t Ofs;
    uint32_t Idx;

    int32_t sine[3];

    /* 1. Calculate sine */
    sine[0] = SineLookup(angle);
    sine[1] = SineLookup((angle + PHASE_SHIFT120) & 0xFFFF);
    sine[2] = SineLookup((angle + PHASE_SHIFT240) & 0xFFFF);
```


----------



## arber333 (Dec 13, 2010)

Hi johannes

I am now driving normally at 90km/h in 3rd . It is not explosive acceleration like with lower voltage, but when i develop rpm everything is good. No more motor jumping and oclimit throwing.
I checked at 50km/h car takes cca 5kW, at 60km/h cca 6kW and at 80km/h cca 9kW. So consumption seems legitimate. 
I will try to go on the highway later this month, but first i have to turn my brake discs. During 5 months of inaction rust gathered on disks and now brakes are ineffective. 

Can you tell how to set up pedal braking? I see in software that signal is good, but i dont have any effect in regen. I have brknompedal set to 30%. Should i give it more?

A


----------



## onegreenev (May 18, 2012)

arber333 said:


> Hi johannes
> 
> I am now driving normally at 90km/h in 3rd . It is not explosive acceleration like with lower voltage, but when i develop rpm everything is good. No more motor jumping and oclimit throwing.
> I checked at 50km/h car takes cca 5kW, at 60km/h cca 6kW and at 80km/h cca 9kW. So consumption seems legitimate.
> ...


Currently the brake pedal regen is preset at 30%. Fixed.


----------



## EVElvis (Jun 20, 2009)

Hi All
Been checking the deadtime with my scope and been playing with changing the value via web interface and looking at the variation of deadtime. I noticed a few things which I was not sure were normal? May well be my lack of experience and knowledge? Anyway wondered if anyone else had noticed the same?
First thing is that when the inverter is started via web interface all bottom PWM signals go high 3.3V. Once started by changing ampnom to 1 etc... they fluctuate as expected with top signals and you can see the deadtime around 1.5 micro seconds at 63 as per instructions. Wondering why all bottom PWM outputs go high on start of inverter? Edit - I think that this is to ensure all IGBTs are set the same prior to start?
Second thing, deadtime set from 63 to 255 clearly makes a huge difference. I stopped then restarted the inverter via web interface and then saw the change occur, however, I could not go back to deadtime 63 without powering inverter down. 
Looking good so far.
cheers
Tim


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Hi johannes
> 
> I am now driving normally at 90km/h in 3rd . It is not explosive acceleration like with lower voltage, but when i develop rpm everything is good. No more motor jumping and oclimit throwing.
> I checked at 50km/h car takes cca 5kW, at 60km/h cca 6kW and at 80km/h cca 9kW. So consumption seems legitimate.
> ...


Thats great news!
Do you mean to use the second pot input for braking? Haven't programmed that yet. In my polo I set brknompedal to 80%, I hardly ever have to use the disk brakes that way. 30% doesn't do much on my motor.



EVElvis said:


> First thing is that when the inverter is started via web interface all bottom PWM signals go high 3.3V. Once started by changing ampnom to 1 etc... they fluctuate as expected with top signals and you can see the deadtime around 1.5 micro seconds at 63 as per instructions. Wondering why all bottom PWM outputs go high on start of inverter? Edit - I think that this is to ensure all IGBTs are set the same prior to start?
> Second thing, deadtime set from 63 to 255 clearly makes a huge difference. I stopped then restarted the inverter via web interface and then saw the change occur, however, I could not go back to deadtime 63 without powering inverter down.
> Looking good so far.
> cheers
> Tim


Alles ist gut 
When the inverter is in stop mode, the timer is disconnected from the output pins, thus all 6 outputs are low. As soon as you start, the timer is connected and generates the complementary output. Thus, all low side switches are on, all high side switches are off.
By default you'd see a 50/50 signal in that case, but I have changed it to what you observe because "empty" pulsing (i.e. not generating current) generates a lot of EMI noise. I mean more than when actually doing useful work. Not sure why.

I noticed the deadtime behavior as well. Must be some hardware security feature.


----------



## EVElvis (Jun 20, 2009)

Thanks Johannes 
Good to hear. I have just played with actual gate driver board outputs, whereas before it was the main board outputs.This time I noticed noise that you mention and what looked like voltage spikes at point of turn off/on. Glad you mentioned it as I can never be sure if its my scope, probe, scope user error or my dodgy temporary wiring connections with my little experience. 
One of my drivers only provides half of the voltage on one side, not sure why but I notice one of the small caps is slightly damaged (I recall that when I damaged it making up the board) I have a spare ill use. Also I note in your instruction video that your gate drivers do not have the diodes fitted, is there any reason why?
I think I had only 5V output for the gate drivers? Had it in my mind they were 15V outputs via DC1 & DC2 components, so I guess this is scope user error. Cant believe I build 3 gate drivers badly. Ill have another play tomorrow.
cheers
Tim


----------



## jhuebner (Apr 30, 2010)

EVElvis said:


> Also I note in your instruction video that your gate drivers do not have the diodes fitted, is there any reason why?


Well spotted  The diodes are on the IGBT board itself.



EVElvis said:


> I think I had only 5V output for the gate drivers? Had it in my mind they were 15V outputs via DC1 & DC2 components, so I guess this is scope user error. Cant believe I build 3 gate drivers badly. Ill have another play tomorrow.
> cheers
> Tim


Very unlikely, maybe use a voltmeter for those kind of tests. The INPUT to the gate drivers is 5V, The output must be -15V or +15V.


----------



## arber333 (Dec 13, 2010)

Hi J

I am in croatia now. Far from my car. Last time i was experimenting with settings something strange happened. Controller wouldnt start. I tried many times...nothing. Then i started to measure, i got 140VDC from + battery pole towards gnd!!! I tought it was BMS but it wasnt. Then i suspected controller voltage measurement. Finally i found out main contactor relay starts as soon as i switch controller on! No precharge... I tried to move it a little and BANG! I saw sparks to my right where main contact box is. I found burned SOC PCB board. I guess full cap voltage was draining trough precharge relay towards chassis. Even though i made protection underneath it contacts still found alu metal...

The good news is controller still works. 
First thing when I come home i will charge :=).

A


----------



## jackbauer (Jan 12, 2008)

Hitting a bit of a problem with my resolver to digital converter. See attached scope shots for noise induced on sine and cosine inputs from inverter. Causing false triggering of encoder outputs. HAve done all the usual tricks like twisting wires , screened cable etc. I believe the noise is induced in the resolver itself but may be wrong. Any thoughts welcome.


----------



## zaxxon (Jul 11, 2009)

jackbauer said:


> Hitting a bit of a problem with my resolver to digital converter. See attached scope shots for noise induced on sine and cosine inputs from inverter. Causing false triggering of encoder outputs. HAve done all the usual tricks like twisting wires , screened cable etc. I believe the noise is induced in the resolver itself but may be wrong. Any thoughts welcome.


Seems very odd one has spikes and other does not. Both would have same noise, if receiving circuit operation and impedance is identical with respect to circuit ground and measurement was done to same refernce point. Look for differences. Resolver, connector, or wire could have developed and path to ground. Or a terminating resistor or filter at circuit end has opened up or is missing on the pin with spike shown.


----------



## jackbauer (Jan 12, 2008)

Sorry I should have stated the clean signal on the left is with the inverter not operating. One on the right is with the inverter pumping current into the motor. The spikes have a ringing frequency of 8.8MHz.


----------



## kennybobby (Aug 10, 2012)

How about a low-pass filter to block the high frequency noise?


----------



## jackbauer (Jan 12, 2008)

Have been trying filtering. The problem is any type of filter alters the sine and cosine signals. Also very little info seems to be available for resolver application circuits.


----------



## dcb (Dec 5, 2009)

just thinking out loud, can you increase the drive current and/or add more load to the outputs with some lowish resistors by the detection circuit?

I don't know how much it can handle without burning out or anything.


----------



## Coulomb (Apr 22, 2009)

Those spikes may not actually be real. It's really hard to arrange your short earth springs for your oscilloscope probe so as to measure what's really there. Since it seems to be affecting the angle measurement, that does suggest that at least part of the switching noise really is there, but maybe it's some other effect.

[ Edit: one test is to measure earth with respect to earth. If you get about the same magnitude of spikes, then they aren't real. You can try fiddling with your earth springs to get the earth with respect to earth as low as possible; one that's reasonably clean, go back with the same technique to your actual sin and cos signals. ]



jackbauer said:


> Have been trying filtering. The problem is any type of filter alters the sine and cosine signals.


Ok, but wouldn't it affect the sin and cos signals the same, and therefore cancel out? The detector should work on the phase difference between the two, from memory. But I don't remember the details.

Sometimes the sender can work on higher voltages, like up to 24 V. That could help, by making the same induced noise be smaller in relation to the signal.


----------



## Weisheimer (May 11, 2009)

Does the noise signal change frequency if you change motor drive speed?

If the frequency of the noise stays constant (and it appears that it does) then I would look at the various supplies to see if it is present on any rail source.


----------



## zaxxon (Jul 11, 2009)

jackbauer said:


> Sorry I should have stated the clean signal on the left is with the inverter not operating. One on the right is with the inverter pumping current into the motor. The spikes have a ringing frequency of 8.8MHz.


 If the circuit receiver and wiring is balanced differentially and noise spikes are at inverter switching points, then its most likely common mode noise induced by current circulating in the grounds between your motor/resolver case ground and resolver receiver circuit ground due to parasitic winding to case capacitance within the resolver and motor. Try a common mode choke by winding your wires (twisted triplet of sin, cos, rtn) around a high mu toroidal core. 
If that does not help enough make sure you have low impedance ac ground path from your motor case back to your inverter ground? Play around with grounding the motor case to inverter ground through a high frequency capacitor or directly to see if that helps. Your goal here is to provide a lower impedance path back for circulating currents and use the common mode chock to increase the common mode impedance back through your resolver interface.


----------



## jackbauer (Jan 12, 2008)

Here is a video detailing the noise issue and my work so far :
https://youtu.be/010ycEHmAHw

For serious motor nerds


----------



## kennybobby (Aug 10, 2012)

Is the PWM frequency of the inverter at 18kHz?

The orange wire connects between the RD card and the case of the motor/gearbox--so that brings the reference ground between those two together.

What brings the reference ground between the motor case and the inverter card together?

The motor wires from the inverter--are they covered with a braid, is the braid exposed or covered with clear insulation? Is the braid bonded at either end to the case/inverter card reference ground?

The 3 motor wires would possibly need to be bundled together within a single shield or braid, with one end of the shield tied back to the inverter card reference. Then the orange wire from the RD card also tied back to the inverter card reference, and a separate wire from the motor case back to the single point ground reference on the inverter card. My thoughts are that a ground loop may be causing the noise.

Are the scope leads referenced to earth ground or is it an isolated/floating scope?


----------



## jackbauer (Jan 12, 2008)

The inverter switches at 8.80khz. The braids connect at both ends. To the gearbox casing and the inverter chill plate. braid is covered in clear insulation. the scope is using a differential probe so should be floating.


----------



## jhuebner (Apr 30, 2010)

You could try connecting the chill plate to logic ground.


----------



## jackbauer (Jan 12, 2008)

Moron of the week award goes to : Damien! Guess what? I don't have a noise problem! The resolver to digital converter couldn't give a damn about the inverter noise what it does car about is the rotor moving. When I inject current into the stator what happens? The rotor moves! The lash in the gears in the 'box mean i dont see the output flange more but the damn resolver does and tells me. Attached are scope shots of the encoder emulation channel running in open loop and 2.5Hz , 5Hz and 10Hz. Crystal clear. Big thanks to Michal Elias for spotting this


----------



## eldis (Sep 3, 2013)

jackbauer said:


> Moron of the week award goes to : Damien! Guess what? I don't have a noise problem! The resolver to digital converter couldn't give a damn about the inverter noise what it does car about is the rotor moving. When I inject current into the stator what happens? The rotor moves! The lash in the gears in the 'box mean i dont see the output flange more but the damn resolver does and tells me. Attached are scope shots of the encoder emulation channel running in open loop and 2.5Hz , 5Hz and 10Hz. Crystal clear. Big thanks to Michal Elias for spotting this


Glad to help


----------



## jhuebner (Apr 30, 2010)

Great  Well spotted Michal
So are we going to see torque control today?


----------



## jackbauer (Jan 12, 2008)

Depends on the software


----------



## jackbauer (Jan 12, 2008)

In this video I eat some humble pie 
https://www.youtube.com/watch?v=Tc9ihN9hD8o

My camera work is so bad my "Moron" sign didn't even work ghaaaa!


----------



## Tomdb (Jan 28, 2013)

Damien, I had a idiot moment myself this weekend turns out.

Taught my Isolated canbus boards were not working, I didn't have the correct optocouples so made them with bridges. However one board already had the pull up resistors. Turns out the comm lines between the mcp2515 and transceiver does not like that. With out a working can readout (usb adapter or arduino board) took me all of sunday and an hour today to figure it out. 

However my inverter is purring nicely. Will make an update video probably in a week or two.


----------



## arber333 (Dec 13, 2010)

Johannes, 
i am monitoring progress from the seaside and making plans...

Can you tell me is there a chance to make ACIM software version with minimal changes so it could run 20 pole PMSM motor WITHOUT resolver? That would be iteration you put aside in favour of resolver motor. I have prepared my encoder disk and plugged the last hole... You know, run one revolution in the unknown to find starting pulse and then start close loop. 
Start would have to be up to cca 50% current so as not to run over oclimit. Maybe i could run it using clutch... only to start. 
I would like to try and run PMSM in some sort of closed loop torque mode, not just freerun...

Also could i increase frequency to 400Hz, since that would mean cca 2400rpm for 10pole pairs? What would be the speed limit, would it run 600Hz? 

tnx

A


----------



## arber333 (Dec 13, 2010)

Hi J

I forgot to comment something specific regarding PMSM motors.
When i managed to get rotation out of my Emrax i checked currents. I got 10A draw on DC bus and 100A! on AC side. That is too much for rotation only. And what made me think was a sort of twitching in rotation. too much reactive current component.
How do you intend to compensate for PMSM difference in stator current field? There are 2 current components in ACIM stator, active and rotor reactive, working to make current form different than PMSM. 
Will you only skew the current graph and would that be enough, since slip will be 0? That should be a variable changed with power required. Could we make it a constant?

A


----------



## arber333 (Dec 13, 2010)

Hi Johannes

Is it possible to limit current draw on DC side? That doesnt need to be superfast limit but only a precaution so one wouldnt draw too much from DC side. 
I imagine the AC side HALLsensors could give measurement for this together with V/Hz that could give aproximate voltage and predict too high current draw from batteries if one would get too excited on the road . 
This could reduce power using existing mechanism in software.
Would that be doable?

I use 300A IGBTs but with my low voltage motor i could use more for better start. I also have 450A IGBTs. I would use them but i am not sure if my cells will take abuse at high RPM. They can give 250A nominal draw and 350A max!!! They are Lipo cells and they have a tendency to selfdestruct if pushed too much....

A


----------



## jackbauer (Jan 12, 2008)

Some progress on getting torque control of the the IPM motor in the Lexus gearbox :
https://www.youtube.com/watch?v=RTdTzMz5tCI


----------



## jackbauer (Jan 12, 2008)

Ok I just updated the inverter in the car with the siemens acim to version 2.87 software. Things are not working very well. Idle would not start at all and when i disabled that and got the inverter into run mode and press the throttle the first 50% seems to do nothing , then the motor revs up suddenly and hits the current limit. Playing with the params does not seem to make much difference. Any ideas?


----------



## jackbauer (Jan 12, 2008)

Down grading to v2.75 and restoring original params has me back to normal. Has something significant changed in to code?


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> Down grading to v2.75 and restoring original params has me back to normal. Has something significant changed in to code?


Huh, i ran my car to 90km/hr today on software 2.87. I am quite impressed that on so low wound motor can get a smooth start. I start with 1.5Hz slip and max at 3.8Hz this doesnt throw oclimit. Anythig over 4Hz bam!... I have to change to 450A IGBTs.....
Also i set min current amplitude at 10% and i start with 1400 boost. 
I have to spin it to 5K RPM in 3rd to get respectable power though.

A


----------



## jhuebner (Apr 30, 2010)

Ok, sounds like a sane parameter set. So are you not satisfied with the power output yet?

I'd like to start working on the one-missing-hole software once Damien has had some success with the resolver. We really need to understand how (and if) PMSMs work on an angle and V/Hz level before doing anything more advanced.


----------



## arber333 (Dec 13, 2010)

Car is working good, i havent drove to highway yet because i am waiting for front brake disks. Had to be replaced because of rust and wear...

What about 300A limit draw for DC side? Can this be calculated and set in software? I would like to protect my battery when i put larger IGBTs in. 

tnx

A


----------



## jhuebner (Apr 30, 2010)

Hi Arber , 

I can implement a makeshift version of a DC current limit. That means I can Calculate a DC current from the AC rms current and the AC amplitude. That still includes the reactive current so it will always be a bit on the high side. For power factors around 0.9 it should be close enough and you can always tune your limit to the actual DC current.

I know there is an idc spot value but that needs the id/iq transformations and they tend to not work depending on how you wire up your motor and other factors that I'm not quite aware of.

Regarding lower torque at lower revs: I can't actually explain that but you could try taking fweak down a bit. Try 5Hz less, check result, 5Hz less, check...


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Hi Arber ,
> 
> I can implement a makeshift version of a DC current limit. That means I can Calculate a DC current from the AC rms current and the AC amplitude. That still includes the reactive current so it will always be a bit on the high side. For power factors around 0.9 it should be close enough and you can always tune your limit to the actual DC current.
> 
> ...


Very good! I would only need rough measurement, just precise enough not to overtax my cells.
Today i changed the amplitude to 20% and motor was livelier some. I will try also to lower fweak factor. I hope i wouldnt trip the oclimit by that.
Also i changed minslip to 1.8... I cant wait i get the brakes ok, then i can go to check the range. I get a feeling i could drive 10% further... We ll see.

tnx

Arber


----------



## arber333 (Dec 13, 2010)

Still waiting for new brake discs DOH!!!

In the meantime since i hadnt had anything other to do i tried to connect all sensors and wiring so i can program controller from inside car. 
I connected cruise, PWM o/p and i put one relay to regulate EMG triggering.
Since my microswitch is connected to gnd, controller pin requires +12V to trigger.
So then i tested PWM and i got green light, since my temp is nominal. Today i will test and adjust safe temp boundary with 1k (100°C) and 1K2 (130°C) resistor to simulate KTY84 sensor. 
I also tested cruise in neutral and cruise works, it just oscillates +/-500RPM about set value. Probably because of flywheel and clutch being too small load. When on road it holds speed... tested to only 50km/h because of no brakes . 

Also i noticed that when i start i mostly get normal battery and oil light until main voltage comes to level. Then i start inverter... 
BUT sometimes when i start, inverter doesnt show oil (operating) light and i cant start. Battery (voltage) light shows normally. If i then restart from 0 the second time everything works. Do you think my precharge relay gets stuck?
Have any of you noticed that behavior?

EDIT: I found out that having long cable connected to controller serial port is causing the glitch. I do not know why, but i connected USB adapter to cable and everything works. If i remove USB adapter then controller wouldnt start every time. For now i simply disconnected connector at controller casing but i will later try to add some GND points.


tnx

A


----------



## arber333 (Dec 13, 2010)

I drove to work first time; full range 65km highway one way. I kept speed at 100km/h and checked power used. 
In level road i get 15Kw-ish power... This is higher than before with 130VDC and Zapi ACE5 controller when motor used 12kW for 100km/h 
Can you explain why there is not a steady amp draw? Huh when i engaged cruise switch i got similar results with power hanging round 12kW - 15kW.
Full power uphill with pedal 100% depressed is cca 38kW! Not much regarding that motor could draw 75kW for 30s to accelerate.
Somehow i think i will have to rewind motor if i want full power...

fweak is 280Hz
slipmin 1,8Hz
slip max 4Hz
ampmin 20%
fmax 250Hz
oclimit -500A

I tried to setup motor temp signal and i have this voltage sensor
http://www.ebay.co.uk/itm/6v-12v-24v-LED-Battery-level-voltage-monitor-meter-J-/200627678428
I set it up so it measures between car GND and controller PWM output. I cant seem to get the correct value and i think i have to make some sort of low pass filter to measure correct resulting voltage. My KTY84 sensor already has 1K at 100°C. Do you have any idea which C to use? Would one 0,1uF be enough to make signal analog enough to measure voltage?

tnx

A


----------



## jackbauer (Jan 12, 2008)

Arber , if I remember correctly it is an open collector output so you will need a resistor pullup to 12v. Try a 1k.


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> Arber , if I remember correctly it is an open collector output so you will need a resistor pullup to 12v. Try a 1k.


DOH! you are right. I anticipated that sensor has its own pullup and i connected just +12V and towards signal  no GND!!! i will change that now...

tnx

A


----------



## jhuebner (Apr 30, 2010)

Argh, quote not working.

So concerning the controller hang with the serial cable connected:
I reckon that is down to the boot loader. It polls the serial port right after startup and if it finds anything other than 0 it starts the update process, i.e. it wait for new software forever.

Concerning your power problem we need more data. Please use the plot function and plot "fstat", "il1rms", "udc" and "uac" while accelerating and cruising.

How did you arrive at the value for "fmin"? That one is crucial for part load efficiency.

I'm not yet sure that rewinding the motor is the #1 solution to your problem unless you don't want to spin faster than 4000rpm. With fweak=280Hz you reach peak power at around 8000rpm. Ever been there?

Some basic questions: is your pot configured right, i.e. do you get ampnom=100% at full throttle?


----------



## Tomdb (Jan 28, 2013)

Just ordered, two more STM32-H103's so i can get building on new controller boards. 

Wondering how its going with the writing of code? 
I will start working on creating a new " main" board to include new features:


Preparation for an resolver decoder add-on
Canbus transciever
Dual throttle input
Prake pot input

Ofcourse changing a few connectors and switching to smd, for smaller form factor. Hope to have something to show this weekend.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Argh, quote not working.
> 
> So concerning the controller hang with the serial cable connected:
> I reckon that is down to the boot loader. It polls the serial port right after startup and if it finds anything other than 0 it starts the update process, i.e. it wait for new software forever.


Yes i figured it is something like that. Could i connect GND on the other side of cable to chassis and use 10K pulldown resistors from TX RX towards GND. How is ttl connected there?



jhuebner said:


> Concerning your power problem we need more data. Please use the plot function and plot "fstat", "il1rms", "udc" and "uac" while accelerating and cruising.


I took the motor out for rewinding. When i went trough 6000RPM i heard some strange noise like flutter of thin metal... In any case it is difficult to upshift at that speed but downshift is strange, sometimes motor just stops and i am stuck with 0RPM on motor and 2500RPM on transmission side. 
I will took those measurements when i put motor back in  maybe next week...



jhuebner said:


> How did you arrive at the value for "fmin"? That one is crucial for part load efficiency.


Huh i tried changing single parameter and suddenly motor took off smoothly with 1.8Hz. With ZAPI controller i had it set at fslipmin 3.2Hz and fmin 3Hz. also fslipmax was 6.4Hz.
Today when i tried setting fslipmax 6Hz and ampmin 30% motor also worked very good above 2000RPM. I got to 50kW draw at 120km/h.
But below 2000rpm i had to be carefull with pedal or oclimit would activate.



jhuebner said:


> I'm not yet sure that rewinding the motor is the #1 solution to your problem unless you don't want to spin faster than 4000rpm. With fweak=280Hz you reach peak power at around 8000rpm. Ever been there?


6500RPM, but when i bought motor they said not to spin more than 240Hz because of g forces on rotor.



jhuebner said:


> Some basic questions: is your pot configured right, i.e. do you get ampnom=100% at full throttle?


[/QUOTE]

I tried static value and i get full throttle travel. I havent checked the ampnom value yet...
I will get my motor rewound. This guy also said he could make wiring for 100Hz and will probably get 30Kw nominal at 120Hz out of motor and better efficiency.
Now it is wound for 90Hz operation with 28kW at 120Hz and weakening at cca 140Hz - 150Hz...
I think i will also put axial taper front bearing in because my clutch exerts some 7kg of pressure along motor axis...

say which version of software is now latest? I use 2.87 now and it works quite good.

tnx

Arber


----------



## Tomdb (Jan 28, 2013)

just came across this.

http://wiki.linuxcnc.org/cgi-bin/wiki.pl?ResolverToQuadratureConverter

A cheap standalone controller can thus convert the quadrature and generate an angle derived output, or you could even mash the code to run on the stm32.

My schematic so far, working on the PCB. I have come to enjoy doing layout, it helps me relax

Any pin preference for the Top-pulse indication from a resolver decoder header?


----------



## Tomdb (Jan 28, 2013)

Got my JTAG programmer and two stm32 h103's in today.

And with in 10 minutes including downloading the flashing software the bootloader was on the chip. Verified to work via uart 3.

Some head scratching on how to get python working again turns out navigating in command promt to the folder was the hardest part. So flashing and programming from a windows pc works.

I am just waiting on my BMS pcb's to come in to verify my pcb design methods work then I will round off my smd based main board with also an 35 pin ampseal.


----------



## jackbauer (Jan 12, 2008)

What Jtag programmer are you using Tom? Can't wait to see the pcb


----------



## Tomdb (Jan 28, 2013)

https://www.olimex.com/Products/ARM/JTAG/ARM-JTAG-COOCOX/open-source-hardware

This one with the coocox software.


----------



## Tomdb (Jan 28, 2013)

My first SMD design just came in, its for my bms slave boards. Happy with the look, now just some testing, then i can finish the controller board layout.


----------



## Tomdb (Jan 28, 2013)

The smd design of the main board will take a little more time, starting over again. Got to get a layout that will make the routing more clean to the micro controller. Last 20 traces needed roughly 40-50 vias, not so good. 

Got some free time the coming days so after my reflow oven is done i can sink some time into it.

How is the testing coming along guys?


----------



## EVElvis (Jun 20, 2009)

Hi All

I have been testing the gate drive outputs. I have nice clean square PWM signals from main board, but outputs from driver boards GTOP etc.. are rather varied. Some show half the amplitude, although I measure 15V between each GTOP & ETOP.
I have not connected the IGBTs, so I do wonder whether a difference in the load makes the signal somewhat better?
Anyone else see similar outputs?
I plan to test again asap with drivers connected to IGBTs.

Edit - Built two more drivers up. Half of each are not right, so suspect temperature is damaging the 3120 driver chips. My solder melts 184 degC and use iron set at 300degC to quickly melt and solder well. Wonder what everyone else uses?

cheers
Tim


----------



## Tomdb (Jan 28, 2013)

got a board layed out, as tiny as possible just to see if I could do it.

Now i wonder if this design wil even work, need to give it a once over end of the week before ordering.

Edit: Dammit just realized, have not hooked up the "top" trigger for the resolver decoder.

Edit 2: Looks like our Chinese friends have a holiday so I have a week to check my board and order the smd version and the "original".


----------



## jhuebner (Apr 30, 2010)

That is indeed pretty small. Are you keeping the STM32-H103? Would be cool to have the Controller onboard. Anyway, good job


----------



## Tomdb (Jan 28, 2013)

still the STM32-H103,

The micro controller board, is so cheap it kind of defeats having it on directly on the board. And its one less variable to go wrong.


----------



## jhuebner (Apr 30, 2010)

EVElvis said:


> Edit - Built two more drivers up. Half of each are not right, so suspect temperature is damaging the 3120 driver chips. My solder melts 184 degC and use iron set at 300degC to quickly melt and solder well. Wonder what everyone else uses?


I solder the all my electronics with an unregulated Ersa 16W iron. I suspect it exceeds 300°C but I never ran into problems.

What puzzles me is that you're getting the full voltage when not pulsing but only part of it when pulsing. That doesn't make a whole lot of sense. Things you can try:
1. A different scope/probe
2. Other PWM frequencies
3. Posting a picture of your setup while probing

Connecting the IGBTs won't make a difference, the signal is cleanest when idling.


----------



## EVElvis (Jun 20, 2009)

Hi Johannes
Both probes I have and scope seems fine. Only have one scope. Probe grounded on main board on 5V power IC5. Are there any better places to ground it with its little crocodile clip? Perhaps thats where Ive been going wrong? 
Without any gate driver and at all three connectors for gates I get 5V power supply and all 3.3v PWM signals and grounds are all at 0. I also get duty cycle change 10Hz fslip and 100% ampnom all ok.
Tried a different PWM frequency and no difference.
I have just noticed a change in the fact that when I connect my gate dnivers and turn on inverter my PSU cuts out on overcurrent. Really puzzled by this, since this used to be occasional if i connected a driver with main board powered up. Its like something is going on with all the drivers. EDIT - Just realised this must have been due to changing overcurrent protection too low. Its ok set at 1 Amp and was 600mA.
I checked all parts on drivers and theyre all in the right places, right values and well soldered.
Taking some videos and pics that show my setup.
Any ideas greatly appreciated. 
Cheers
Tim


----------



## jackbauer (Jan 12, 2008)

Tim , What I generally do is test each gate drive board individually and away from the main board first. Connect an IGBT or a 10R dummy resistor from Gate to Emitter , supply 5vdc at 1A to + and - terminals then use a jumper to pull Top and Bot high and check the voltage on the igbt or dummy resistor goes from about -15v to +15v. then you know the drivers are working before progressing.


----------



## jackbauer (Jan 12, 2008)

I'm doing a small update on my drivers and will be ordering more board sets if anyone is interested.


----------



## jhuebner (Apr 30, 2010)

EVElvis said:


> Hi Johannes
> Both probes I have and scope seems fine. Only have one scope. Probe grounded on main board on 5V power IC5. Are there any better places to ground it with its little crocodile clip? Perhaps thats where Ive been going wrong?


Yes, thats where.
Drivers are galvanically isolated so basically your ground is floating. When testing the drivers, connect ground to the respective E output and probe the G output.
Try without any load first


----------



## Tomdb (Jan 28, 2013)

Damien,

How did your adaptation of the main board turn out? I am thinking of ordering a few of my own smd design and a few originals.


----------



## EVElvis (Jun 20, 2009)

Hi All
Seems to be running ok. 
I think, well I hope i dont have any issue and it is all down to my lack of knowledge/experience. I apologise for confusing anyone, particularly Johannes who I know will think deeply into this. 

Just for the record and to help me make sense of events I do the following:

I have the three gate drivers connected, and I draw 0.264A in total. If I connect laptop USB, I get 0.249 provided by PSU, some from USB.
With inverter halted I measure 15V between each GBOT & EBOT or GTOP & ETOP. GTOP & GBOT of all gate drivers are -15V.
If I hit 'start inverter in manual mode' I now draw 0.271A from PSU.
Strangely I now read 15.4V accross GTOP & ETOP, and 13.37V accross GBOT & EBOT on all gate drivers. Presumably all gates set the same. 
No pulsing yet as I have yet to change fslipspnt and ampnom to 1. 
I now do this, and pulsing starts.
I now measure 1Volt between each GBOT & EBOT or GTOP & ETOP. 
With scope probe carefully grounded to negative on one capacitor whilst probing, I clearly see nice clean PWM square waves -15 to 13V at each GTOP and GBOT to ground and nothing EBOT or ETOP to ground, so thats ground to ground I presume. 
All three drivers the same. I note on scope a small spike to +15V then drop to 13V or so.

Hopefully thats normal and theres nothing wrong. 
cheers
Tim


----------



## arber333 (Dec 13, 2010)

I have some problem with BMS and cells not being equal... Have to solve this somehow...

Otherwise inverter works good, surprisingly it seems to have even lower consumption than my mosfet Zapi kW-vise. It seems that the large amp draw was EVdisplay doing. It wasnt calibrated properly and so it showed 15% more.

I still havent found the best compromise between acceleration and amps, but i am close. I set *fslipmin *0.6Hz just out of curiosity and it works good. Also i set *fmin *0.5Hz. *fmaxslip *is 6.4Hz still. 
I varied *boost *value a bit and came to conclusion that this variable also applies when motor transitions from regen to drive mode. Johannes please comment me here? So when i use 2200 motor surges against clutch, but when i set 1300 motor is very benign. I opted for 1600 to have good takeoff and tolerable acceleration on crossroads.
*ampmin* though is a bit elusive. I have it set at 28%. It seems 35% is too much and again motor surges from 0 load. Lower than that it seems there isnt much effect. How can i best set and try different versions of this?

There is still something i cant handle though. The cruise mode works by pushbutton yes? Well when i push the button everything starts to rock violently. It doesnt seem to matter how i set *speedkp *parameter, car still jumps around... Tell me what works for you? I had it set from 1 to 25, do you think i should set more? I noticed that when i use 25 motor is steadier at transition from steady state to acceleration. 

tnx

Arber


----------



## EVElvis (Jun 20, 2009)

jackbauer said:


> Tim , What I generally do is test each gate drive board individually and away from the main board first. Connect an IGBT or a 10R dummy resistor from Gate to Emitter , supply 5vdc at 1A to + and - terminals then use a jumper to pull Top and Bot high and check the voltage on the igbt or dummy resistor goes from about -15v to +15v. then you know the drivers are working before progressing.


Thanks Damien, just trying to understand the jumper bit? From further tests i think theyre all ok, although i dont get quite +15V its seems? I hope to post a video of my testing, but got to sort a camera and youtube account first.

Now im wondering if there is any difference in connecting either side of my IGBTs E1G1 or E2G2 top or bottom. I believe not, so long as I wire the same for each IGBT from the drivers? EDIT - I copied Johannes website gate driver picture which if im not mistaken shows E1G1 Top, E2G2 bottom. Guess it may mean FWD and reverse drive control set either one way or another?

cheers


----------



## EVElvis (Jun 20, 2009)

jhuebner said:


> Yes, thats where.
> Drivers are galvanically isolated so basically your ground is floating. When testing the drivers, connect ground to the respective E output and probe the G output.
> Try without any load first


Thanks for confirming Johannes, thats what im doing now 

cheers


----------



## arber333 (Dec 13, 2010)

There is one thing i will have to address soon. My pedal sensor.
It is one chineese hall sensor on a pedal mechanism here. 
http://www.cloudelectric.com/product-p/th-5v-ec.htm

It works pretty good. It is 5V unit and i had to prepare resistor divider to reduce signal from 5V to 3.3V. The only problem i just figured out is this is logarithmic mechanism with linear sensor. So when i press first 30% for regen travel it happens very quick and i am out into throttle area. It can be annoying when i want precision regen downhil. 

Johannes would it be possible to put three different throttle maps in your code. We could then select proper one from web interface and drive . I would suggest one *logarithmic *one *linear *and last one *exponential *scale. 
That way one could use sturdy linear pot with software logarithmic scale for a sports car etc.... I found only flimsy plastic logarithmic and exponential pots while linear ones are sturdy metal casing and shaft.

tnx

Arber


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> I'm doing a small update on my drivers and will be ordering more board sets if anyone is interested.


Hi Damien

I am interested in isolated sensor board? Is this just to swap board 1:1? Or would it require software changes? 
I found out that somehow controller is creating weaves of EMI trough chassis and my BMS goes nuts if i press throttle past 50%. I solved this by using isolated 12V PSU to power BMS, but this link is creating shock when i touch chassis while charging. This never happened with 3phase charger before.

Could you send me one board if applicable for me please? PM me about details...

Arber


----------



## EVElvis (Jun 20, 2009)

Hi All
Ok, so I have some interesting findings, and for once I took some videos which I have uploaded. Today is the first time i connected my IGBTs.
Not all great findings, and I have something wrong, but not sure what. I must end up with shoot through of my IGBTs as I have blown a couple of 10A auto fuses on my dc bus line.

As I have seen before, I note that on each gate driver between each and every GTOP & ETOP = 15.4V and GBOT & EBOT = 13.4V. No idea why and 3.3V driving PWM signal seems ok as shown in this video:

https://www.youtube.com/watch?v=-AIe66-mJJc

With drivers connected to main board I did see a spike to 30V, then measure around 28.4V. Seems to be an issue somewhere, but all gate drivers are the same as shown here:

https://www.youtube.com/watch?v=juvZqt6Eb9M

After connecting IGBTs, I first had deadtime set to 63 and it did not appear to be enough as shown in this video:

https://www.youtube.com/watch?v=Ams6EYoFNrQ

So I changed it to 200 and could see plenty of deadtime with no overlap at all. I then connected the dc bus to 12V battery via 10A fuse. Started the inverter and I got some smoke and a fizz noise. I cannot see exactly what fizzed and I thought it was the main board. It looks all ok, and it still seems to work. I also dont understand how the main board can get damaged. I did notice my scope ground was sparking on one ground connection, having left those in the position shown in my video. I do wonder if that had caused some issue and prevented the switching off of a gate? 

Any pointers would be greatly appreciated? Feeling so very green, but enjoying the learning.

Ill have another play tmw. Really want to get a motor spinning.

cheers

Tim


----------



## EVElvis (Jun 20, 2009)

Hi All

In good light I have now seen what got hot yesterday. I dont understand fully, but must be shoot through? The ETOP and EBOT connections on one IGBT have got hot. You can see the IGBT pins have got hot as they are discoloured and the smoke I saw was the solder having melted. I can even see the copper in the PCB has got hot and changed colour.
So hopefully thats minimal damage, but suspect IGBT knackered. I will test it.

Anyone got any spare Hitachi MBM600GS6CW IGBTs ?

Cheers
Tim


----------



## jackbauer (Jan 12, 2008)

tim,do you want a set or my new driver boards?


----------



## EVElvis (Jun 20, 2009)

Hi Damien
Yes please, send me a PM and let me know how much. I understand they have some extra protections by using more sophisticated chip? 
Anything that helps me stop destroying IGBTs. Well, not sure if I killed one yet, but it drew >10A. It was the first one along the DC bus nearest the battery connections. 
Cheers
Tim


----------



## jackbauer (Jan 12, 2008)

pm sent re the boards


----------



## jackbauer (Jan 12, 2008)

I have ran some tests and they do seem to work well regards shoot through. Trying to turn both on at the same time results in the desat locking out one or both.


----------



## EVElvis (Jun 20, 2009)

Thanks Damien, much appreciated.
PM sent. 

For the record, and hopefully to gain some knowledge from destroying an IGBT:

I have just had a play again and taken some pictures of the damage attached. One picture shows IGBT pins where you can see slight discolouration, and the other shows the root of the smoke which was the solder melting and also the copper line connected well heated and discoloured.

I was just measuring the IGBTs resistance and scoping the outputs. 
Scoping the outputs from + & - to phase output showed that switching was occuring ok and was the same on all IGBTs. Gate drivers seem ok. But on damaged IGBT, resistance of negative post of DC bus to phase output measured only 8 Ohms, so in effect permanently on I suspect, all others didnt read anything due to DMM not picking up when they were on I guess?
It is entirely possible it was always like this as I had not tested the IGBTs, thinking risk that I would damage them in the process was much more likely that they were broken, especially when told the van worked that they came from.
I played with deadtime a bit more and didnt always seem to get consistency. Sometimes when set to 63 it looks ok, but then sometimes, as in my video there was some overlap. Seems that turning power off and on again is the only sure way to have deadtime set? Probably operator error though, and when I tested yesterday, I suspect deadtime may not have really been set right. Otherwise there was another issue with the fact my gate driver output voltages were slightly odd as described previously.

Cheers
Tim


----------



## jhuebner (Apr 30, 2010)

Hi Tim,

I couldn't see exactly how you connected the probes but two things came to my mind:
1. If you probe Top&Bottom simultaneously you are effectively shorting out EBOT and ETOP or in other word B- and Lx. Thats ok with no DC bus voltage but fatal with it.
2. Do not run your first tests off a car battery even when fused. The fuses melt time is still ages from an IGBT perspective. Use a lab supply instead.

From what you're writing the main board seems ok.


----------



## EVElvis (Jun 20, 2009)

Thanks for looking into this Johannes



> I couldn't see exactly how you connected the probes but two things came to my mind:
> 1. If you probe Top&Bottom simultaneously you are effectively shorting out EBOT and ETOP or in other word B- and Lx. Thats ok with no DC bus voltage but fatal with it.
> 2. Do not run your first tests off a car battery even when fused. The fuses melt time is still ages from an IGBT perspective. Use a lab supply instead.


I did unfortunately use a battery and 10A auto fuse. I cannot recall exact sequence of events, but I dont think the scope was connected to the gate driver of the failed IGBT. However I did notice something odd going on with the way they were connected. The failed IGBT was the one nearest the battery connections. Hopefully I have not damaged the others.

Wish I had not been so hasty in wanting to drive a motor, and should have watched your video again, where I note you use a bench power supply to check for shoot through. 

Live and learn.

Pleased the mainboard is ok 

cheers

Tim


----------



## jhuebner (Apr 30, 2010)

As some of you might have noticed my response time is rather long these days. I am working on a new project and hardly find the time to work on the inverter.

I will implement the DC current limit as I promised to do so but that will be it for now.

Kit sales and support will continue and I will stay present in this thread.

Software source code is available in the zip file and on git hub. You can get in contact with other tumanako members through the mailing list.
http://sourceforge.net/p/tumanako/mailman/?source=navbar


----------



## Tomdb (Jan 28, 2013)

Im getting some main pcb's from Damien, so i placed my order at digikey for components to solder up two complete pcb's. Now the waiting is on all the parts to arrive so i can hook them up to the Honda power electronics.


----------



## dcb (Dec 5, 2009)

fyi, wasn't sure who else might be interested, but SILABS has announced a high speed isolated shunt monitor Si8920 (using their digital isolation technology), there is a sample leg in the reference doc along with a 4 amp digitally isolated gate driver Si8234.

http://www.mouser.com/ds/2/368/Si8920-766188.pdf

mmm... fast accurate isolated current monitoring... (though I'm starting to consider distributed isolated gate processing logic at this point with just a solid LIN to the controller).


----------



## Tomdb (Jan 28, 2013)

Got two of Damien's main pcb's built up. First tests look good.

Now time to hook it up to the Honda IMA inverter main board to see if I can drive the gate drivers with an simple solder bodge job. If all goes well I just need to take a look at the current sensors to see if these need a voltage divider and what the conversion level is.

Hooked it up to the Honda inverter, not quite working just yet.

Got the signals worked out so far that i can drive an igbt. Just have to figure out if my assumption of pin 6 and pin 8 in my .pdf with my measurements/conclusions are pure drive signals for the high and low. 

Anyone ever find a IGBT driver with a possible other setup? Could driving the Opto-couplers on the driver side with 3.3V instead of 5 volts keep the opto from working.


----------



## jhuebner (Apr 30, 2010)

Tomdb said:


> If all goes well I just need to take a look at the current sensors to see if these need a voltage divider and what the conversion level is.


Just be reminded that you don't need the current sensors for motor control. Only if you want to see the currents e.g. on the web interface.

EDIT: just checked your document, [email protected] sounds like a good start. Maybe they use the exact same levels.


----------



## Tomdb (Jan 28, 2013)

The sensor are not hooked up yet. Will have to get the motor running on just, Fslipspnt en Ampnom in Start 2 before I will start hooking up more.

Also I wont be running with an sensor board, This means I will have to dig into the schematic and code a little to find the correct offsets.


----------



## Tomdb (Jan 28, 2013)

Damm, do i feel dumb.

Got it spinning today, after realizing, did I hook the phase leads back up after putting my motor back together, nope . 

Then set my fweak at 5 and pole pairs at the required 1. It spun right up. This means my hunch was correct.

However this again means, i need to get my batteries sorted. before i can do some real testing. However it also means I have two working inverters to test with.


----------



## jackbauer (Jan 12, 2008)

Well done tom. great to see the boards worked out Where do you source the honda inverters out of interest?


----------



## Tomdb (Jan 28, 2013)

Japanese car recyclers here in the Netherlands, Inverter complete with bus caps in a nice package. They cost about 100 euros a piece.


----------



## Gurgel (Jul 22, 2015)

oh yeah! very easy , this price is comfortable for my pocket! but can you put some photo? thx


----------



## Tomdb (Jan 28, 2013)

got it all in a box, unfortunately could not find a shorter one, i need 35mm in height for the connector. But i could only find 60mm tall ones.

The black box (on top), contains the main board +h103, is 113mmx190mmx61mm. I need the 190mm for cable management and an extra relay to switch the Honda Ima inverter on and off.

For testing this is fine. If there is enough interest, I could look into redesigning the main board to fit under the existing Cover of the Honda inverter. This is tricky due to the fact the large lump is the bus and snubber cap which is part of the cover.


----------



## coleasterling (Feb 29, 2012)

Looking great, sir!!


----------



## jhuebner (Apr 30, 2010)

Thats a great source for a compatible power stage!

You are using the existing gate drivers, so in effect you only need the main board?


----------



## Tomdb (Jan 28, 2013)

only the main board hooked up to the mainboard of the IMA inverter.

Just one resistor divider for the current sensor. 5v range to 3.3v range.


----------



## coleasterling (Feb 29, 2012)

For fear of sounding dumb, I'm interested to see how this works at high currents. I read a few references to hardware over-current protection. Is it hooked up in a way that allows the main board to still control the ready signals to the gate drivers?


----------



## Tomdb (Jan 28, 2013)

coleasterling said:


> For fear of sounding dumb, I'm interested to see how this works at high currents. I read a few references to hardware over-current protection. Is it hooked up in a way that allows the main board to still control the ready signals to the gate drivers?


I have no clue what you mean about this? The overcurrent protection is based on the main board (added on board) and will just stop the pwm signal from reaching the gate drivers. 

Its based on a logic gate comparing the feedback from the current sensor to a level set by the micro. So if the phase current exceeds the max it stops the pwm.


----------



## coleasterling (Feb 29, 2012)

Sorry for the confusion there, I realized it doesn't make much sense, either. 

The datasheets for similar gate driver chips from Hitachi reference hardware over-current protection in the driver chip. If it senses over current, it shuts down the driver and throws a fault. 

One, I am wondering how that's handled in the ECN3082A Honda had made (and the whole driver board). And two, if the original main board sees a fault, how will that affect the drive with your new board on top?


----------



## Tomdb (Jan 28, 2013)

Okay, So far i figure I can wire in the 5v pin i mentioned pin 9 (in my pdf) this is the feedback pin from gate driver. 

It is switched high by an opto coupler on the gate driver board when the driver is ready. Low when off or in fault.


----------



## coleasterling (Feb 29, 2012)

Good deal! Seems simple enough. That mimics the datasheets as well. 

I need to get you some motor plates for testing!


----------



## arber333 (Dec 13, 2010)

I must announce here that Johannes returned my trust in EVs. I was ready to give up when my sinopoly cells melted and i was close... However J had me thinking outside the box, like using 75V motor with 300VDC rail, with lowering slip and streaching FW region. To me (i am ME) it seemed to defy the laws of physics but motor ran, albeit high at 6000rpm, DOH! 
Now I finished inverter and i have motor rewound to acceptable level. I have inverter set and it runs good. But still I wrestled with cruise control. Couldnt run steady downhill... J suggested this:

"I set *speedflt *to 1 and *speedkp *to 0.25 (or even lower). Anything above gave me jumpy behaviour as well." 

Well today i tried it and car s smooth as butter. I even have faster acceleration and more power on start, possibly due to speedflt parameter change. 
Also i figured to lower the *fmin *parameter to 0.6hz and it proved to make a smooth take-off while before car jerked a bit.
I set my *ampmin *to 30% and i get very good acceleration and good steady speed transition.

I would only need some maxpower limit due to sensitive cells and i hear J is already working on this... .

If anyone of you would like to have my current working settings tell me. I am very pleased with this DIY inverter.


----------



## jhuebner (Apr 30, 2010)

Glad to hear that 

So I have taken a different approach to DC current derating. Instead of running a control loop on the DC current (which isn't measured directly and is only derived from the AC current 4x per second) I decided to simulate a constant power region.

There is a new parameter fpconst. Above fpconst fslipspnt is derated until fweak is hit, then fslipspnt is uprated again and reaches its normal value at 2*fweak-fpconst.

The amount of derating is scaled by 2*((fweak-fpconst)/fweak), so the minimum value that is reached at fweak depends on where the derating starts.

Attached is the log of a testdrive. fweak is 90Hz both times, in the second plot fpconst is 60Hz. You can see some "natural" derating in both plots caused by the voltage drop of the cold batteries. In the second plot you can see the RMS current ramping down above 70Hz.

When fpconst is configured > fweak it has no effect.


----------



## arber333 (Dec 13, 2010)

I tried the 115Hz while driving on highway. I used 4th gear with 3500RPM uphill. Derating starts at cca 3000RPM and i saw current stop at 230A at 3500RPM and when RPM rose to 4500 draw was 210A! It works.


In 5th gear however i went uphill at 3000RPM and at 3500RPM a had 263A and rising!!! I think i will have to lower the fpconst to 100Hz. My FW is now at 155Hz. Maybe that will work in 5th.


I thinks this works as promised, however i dont know how fast the derating works...


tnx J



A


----------



## jhuebner (Apr 30, 2010)

Ok strange. There is no control loop involved so I'm surprised you get different results in different gears. Are you sure the value was still in place when you repeated the test?

That said 115Hz means about 3400rpm. So no derating before that.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Ok strange. There is no control loop involved so I'm surprised you get different results in different gears. Are you sure the value was still in place when you repeated the test?
> 
> That said 115Hz means about 3400rpm. So no derating before that.


115Hz was set yesterday evening and saved in flash. 
I use 6Hz maxslip and have to account for cell Udrop. I believe i saw verifiable derating at cca 3500RPM that is cca 110km/h in 4th. I did push the car uphill... so i checked only amps and RPM.
In 5th i guess i still havent reached 3500RPM at same speed. 
I will make some graphs now to record power actual...


----------



## arber333 (Dec 13, 2010)

Hm

J please explain, how exactly does fpconst show in normal driving. Are you able to go beyond fweak? 

If i set fpconst at 100Hz, will my slip will be derated by 70% if i understood correctly? So instead of 6.2 i will get 4.3Hz at upper part of RPM curve?

I will try to set this so i could use my new 450A IGBTs for a really quick start.

tnx

A


----------



## MPaulHolmes (Feb 23, 2008)

Here's some pseudocode for what I do to limit battery amps. Just another approach. Great work, by the way!:

```
batteryCurrent = currentPhase1 * duty1 + currentPhase2 * duty2 + currentPhase3 * duty3;
if (batteryCurrent > maxBatteryCurrent) { 
	averageDuty = (duty1+duty2+duty3)/3;
	if (averageDuty > 0) {
		temp = maxBatteryCurrent / averageDuty;
                if (IqRef > temp) {
				IqRef = temp;
			}
		}
	}
}
```


----------



## dcb (Dec 5, 2009)

just some more reading, don't quite get it completely yet, but the controller *should* have the necessary bits to do it.
http://www.vkingpub.com/VkUpload/201406161627404039.pdf
http://www.vkingpub.com/VkUpload/201406161534433632.pdf


----------



## jhuebner (Apr 30, 2010)

Is this a sensorless method? I thought so at first but then they draw a speed sensor in the test system. But maybe thats just for illustration purposes. If it is really sensorless it would be a large improvement.

Like said I'm currently not available for software development, but I hope the current framework will enable somebody else to jump in. Like you say, all needed inputs are available.


----------



## dcb (Dec 5, 2009)

No coding expectations with it, but would appreciate help understanding it from anyone whom it makes sense. I'll pick it over a bit more, no dyno here so I would have to do careful acceleration tests, etc.

I don't see where they incorporated the speed signal in the equations though, but they do indicate good low speed performance, so it might be hidden in the object code implementation. 

It also seems that torque control without flux control would be ideal (throttle cruise control can come later.

Also, this was entertaining (too many philosophers, not enough cooks), suggest sliding mode is worth considering...
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.52.5072&rep=rep1&type=pdf

probably first step is get it running then experiment with sliding slip vs current (or experiment w/v and hz separately), and measure performance/efficiency.


----------



## arber333 (Dec 13, 2010)

Well i can tell now that at the best setting controller is giving clean acceleration and no vibration in steady drive. It seems to consume cca 2kW more at highway speeds but i am still not sure if this is due to error in primary hall sensor reading. 
Motor is not heating over 110°C whereas with low voltage controler it would heat over 140°C in 40min drive. This alone is worth investing in it. 
Also with water cooling i dont think i ever saw controller go beyond 40°C.

I am now using cruise control more and more. It also seems to consume cca 1kW more than throttle driving. I noticed it almost never goes to regen despite downhill...

A


----------



## jhuebner (Apr 30, 2010)

Yes same here. The controller is air-cooled only and sits where the radiator used to reside. Never seen more than 50°C. The motor can reach above 100°C on hot summer days when going uphill.

I have seen the cruise control do regen but only on rather steep slopes. The kind of hills that make your car go faster when not in gear. So above 5% or so.


----------



## gunnarhs (Apr 24, 2012)

dcb said:


> No coding expectations with it, but would appreciate help understanding it from anyone whom it makes sense. I'll pick it over a bit more, no dyno here so I would have to do careful acceleration tests, etc.
> 
> I don't see where they incorporated the speed signal in the equations though, but they do indicate good low speed performance, so it might be hidden in the object code implementation.
> 
> ...


Hi the theory of the matter was discussed quite throughly in this thread here http://www.diyelectriccar.com/forums/showthread.php?t=76985.
I will refer here to your previous posted papers of the improvement of DTC with help of Space-Vector-PWM (and later Fuzzy instead of Table-values)
here some points for clarification
1. The underlying method in the papers is a (speed-) sensorless
DTC-control, the speed sensor in the testing-diagram is only for measurement of the actual control -quality but does not serve as control (input) parameter. 
2. The only significant improvement over standard DTC is the use of Space-Vector-PWM which enables to use constant switching frequency which is better for the electronics and the human ear (by using frequencies well over 3000 HZ ).
3. The simplest form of Fuzzy-Logic is actually a basic switching table but further improvements are welcome


----------



## dcb (Dec 5, 2009)

thx for the reminder, that is an interesting thread.

fwiw I lost a lot of good parts in the last flood so I'm kind-of starting over, but I did snag a couple 1.5 hp motors and a surplus torque sensor to do some bench testing in the meantime (might go with an alternator for the dyno, it's a chicken and an egg using an induction motor as a brake to test an induction motor).

It seems like with just trial and error (and lots of logging) one should be able to piecemeal a best case acceleration v/hz map (like a fuel injector map) for a given vehicle, or efficiency map, as a "worst case" scenario, which isn't so bad because it is basically a binary search.


----------



## Tony Bogs (Apr 12, 2014)

Here's Stiive's go at DTC-SVM, he did get it to work, but there were some issues at the end if I remember correctly:
http://www.diyelectriccar.com/forums/showthread.php/3-phase-dtc-svm-induction-motor-74151.html


----------



## dcb (Dec 5, 2009)

Tony Bogs said:


> Here's Stiive's go at DTC-SVM, he did get it to work, but there were some issues at the end if I remember correctly:
> http://www.diyelectriccar.com/forums/showthread.php/3-phase-dtc-svm-induction-motor-74151.html


interesting also, but I think that was hysterisis control, not svm, but it is confusing.

Also I *thought* i read in there somewhere that someone sort-of preloaded the flux before changing speed (i.e. from 0 rpm? dc injection just before launch?) and got more out than expected just from instantaneous battery draw. Just making a note to try it sometime.


----------



## Tony Bogs (Apr 12, 2014)

DTC is a form of hysteretic control. It can be combined with flux space vector input to improve control (SVM).

ABB had the IP rights to DTC (expired recently AFAIK):
https://library.e.abb.com/public/14f3a3ad8f3362bac12578a70041e728/ABB_Technical_guide_No_1_REVC.pdf

A DTC (MATLAB) design, showing the six SVM sectors:
http://www.enggjournals.com/ijet/docs/IJET12-04-02-008.pdf


----------



## dcb (Dec 5, 2009)

That is sort- of what I'm getting at, everything I've read shows svm based DTC is fixed pwm frequency, even that first ABB link appears to be switching at 40khz. 

" Torque and flux status signals are calculated
using a two level hysteresis control method.
These signals are then fed to the optimum pulse selector"

...

"This configuration brings immense processing speed such that
every 25 microseconds the inverter’s semiconductor switching
devices are supplied with an optimum pulse for reaching, or
maintaining, an accurate motor torque."

So they implemented the sensing/logic with hysteresis, but the power control is fixed frequency.

whereas in the other thread Stiives describes the DTC sound (spread spectrum) and mentions hysteresis control...

Indeed:


Stiive said:


> the hardware OTOH took about 2months and many hours!
> I had heard that DTC will make the motor sound awful, sounds alright to me at these lower powers so far.


A hardware based high power variable band hysteresis controller would take a while to sort out, but you don't need any extra current limiting stuff either, current limiting is at the core of it.



Stiive said:


> DTC sound is starting to come through now though. . Decibels seem to vary with flux :s





Stiive said:


> Yeh, my hysteresis band is very small


A comparison of DTC and DTC-SVM
http://ijartet.com/papers/ICAEECA-2015/V02S110203.pdf

```
DTC 
uses hysteresis controller
Controller output will be flux and torque
Forward Euler Integrator
Variable switching frequency

DTC-SVM 
uses PI controller
Controller output will be voltages of d-q
Trapezoidal Integrator
Constant switching frequency
```
Then there is the obligatory million papers upgrading the pi controller to an estimator to an observer (estimator w/feedback) to fuzzy logic (hardcode some educated guesses), etc...

But stiives implementation doesn't sound like the DTC-SVM I am familiar with, which *should* be within reach of the huebner controller, though 40khz might be asking a bit much of it.


----------



## Tony Bogs (Apr 12, 2014)

Yeah, the terminology is confusing. 
The original DTC patents are clear: hysteretic control, for which high speed sensors and controllers are needed. 

I'm sticking to good old VFD. Minimal software effort.


----------



## jhuebner (Apr 30, 2010)

dcb said:


> But stiives implementation doesn't sound like the DTC-SVM I am familiar with, which *should* be within reach of the huebner controller, though 40khz might be asking a bit much of it.


Not sure how numerically heavy DTC is. If it is similar complexity as slip control then 40kHz is doable. Otherwise for a few bucks more you can do a plug and play upgrade to the STM32-H405 which houses the same STM32-F4 that Stiive used, if I remember correctly.

The software shouldn't change much at all. You'd have to work on it anyway to implement DTC.


----------



## dcb (Dec 5, 2009)

the h405 is a nice option. I do want an excuse to play with mbed (might encourage more developers, not necessarily art majors) more though, so kind-of toying with this nucleo idea:

http://www.mouser.com/ProductDetail...=sGAEpiMZZMvc81WFyF5EdrL2yzGi9HGfJJ72E2OvwAY=

has 3x adc, but I can't figure out how to sync more than 2, and not sure how critical it is to get bus voltage lined up with the phase that precisely.

fyi, my early attempts at importing libopencm3 to mbed were fairly miserable. but my el'cheapo text lcd and button shields are happy enough on nucleo and mbed (though I had to replace the blue lcd with transflective green, I REALLY hate blue, especially at night, or during the day)


----------



## Tony Bogs (Apr 12, 2014)

Just had another great Zen experience with one of Damien's videos. Almost fell asleep. Panzer episode 25, inverter 6. Nice board upgrades. Really like the robust Ampseal.

The software takes so much more time and effort than a piece of hardware. So hat tip to Johannes and other contributors. Just checked: libopencm3 does support the F4.


----------



## jackbauer (Jan 12, 2008)

Sorry for putting you asleep Tony


----------



## Tony Bogs (Apr 12, 2014)

No, just took my afternoon nap before watching the video (yeah, I'm that old). Nice videos, but luckily there's fast forward. 

Btw, did I miss the full power desat test while fast forwarding? 
I'm definitely going to test desat at full power, but with an ACPL-339J and IXYS drivers in stead of fixed R soft shutdown ACPL's.


----------



## jhuebner (Apr 30, 2010)

Tony Bogs said:


> The software takes so much more time and effort than a piece of hardware. So hat tip to Johannes and other contributors. Just checked: libopencm3 does support the F4.


Great  I hope you can pick up the software development. I think the hardest part is installing the toolchain


----------



## Tony Bogs (Apr 12, 2014)

Nope, not taking over development, but I will modify the SW for my build.
Probably not before 2018  though. SiC. 

Toolchain: it's definitely easier to install an .exe, but I'm not a newbie to Linux or open source.


----------



## arber333 (Dec 13, 2010)

Well i have to report i really have nothing to report .
I know it is rather boring but i drove like 9000km from controller built and there are no additional problems. I really like cruise control.
Since we know operation without problems is just boring  i produced some inconveniences, mostly by my preference.

- throttle pedal is exponential and throttle curve is exp also. That means things happen quickly in the first 30% throttle command. I would like to stretch this area for better regen control...

- I still havent succeeded in getting DC amp limit draw with the slip derating, mostly because roads are now slippery and not good to test at max torque/power!! Will try it in spring.

- I will have to figure out how to use PWM output indication of motor temperature. I still havent made this work.

- What about brake pedal regulation? I still have a 5K pot under my brake pedal. Couldnt this be used in code to have more control when braking?

- Also i still have to try and use clutch switch to open *forward *pin and release motor from torque. That could ease shifting without clutch. And with clutch for that matter, since motor wouldnt brake on released throttle.

- There is still the question of PMSM motor drive. Controller can drive it sensorless without hardware change, but reactive current component is heating motor and consuming batteries. 
Also to use EMRAX motor fully controller would have to operate up to 600Hz or even better 800Hz sinus. Can this be done with current hardware?


----------



## jhuebner (Apr 30, 2010)

Congratulations on 9000km! That was quick.

Most things are out of my reach right now.

but this one:



arber333 said:


> - What about brake pedal regulation? I still have a 5K pot under my brake pedal. Couldnt this be used in code to have more control when braking?


You can connect the pots in series:

- GND: brake pot "positive" pole, i.e. as the brake pedal is pressed, the wiper moves closer to that pole
- Brake pot wiper to "negative" pole of throttle
- throttle pot wiper to inverter input
- throttle "positive" pole to 3.3V

So when you press the brake pedal the voltage is drawn towards GND. Full brake is potmin. When you press the accelerator pedal the voltage is drawn towards Vcc and full throttle is potmax. 

Of course that also means that pressing both throttle and brake gives a weird combination of the two.

Don't forget to disconnect the brake switch, as it sets the regen torque to a fixed value.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Congratulations on 9000km! That was quick.
> 
> Most things are out of my reach right now.
> 
> ...


!!! OK now that is a cool idea. However i forgot to say that i use hall sensor for my throttle pedal. Its powered by 5V and it puts out 0.8V - 4.2V. Then i use resistor divider to get this down to 0V - 3V. I dont know what would happen if i connected 5K pot in series. I am not sure i want to find out the results.... .

I vote for separate brake pot seting in software later on. Whenever you are available J.


----------



## dcb (Dec 5, 2009)

arber333 said:


> - I will have to figure out how to use PWM output indication of motor temperature. I still havent made this work.


a while ago I used a pwm signal to drive a cheap low power analog meter (for an mpg reading), I experimented with the duty cycle and set the max duty cycle to 100%fsd, and half of that was %50 fsd. You might be able to feed a potentiometer and have the wiper drive the meter for adjustment too. knowing what I do now, I might add a "freewheel" diode and/or drive it with a transistor, but you get the idea. A digital voltmeter can probably be scaled with a pot and very small capacitor to give a meaningful result too (i.e. 1.00 v = 100 degrees (C or F, whatever floats your boat)

edit, I assume the max output from the pwm is ~3.2v so keep that in mind when scaling for C/F.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> !!! OK now that is a cool idea. However i forgot to say that i use hall sensor for my throttle pedal. Its powered by 5V and it puts out 0.8V - 4.2V. Then i use resistor divider to get this down to 0V - 3V. I dont know what would happen if i connected 5K pot in series. I am not sure i want to find out the results.... .
> 
> I vote for separate brake pot seting in software later on. Whenever you are available J.


Ok sure.



dcb said:


> a while ago I used a pwm signal to drive a cheap low power analog meter (for an mpg reading), I experimented with the duty cycle and set the max duty cycle to 100%fsd, and half of that was %50 fsd. You might be able to feed a potentiometer and have the wiper drive the meter for adjustment too. knowing what I do now, I might add a "freewheel" diode and/or drive it with a transistor, but you get the idea. A digital voltmeter can probably be scaled with a pot and very small capacitor to give a meaningful result too (i.e. 1.00 v = 100 degrees (C or F, whatever floats your boat)
> 
> edit, I assume the max output from the pwm is ~3.2v so keep that in mind when scaling for C/F.


The PWM is open collector (BC549) and his indicator only has two wires. But it comes close. Connect red to 12V, GND to the PWM output that has been filtered with an RC like your schematic.


----------



## dcb (Dec 5, 2009)

jhuebner said:


> The PWM is open collector (BC549) and his indicator only has two wires.


Ah, ok and there are gain and offset parameters to adjust it, cool.

http://www.diyelectriccar.com/forums/showthread.php?p=654010#post654010


----------



## EVElvis (Jun 20, 2009)

Hi All

You will be pleased to know I have finally got my inverter working and spinning a motor:

https://www.youtube.com/watch?v=6WDoVbpveuI

Now have renewed confidence that I will finally get my project rolling.

Thanks for all the help!

cheers
Tim


----------



## Tomdb (Jan 28, 2013)

Some great progress, now just slap it in the car and drive.


----------



## jhuebner (Apr 30, 2010)

Great! Well stick on a speed sensor, then put it in the car.

The drop in the supply current you noticed is down to the switching pattern. Once you approach the maximum amplitude (I guess fweak is around 15Hz) Each phase switches 1/3rd less. Therefor only 2/3rd of the switching power is needed at full amplitude. You don't quite see that ratio because of all the standby power.


----------



## EVElvis (Jun 20, 2009)

Not long now I hope. Weather holding progress to some extent, but gives me time to read more about what is going on and plan the battery pack & BMS etc. 
Good to know drop in supply power is expected.
Cant recall what fweak was, seem to think it is 124 Hz, set for the larger motor in the car? 
Fortunately the motor in my car already has a suitable encoder HEDS-5605-FB fitted, as described in the attached. Just ordered a KTY83 temp sensor, as the one fitted to the motor is much like that provided for the inverter temperature. 

Hopefully next video is spinning the 90kW peak 25 kW continuous motor installed.


----------



## postmann2002 (Jan 28, 2013)

Hello,
I'm a long time reader here in diyelectriccar... and especially interested on this thread.
I'm from Germany, so sorry for my bad english.

A few years ago I had the idea to build an electric car and therefore I collected some AC-Stuff for this project. But due to lack of time I give it up.
Maybe I will continue this idea of a selfmade-electric-car in a few years more, when my son becomes 18... and able to help me
But, if someone is interested to buy this stuff, I will sell it.

Here are the electric components from a 10t Hybrid-Bus:

Motor/Generator PMSM/BLDC 1FV5139 85kW (rated)... I think able of >200kW peak.

2 x Driver-Boards from Elfa-Duo-Inverter
(one Driverboard is damaged (two of eight Driver-circuits are smoked by a shortcut or overcurrent... the corresponding two IGBT's were also damaged).
The Bards have also onboard a Isolated Voltage measuring circuit and connectors for two amp-sensors and one Temperature-Sensor (temperature-control of IGBT's)
4 x Big Capacitors Epcos 2100µF 385V (in the original Inverter were two in series... so 770V rated)
6 x Big IGBT
2x Current-Sensors
Temperature-Sensor
Brainboard (I don't know if someone can reuse it)
Some Stainless-Screws
Multilayer of stainless metal-sheets with Isolators (Busbars and Phases U, V, W)

Throttle (original from the Hybrid-Vehicel)

IMA Battery NIMH 144V and 6,5Ah (Honda Insight) capable of 10kW (maybe more for shorter periodes) for experiments.
Selfmade Charger (350mA)
Please note, that a Inverter-Box is not included.

all together 3000€ pick up (interesting for the european ev-community)

I think, that this combination, "Homebrew ac-controller" with my stuff, would be a easy way for somebody who has time and knowledge to build his/her high power Inverter/drivetrain.

Imagine... the AC-Power-Stage powered a 10-tons-bus to a velocity of ~80km/h... what would it do with a 1.5t electric car?

Here is my advertisement in Germany:

http://www.ebay-kleinanzeigen.de/s-...lektroauto-motor,-inverter/397342132-223-4863

...and a few pictures

Regards Peter


----------



## postmann2002 (Jan 28, 2013)

Hello,
I'm a long time reader here in diyelectriccar... and especially interested on this thread.
I'm from Germany, so sorry for my bad english.

A few years ago I had the idea to build an electric car and therefore I collected some AC-Stuff for this project. But due to lack of time I give it up.
Maybe I will continue this idea of a selfmade-electric-car in a few years more, when my son becomes 18... and able to help me
But, if someone is interested to buy this stuff, I will sell it.

Here are the electric components from a 10t Hybrid-Bus:

Motor/Generator PMSM/BLDC 1FV5139 85kW (rated)... I think able of >200kW peak.

2 x Driver-Boards from Elfa-Duo-Inverter
(one Driverboard is damaged (two of eight Driver-circuits are smoked by a shortcut or overcurrent... the corresponding two IGBT's were also damaged).
The Bards have also onboard a Isolated Voltage measuring circuit and connectors for two amp-sensors and one Temperature-Sensor (temperature-control of IGBT's)
4 x Big Capacitors Epcos 2100µF 385V (in the original Inverter were two in series... so 770V rated)
6 x Big IGBT
2x Current-Sensors
Temperature-Sensor
Brainboard (I don't know if someone can reuse it)
Some Stainless-Screws
Multilayer of stainless metal-sheets with Isolators (Busbars and Phases U, V, W)

Throttle (original from the Hybrid-Vehicel)

IMA Battery NIMH 144V and 6,5Ah (Honda Insight) capable of 10kW (maybe more for shorter periodes) for experiments.
Selfmade Charger (350mA)
Please note, that a Inverter-Box is not included.

all together 3000€ pick up (interesting for the european ev-community)

I think, that this combination, "Homebrew ac-controller" with my stuff, would be a easy way for somebody who has time and knowledge to build his/her high power Inverter/drivetrain.

Imagine... the AC-Power-Stage powered a 10-tons-bus to a velocity of ~80km/h... what would it do with a 1.5t electric car?

Here is my advertisement in Germany on "ebay-kleinanzeigen":

http://www.ebay-kleinanzeigen.de/s-...lektroauto-motor,-inverter/397342132-223-4863

...and a pictures

More informations here in diyelectriccar marketplace:

http://www.diyelectriccar.com/forum...er-components-166874.html?p=708746#post708746

Regards Peter


----------



## postmann2002 (Jan 28, 2013)

Hello,
I'm a long time reader here in diyelectriccar... and especially interested on this thread.
I'm from Germany, so sorry for my bad english.

A few years ago I had the idea to build an electric car and therefore I collected some AC-Stuff for this project. But due to lack of time I give it up.
Maybe I will continue this idea of a selfmade-electric-car in a few years more, when my son becomes 18... and able to help me
But, if someone is interested to buy this stuff, I will sell it.

Here are the electric components from a 10t Hybrid-Bus:

Motor/Generator PMSM/BLDC 1FV5139 85kW (rated)... I think able of >200kW peak.

2 x Driver-Boards from Elfa-Duo-Inverter
(one Driverboard is damaged (two of eight Driver-circuits are smoked by a shortcut or overcurrent... the corresponding two IGBT's were also damaged).
The Bards have also onboard a Isolated Voltage measuring circuit and connectors for two amp-sensors and one Temperature-Sensor (temperature-control of IGBT's)
4 x Big Capacitors Epcos 2100µF 385V (in the original Inverter were two in series... so 770V rated)
6 x Big IGBT
2x Current-Sensors
Temperature-Sensor
Brainboard (I don't know if someone can reuse it)
Some Stainless-Screws
Multilayer of stainless metal-sheets with Isolators (Busbars and Phases U, V, W)

Throttle (original from the Hybrid-Vehicel)

IMA Battery NIMH 144V and 6,5Ah (Honda Insight) capable of 10kW (maybe more for shorter periodes) for experiments.
Selfmade Charger (350mA)
Please note, that a Inverter-Box is not included.

all together 3000€ pick up (interesting for the european ev-community)

I think, that this combination, (UMC or Homebrew ac-controller from jhuebner) with my stuff, would be a easy way for somebody who has time and knowledge to build his/her high power Inverter/drivetrain.

Imagine... the AC-Power-Stage powered a 10-tons-bus to a velocity of ~80km/h... what would it do with a 1.5t electric car?

Here is my advertisement in Germany:

www.ebay-kleinanzeigen.de/s-anzeige...lektroauto-motor,-inverter/397342132-223-4863

or here on "marketplace":

www.diyelectriccar.com/forums/showt...er-components-166874.html?p=708746#post708746

Regards Peter


----------



## Tomdb (Jan 28, 2013)

anyone tried this yet?

http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF257936?s_searchtype=keyword#

Going to try and get it to work with an H103 as with the heubner inverter. Might look into getting the H405 to do extensive testing.


----------



## Tomdb (Jan 28, 2013)

Built a semi permanent setup, 17s pack of a123 cells as test pack to start, right now just load testing the IMA hack. If only I had a way of building a dyno 

Have been looking at getting more test motors so this a better excuse then ever. This setup will also allow me to test different motors and voltages. A small brushless motor is hooked up, I will run the bldc software I aquired from Damien as a start but will look into getting the STM bldc motor libary running on one of my H103's. Besides those chips I put in an order with olimex for two H405's, porting the code should not be too hard. Plus working in other aspects with the improved hardware should be a nice project.

However a test bench like this will also allow me to test my BMS system, I will run two board (12s each) in series with a simple arduino with a touch screen as BMS master. This way I can easily monitor the pack whilst testing the BMS hardware and software. Guess by the time I get an vehicle most of my testing will be done.


----------



## jackbauer (Jan 12, 2008)

The inverter gets it's first real test 




Good to see smooth transition from drive to idle to regen and back. More updates soon


----------



## Tony Bogs (Apr 12, 2014)

Thank _you_, Damien! That is indeed a major step and really cool. 
Can't wait to see the updates. Maybe highway? 100mph?

Good to see the safety catch is in working order, now it has been great fun to watch.


----------



## Tomdb (Jan 28, 2013)

What did you set the amp-limit to that made it shut down?

CAnt wait to see you put in the rest of the cells and see what this puppy can do.


----------



## EVElvis (Jun 20, 2009)

Hi All

Just getting throttle pedal connected up, which is sensed ok and pot min and max set, but do not know how to get inverter in the opmode 'run' whilst using the web browser. Can still only manually operate. Have pin 7 connected to 12V.
Any ideas greatly appreciated.

cheers
Tim


----------



## jhuebner (Apr 30, 2010)

5 start conditions:
- pin 7 high
- pin 11 high
- pin 17 high
- udc >= udcsw
- potnom <= 0

Pin 7 should only be a pulse. If you keep it high the hardware shutoff won't really work because it's reset right away.


----------



## jhuebner (Apr 30, 2010)

I was finally convinced to support the use of a regen pot.

So firmware version 2.93 allows for that. You can connect a pot to the secondary input. It will scale brkmax (foot off regen) and brknompedal (brake pedal switch regen).
All tested and working in the Polo.

As usual, the new firmware is in the zip file found here http://johanneshuebner.com/quickcms/index.html%3Fen_downloads,14.html

and in the github.


----------



## arber333 (Dec 13, 2010)

Thats great! I will try it tomorrow. I used the same setup before with Zapi controller. Regen was very precise. I started to regen with 30% and within 1/3 of brake pedal travel it reached 100% regen. Rest was friction. So this way even with snow there should still be comparable brake grip front - back.

I have 5K Colvern industrial pot. Expensive as hell but very precise. Here is my setup. 
https://mazdamx3ev.wordpress.com/2013/04/20/regeneracija/


Around new year i will have 10KKm on your controller without any significant problems. That gets to show something...

I spend cca 75Ah for my daily trip. Thats some 23kWh out of 24kWh planned so math shows good consumption also. Cells should last good time. 



tnx


A


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> I was finally convinced to support the use of a regen pot.
> 
> So firmware version 2.93 allows for that. You can connect a pot to the secondary input. It will scale brkmax (foot off regen) and brknompedal (brake pedal switch regen).
> All tested and working in the Polo.
> ...


I see i use 5K three wire pot. One wire is positive (+3V) one GND and one was SIGNAL (yellow wire). The way i see it i can connect this two ways so i can have signal INCREASING or DECREASING with pedal pushed in. Do you think i would need 10K resistor across + and signal?

A


----------



## arber333 (Dec 13, 2010)

Dear all...

I had reinstalled my computer with a new version of Lubuntu recently. With it i installed PHP server and enabled system access to usb. Since then i used web interface a number of times. 
Yesterday however i tried running update with new 2.93 software and system wouldnt run procedure. I taught i there was something wrong with the setup...
Well as it turns out you have to put all .zip content, folders and all extracted to desktop! Not to another folder mind you. Since i put everything to desktop updater works as it should. 

I am going for a ride.

EDIT: some 120km driven and i am not convinced this is it. The pot response is lacking... i have to retry tomorrow. Maybe i will try Johannes connection.
Also i get the feeling my 5v hall throttle is not giving full signal since i put a simple R divider on the signal line. I get 20% of negative position and then throttle authority. Does anyone know a good analog level shifter 5V/3.3V?

A


----------



## Readykilowatt (Aug 11, 2009)

Hi,

I am in New Zealand and using a raspberrypi2 to program the inverter.
Using a Semikron Skai power stage. 

Am not able to get to start 2 mode.
When the Estop is set to the running position the overcurrent , din_ocur ,goes to 1, before the inverter is put in fwd. I'm gessing that this is inhibiting the run mode?

would this be anyting to do with not being able to save any number in the ampnom setting?

I have read that the current measurement is only for the gui, but notice there is no offset adjustment. The output from the Skai for the phase current is centered on 0 and goes + and - unlike the hall senseor which is offset to ~ 2.5V

Any ideas where I'm going astray would be greatly appreciated.

Peter


----------



## Tomdb (Jan 28, 2013)

Peter,

Read out the il1 and il2 while not in mode 2.


----------



## arber333 (Dec 13, 2010)

Readykilowatt said:


> Hi,
> 
> I am in New Zealand and using a raspberrypi2 to program the inverter.
> Using a Semikron Skai power stage.
> ...


Well i would check the power stage for blown transistors. There has to be some manual how to do that on SKAI?

Second i set up all propper signal pins to 12V source with the exception of start pin. This i setup with a button. When i touched button inverter went to start 2 if it found encoder connected. 

Also the two times oclimit was thrown:
1. when i broke IGBTs, seriously!!!! 
2. when i set oclimit = 500A!!! 
Notice you have to set oclimit to -XXX (negative)value, why i cant remember, ask J

Also you can set the apnom parameter in mode 1. Just put something for ampnom in % (i put cca 20%) and set slip for fslipspnt (1.5?). Beware motor can jump off your table if slip is not proportionate to amps! While in mode 2 your throttle pedal is setting amps proportional to slip according to encoder...

hope it helps

A


----------



## EVElvis (Jun 20, 2009)

jhuebner said:


> 5 start conditions:
> - pin 7 high
> - pin 11 high
> - pin 17 high
> ...


Thanks Johannes. Just tested it and pedal works, albeit I get low rpm at full pedal, so no doubt a parameter setting of some sort. Will have another go soon.


----------



## Readykilowatt (Aug 11, 2009)

Thanks for the replies.

It seems the phase current output from the Skai was outside the range the inverter board was expecting. 

Is there a way to adjust the offset of il1 and il2 ?
I see the gain adjustment.

Still am not able to get to start 2 mode but will try again today.

There is a nice square wave being generated.

Peter


----------



## jhuebner (Apr 30, 2010)

Readykilowatt said:


> Is there a way to adjust the offset of il1 and il2 ?
> I see the gain adjustment.


The offset auto-adjusts in stop mode and il1/il2 only display something meaningful outside stop mode.

Is the SKAI output really bipolar? The inverter only supports unipolar signals.

The negative values for ilXgain originate from the experimental use of FOC. The signals are inverted with the negative gain because they are amplified with an inverting opamp. That messes up the transformation.

Thing to remember is, that ilXgain and ocurlim must have the same sign.


----------



## EVElvis (Jun 20, 2009)

Hi all
Just looking for a suitable switch for forward and reverse and wondered what everyone is using? Wanting something that would protect against accidental switching forward to reverse.
cheers
Tim


----------



## jhuebner (Apr 30, 2010)

The software won't change direction above 100rpm.

I use the gear lever now. In the R4 I had a 3-way switch (D-N-R)


----------



## EVElvis (Jun 20, 2009)

> The software won't change direction above 100rpm.


Thats good to know, thanks Johannes.


----------



## arber333 (Dec 13, 2010)

Hi Johannes

I raised the voltage on my controler to get more range last weekend and now all my previous settings are now so so... Motor has less efficiency at same speed and i really cant get much further on the increased voltage.

Since Vdc increased from 310Vdc to 340Vdc nominal i had to change fweak from 150hz to 165hz. It wouldnt work good. Motor whines when i apply power and it consumes about 2kW more than it should. 
Ie... 20kW to drive 100km/h level road!!

I use

boost=1600
fweak=165Hz 
fslipmin=1.2Hz
fslipmax=4.3Hz reaction is slower than with 6.2Hz but less amp draw in the end
fmin=0.6Hz
ampmin=28%

Also i noticed at 3500RPM battery Vdrop becomes quite significant. It seems there Vrmsmax is applied and motor goes to weakening... But i set this to 165Hz hm....? 

If i check fslipspnt at steady speed fslipspnt=1Hz and ampnom=83% at 100km/h. What does this tell me?

What do you think i am doing wrong?


----------



## arber333 (Dec 13, 2010)

There is also a side issue i want to discuss.

I am using pedal hall sensor as throttle. It is 0.8V - 4.2V signal and runs on 5V. I used voltage divider that made 0.5V - 3.3V. Now when i connected to throttle i only got digital value from 580 to 3500! Why would that be? 
Resistor values are 6K8 signal to gnd and 1k8 throttle to signal out. Did you use some pullup resistors in circuit. Should i add it to this divider?

Also i tried to wire second 5K pot (resistive potentiometer) to brake pedal and i got marginal results. 
I connected 5K resistor from 3V3 to signal then wire to pot wiper and one wire to gnd. I get digital value from 150 to 3000. This wiring works but i get some anomalies while driving. 
E.g. when i push brake switch even throttle regen goes to 0. When i press further regen is applied from 0 to some 4kW. By then car is at halt by friction. 
Normally that would work very good in winter, but since brake regen does not go from throttle regen it gets a little jerky when i alternate from brake to throttle pedal while driving.
Is it possible that throttle divider interferes with brake pot and vs?

tnx


----------



## arber333 (Dec 13, 2010)

Huh

I installed a new firmware on my EVdisplay to extend the sensing area to 450V and put 1M resistor inline with battery + as per instructions. Woa... it showes 237V!!! I schratched my head for a minute but i figured only electronic part left in my car that uses resistor divider is controller. That must be interfeering with EVdisplay probe...
Johannes how much total resistance is there from +B to -B in your sensing circuit?
I may have to recalculate sense resistor for EVdisplay.

A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> There is also a side issue i want to discuss.
> 
> I am using pedal hall sensor as throttle. It is 0.8V - 4.2V signal and runs on 5V. I used voltage divider that made 0.5V - 3.3V. Now when i connected to throttle i only got digital value from 580 to 3500! Why would that be?
> Resistor values are 6K8 signal to gnd and 1k8 throttle to signal out. Did you use some pullup resistors in circuit. Should i add it to this divider?


Yes, there is a 47k pull down resistor on both pot channels.



arber333 said:


> Also i tried to wire second 5K pot (resistive potentiometer) to brake pedal and i got marginal results.
> I connected 5K resistor from 3V3 to signal then wire to pot wiper and one wire to gnd. I get digital value from 150 to 3000. This wiring works but i get some anomalies while driving.


Sounds good so far.



arber333 said:


> E.g. when i push brake switch even throttle regen goes to 0. When i press further regen is applied from 0 to some 4kW. By then car is at halt by friction.
> Normally that would work very good in winter, but since brake regen does not go from throttle regen it gets a little jerky when i alternate from brake to throttle pedal while driving.
> Is it possible that throttle divider interferes with brake pot and vs?


What are your settings for brknom, brkmax and brknompedal? Currently, the brake pod scales both, brkmax and brknompedal. When the brake pot goes out of range, no scaling is done at all to allow operation without that pot. So you should add some leeway to pot2min and pot2max.



arber333 said:


> I installed a new firmware on my EVdisplay to extend the sensing area to 450V and put 1M resistor inline with battery + as per instructions. Woa... it showes 237V!!! I schratched my head for a minute but i figured only electronic part left in my car that uses resistor divider is controller. That must be interfeering with EVdisplay probe...
> Johannes how much total resistance is there from +B to -B in your sensing circuit?
> I may have to recalculate sense resistor for EVdisplay.


Yes, these two will interfere. The current setup is BAT+ 680k 680k 10k GND 680k 680k BAT -


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Yes, these two will interfere. The current setup is BAT+ 680k 680k 10k GND 680k 680k BAT -


Yes! thats it! 
But if you calculate 680K+680K= 1M3 vs second 1M shouldnt it create 33% more value. I put in one 500K pot and will try to adjust it for precision.

EDIT: I tried various resistances but it didnt seem logical. Finally i put in one 500K pot and adjusted it. It showed correct value at 325K! I guess your divider doesnt have anything to do with this since i disconnected sensor board and error was stiill there.

Well i just set my throttle with better divider and go for a drive.

A


----------



## arber333 (Dec 13, 2010)

Johannes

I have the car under control . I reduced fweak to 140Hz and gave slipmax=5.2Hz!!! When i accelerated it was quite good untill i pushed pedal in..... Car went beserk and amp meter showed 105kW amp draw!!!! Argh! I hope LiPos will be ok. It was only a moment... I have fweak set to 150 now and it behaves better.

Well i still have to set the motor temp indicator. I tried wiring it like this







Since it is pwm should i use some RC to smooth the weave?

Also i tried to setup this pwm in software, but without success. 
The function range for pwmoffset is 0 to 65535 and pwmgain -65535 to 65535 yes?
Can you tell me the math for setting pwm to show 100% duty at 25°C (600R) and 65% at 140°C (1K3)?

Tnx

Arber


----------



## jhuebner (Apr 30, 2010)

Yes. So 100% is a digital value of 4096, 65% is a digital value of 2662. So pwmgain is

(4096-2662)/(25-140) = -12.5

to reach 100% at 25°C: 4096=-12.5*25+b (=) b= 4096+12.5*25=4408
so, pwmofs=4408

And use a small R and large C to get rid of the ripple and not have to much loss over the resistor. Something like 47R and 470µF.

Your drawing is wrong, the indicator must be tied to 12V and the cathode to Pin 18.

EDIT: you can test digital values by setting pwmgain to 0 and then try values between 0 and 4096 for pwmofs


----------



## arber333 (Dec 13, 2010)

Well sh....t i connected it wrong. Yes positive is on pin18 and negative to gnd. I taught to make a pullup on pin18 and +12V but it didnt work well. 
I will have to take my dash out tomorrow and rewire it.

Meanwhile i figured the power reduction. It works. I had to set fslipmax to 5.2Hz and fpconst to 95Hz, but no matter what i do with throttle now it allways ends at 230A!!! I guess 6.2Hz was too much, even though motor didnt complain. I will stretch this a bit to 250A. 

Also i set the brake pedal sensor. I set pot2min to start reading BEFORE brake switch is on. That way i allways have larger "brake" than "release". Also i measured brake position and set pot2max value to 1/3 of pedal travel. It works great!

I cant wait when you have time to put your mind to PMSM control. That should be something... Imagine diy controller running ANY motor available . Er... aside from multiphase SRM but we can get there...

tnx

A


----------



## jhuebner (Apr 30, 2010)

Just wanted to introduce a project that I started back in 2014 whilst driving through Australia.

It's the missing link from making the inverter kit a full inverter kit. Due to a lack of time I had to ditch the project for a while. Now I wanted to at least show it off.

So, what is it:
- A dual layer PCB with most copper being used for B- and B+
- A digital isolator and a DC/DC converter for isolation
- 3 4A dual bootstrap drivers
- 6 100µF film capacitors with a total 120A RMS ripple current rating
- 12 600V/160A (@125°C) IGBTs with copack diodes

The IGBTs where designed for unipolar gate drive.

I have run it up to 120A (with 90A IGBTs) and couldn't find any hot spots, just general heating because there is no real cooling mechanism on a solid aluminum plate. Also the ringing on the DC bus is really minimal, observed only a 3V overshoot at a bus voltage of 70V.

So I reckon this power stage can be used up to 450V and 250A (~100kW). I currently have no means of testing it though.

The BOM adds up to about 300€.


----------



## arber333 (Dec 13, 2010)

Ah so that would be really inexpensive LV inverter.

So i guess that would be voltage limit of ~300VDC? I am not sure about using IGBTs higher than 1/2 voltage rating.
You think 600uF would be enough capacitance for cca 300A?
What about IGBT losses x12? IGBTS have their own diode allready on?

According to BOM is that material price for whole inverter circuit or just the power stage circuit?

tnx

A


----------



## jhuebner (Apr 30, 2010)

Quote:
Originally Posted by *arber333*  
_Ah so that would be really inexpensive LV inverter.

So i guess that would be voltage limit of ~300VDC? I am not sure about using IGBTs higher than 1/2 voltage rating._

It depends on the bus inductance. And that is really low as it is basically a laminated bus with as short as it gets traces between capacitors and IGBTs.

Quote:
Originally Posted by *arber333*  
_ You think 600uF would be enough capacitance for cca 300A?_

Yes, in a paper quoted earlier in this thread they recommended the ripple current rating to be about 1/2 of the RMS AC current. That criteria is met.

Quote:
Originally Posted by *arber333*  
_ What about IGBT losses x12? IGBTS have their own diode allready on?_

Yes diode is on chip. What do you mean about x12 losses?

Quote:
Originally Posted by *arber333*  
_ According to BOM is that material price for whole inverter circuit or just the power stage circuit?_

Just the power stage. The controller kit without gate drivers would add another 160€ + chill plate + enclosure.


----------



## jackbauer (Jan 12, 2008)

I'll be doing some testing and development work on this power stage soon


----------



## Tomdb (Jan 28, 2013)

What you going to drive with it?
How about building it modular, so you can add stages as you need? 

I right now need to find a suitable motor to do more testing with my Honda IMA powerstage. That is why i have so little updates from my side right now.


----------



## Arlo (Dec 27, 2009)

I don't know if I am supposed to post here but I got my controller running my leaf motor in my Honda CRX... Road tests coming soon.

https://www.youtube.com/watch?v=E9ilJAO6Gzk


----------



## Tomdb (Jan 28, 2013)

How about making an new thread?
Because this thread is about an AC induction motor inverter based on the Johannes huebner controller.


----------



## arber333 (Dec 13, 2010)

Hi Johannes

I found a problem with settings. While driving in reverse, motor has the same power than in forward. I set up pin 19 with reverse switch. So when i put car in reverse those lights should go on as well as pin 19. It is wired open collector yes? In software i see pin 19 go live i just dont see any effect while driving.

Can you tell me how to set reduction of torque (actually it is BMS port) for reversing?

I have set it at 35. I taught this means 35% of power... Should i put -35% in?

tnx

A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> I have set it at 35. I taught this means 35% of power... Should i put -35% in?


So din_bms goes high when you put in reverse? You set bmslimhigh to 35?

Thats the setup I'm using as well. There's no mechanism that should prevent this from working.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> So din_bms goes high when you put in reverse? You set bmslimhigh to 35?
> 
> Thats the setup I'm using as well. There's no mechanism that should prevent this from working.


Huh, then i will set it even lower. When i reverse car wants to lurch back if i am not careful with pedal... 25 is lower than 35 yes?

A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> 25 is lower than 35 yes?


Yes
.......


----------



## arber333 (Dec 13, 2010)

Well BMS(actually it is reverse) limit works somewhat better now. 

How does value -1 affect regen? What would -5 do?

Also i set the RC divider and propper polarity of my temp indicator like you suggested. I had to adjust values some due to my 13.8V workng voltage. It works very good. I simulated KTY84 reading using resistors. At 85°C indicator is yellow, at 110°C and 120°C it is blinking yellow amd at 145°C it turns red. Over 150°C it blinks fast and beyond 160°C it goes out.
I will check tomorrow how this works. 
Later i will maybe add 12V stable regulator if i find voltage drop... 

For anyone who would need this kind of (voltage) sensor
http://www.ebay.co.uk/itm/6v-12v-24v...8AAMXQVT9S2Hr5

EDIT: I have set gain to -22.5 and offset to 3550. Those values were most accurate from 85°C to 140°C where my motor would run. Today in the morning i drove to work at 100km/h and watched. LED wouldnt even go past green. So cooling is very effective, even though it was -5°C outside .


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Well BMS(actually it is reverse) limit works somewhat better now.
> 
> How does value -1 affect regen? What would -5 do?


-1 is pretty much no regen at all. Try what works best for you. I think my setting is -20. More negative value - more regen - more braking force.



arber333 said:


> Also i set the RC divider and propper polarity of my temp indicator like you suggested


Great


----------



## arber333 (Dec 13, 2010)

Some info. I added 25mm alu standoffs over rear shocks to lift the rear part of car to acceptable height. It wasnt difficult. Now car is at somewhat level ride again. 
Now i noticed something weird... Cca 1kW less consumption at 100km/h on level road....huh!? 
I guess suspension geometry changed when i put 150kg of cells in the trunk. Now that i returned (as much as i could) to default again i see improvement... That goes to show good alignment is mandatory when converting EVs.


----------



## PStechPaul (May 1, 2012)

If you jack up the back end higher than the front it will always be going downhill, so of course it will use less energy!


----------



## arber333 (Dec 13, 2010)

PStechPaul said:


> If you jack up the back end higher than the front it will always be going downhill, so of course it will use less energy!


Hah, reminds me of a winter day when i was ridge gliding against a prevailing West. It was blowing so strongly i was actually gaining height on the back slope...energy laws forgotten...for some 20minutes .


----------



## jhuebner (Apr 30, 2010)

Yep, had to do the same thing. I wasn't aware it would affect energy consumption though, nice observation.

This is what I started out with:


----------



## jhuebner (Apr 30, 2010)

Since I ran out of sensor board PCBs I decided to do a little redesign on the next one.

So I decided to introduce my idea of isolated bus voltage sensing:

DC/DC converter, ATTINY13 MCU, PC817 (or some other generic) opto. It is cheaper than using an isolated opamp.

The MCU measures the voltage and converts it to a PWM signal. That is transmitted using the opto and low pass filtered to make it a DC signal again.

Tweaked it for good linearity and decided it will be on the next kits.

The MCU comes preprogrammed, the program is trivial anyway and will make it's way into the zip file.


----------



## Tomdb (Jan 28, 2013)

Does the PWM get reduced to an linear signal again, or does the H103 convert the PWM based on duty cycle?


----------



## jhuebner (Apr 30, 2010)

Tomdb said:


> Does the PWM get reduced to an linear signal again, or does the H103 convert the PWM based on duty cycle?





jhuebner said:


> The MCU measures the voltage and converts it to a PWM signal. That is transmitted using the opto and low pass filtered to make it a DC signal again.


So yes, linear signal.

The new board has exactly the same electrical interface as the previous.


----------



## arber333 (Dec 13, 2010)

Good thinking J!

I found it annoying to have to add so many DCDC converters for each thing that misbehave when i rev my motor.

I will order one board of course 

EDIT: I also found out i forgot to turn off a small light in my car and today motor temp light was blinking orange for some time.... I will add one 12V nonisolated PSU, like this.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> EDIT: I also found out i forgot to turn off a small light in my car and today motor temp light was blinking orange for some time.... I will add one 12V nonisolated PSU, like this.


Do you think it will help? It's a 7812 regulator, so it can only convert down, not up, right?


----------



## PStechPaul (May 1, 2012)

I had a similar idea for a cheap isolation amplifier:

http://www.diyelectriccar.com/forums/showthread.php?t=159130&highlight=isolation+amplifier


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Do you think it will help? It's a 7812 regulator, so it can only convert down, not up, right?


Darn! You are correct, i read datasheet...
On the other hand i got this regulator. It could supposedly provide stable 12V from varying 5V - 35V source.
http://www.ebay.co.uk/itm/121421996181?_trksid=p2057872.m2749.l2649&ssPageName=STRK:MEBIDX:IT

I just got it from ebay. I will play with it a bit...


----------



## jhuebner (Apr 30, 2010)

Ok, IL300. It does not need an isolated power supply. So it would match cost with the PWM solution and not need programming.

When calculating it with my 500V bus voltage you'd need a 1W resistor for 2mA drive [email protected] Or 5W for 10mA

So yes, also a possible simple design.

EDIT: Or maybe not...
For the thing to be linear you need some compensation circuitry. And that needs an Opamp and thus an isolated power supply.

Supplying with the high voltage and (resistor/Zener) is not very universal, as you have to adjust the resistor to the DC voltage of your project. Plus it won't work at lower voltages.

EDIT2: I also played with the NE555 but never got a linear voltage/pulse-width out of it because it basically follows a capacitor charge curve.


----------



## dcb (Dec 5, 2009)

jhuebner said:


> Or maybe not...



did you consider the isolators w/built in dc/dc?
http://www.mouser.com/Search/Refine.aspx?Keyword=digital+isolator+dcdc&Ns=Pricing|0&FS=True

my own preference would be a dual receive, full and a half pack voltage tap reference for 1st order balance monitoring.

edit: "The Si88xx isolated dc-dc converter is based on a modified fly-back topology and uses an external transformer and
Schottky rectifying diode for low cost and high operating efficiency. " so not a built in dcdc :/


----------



## jhuebner (Apr 30, 2010)

Yes I did consider it and I used such a part before on a different project.

But:
The part you reference needs an external transformer for the DC/DC feature.

You'd need the original: http://www.digikey.de/product-detail/de/ADUM5211ARSZ/ADUM5211ARSZ-ND/3894016

5€ and thus more expensive then discrete DC/DC and opto.


----------



## dcb (Dec 5, 2009)

yah built in dc isn't all that critical, forgot it was the analog devices with it though. High speed is nice though.

there just seems something off about analog to 10 bit digital to iso to analog to 12 bit digital, though I'm sure it will work. 

Is there any benefit looking forward though (i.e. for FOC implementers) for having a single stage 12+ bit fast digital -> iso -> cpu reading?


----------



## jhuebner (Apr 30, 2010)

dcb said:


> Is there any benefit looking forward though (i.e. for FOC implementers) for having a single stage 12+ bit fast digital -> iso -> cpu reading?


Does FOC use the bus voltage? I think DTC does. I'm not quite sure what DTC requires in terms of time delay.

The 10 bit resolution could be helped by oversampling just in case anyone cares.

Currently the only purpose is a warning light and the precharge logic. For that it's sufficient.


----------



## dcb (Dec 5, 2009)

jhuebner said:


> Does FOC use the bus voltage?


sorry for the distraction, it would use the bus voltage if it is trying to be accurate when sorting out the phase voltage pwms though. 

edit: and my recollection that fast corrections are more important than accurate, fyi. if it can only update slowly, then the results are not as good as if it can update rapidly and have the corrections average out, so 10 bit is probably better than oversampling.


----------



## dcb (Dec 5, 2009)

fyi, mpauls FOC controller doesn't require bus voltage, so maybe not critical for that application. you might be right about DTC, but that is a whole 'nuther.


----------



## jackbauer (Jan 12, 2008)

The inverter spinning up a big Siemens 1PV5138 for my drift car project


----------



## jackbauer (Jan 12, 2008)

For those people using my version of the PCBs please see the attached photo for a wire link that needs to be fitted. New boards will not need this.


----------



## MPaulHolmes (Feb 23, 2008)

jackbauer said:


> The inverter spinning up a big Siemens 1PV5138 for my drift car project


My new nickname for you is going to be DK (drift king).


----------



## arber333 (Dec 13, 2010)

Ok guys, i have something new to add...

Yesterday i installed this pedal:
http://www.evwest.com/catalog/produc...roducts_id=274
I bought it from ebay for 60€ and it was in very good condition.
It is Toyota Prius II pedal that works from 5V BUT can create 2 outputs. One is 1,6V to 5V and second from 0,8V to 3,6V. I used second o/p and behold... very smooth start but firm throttle response all the way to 100%. 
Electrical stop ends a little sooner than mechanical stop but that can be arranged . 
Connection is straightforward. It has 6 pins that can accept 2.8mm female faston crimp. I simply connected lower three pins. 

Pin 1 = +5V
Pin 2 = GND
Pin 3 = Signal (0.8V - 3.6V)










I think it is very good input pedal for this controller. You have to check you buy either LH or RH side pedal whatever the application... there are plenty of both.


----------



## Sangri (Feb 13, 2016)

Hello all.
I have a MG from Toyta Camry and IGBT IPM module from Mitsubishi 600V600A with condensators. Can anybody help me make invertor for this motor ( they have resolver as a position sensor). Please


----------



## arber333 (Dec 13, 2010)

Sangri said:


> Hello all.
> I have a MG from Toyta Camry and IGBT IPM module from Mitsubishi 600V600A with condensators. Can anybody help me make invertor for this motor ( they have resolver as a position sensor). Please


Well you can make inverter exactly as Johannes says in his instructions and on this forum.
http://johanneshuebner.com/quickcms/index.html%3Fen_motor-inverter,8.html

As far as the motor is concerned PMSM is still a no go. I can spin PMSM unloaded but as soon as i put any load to it it falls out of sync.
I suggest you find a good ACIM motor and prepare pulse encoder as i show here. https://mazdamx3ev.wordpress.com/2015/07/03/enkoder-senzor/

Also here is my controller build: https://mazdamx3ev.wordpress.com/tag/krmilnik/
Oh its slovenian language for those who want to google translate...

A


----------



## jhuebner (Apr 30, 2010)

Sangri said:


> Hello all.
> I have a MG from Toyta Camry and IGBT IPM module from Mitsubishi 600V600A with condensators. Can anybody help me make invertor for this motor ( they have resolver as a position sensor). Please


Maybe Paul Holmes controller is for you:
http://www.instructables.com/id/200kW-AC-Motor-Controller-for-Electric-Car/

Or eldis UMC drive:
http://www.diyelectriccar.com/forums/showthread.php/any-ac-motor-any-inverter-umc-152234.html

We will be working on running PMSM with the controller of this thread, but like arber says: so far it's still a no go


----------



## arber333 (Dec 13, 2010)

Well i think there are some parts that are difficult to get for Pauls controller here in EU.
I tried to order the Power ring cap and the price was $150 which is very good, but they are treating it as dangerous goods! Hence shipping to EU was $400!!? Ouch!
I will stick to elcaps that i could get almost for free here. Maybe i will change to film caps later, they are the same package than elcaps... I do have to use snubbers though, with powerring i could do without.

A


----------



## jackbauer (Jan 12, 2008)

Controller power test success


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> Controller power test success


Apparently, with no need for that fire extinguisher


----------



## jackbauer (Jan 12, 2008)

In the video I'm running in 2nd gear with the limiter set to 3200rpm. Road speed hit 30mph then hit the rev limiter. Rev limit is very smooth. Nothing happens for a bit until the torque converter hits its stall speed of about 2000rpm.


----------



## Tony Bogs (Apr 12, 2014)

Nice to see that you have found an application for the good old LM1815 pulse seperator in your rev counter, Damien! But a nano Arduino as a divider, really? Must be the IoT times.


----------



## jackbauer (Jan 12, 2008)

Back at the Lexus gearbox today with a new resolver to encoder converter. Works so much better then the demo board. No more false pulses etc. Sadly no luck getting the motor to run in torque mode as yet....


----------



## bigmouse (Sep 28, 2008)

jackbauer said:


> In the video I'm running in 2nd gear with the limiter set to 3200rpm. Road speed hit 30mph then hit the rev limiter. Rev limit is very smooth. Nothing happens for a bit until the torque converter hits its stall speed of about 2000rpm.


Very nice! Need to get yourself a LSD in that thing. I'm expecting similar results with my E46, so will hopefully swap an M3 rear end in once it's up and running.


----------



## jackbauer (Jan 12, 2008)

Thanks to Johannes for amazing work on the software I got MG2 in the GS450h gearbox running in Torque control tonight :


----------



## Tomdb (Jan 28, 2013)

Wonder what changed, and what is the starting sequence/mode?


----------



## jackbauer (Jan 12, 2008)

Still lots more to do as it is still a bit flaky but was great to get it running. Went through so many dead ends! I'll let Johannes explain the software


----------



## PStechPaul (May 1, 2012)

It looks like there is only a small range of throttle position from zero to maximum RPM. This might be due to the torque control needing a load to operate properly. But otherwise it seems to be pretty good.


----------



## Nathan219 (May 18, 2010)

Great news, I think I have one of these transmissions also if someone is wanting to duplicate. did you find a reasonable price on the Axels, what kind of power are you expecting! 

Great Teamwork guys!

P.S. just looked up a few posts I have the hybrid SUV transmission which is probably similar it function but with stub axels.


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> Thanks to Johannes for amazing work on the software I got MG2 in the GS450h gearbox running in Torque control tonight :


Very good news D . I am anxious for news. I still have that Emrax on loan and waiting patiently... I would like to use it with missing pulse encoder that i can fit directly to shaft.
How did you figure resolver signals? Do you have a separate PCB? How do you interface it to Johannes controller. What/how many pins can you use? Would we have to redesign master PCB?

EDIT: Just now I got materials to build a second inverter and i am ready to take a challenge with PMSM control. Car would be Audi A6 2.5! If not i can return Emrax and use one ACIM from a Leaf or Ampera. Would be a great build, lots of room and comfort.

tnx

A


----------



## jhuebner (Apr 30, 2010)

Ok, I'll provide some more details on the software. The changes weren't that many:



Configure a pin as an input for the north marker
When the interrupt for that pin fires, reset the angle

Add parameters "syncmode" and "syncofs", the latter describes the offset between the rotor and the electrical field
Add a "search mode" i.e. when the absolute rotor position is yet unknown (usually after power up) dump a slow (like 1Hz) sine wave at the motor until the north marker fires
Ignore slip setpoint...
When regen is requested, jump 180° back in the electrical angle (yet untested)
I think these were the vital changes. The difficult thing was to map all that stuff to reality. When we started out we didn't even know how many pole pairs the motor had. On the last two runs we discovered that the north marker fired 4 times per mechanical turn. And now Damien found out that one turn seems to equal 512 pulses, not 1024 as in the docs. I'm still confused with the north marker semantics, so I changed the code to only sync to it once and then ignore it. Which of course can be an issue when loosing sync for some reason.


Anyway, I think we are getting closer to some sort of "production version". I'm not yet sure how Saliency (that Paul explained in another thread) maps to this simple control method.


Arber, when this is solved it should be quite easy to change the north marker detection to the "missing hole method".


Any sponsoring is welcome.


----------



## MPaulHolmes (Feb 23, 2008)

> On the last two runs we discovered that the north marker fired 4 times per mechanical turn. And now Damien found out that one turn seems to equal 512 pulses, not 1024 as in the docs. I'm still confused with the north marker semantics, so I changed the code to only sync to it once and then ignore it. Which of course can be an issue when loosing sync for some reason.


I had given Damien some bad info. The leaf motor resolver has one resolver revolution per electrical revolution, so I thought it was that way for Damien's too. I couldn't check it very easily because the motor was trapped inside the gear box, but I took the motor apart yesterday and just spun the motor and looked at the encoder ticks. It's a 4 pole pair motor, so 4 electrical revolutions per mechanical revolution. The resolver has one index pulse (north marker) per 2 electrical revolutions. It is also 256 encoder ticks per 2 electrical revolutions. That means, 512 ticks AND 2 index pulses per mechanical revolution. Holy crap that was confusing!!


----------



## Nathan219 (May 18, 2010)

Someone asked me to post pics of lexus hybrid suv transmission.


----------



## Tomdb (Jan 28, 2013)

ah yes, that is the setup they went with.

SUV's got another motor in the back. The front is roughly the same as a prius.


----------



## jackbauer (Jan 12, 2008)

So tonight we got the GS450h motor running at upto 1050rpm running the inverter dc bus from my tig welder! Seems the 700rpm limit was caused by my bench power supply maxing out at 45v dc. Tomorrow night : 270V from the E31


----------



## Tomdb (Jan 28, 2013)

ran into the same issue testing the remy core from the x6, no more then some thing like 1000 rpm on 56 volts. But i had an induction reading on the motor of some 600uh


----------



## jackbauer (Jan 12, 2008)

Just recently implemented direction monitoring. Big difference


----------



## Tomdb (Jan 28, 2013)

Damm thats is some great progress.

Wonder how the stall torque is. Usually bigger loads might complicate it more, and indeed the biggest issue of starting is still there. However, depending on the ratio it might be a small creepage before engagement. 

Ever taught about just sending a pulse and measuring the currents? Should give you rotor position, atleast with some math, believe this is what is used in the Lebowski starting sequence.


----------



## jhuebner (Apr 30, 2010)

I wonder why it jumps back and forth so much. For this one rotation it basically runs in open loop mode with a low frequency.



Tomdb said:


> Ever taught about just sending a pulse and measuring the currents? Should give you rotor position, atleast with some math, believe this is what is used in the Lebowski starting sequence.


If all else fails, yes. I'd like to keep the current sensors out of motor control as long as possible to eliminate a component that can go wrong or can be misconfigured.


----------



## jackbauer (Jan 12, 2008)

The jumping back and forth happens when ampnom is too low for a set frequency.


----------



## Tomdb (Jan 28, 2013)

true, indicates that the current/torque is too low to get in phase.


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> The jumping back and forth happens when ampnom is too low for a set frequency.


Ok, so instead of using the value from the pot should I use a constant (configurable) value during indexer search?


----------



## Tomdb (Jan 28, 2013)

Would be a good start i think, just like the "stationary rpm". What frequency do you use at start?

Mind sending me the code, might try it on one of my inverters.


----------



## jhuebner (Apr 30, 2010)

Yes, it's here: http://johanneshuebner.com/stuff/sine.zip

It's also on github in the "sync_motor" path.

fslipspnt is used for searching, i.e. configurable.


----------



## gunnarhs (Apr 24, 2012)

Hi Johannes, Damien and co.
Just getting back to the forum after being inactive for some time.
Amazing progress made so far with the induction drive and the slip-control glad to see this work for you too
To the last posts here in this thread, are you going to drive PM-motors with same concept (which does not sound like a good idea on first look ?
Or are you using at least current sensors with the id/iq - modeling (which in my opinion must been done with PM-Motor-control) ?


----------



## jackbauer (Jan 12, 2008)

More volts , more speed , more fun

Think i will need to get an oil pump sorted asap....


----------



## Tomdb (Jan 28, 2013)

Some good progress again. Would love to see what the "Stall torque" behavior is. Because at standstill you need a breakaway torque, love to see how it behaves from standstill. To see if the simple control will work alright.


----------



## jackbauer (Jan 12, 2008)

Tom , I can only do this once I have oil pressure as right now it just slips the clutches if i load the output flange. Big challenge now is to get a pump that does not cost the earth!


----------



## Tomdb (Jan 28, 2013)

What kind of inlet outlet is there? Because I would suggest running just and powersteeringpump just like you did for power brakes on the panzer.


----------



## jackbauer (Jan 12, 2008)

It's designed for the toyota pump and is a custom flange mount. Plan is to make a plate from ali to bolt on with bsp ports tapped in to allow use of a non standard pump. I'm guessing i need around 100-150psi and a fairly low flow but it's just a guess.


----------



## bigmouse (Sep 28, 2008)

If you run MG1 in the correct direction, it will drive the internal pump and power the clutches. This works as long as the input shaft isn't locked. Once you lock the input shaft, the internal pump will never turn again, but MG1 torque can transfer to the output.

I still recommend using the proper pump. With the original pump and controller, you drive it with a simple PWM. Super easy.

Are you still planning on rewiring the stators for lower voltage operation, or will you be using a high voltage pack like me?


----------



## jackbauer (Jan 12, 2008)

Not sure about the rewire as yet. Still looking at options but number one thing is to get the motors turning The lexus pump would be ideal of course but sadly they are just stupid money anywhere i have looked...


----------



## jhuebner (Apr 30, 2010)

Looks pretty smooth if the startup is not being filmed  No seriously glad to see this some months after we'd started out with this jerky bumping around.



gunnarhs said:


> Hi Johannes, Damien and co.
> Just getting back to the forum after being inactive for some time.
> Amazing progress made so far with the induction drive and the slip-control glad to see this work for you too
> To the last posts here in this thread, are you going to drive PM-motors with same concept (which does not sound like a good idea on first look ?
> Or are you using at least current sensors with the id/iq - modeling (which in my opinion must been done with PM-Motor-control) ?


What you're seeing here is pure sine commutation with a linear V/f voltage curve. Current sensors are yet unused and we plan to keep it that way - less hardware involved, less paths for trouble.

Or to tell the actual less philosophic story: another naive experiment might turn out so well that there's no need for more sophistication.


----------



## jackbauer (Jan 12, 2008)

Yeah , I just turned it by hand to find the north marker Working on an adapter plate for the pump flange. Think what i'll do is stick a pressure gauge on it and spin up mg1. That will give me an idea of the pressure i'll need. If i had a second inverter i could run mg1 as a pump motor at least temporarily. Really need to get the gs450h inverter ....


----------



## gunnarhs (Apr 24, 2012)

jhuebner said:


> What you're seeing here is pure sine commutation with a linear V/f voltage curve. Current sensors are yet unused and we plan to keep it that way - less hardware involved, less paths for trouble.
> 
> Or to tell the actual less philosophic story: another naive experiment might turn out so well that there's no need for more sophistication.


As sure as I was that slip-control would work well for induction-motor-electric-car-drive, I am sure that it will not work properly for PM without some sort of iq/id -control and current sensors.
I even think we would need the full (feedback) FOC with both Clarke and Park, both using speed and current feedback.
But this is pure theory, I have never done a proper PM-drive myself for other purpose than spinning a fan. 
I think the startup problem you are running into with your control can be easily solved with some fix, either using known parameters for the drive or in the crudest version using the original vehicles starter motor to turn the motor to right start marker position  (if you have access to the rotor axis).
What I would think is impossible is doing Field weakening of the PM under load to reach "overspeed" region without using FOC and still remaining steady control.
I think the ATM / torque-converter could help keeping the PM in steady state near Base-Speed, at least at lower speeds.

But I would LOVE if I was wrong and this would work, driving a PM-drive in a car without FOC and only with speed feedback. So I will follow this experiment and not be the annoying "told you so " guy.
If it even closely vworks I will try it out in an Electric Vespa


----------



## onegreenev (May 18, 2012)

I got my little induction motor running again last night after a long hiatus from playing with this project. I now have some 96 volt batteries but was unsuccessful at getting it to run on 96 volts. I did get it to do a quick bump but mostly I only get a little electrical clunk within the motor when the throttle is at half. Its a weak bump but it is getting power. I just was not able to get it to run. So I put the 12v pack back on and it jumped to life once again. Its a 36 volt 6.3 kW Forklift AC Induction motor. Im using Johannes Hubners inverter kit. Im going out to play with it some more but will mostly be just playing around with it. 

Pete


----------



## onegreenev (May 18, 2012)

Played with my inverter and motor this evening. I tried again with the little 96 volt battery. Im guessing at this point its the battery and not the motor. I added in another 12 volts of LiFePO4 cells so I played with 24 volts and the motor just screamed to life. However I am still getting an issue I had when I stopped last winter. The drive end of the shaft gets rather hot rather quickly. Up in the 108 degree F temp range. The other end does not get hot and remains rather cool. Here is my ending settings that I used. I had played with fweak and boost and pwmfrq and found the pwmfrq set at 2 is best. I have set fweak to high numbers and low numbers. I have set boost all the way to 20000 and as low as zero.


----------



## onegreenev (May 18, 2012)

Did one last check this evening. I setup my multimeter with current sensor to check the current from the battery and from the motor leads. The battery current jumps up into the 300 amps on acceleration then nearly nothing as it winds down but since I had fweak set at 10 when the motor was nearly stopped the back current back into the battery peaks at about 200 plus amps very briefly as the motor stops. This is all under no load. Its interesting how much current the motor takes to spin up. But it does spin the motor up rather fast. I would have gotten some video of that but it was just too dark for any decent quality video. I'll do some more tomorrow to show you. 

Pete


----------



## bigmouse (Sep 28, 2008)

Cool stuff! I've been tempted to play with those AC forklift motors myself. They're wound for such low voltage that it's probably possible to get some really good power out of them with a higher voltage pack, a good rotor balance, and some proper bearings.


----------



## arber333 (Dec 13, 2010)

Well 

First 24V is a little low...but can be done
Second you have to have some boost to start the motor effectively from standstill. try 1500 value?
Third you have to give some minimal slip from start to overcome bearing friction say 0,5Hz? Maybe 1Hz
Ocurlimit is suppose to be negative so you start at 24V 100A maybe that is the reason it is heating up. If the battery is good try 200A.

You have sensor on your shaft? If not you have to start manually. So start manually! Put say 30Hz in fslipspnt and 20A in ampnom! Now you will run motor sensorless. You vary speed by putting different fslipspnt but you have to account for change of ampnom when you spin it up.
Fweak is only for sensor operation. In sensorless you deal with fslipspnt and ampnom.

tnx

A


----------



## onegreenev (May 18, 2012)

Thanks for the information. I do run an encoder which works just fine. What I don't have is my current sensors hooked up. I plan on getting those set up tonight. These motors have an encoder bearing built in.


----------



## arber333 (Dec 13, 2010)

onegreenev said:


> Thanks for the information. I do run an encoder which works just fine. What I don't have is my current sensors hooked up. I plan on getting those set up tonight. These motors have an encoder bearing built in.


Current sensors will not help. They are informative tool to setup the inverter. It could be run without them.
Hm if you have encoder check if you have correct pulse count set up.

A


----------



## onegreenev (May 18, 2012)

Pulse count is 64. I'm aware I don't need the current sensors connected for proper set up.


----------



## Tomdb (Jan 28, 2013)

Some small progress from my side.

Got distracted from this setup due to wanting to run the big Remy core from the BMW. Since i built a controller for that and will have just mechanicals there I decide to tackle converting my small test motor to something i could mount in a small bike.

Dismantled the motor for its rotor, it just fit my lathe. dialed it in and drilled a 6mm hole to except and encoder shaft that has a piece of friction material on it. (aka tape) Then rebuilt the motor, painted it and fitted the encoder. A bench test confirms I spin the sprocket the encode gives me a squarewave of 2.5 volts. So it should work.

Going to test it soon with the DIY inverter I built using all of the Huebner components. Got to get my battery monitoring setup sorted first though, some baking left to do.


----------



## onegreenev (May 18, 2012)

Did a few software adjustments and got the motor to spin up nice and smooth and after playing with it for a bit the motor shaft still got warm but not like before and not like last evening. This is still doing off throttle regen so I suspect that that is causing the induction heating of the shaft. So if its on a load Im suspecting its not going to be much of an issue. Nothing that the fan can't handle I'm sure. Now that I have some things ironed out, I can now move to the next portion. Putting a load on the motor then see how well it handles that. Im going to connect up another motor to this one first. Here is a quick flick of the motor running tonight. Just a quickie. The video I did was not so good so I'll try later for a bit longer one. But its going well. Video is in 4k. But real short in duration. 

Pete


----------



## jackbauer (Jan 12, 2008)

First time spinning the GS450h gearbox with oil pressure. Still need to do some tweaking on the inverter and rig up some switches so i can fire the shift solenoids.


----------



## Tomdb (Jan 28, 2013)

Nice. However, does this mean that you cant run mg1 to give you daul motor drive?

But this gives you a good target for an oil pump pressure. plus a blanking plate aint too bad. Probally internal regulator which is a good thing. A powersteering pump will most likely be overkill, wonder if an diesel fuel pump might work (ones used as low pressure feed that is)


----------



## dima (Dec 1, 2015)

Made some progress, figured I post some inspirational photos 

Titled this one "We eat AC Controllers for breakfast" ...grandma would not be proud, but hey - copper is copper right.


----------



## onegreenev (May 18, 2012)

dima said:


> Made some progress, figured I post some inspirational photos
> 
> Titled this one "We eat AC Controllers for breakfast" ...grandma would not be proud, but hey - copper is copper right.



How are you connecting those caps? Looks great. make the inverter skinny. Great idea.


----------



## dima (Dec 1, 2015)

I suppose it will only work with certain fat capacitors. Tight fit - makes for precise cuts and drills with a 3mm gap. I plan to bolt those last with a small hex wrench (of course use a thinner head hex bolts than in the picture)


----------



## arber333 (Dec 13, 2010)

Huh!!! I changed some parameters yesterday and today i have +5% to SOC remaining when i came to work. 

I changed: 
ampmin to 28

fslipmin to 1.6

fweak to 160 since i upped the voltage some...

And finally i belive it was the most important setting, i have 300A IGBTs and so i set my oclimit with some margin. Well i was wrong! Yesterday i set oclimit to 550 and car was livelier than before. What is best, energy consumption is less while straight driving?!!


----------



## arber333 (Dec 13, 2010)

Oh yes i wanted to ask about error reporting while driving. 
Yesterday i got shutdown on the crossroads. I managed to stop safely and secure my car etc... 

I was fiddling with inputs and i taught inverter was overheating... It turned out it was tank door switch. It is set as NC when door is closed, so that inverter works. Basicaly is same as EMG disconnect button, so that i cant drive off with cable plugged in! Now i got lot of corrosion inside switch and it seems that was it. 


It got me thinking of how trivial thing it was and how i reacted and went to check everything...lost lot of time...

Couldnt there be a form of logger inside firmware to log emergency events. We could then connect to console and see history. That way some diagnostic would help determine where the error is, kind of like blink codes for ABS?

Also you could log some 5 recent events and delete older automatically...yes?


----------



## arber333 (Dec 13, 2010)

dima said:


> I suppose it will only work with certain fat capacitors. Tight fit - makes for precise cuts and drills with a 3mm gap. I plan to bolt those last with a small hex wrench (of course use a thinner head hex bolts than in the picture)


Well i cant see why you couldnt use a small file to make the gap larger. maybe even sheet metal shears. I found out the hard way that 3mm gap is too small with voltages over 300VDC. The b..ch jumps across like lightning and you can get blown IGBT return diode. I suggest 4 to 5mm gap when applying over 300VDC.

my 2c

EDIT: I didnt use one wide rail for +/- but several thin 12mm wide strips of copper stacked together. Over them i put 2uF snubber caps. It works, period! I think i will just replace Rg 10ohm with 6R8 to get faster IGBT closing.


----------



## dima (Dec 1, 2015)

One heck of a tight fit, does anyone think this is a *bad idea* placing snubber cap so close to driver board? 

Thanks arber333 I will try to widen the gap and maybe coat the copper with some insulating lacquer.


----------



## arber333 (Dec 13, 2010)

dima said:


> One heck of a tight fit, does anyone think this is a *bad idea* placing snubber cap so close to driver board?
> 
> Thanks arber333 I will try to widen the gap and maybe coat the copper with some insulating lacquer.


Hm i tried coting it but it doesnt help alone. If you have sufficient gap that is usually enough. 
Snubbers are usually 1uF per 100A but i use 2,5uF for 300A and it is good.

Drivers should be good, if you dont feel good put some thin pertinax board between as isolation .
Try fitting snubbers longitudinaly so they clear driver board.

I still think you should use another layer of copper. Those caps are heavy and car is vibration enviroment. At least think how to fix caps together so they will not wobble when driving.


tnx

A


----------



## Tony Bogs (Apr 12, 2014)

arber333 said:


> Oh yes i wanted to ask about error reporting while driving.
> Yesterday i got shutdown on the crossroads. I managed to stop safely and secure my car etc...
> 
> I was fiddling with inputs and i taught inverter was overheating... It turned out it was tank door switch. It is set as NC when door is closed, so that inverter works. Basicaly is same as EMG disconnect button, so that i cant drive off with cable plugged in! Now i got lot of corrosion inside switch and it seems that was it.
> ...


Great ideas, both the emergency switch input on the charge port and the logging.
About the logging. Which popular open source system has a log daemon running from the start? Let me think... Yeah, I can think of one or two. 
Just send the error messages via the serial link (with checksums, line drivers/receivers of course) and that's it. 
The error sections are easy to find in the source code. Same goes for the UART functions. 
Great project this. Some others may look good (3D Kicad? board views) but this one is so easy to modify and it works!


----------



## arber333 (Dec 13, 2010)

Tony Bogs said:


> Great ideas, both the emergency switch input on the charge port and the logging.
> About the logging. Which popular open source system has a log daemon running from the start? Let me think... Yeah, I can think of one or two.
> Just send the error messages via the serial link (with checksums, line drivers/receivers of course) and that's it.
> The error sections are easy to find in the source code. Same goes for the UART functions.
> Great project this. Some others may look good (3D Kicad? board views) but this one is so easy to modify and it works!


Well idea was to have as little of additional parts as possible, for ease of use and reliability. So i asked Johannes to think of a way to put error logging to flash and save up to say 5 most recent errors. That way everything stays the same, only code is different.

Second option is to put EVERYTHING (even normal logging) on serial port and record with https://www.sparkfun.com/products/13712.
It is very flexible and opensource. I think it can start to logg data as soon as it gets power.

I am not a programmer and will leave this work to those with knowhow. It was just an idea out of frustrrating serch for unintended shutoff in the middle of the crossroads .


----------



## Tony Bogs (Apr 12, 2014)

Nevertheless, it is a feature that is missing for daily use. Error logging is standard on modern cars. 

In programming time, the logging to an external host, could be the same host that configures the controller, takes very little effort. 

Just imagine that host connected to a touchscreen like the one that can be seen on the dashboard of a Tesla 3 or even a Bolt. 
A headless Linus box (wireless access) or the sparkfun gizmo are also options.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Huh!!! I changed some parameters yesterday and today i have +5% to SOC remaining when i came to work.
> 
> I changed:
> ampmin to 28
> ...


oclimit is a hard shutdown limit. It is never used by the motor control loop. Could it have been something like higher temperature that made the car more lively? I can definitely feel the difference as spring dawns. Also energy consumption is less in warmer weather because you don't loose so much energy to voltage sag.


----------



## jhuebner (Apr 30, 2010)

Crosspost from the Polo thread:

I had some problems with the encoder that suddenly spawned. I took the whole front apart and rerouted the encoder cable to interfere less with the power cables. I also connected the shielding to the inverter chassis instead of the GND Pin 1 for a more direct connection.

Maybe most importantly I changed the low pass filter. R3 and R4 are now 500R and C1 remains at 22nF. That results in a rising edge cut off frequency of 7.3kHz and a falling edge cut off frequency of 14.5kHz. 

Before it was 5.4KHz and 60kHz. So vastly asymmetric with the spikes that the 60kHz lets through and the slowness of the 5.4kHz cut off.

I have changed the BOM accordingly.

Driving is now back to normal. 

If you're having problems with the encoder, that is an easy fix.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> oclimit is a hard shutdown limit. It is never used by the motor control loop. Could it have been something like higher temperature that made the car more lively? I can definitely feel the difference as spring dawns. Also energy consumption is less in warmer weather because you don't loose so much energy to voltage sag.


Well the spring is here about a month but car started rocketing after i changed those settings. Huh maybe those settings combined made all the difference...

A


----------



## arber333 (Dec 13, 2010)

Yesterday i took the infamous switch off and put one 230VAC relay on the EMG line to disable car when charging. It works and is protected from moisture.

I connected clutch (starter interlock) switch to BMS input to disable regen when shifting. It is currently connected connected to reverse light switch on my transmission. I had to put a diode between to keep reverse light from going on every time i push clutch . It works good and i can shift as any IC car. There wont be any need to modify software for that.

EDIT: Well i noticed when stopping and if i put from 3rd to 2nd i get a jolt before car stops. Must be because there is still energy in flywheel and motor is spinning a bit... oh well i should just stop with 3rd all the way and then put in lower gear.


----------



## jddcircuit (Mar 18, 2010)

jhuebner said:


> Looks pretty smooth if the startup is not being filmed  No seriously glad to see this some months after we'd started out with this jerky bumping around.
> 
> 
> What you're seeing here is pure sine commutation with a linear V/f voltage curve. Current sensors are yet unused and we plan to keep it that way - less hardware involved, less paths for trouble.
> ...


I agree with gunnarhs that current control is the way to go for these IPM motors based on my recent experience.

I am also all about naive experimentation but for a good experiment you almost really need the current sensors to prove that you don't need them.

My recent experiment showed me that just applying sinusoidal phase voltage relative to the rotor position (which I assume is V/f) resulted in very high reactive currents (Id currents) that I could not seem to avoid in all cases. My bus power supply didn't care either way and still showed low power draw which was misleading to me. The way to see the wasted currents is either by directly measuring the phase currents or indirectly by closly analyzing the IGBT temperature rise. In my case the currents were up to 10x what I wanted in some cases which could easily blow the IGBTs I am using.

I then designed an experiment to measure the accuracy of my sin/cos rotor sensor. I found a subtle non-linear wobble in the position error depending on the actual shaft position. Relatively small error but could explain the higher Id currents I was seeing when the bemf is not precisely aligned with the applied voltage.

Adding in the current sensors and some FOC made the high currents go away. If I wanted to reduce complexity I would be inclined to remove the rotor sensor and go with a "sensorless" technique rather than go without the current sensors.

However I do encourage you not to take my word for it. Please experiment and share your conclusion.


----------



## PStechPaul (May 1, 2012)

It seems to me that a simple V/f control should work as well as the same motor connected to three-phase mains of the appropriate voltage and frequency according to the design. Under static load and speed conditions, I would expect the PF to be low with no load, but improve as the load is increased to rated value. 

But under dynamic conditions, such as start-up and rapid change of driven RPM, the motor could draw currents up to the locked rotor condition, as it would when starting conventionally without a VFD on a fixed AC source. By adding simple current sensors on the three low legs of the H-bridge, it should be possible to detect overcurrent and "short cycle" the PWM to keep the current within safe limits.

Also, by simply monitoring the motor voltage on at least one phase, it should be possible to see if the voltage is less than it should be according to the V/f value, indicating a heavy load, or if greater, it would indicate regeneration. Perhaps the sensorless FOC or direct torque control algorithms do the same thing. But I like the idea of eliminating the rotor position transducer for reduced complexity and the need for additional components attached to the motor. If anything, perhaps a simple inductive proximity sensor and a one or two lobed shaft attachment could be used to read actual RPM.


----------



## jhuebner (Apr 30, 2010)

jddcircuit said:


> Adding in the current sensors and some FOC made the high currents go away. If I wanted to reduce complexity I would be inclined to remove the rotor sensor and go with a "sensorless" technique rather than go without the current sensors.


I'd also rather ditch the shaft encoder and just use the current sensors. I think eldis has achieved this I just don't know how. It's currently beyond my horizon.

As long as the shaft encoder is there I want to avoid the extra complexity of current control. We'll take a closer look at the actual rotor currents next time.

There is Clarke/Park in the current software and it does produce somewhat meaningful outputs. But only if you stick the current sensors to the right phases and get the spinning direction right. Two more things to go wrong on benchtop builds.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> I'd also rather ditch the shaft encoder and just use the current sensors. I think eldis has achieved this I just don't know how. It's currently beyond my horizon.
> 
> As long as the shaft encoder is there I want to avoid the extra complexity of current control. We'll take a closer look at the actual rotor currents next time.
> 
> There is Clarke/Park in the current software and it does produce somewhat meaningful outputs. But only if you stick the current sensors to the right phases and get the spinning direction right. Two more things to go wrong on benchtop builds.


I think encoder drive is easier to use. Since it is only simple rotation no quadratur signals. However there is no reason you couldnt use current sensors to optimise slip/current relation. It would have to be faster response as well as calculating the sensorless phase... Hm maybe we could have flash lookup tables for comparing L1 L2 current to find L3 current. 

Yes efficiency leaves somewhat to be desired...ramble ramble... but my motor is spinning regardless of super efficiency of some 10K€ vector control inverters. And all for sub 1K€!


----------



## bigmouse (Sep 28, 2008)

I've been watching this conversation for a while now and trying my best to hold my tongue, but I feel it's necessary for me to provide my input.

Current sensors are absolutely required. Open loop control simply does not work in this sort of application. "Sensorless" control refers to lack of a rotor position sensor and normally uses current sensors and/or voltage sensors to infer the rotor position. There is no such thing as a truly sensorless inverter. You are simply replacing or inferring the information that a particular sensor would give you using OTHER sensors which you have. This interpretation is done in real time, in firmware, with very complex algorithms.

Leaving out current sensors does not improve ease of use or reliability. Quite the opposite.

If you want to reduce complexity, the best way to do this is to directly measure the things that you need to measure. Specifically, phase currents and rotor position. That's as simple as it gets.

Hardware complexity is GREATLY overruled by firmware complexity. I've gone down this road several times before and have always found that the shortcuts I thought I was taking to make things easier/simpler/less complex actually had the opposite effect. Look at what happened when eldis tried to simplify things be using a resolver to encoder converter rather than reading the angle directly. Things got complicated, required information was missing, and he ended up redesigning it to do it the way it should have been done in the first place.

Open loop control is great for just getting a motor spinning with low voltage and low currents on the bench to make sure the PWMs are getting where they need to go. Anything beyond that, you absolutely need to close the loop. Benchtop or not, current sensors are required and worth putting in. V/Hz control doesn't work on permanent magnet motors, and barely works on induction motors.

In the future, if you want to go sensorless to save money because you're building thousands of these things, then tackle that project (and even then, you'll still need current sensors).

If you want to build a reliable, inverter that will provide good performance throughout the operating range with the simplest code (quickest path to a functioning inverter), then go with the proven, simple, methods that have been around for decades: Current sensors, rotor position, FOC.


----------



## eldis (Sep 3, 2013)

Haha, I just noticed that my name appeared, and then bigmouse summed it for me. Thanks 

Yup, the guy is right. Current sensors are always a must. You need at least two (most OEMs do it that way), or use three for redundancy fault handling) and slightly better accuracy.

Either you get a physical sensor (encoder for induction motors, resolver for IPM), or you go sensorless (which just means you sample three phase voltages and get the angle from that).
There is sensorless and sensorless. The crude zero voltage crossing and similar usually implemented on AVR 8bits, works just for RC airplanes. For good starting torque the sensorless starts to be a real science - sliding mode observers, saliency tracking, DTC. Important is that it can be done and is being done, but it is not as easy as reading encoder count.


----------



## arber333 (Dec 13, 2010)

Well i dont know if the car capable of running at 160km/h is a simple project...nor is 400VDC! But if i take sensors out inverter doesnt complain. It keeps on spinning wheels with torque that *I *commanded. Now i have 20K km on it, still going...

Since this is how cars have run for 100 years now i dont see why add additional factors that would complicate code, hardware and demand larger processor etc...
Maybe only to improve effeciency but we have to check price vs benefit...

Johannes what you could try is expand master PCB and add the omitted ports for Olimex as inputs/outputs so we could adapt other sensors or signals.

I am still on to try PMSM motor with missing hole pulse and current skew .


----------



## MPaulHolmes (Feb 23, 2008)

What was the problem with the resolver to encoder? I'm using a dspic with a quadrature encoder interface, and haven't had any troubles with a resolver to encoder chip feeding the QEI with resolvers from leaf motors and toyota MGRs. To get the initial index pulse at turnon (which requires < 1/4 mechanical revolution for those motors), I just divided the circle into 8 pieces and let it cycle through each of those 8 candidate rotor flux angles. If a rotor flux angle candidate produced movement when the throttle was applied, I kept it there. Then, in < 1/4 of a turn, the true rotor flux angle is known, and everything is wonderful until you turn the controller off again.


----------



## bigmouse (Sep 28, 2008)

MPaulHolmes said:


> What was the problem with the resolver to encoder? I'm using a dspic with a quadrature encoder interface, and haven't had any troubles with a resolver to encoder chip feeding the QEI with resolvers from leaf motors and toyota MGRs. To get the initial index pulse at turnon (which requires < 1/4 mechanical revolution for those motors), I just divided the circle into 8 pieces and let it cycle through each of those 8 candidate rotor flux angles. If a rotor flux angle candidate produced movement when the throttle was applied, I kept it there. Then, in < 1/4 of a turn, the true rotor flux angle is known, and everything is wonderful until you turn the controller off again.


In many applications (arguably, including a car), a 1/4 turn of the motor to "find" the index mark would be unacceptable. When you first apply current, you don't know which way the motor is going to turn. The rotor may align itself with the field by rotating backwards before "catching" and moving forwards again (I expect you've probably experienced this, based on your description). Depending on the pole count and amount of gear lash, 1/4 turn may not even show up as motion at the wheel, but the clunk would be unsettling and undesireable at the very least.

I'm not arguing that it can't work, my point is that there's a better way. If you have a resolver to encoder emulator, then you have a resolver to digital converter. You already have the hardware to read the angle directly without the guesswork of an encoder index, so why wouldn't you use it? The Tamagawa part I'm using can be configured for either parallel data output or encoder emulation, as well as a SPI interface. I imagine your DSPic has a SPI interface or enough pins to read the parallel data as well.

Aside from rotor position sensing, for which there are indeed established viable options which omit a sensor (with added complexity elsewhere to compensate and the associated performance compromises), my initial remarks were aimed more at the proposed lack of current sensing which had been discussed here.

I'm not aware of any control method which allows full utilization of a motor without current sensors. That doesn't mean they don't exist, but I suspect they're confined to academic research, not practical application.

Without current sensors, you are, by definition, open loop. Open loop control works okay with induction motors for reasons described by others earlier in this thread (see comments comparing V/Hz control to direct-on-line operation of induction motors). You just have to make sure your power stage is over-rated enough to handle the peak currents and be willing to accept falling off the back side of the torque curve if your electrical frequency diverges too much from your mechanical frequency (without motor speed feedback, you have no idea what your slip frequency is).

For permanent magnet motors without current sensors, you might get it to spin, you might even get it to make torque (if the load is small enough with low enough inertia), but without closed loop control current control, you'll never maximize the performance potential of the system as you have no way of optimizing the angle of the flux relative to the rotor. The voltage vector alone only aligns with the current vector at very low speeds.

I'm going to assume that nobody here is actually intending to run a permanent magnet motor with neither current sensors nor rotor position and expect to get any usability from it.


----------



## arber333 (Dec 13, 2010)

Well i have tried... and it is a fail. Motor spins and i can throttle it a bit but as soon as i apply any torque it falls out of sync and starts to vibrate. Of course using resolver is always better. But we are doing DIY work here yes? I say we at least try if it works without resolver. 

A


----------



## jhuebner (Apr 30, 2010)

You guys (eldis and bigmouse) maybe right when it comes to synchronous motors.

You are definitely wrong when it comes to asynchronous motors.

I want to clarify that we are not talking about "open loop" here. The rotor encoder closes the loop. 

Arbers conversion has done 20k kilometers with that technique.
Jack Bauer has been moving his huge BMW 8 around with it
My own conversion has done 13k kilometers.

I reach 12 kWh/100km which is on par with Volkswagens eUp. The phase currents are not excessive, 80A RMS for 40kW @ 500Vdc. Don't see a problem here.

The Web is full of advanced control techniques that you "MUST" use. They just make inverter development seem like rocket science which is probably what industry wants it to be.

What possible magic do you expect FOC to do? There is only frequency and amplitude. It's always a sine wave and it's always offset by 120°. Two quantities, thats it.

Like said, I don't want to discredit FOC or DTC as technological boohaha. They allow sensorless control as in "without speed sensor". Which is great. 

But for traction applications you often get speed sensors build in anyway.


----------



## arber333 (Dec 13, 2010)

Here, Here!

I must say i noticed something odd though. When i draw cca 30kW from battery and motor is accelerating trough 3000rpm i get whining noise and small vibrations. It feels its something electrical not mechanical. This subsides after 3500rpm and at 4000rpm motor feels right at home. This happens in every gear!

What could it be? Insufficient capacitance maybe? 

A


----------



## dcb (Dec 5, 2009)

This link compares the two pretty nicely.

http://mkweb.uni-pannon.hu/hjic/index.php/hjic/article/download/422/390

COMPARISON OF SCALAR AND VECTOR CONTROL STRATEGIES OF
INDUCTION MOTORS

with scalar control and feedback, you essentially get torque control but not flux control (basically slip control)

so as near an analogy as I can make, closed loop scalar is like a shunt wound motor where foc is like a sepex. But of course this is just software so it is fairly trivial to tweak your scalar routine to create different mappings than a hardwired shunt motor.

but speed feedback is cheap compared to magnets and both techniques need it for reasonably smooth operation in an induction motor, where a synchronous motor needs absolute position information for best operation across the entire speed range.

and foc needs no-load and locked rotor tests to quantify the motor parameters, and some hope that rotor resistance doesn't vary too wildly, and somewhat complicated maths, and there is still lots of room for refinement.

but in figure 8 and 9, in practical terms, closed loop scalar is perfectly driveable. the response is a bit more sluggish is all (without other optimizations), and dtc has better response yet if you are concerned w/performance (though the open source controllers don't have suitable current sensors for DTC)

IIRC the huebner will *automatically* go into field weakening when it runs out of voltage.


----------



## jhuebner (Apr 30, 2010)

The comparison is pretty good but it assumes scalar control to only vary the slip frequency to adjust torque while keeping a constant V/Hz ratio.

As soon as you lower the V/Hz ratio you decrease torque AND flux. Which is what we're doing here.

I think Paul Holmes does the same in his FOC controller. The throttle controls Iq AND Id.

---

Arber, does the vibration change if you change fweak?


----------



## MPaulHolmes (Feb 23, 2008)

I meant to say that if you get forward motion, not just motion, then you keep it there. So, it may go backwards like 1/1024 of 1/4 of a mechanical revolution. The chip does have parallel and spi options to read both speed and angle, but it wasnt necessary.


----------



## dcb (Dec 5, 2009)

jhuebner said:


> The comparison is pretty good but it assumes scalar control to only vary the slip frequency to adjust torque while keeping a constant V/Hz ratio.


Yah it is not a great analogy, you obviously deviate from scalar to get the rotor started and I *think* you keep increasing frequency once you run out of voltage (field weakening) plus there are other possibilities.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Arber, does the vibration change if you change fweak?


Well i belive so. I wasnt paying attention when i put the final 32V in but i think RPM were in the same region. Hm...
EDIT: I mean when i had less voltage and lower fweak i noticed vibrations in same rpm region.
It happens also with regen but at lower RPM!
It feels like resonance...

With turbine engines we have N1 and N2 C.T. speed that we have to pass quickly. There are bad gremlins living in that area that could damage compressor turbine . Maybe here lives an electric eel 

Heh


----------



## dcb (Dec 5, 2009)

the gear train is also suspect for rpm specific noises


----------



## jackbauer (Jan 12, 2008)

I'm just back from a "road tune" of my automatic gearbox controller and I can say that the inverter driving my siemens motor is smooth as silk


----------



## jddcircuit (Mar 18, 2010)

I wanted to share a project I am working on. It may be relevant to some of the discussions.






With rotor position sensor and phase current sensors the FOC software for synchronous motors seems to be relatively straight forward. I would not call it overly complex. I do always get the polarity of things backwards the first time I hook things up but a couple of tries and fails fix that.

I am learning quite a bit during this inverter build. For example when I tried to filter my SIN/COS rotor position sensor I inadvertently induced some delay in the rotor position that increased at higher speeds. At higher speeds the phase current did not match phase voltage (phase duty cycle). I could fix this with software compensation which would maintain power factor. Sometimes two wrongs make a right when I am compensating for something else I did incorrectly. I decided to redesign my position sensor to minimize the delay instead of just overcompensating in software.

I would probably give up the rotor position before I give up the current sensors. With the current sensors I can at least manage the power factor.


----------



## gunnarhs (Apr 24, 2012)

jhuebner said:


> As soon as you lower the V/Hz ratio you decrease torque AND flux. Which is what we're doing here.
> 
> I think Paul Holmes does the same in his FOC controller. The throttle controls Iq AND Id.
> 
> ---


Induction-Motors:
Yes that is basicly how it is done with slip control for induction motor in a vehicle it works for me too. I did though add a current control model for two reasons
1) To keep eye on the currents and power factor (reactive control)
2) To improve dynamic behaviour if asked for (progressive control)
So I had both speed sensor and current sensors.

PM-motors:
Have not done a EV-drive with PM but from the theory I can not understand how one is going to control the Id-compoment without current model in a PM.
(which must be set negative for overspeed driving under load to weaken the PM-field in a PM-motor)


----------



## jhuebner (Apr 30, 2010)

gunnarhs said:


> Induction-Motors:
> Yes that is basicly how it is done with slip control for induction motor in a vehicle it works for me too. I did though add a current control model for two reasons
> 1) To keep eye on the currents and power factor (reactive control)
> 2) To improve dynamic behaviour if asked for (progressive control)
> So I had both speed sensor and current sensors.


I also use the transformations to monitor power factor. A few (maybe 100 ) pages back I posted the results. While driving power factor is steadily above 0.9. On regen I think it went down to 0.7 for whatever reason. 



gunnarhs said:


> PM-motors:
> Have not done a EV-drive with PM but from the theory I can not understand how one is going to control the Id-compoment without current model in a PM.
> (which must be set negative for overspeed driving under load to weaken the PM-field in a PM-motor)


First, I don't want to claim that I actually KNOW anything.
What I think is, that Id is not an actual physical quantity. It's virtual for ease of computing.
The actual physical quantities in the PM motor would be V/f (again) and the angular difference between rotor current (not voltage!) and stator. Or to be more precise, V/f and a given angular difference result in a certain phase current. 

If you're spot on, i.e. the stator field leads the rotor field by 90° I'd expect a power factor of 1. In other words: Iq=Iref, Id=0.

So you can reach this state with an id/iq current controller or by statically dumping an angular difference onto your stator.

My next guess is, that above "base speed" the stator should not be 90° ahead of the rotor, but less than 90° as the magnetic field of the stator gets weaker.


----------



## dcb (Dec 5, 2009)

a friendly reminder that a lot of the pm machines out there have an offset reluctance torque to consider as well. I'm not smart enough to sort it out without dynoing the crap out of it though.


----------



## dcb (Dec 5, 2009)

also a good resource for pm/field weakening (the whole series is pretty cool):
https://www.youtube.com/watch?v=5eQyoVMz1dY&feature=youtu.be&t=1960

careful with high rpm back-emf...


----------



## gunnarhs (Apr 24, 2012)

jhuebner said:


> I also use the transformations to monitor power factor. A few (maybe 100 ) pages back I posted the results. While driving power factor is steadily above 0.9. On regen I think it went down to 0.7 for whatever reason.


Ok, I remember , this is pretty good and confirms the good efficiency of the drive.



jhuebner said:


> First, I don't want to claim that I actually KNOW anything.
> What I think is, that Id is not an actual physical quantity. It's virtual for ease of computing.
> The actual physical quantities in the PM motor would be V/f (again) and the angular difference between rotor current (not voltage!) and stator. Or to be more precise, V/f and a given angular difference result in a certain phase current.


This is about how the induction motor works so your knowledge here is well confirmed.
Setting Voltage (vector) AND slip (by giving the modulation frequence rel to measured speed) 



jhuebner said:


> If you're spot on, i.e. the stator field leads the rotor field by 90° I'd expect a power factor of 1. In other words: Iq=Iref, Id=0.
> 
> So you can reach this state with an id/iq current controller or by statically dumping an angular difference onto your stator.
> 
> My next guess is, that above "base speed" the stator should not be 90° ahead of the rotor, but less than 90° as the magnetic field of the stator gets weaker.


Here in the PM this is a bit different at least in theory assuming a magnetic rotor and current only flowing in the stator 
(Note that there is no current here flowing in the rotor like in the induction machine, this makes it simpler for FOC at least under base speed)

You do not want to destabilize the motor (more  ) by adding to the slight variation out of the 90°. 
The only thing you want to achieve is overcoming the resisting magnetic force to exceed (base)speed. 
In fact you have to (first) put a negative Id to overcome the opposite current "induced" in the stator by the resisting permanent magnets ("Back EMF"). 
So you have to align your voltage - vector that it first cancels out the resistive current (-id) then adds the rest of the voltage to produce the iq. 
The critical thing is (especially under load) is to assign the right amount of -id
1) To little -id with high frequency set could cause an unpleasant Back EMF
2) To high -id could destabilize the motor


----------



## jhuebner (Apr 30, 2010)

Yes, this is also what I understood from the brilliant video that dcb posted.

Like he says, you can not weaken the actual rotor field but you can weaken it's effect (BEMF) on the stator. It is also good to know that once you fail to provide the negative id the BEMF rises back to the value at that speed. It will cause uncontrollable high current into the inverter and battery.

Now the question to me is: what does negative id translate to in the physical world?

It must be the phase shift as it is the only quantity left to be controlled. The amplitude is at it's maximum in the overspeed region.

Same has to go for reluctance torque. At the end of the day every fancy calculation must result in amplitude and phase shift. (amplitude and slip for induction)


----------



## gunnarhs (Apr 24, 2012)

jhuebner said:


> Yes, this is also what I understood from the brilliant video that dcb posted.


This Video and all other sessions related are brilliant, they go well into every detail.
Nothing to add from my part learnt a lot too 



jhuebner said:


> Now the question to me is: what does negative id translate to in the physical world?
> It must be the phase shift as it is the only quantity left to be controlled. The amplitude is at it's maximum in the overspeed region.


Yes, usually the amplitude is at maximum. 
The phase shift (usually determined by Voltage Space-Vector -map of some kind) must be put so that it provides enough -id to overcome the Back-EMF AND enough torque to drive the load (iq). 
To do that I have either to have a exact map of Motor/Load/Voltage/Frequency situation.
Or measure the currents and (pre)-calculate the (expected) id and iq.
(In the induction motor is it sufficent to have slip info if dynamic response is in average demand)
As you know with the Induction motor there it is easier to measure the slip, in the PM it is easier to measure currents and calculate from them 


jhuebner said:


> Same has to go for reluctance torque. At the end of the day every fancy calculation must result in amplitude and phase shift. (amplitude and slip for induction)


This is easier, you just have to step up the voltage to produce enough iq and set the position that it is orthogonal to resident rotor magnetic field. You must though be aware of the direction
(In the induction motor you step up voltage and frequency to find the right starting situation i.e. starting frequency).


----------



## dcb (Dec 5, 2009)

fwiw, wilson has ltspice simulations, I've run this
http://e2e.ti.com/group/motor/m/spice/666381
"31 ACIM Digital FOC Speed Control with slip estimator.asc"
(using wine on ubuntu), little slow but you can poke and prod various signals.

Though I am not sure if there is a difference between absolute maximum torque and maximum torque per amp (i.e. is pullout torque somehow quantified in FOC? or just another fudge factor).

here is a list, but it appears incomplete
http://e2e.ti.com/group/motor/m/spice

so it takes a little ingenuity to find 'em, maybe google
"41 PMSM Digital FOC Speed control"
or
"44 PRIUS IPM Motor with Digital Speed Control"


----------



## dcb (Dec 5, 2009)

here is a screenshot of the acim ltspice model just to give you a teaser, it has a speed controller which isn't that interesting in a car till you hit the cruise button, but gobs of points to examine.

I'm comparing slip vs slip_guess vs requested load vs shaft torque vs rpm here.

The circuit at the bottom might look familiar 

It is interesting that at .1 seconds, it hits the 1.2k rpm speed target @ 1nm, then the slip starts creeping up all the way to .5 seconds, like it is doing a search algorithm.


----------



## gunnarhs (Apr 24, 2012)

dcb said:


> a friendly reminder that a lot of the pm machines out there have an offset reluctance torque to consider as well. I'm not smart enough to sort it out without dynoing the crap out of it though.





dcb said:


> fwiw, wilson has ltspice simulations, I've run this...
> 
> Though I am not sure if there is a difference between absolute maximum torque and maximum torque per amp (i.e. is pullout torque somehow quantified in FOC? or just another fudge factor).
> ...
> ...


Ok, I was not aware of the effect of the changing reluctance torque in IPM in regards of amperage until I looked up the points regarding the IPM as you suggested. 
This complicates shit a lot !! In your case here with the Lexus it is a IPM I suppose(?) 
The standard FOC-current control is calculated from current measurement and only uses one map (the Space-Vector-Voltage-Map) to align the iq and id in your favour. 
For Induction Motor in steady state (after startup, almost constant slip ~ iq/id) ) and PMSM (id = 0 under base speed), the iq should be the decisive factor and maximum torque should be related to iq ( limited to be maximum twice the rated torque per AMP for standard motors) This is usally not included in the FOC algorithm itself but in the motor parameters passed to this algorithm which set the border-values. 
So the same FOC - algorithm can be used for similar motor-type of bigger size.

In the case of the Toyota IPM, that algorithm seems to be specific for the motor with id settings positive AND negative over different speed AND amperage region. Nasty , nasty...

Still I think starting the IPM-Motor a standard FOC should do it if load is reasonable...
But that is only what I think, it may not be so...


----------



## dima (Dec 1, 2015)

Hello All,

I am no engineer just a regular DIYselfer 

After reading 100's of replies, pages of text and analyzing the PCB layouts it is extremely difficult to visualize how to connect it all. I wish there was a "user manual" how to wire this thing.

Need someone with knowledge to review it and suggest corrections. Hopefully it will make it into Johannes repository and save someone a lot of time.

Questions: 

1) Still confused how pin# 4 on sensor board senses the contractor voltage (UDC?).
2) What are those B+ and B- on the sensor board ...related to #1?
3) Am I connecting the 12V right into pin# 24 or is that 12V coming from Buck converter?

Thank you.



> UPDATED Feb 14, 2017


----------



## jhuebner (Apr 30, 2010)

Hi,

a piece of art 

It seems you're not using Pin 12 to control your DC contactor, are you using a custom precharge logic instead?

Pin 24 is connected correctly, it is the main power input to the inverter.

B+ and B- may be connected directly to the DC bus. The value is displayed as "udc" and it is being used to control the precharge logic and the voltage warning light. It has no influence to the motor control.


----------



## dima (Dec 1, 2015)

Hi

Ah but it is a piece of art 

I have not connected anything yet ...must visualize before I do.

Thanks Johannes, I do have pin 12 (from J5) going to contactor (No I am not re-inventing the wheel just capturing your explanations)

... keeping the motivation alive for now.


----------



## jhuebner (Apr 30, 2010)

Cool housing and very creative way to not use the IDC headers 

Just realized you updated the schematic above. The start key switch must pull the start input up to 12V. Same goes for the brake switch. It doesn't need a ground connection.


----------



## dima (Dec 1, 2015)

So you cannot use HAL sensor for brake? What do you use, a variable resistor? Also I got USB connection backwards - diagram updated.


----------



## jhuebner (Apr 30, 2010)

Oh now I see what you want to do. For variable regen you must use Pin 8. It is also a 0-3.3V input.

Pin 9 only switches between two levels of regen and also locks out the throttle pedal.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Oh now I see what you want to do. For variable regen you must use Pin 8. It is also a 0-3.3V input.
> 
> Pin 9 only switches between two levels of regen and also locks out the throttle pedal.


Well i tried to use hall sensor for throttle and 5K pot for partial braking. It worked, but it wasnt comfortable. There was an area where throttle would go through zero and regen began, but when i applied brake switch to pin 9 brake signal was jumping in and out in that area. This made the car jumpy on the crossroads and annoyed me a great deal. I finally coded the pin8 signal to full. It is still connected though, i just dont use it. This idea of using first 30% of throttle pedal as brake is excellent! 

Lately i put clutch starter interlock switch on pin19 BMS and i can shift with ease, no more RPM dropping in the middle of the crossroads while i try to shift... 

A


----------



## dima (Dec 1, 2015)

Ah That's a deal breaker on the brake ...so complicated, anyway tried my best to update the schematics.


----------



## lrdesigns (May 12, 2016)

like your controller , will buy kit and build something with it, have few question thouh, i require your help

[email protected]


----------



## dima (Dec 1, 2015)

Inverter is ON!

Very excited, wrote OSX app for it  
Source code on Git-Hub.



> UPDATED MAY 30, 2016


----------



## arber333 (Dec 13, 2010)

While helping my friend with his inverter we made V/Hz work manually and later with 5K pot. 
But when we connected encoder we had problems. His encoder is optical quadrature with two signals 128PPR each at 90°.
First we simply put 3V on and tried output with LED. It worked! LED was blinking when we spun wheels. We got 3V on pulse. So we connected signal line. When encoder started it was in V/Hz mode. No sensor was detected. Hm When i tried to measure voltage signal to GND i got 0.8V! Signal was not changing with RPM and LED was barely alight. The other signal was at 3V unconnected, but if we put the line on it would fall to 0,8V again. 
Do you think something happened to input transistor? How could i check?
Did you encounter anything like this?

A


----------



## jhuebner (Apr 30, 2010)

The 0.8V is normal, it is the Vbe of any bipolar transistor. Maybe you encoder output is not compatible to that sort of input.

Look at the input circuit. You could remove R1, R3 and T1 and bridge the base to the collector i.e. bridge the two pins of T1 that are NOT connected to the ground plane.

That way you get a high impedance, low-pass filtered digital input.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> The 0.8V is normal, it is the Vbe of any bipolar transistor. Maybe you encoder output is not compatible to that sort of input.
> 
> Look at the input circuit. You could remove R1, R3 and T1 and bridge the base to the collector i.e. bridge the two pins of T1 that are NOT connected to the ground plane.
> 
> That way you get a high impedance, low-pass filtered digital input.


Well we tried and setup the port directly, but it was a failure. Inverter wouldnt start in slip mode.
After that i rewired resistors back to original schematic. We went to check voltage drop. It was substantial, we got 2.5V when encoder was connected. Then we used on Liion battery at 3.4V and put it in paralel with inverter 3V3 supply. Hah! Motor started in torque/slip mode. So it was the sensor current demand that caused voltage drop. 
Since we cant have Liion battery connected all the time we put 5V from sensor pins directly to encoder supply. Again motor worked in slip mode...

Johannes, since signal from encoder is translated by BC547 transistor, i dont think using 5V as encoder supply will hurt olimex sensor port. Or would it? Voltage difference from +5V to signal pin is ccca 2,7V. Could you confirm this and write it to your instructions page so it is clear why some encoders wouldnt work right away. 

A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Well we tried and setup the port directly, but it was a failure. Inverter wouldnt start in slip mode.
> After that i rewired resistors back to original schematic. We went to check voltage drop. It was substantial, we got 2.5V when encoder was connected. Then we used on Liion battery at 3.4V and put it in paralel with inverter 3V3 supply. Hah! Motor started in torque/slip mode. So it was the sensor current demand that caused voltage drop.
> Since we cant have Liion battery connected all the time we put 5V from sensor pins directly to encoder supply. Again motor worked in slip mode...
> 
> ...


Yes, well spotted! 5V supply is ok, the Olimex will not see the 5V. Will add it to the instructions


----------



## dima (Dec 1, 2015)

Could not compile the source code until changed anian.cpp line 48 from

```
adc_off(ADC1);
```
 to

```
adc_power_off(ADC1);
```
 using latest libopencm3


----------



## arber333 (Dec 13, 2010)

About pairing inverter and motor...

Last week i tried to smooth motor some more. I got the feeling that motor jumped a bit when throttle went through 0%. So i lowered slipmin from 1.3Hz to 1Hz. Things went a lot smoother at drive-off BUT I eventually noticed that motor started to overheat sooner. This is now amplified more by spring heat. Motor overheated driving over some hill where it used to hold temperature normaly, even with axial impeler turning at 4000RPM.

J do you think too small slipmin parameter can cause overheating?

Today i will change this to previous and drive again.


----------



## jhuebner (Apr 30, 2010)

dima said:


> Could not compile the source code until changed anian.cpp line 48 from
> 
> ```
> adc_off(ADC1);
> ...


Thanks for pointing it out. Will change it on next commit.



arber333 said:


> About pairing inverter and motor...
> 
> Last week i tried to smooth motor some more. I got the feeling that motor jumped a bit when throttle went through 0%. So i lowered slipmin from 1.3Hz to 1Hz. Things went a lot smoother at drive-off BUT I eventually noticed that motor started to overheat sooner. This is now amplified more by spring heat. Motor overheated driving over some hill where it used to hold temperature normaly, even with axial impeler turning at 4000RPM.
> 
> ...


Too little slip causes lower power factor and thus more ohmic losses and thus more heat.

If you want smoother start, try lowering ampmin.


----------



## jhuebner (Apr 30, 2010)

Ok, updated to the latest opencm3 version.

Not much testing yet, will do that tomorrow.

While I was at it I also added a very basic error log functionality:



Record the time of the error (ms since inverter start)
Output error code and consequence of error (Stop, Derate, Display)
Remember the last 4 errors in RAM, i.e. they are lost at each "reboot"
Only record each incident once after starting (i.e. key switch starting)

The latter means for example if your throttle goes out of range you will receive that message ONCE.
When you start the inverter again, you may receive it once again.

The error codes are textual, i.e. no cryptic error numbers.

There are 4 errors right now:


Emergency stop -> STOP
Motor protection -> STOP
Over Current -> STOP
Throttle out of range -> DISPLAY
More to come.


The last 4 errors can be displayed by typing "errors" . The web interface does not support this yet.


----------



## jhuebner (Apr 30, 2010)

Ok, now that I was at it I did some more things:



Added a "defaults" command to load default parameter values
Added creep mode
Updated the web interface to support error memory and defaults
Creep mode just uses the idle speed controller but only when off the brake pedal. Here is an example of how to configure it:


idlespeed = 200rpm (depends on you gearing)
idlethrotlim = 25% (depends on you gearing and motor)
idlemode = 1 / nobrake
As soon as you enable the idle speed controller you have to press the brake pedal to be able to start.

Tested all changes with the Polo.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Too little slip causes lower power factor and thus more ohmic losses and thus more heat.
> If you want smoother start, try lowering ampmin.


Well before i set up my motor initially i tried various options. I found some settings worked and used them. I actually havent used results from your slip equasions. Your last comment got me thinking... I searched for my old calculations from before motor rewiring. 
I put in as calculated slipmin 3Hz, slipmax 5,4Hz and i lowered ampmin to 10%. 
Difference was humongous! Car can accelerate to 100km/h in 3rd gear linearly! I can now run at 130km/h in 5th and motor doesnt overheat. And it can take off quite smoothly. Consumption is on the same level as before.
Problem i am dealing now is regen effect is very strong in 2nd gear. If i lower brkmax i only get less amps back. Braking effect however remains very strong still. On highway that is not a problem, but in city driving it can get very jittery if i alternate throttle around 0% position. 
You have any idea what to do? Could it be helped or is this just my motors construction?

I had idea that could be done in software. Could you somehow put hysteresis filter to 0% throttle position so it wouldnt oscillate when i alternate from throttle to regen? Maybe averaging samples could help?

tnx

A

EDIT: I also noticed in web interface i have only -25% throttle travel available for regen. Why would that be, since i set it to 35%?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Ok, updated to the latest opencm3 version.
> 
> Not much testing yet, will do that tomorrow.
> 
> ...


Excellent! I will try new software ASAP and simulate some "OClimit errors", "EMG stop" and "throttle out of position" errors.

You could add errors
1. "inverter hot" --> derate
2. "motor hot" ---> derate
3. "encoder input error" --> Stop

A


----------



## arber333 (Dec 13, 2010)

OK i may have a good procedure on how to setup the motor - inverter to best efficiency. It worked for me at least and since i figured it out more by accident i want to share it here. 

After first motor run setup next parameters important ones in *bold *
*boost* calculate cca 15V boost at first to overcome motor winding resistance at start
*fweak* calculate it acc. to johannes equasion, in general something around 130Hz works unless motor is industry specific
*fslipmin* either calculate it like Johannes showed or set it so that you can take off without motor jittering
*fslipmax* just set it 2x fslipmin initially
*ampmin* 5 i set it at this and try to set fslipmin. I later reduce it if neccesary. 
fmin 0.5 or 0.25 it is slip resolution. I have minslip 3Hz and at such high minimal freq. motor doesnt work good, so i set it lower. 
brknompeda -25 i reduce braking only for initial setup
brknom 35 throttle braking action in %
brkmax 10 throttle pedal braking torque set low initially 
brkrampstr 25 Hz ramp for braking at low rpm set high only initially

Now comes the tuning part. 
First you want to find a flat surface - a parking lot etc. so you can drive and stop without checking traffic. Change only one parameter at a time and save settings that work!

1. set fslipmin so that you feel car taking off smoothly and try to change it by +/-0,1Hz and check differences in starting. Save when satisfied.

2. lower boost value in 100pts untill motor jitters at start. Then return it to last good value.

3. try lowering ampmin in 0,1 increments and observe throttle travel. When throttle is not just smooth but becomes sluggish return some previous increments untill throttle reaction is acceptable. 

4. change fweak value in +/-10Hz increments from starting point and observe torque in starting. This value is very dependent on battery voltage and is very subjective.

Now you find a hill or ramp and set car on it. You want to hold car in position on slope just using throttle pedal. If there parameters are not good motor will jump or will feel sluggish

1. add boost if motor is oscillating if it is smooth reduce it in 100pt increments untill you get oscillation. Then return to last good value
2. reduce/increase ampmin in 0,25 increments untill you get oscilation in motor and return last good value 

Now set the car into a hill to set fslipmax. Warning full throttle will be used. Be sure there is no other traffic!
Set fslipmax to chosen value (guess it at 2xfslipmin if you have no other way) and try to take off with full throttle. 
If car feels sluggish with full throttle you have to add more slip.
If motor starts to jitter there is too much slip. Try to reduce it in 0.1Hz increments. 
When you feel satisfied with settings save them and go on setting regen and braking effect.

Hope this procedure helped you. It certainly was succesful for me. My car can now drive at 130km/h highway speed without motor overheating and i get enough torque at start to drive comfortable in city traffic. Best of both worlds!

A


----------



## arber333 (Dec 13, 2010)

Johannes can you tell me if your software has provision for reducing power under load in case of inverter overheating? If so, how does it start to reduce power and what are the limits?

Is there also something to reduce power in case of motor overheating?

tnx


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Johannes can you tell me if your software has provision for reducing power under load in case of inverter overheating? If so, how does it start to reduce power and what are the limits?


Yes, it will derate above 85°C and reach 0 power at 88°C.



arber333 said:


> Is there also something to reduce power in case of motor overheating?


No, just the mprot input


BTW thanks for the guide, I will link to it.


----------



## arber333 (Dec 13, 2010)

Last weekend I improved water cooling for my inverter. I used a good copper water cooler with 2x 24V fans that i ran with 12V - 24V boost regulator. Also i kept old BMW heater mounted in frontal air flow. Together they really made a difference. Inverter never goes over 40°C. On its own the copper cooler is a bit weak, since temperature reaches 60°C.

See log pic of my drive home from work, cca 42km at highway speeds of 120km/h. In motor graph you can see a hump - steep rise uphill and downhill at 120km/h, i never released gas pedal . 
Recently i went trough 20KKm with this inverter and it is going strong, 0 maintenance and very little fiddling required.











Regarding last blown IGBTs we figured *dead time* parameter at 28 is too small for Infineon 400A igbts. We think this together with weaker caps was the cause for blown IGBTs. After some testing we choose parameter 63. 

Myself i still use 28 on 300A Fuji IGBTs, but they are faster evidently. Now i will also change to 56 as 1,5us and see how it goes.


----------



## jhuebner (Apr 30, 2010)

Seems like your plot didn't make it here.

It's pretty amazing how little temperature the inverter develops. This goes even for my air-cooled version that never exceeds 50°C even on hot days.

I should really change that default for the deadtime, 800ns is pretty silly actually.

Did you ever do the deadtime check, i.e. 0 current on a small power supply with no motor connected? 
Maybe that check does a false positive because t_off might increase at higher loads?


----------



## arber333 (Dec 13, 2010)

Well i havent even tried before, because my inverter worked "of the shelf" .
When we broke IGBTs we were forced to check this. Still i drive deadtime 28 and no problems. Hah, must be because i never take Ibatt over 250A! 

Before i drive home today i will change this to 56 or even 63. I will report result then...

EDIT: I changed deadtime to 63 and motor is running smoothly! Better than before. BUT there are some oscillation present at takeoff, i guess they were dampened before. I will have to reset my inverter settings a bit. 

EDIT2: I figured i used too little voltage and motor is jumpy at start. When i gave it 2000 boost driveoff is without oscillation. However now i also see braking is stronger than before, i get about 3A more!

EDIT3: i gave it 2200 boost and i also set throttle braking at 15kW (45%) and brake pedal the same power. I put ramp at 35Hz. This setting now doesnt cause vibrations anymore when braking and i can control the car in traffic more.
I keep ampmin setting at 3 because more causes car to jump at start.

A


----------



## EVElvis (Jun 20, 2009)

Hi All
Had a good day today finishing getting the car connected to the inverter and powering it up. 
Before I connect the cars main motor I am using a small motor to test. For some reason cannot get it to spin up much with throttle pedal fully depressed, compared to manual mode operation which lets me spin up to psu limit. Any ideas? Potmax and PotMin set etc, and did wonder if it is because I have the parameters set for my larger motor, including nuimp set to 256?
Also should error light be on until start signal provided?
Took a small video, so you can see:

https://www.youtube.com/watch?v=x52uhfntTf4&feature=youtu.be

Now studying the parameters for clues and catching up on recent posts. Any help greatly appreciated.
cheers
Tim


----------



## jackbauer (Jan 12, 2008)

Tim I'd suspect your encoder is not connected or being read correctly. Had the same thing happen. With no encoder the throttle simply ramps from fslipmin to fslipmax.


----------



## arber333 (Dec 13, 2010)

EVElvis said:


> Hi All
> Had a good day today finishing getting the car connected to the inverter and powering it up.
> Before I connect the cars main motor I am using a small motor to test. For some reason cannot get it to spin up much with throttle pedal fully depressed, compared to manual mode operation which lets me spin up to psu limit. Any ideas? Potmax and PotMin set etc, and did wonder if it is because I have the parameters set for my larger motor, including nuimp set to 256?
> Also should error light be on until start signal provided?
> ...


You may use wrong encoder setting. I have it set at 60ppr and if i set it at 61 motor would spin and "fall out of sync" i.e. run using max slip as rotation limiter. Try checking if you get correct signal out of encoder. power inverter up, spin motor by hand and check if you get nice square weaves on scope. Then you have to know how much pulses there are per rotation. Industrial encoders use 64, 128 etc.. 
You can even make your own like Johannes and me.
https://mazdamx3ev.wordpress.com/2015/07/03/enkoder-senzor/

A


----------



## arber333 (Dec 13, 2010)

Lately i discarded my usual braking scheme of using light 5kw braking on throttle pedal and 2x - 3x harder motor braking on actual brake pedal. 
Now i use strong braking, at least 15kW on throttle pedal released and i adapt throttle according to traffic. Brake i set about the same, so if i remove foot from throttle or if i shift i dont get a jolt of regen, but rather regen is allready present. Now everything is very good and i am happy with this arrangement. 
But people driving behind me are somewhat confused. If i release throttle in city traffic speed is reduced rapidly WITHOUT brake lights. It could get dangerous in dense traffic. This is why I use 35Hz brakeramp and I consciously try to brake using brake pedal (brake switch) to show other drivers my intention. But its so much easier/natural to just use throttle pedal like BMW I3.


----------



## EVElvis (Jun 20, 2009)

Thanks Guys
Pleased you think its the encoder not being connected. I will connect the cars motor and encoder up and see if it spins up. Not sure my power supply has the power as gearbox is connected too, but we will see.
cheers
Tim


----------



## Gurgel (Jul 22, 2015)

Hello guys !
I made this card for experiments with DRIVERS from Mr. Johannes, this power stage uses only two IGBT low cost and low power, so I decided to share,,


----------



## jackbauer (Jan 12, 2008)

Have posted this on the Enova thread but think it deserves a place here too :
https://youtu.be/VQzvf70v1JA

Another motor working with this inverter


----------



## Tomdb (Jan 28, 2013)

You got a nice collection building up there. How about a simple load bench? You know for testing controllers and motors. Really wondering what kind of starting torque and response the current controller/firmware has. 

Plus why not find out what kind of power your; Siemens, Enova or Lexus motor/gearbox got.

Since the software right now is very basic (this is not a bad thing mind you) it should run any AC motor without a problem. Or are the two firmware's separated? Else the statement should read, the software can run any AC magnet motor (not every type optimal but good enough for a start).


----------



## jackbauer (Jan 12, 2008)

I'd love to Tom. Lots of nice projects in my brain but sadly money , work and life tend to intrude


----------



## Tomdb (Jan 28, 2013)

Unfortunately for me right now almost the same. However my biggest issue is that I have no space for my projects, however I keep hoarding nice parts.

If you need help with any part Id love to help you out, CAD software electronic design. 

But on topic, could you elaborate on the Enova "driver board" features, voltage supply gate signals and other features, like sensors or outputs. Since these are available cheap it might be a great base for a Jhuebner inverter.


----------



## jackbauer (Jan 12, 2008)

Will do Tom. I have most of the driver board figured out. Can run the gate drivers etc. Still working on the current and voltage sensing and interlocks. I'm not even going to try and make the logic board run. It's prehistoric. Much easier to drop in a Huebner board or a variant.


----------



## dima (Dec 1, 2015)

On that note, will sensor board revision 3 Schematics and Tiny code be available for download?


----------



## arber333 (Dec 13, 2010)

dima said:


> On that note, will sensor board revision 3 Schematics and Tiny code be available for download?


ATtiny code is loaded in inverter.zip in firmware folder on johannes website:
http://johanneshuebner.com/quickcms/index.html?en_downloads,14.html


----------



## dima (Dec 1, 2015)

Didn't see any pcb layout or the source code for ATtiny anywhere (even in gitHub)


----------



## dcb (Dec 5, 2009)

mpaul uses an attiny in his design to control the gate driver isolated power supply (it is a bit odd, but it works just fine, software programmable 555 basically), I don't know of any attiny in Johannes controller (the main subject of this thread).


----------



## arber333 (Dec 13, 2010)

dima said:


> Didn't see any pcb layout or the source code for ATtiny anywhere (even in gitHub)


Check PCB folder in Johanness documentation and open it in Eagle. I belive it is new version.

EDIT: I checked and it seems sensors PCB is still V1 non isolated version.


----------



## jhuebner (Apr 30, 2010)

Hi all,

been on holiday the last 3 weeks.

So I updated the zip file. It contains two versions of the sensor board now, the very first one and the recent one. Also I included the modified gate driver (fits SMD part and -9/+15 DC/DC).

Attiny source code is included as well.


----------



## EVElvis (Jun 20, 2009)

Hi All
After some success being able to run small 8kW motor with the inverter all connected in the car (https://www.youtube.com/watch?v=x52uhfntTf4) Since this video I have updated to the newest software which works fine so far.
I am unable to spin up or even get the inverter to try and spin up my 25kW continuous rated Hyundai motor and gearbox. There is no PWM signal to the IGBTs at all, since I expect when it does try that my PSU will trip - it is set at 30V and 3A output. At least if it tries I am pretty confident applying more power that it will go. 
Inverter software indicates that the inverter trips on overcurrent after very briefly indicating run mode if I am quick at refreshing the web interface. Tried changing parameters which at least managed to stop my red fault LED lighting up immediately.
Any help greatly appreciated.
cheers
Tim


----------



## jhuebner (Apr 30, 2010)

Hi Tim,

can you post some more data on your motor and also attach a parameter dump (from the web interface).


----------



## EVElvis (Jun 20, 2009)

Hi Johannes
Motor plate attached.
I will get a parameter dump asap, probably tomorrow now.
Most parameters are set to default. From memory changes made were as follows:
fslipmin/fslipmax, fweak - all left at default believing it would make no difference for a little 30V test - hope im wrong. Happy calculating what they should be based on rating plate. 
boost	dig	- tried 1700 - 5000
fweak	- tried 10.
deadtime	dig	193	
numimp 256
potmin	dig 500	
potmax	dig	3400
udcsw	V	15
udcmin	V	15
udcmax	V	30
ocurlim	put this up to 1000 as error was overcurrent.
il1gain,il2gain	I played with these a bit as current readings were high.

cheers!


----------



## arber333 (Dec 13, 2010)

Well

first dont try to run your motor sensored on 30V if you will later run it at 200V. As i gather you already tried to run it manualy in V/F and it worked. That is all you need for testing.

Now you should make your car move and you cant expect that from 30V! You need at least 3kW and transmission! Since you are 1:1 you will need 5kW at least. Try upping the voltage to 100VDC and make suitable corrections.

For 100VDC
boost try 8000 since it is very low voltage you may have problem with motor wiring resistance. I need 28V just to start my motor...
fweak - try 90Hz so you dont throw overcurrent so often and increase in 10Hz steps so you get good take off. Check my post #1232 for procedure.
deadtime i use 63 with 9Khz 
potmin/potmax have to see pedal travel to set. 
ocurlim i set at -550 since i have 300A IGBTs
il1gain,il2gain just adjust so they get very close.

A


----------



## jhuebner (Apr 30, 2010)

It's also important to know that correct current sensor calibration (ilXgain) is essential for the over current limits to be set correctly. Also ilXgain and ocurlim must have the same sign.


----------



## EVElvis (Jun 20, 2009)

Thanks Guys
Im not trying to move the car just yet, just want to spin or at least try to spin the main motor before connecting propshaft (not the one in my video) 
Will have a play later hopefully and let you know how I get on. Will get parameter dump too.
Cheers
Tim


----------



## arber333 (Dec 13, 2010)

EVElvis said:


> Thanks Guys
> Im not trying to move the car just yet, just want to spin or at least try to spin the main motor before connecting propshaft (not the one in my video)
> Will have a play later hopefully and let you know how I get on. Will get parameter dump too.
> Cheers
> Tim


Just set fweak to 90 then and run the motor - no load on it though . 
Also set slipmin to 1 and slipmax to 3,
set ampmin to 10,
set boost to 10000,
set oclimit to -500,
set fmin to 0.5,

Maybe you are in luck.

A


----------



## EVElvis (Jun 20, 2009)

Thanks Arber333
Only just seen your post so will have another go tomorrow, but I have just had a quick play, but still no go with overcurrent error. 
Got parameter list though, as follows:
{
"boost": "1700",
"fweak": "5",
"fpconst": "400",
"fslipmin": "1",
"fslipmax": "3",
"polepairs": "2",
"ampmin": "10",
"encflt": "4",
"fmin": "1",
"fmax": "150",
"pwmfrq": "2",
"pwmpol": "0",
"deadtime": "193",
"numimp": "256",
"potmin": "540",
"potmax": "3500",
"pot2min": "4095",
"pot2max": "4095",
"idlespeed": "-100",
"idlethrotlim": "50",
"idlemode": "0",
"speedkp": "0.25",
"speedflt": "1",
"cruisemode": "0",
"bmslimhigh": "50",
 "bmslimlow": "-1",
"brknompedal": "-50",
"brknom": "30",
"brkmax": "30",
"brkrampstr": "10",
"udcsw": "10",
"udcmin": "12",
"udcmax": "24",
"udclim": "25",
"ocurlim": "1000",
"minpulse": "1000",
"il1gain": "0.5",
"il2gain": "0.5",
"udcgain": "6",
"pwmfunc": "0",
"pwmgain": "100",
"pwmofs": "0",
"speedgain": "6000",
"snshs": "0",
"snsm": "2",
"fslipspnt": "-1",
"version": "3",
"ampnom": "0",
"opmode": "0",
"udc": "18.81",
"idc": "0",
"il1": "0",
"il2": "0",
"uac": "0",
"il1rms": "0",
"il2rms": "0",
"id": "-0.09",
"iq": "0",
"p": "0",
"q": "0",
"s": "0",
"pf": "0",
"t": "0",
"fstat": "0",
"speed": "0",
"amp": "0",
"pot": "576",
"pot2": "61",
"potnom": "-25",
"dir": "0",
"tmphs": "21.4",
"tmpm": "170",
"din_cruise": "0",
"din_start": "0",
"din_brake": "0",
"din_mprot": "1",
"din_forward": "0",
"din_reverse": "0",
"din_emcystop": "1",
"din_ocur": "0",
"din_bms": "0",
"tm_meas": "0"
}

cheers


----------



## jhuebner (Apr 30, 2010)

First thing that looks suspicious is ilXgain=0.5 - sure thats calibrated correctly?

Second thing is that neither din_reverse nor din_forward are one, so inverter is in neutral mode and won't output anything.


----------



## arber333 (Dec 13, 2010)

Fweak is there to set the max toque region which is somewhere at 90Hz. Fslipmax sets max slip. 
Try to set like i said, and get some serious volts in the car soon.

A

EDIT: Yeah i have to read more carefully  i still think motor needs more boost.


----------



## jhuebner (Apr 30, 2010)

Yeah fweak 5 is fine for bench testing with an input voltage way too low. For an actual setup it needs to be higher.

fmax is not the maximum slip, it's the frequency at which the inverter will cut power to avoid over-revving the motor.


----------



## EVElvis (Jun 20, 2009)

Thanks Guys
ilXgain most likely not calibrated correctly. 
I can switch fwd and reverse in ok, just didnt have it set when I took parameter file.
Will have a proper go tomorrow.
cheers!


----------



## arber333 (Dec 13, 2010)

I asked Johannes to program PA7 port that was not meant in original design to function as regen signaling to show when car is braking with single pedal. 
This makes brake lights lit when throttle pedal is almost released. Cca 10kW+ regen shows brake light. 

EDIT: I use 5V Arduino relay module that works with high pulse and has opto trigger that can work with 3V3. 
http://www.ebay.co.uk/itm/1-Kanal-5...534574?hash=item51e45b38ee:g:7QAAAOSwn9lXKHZl
First i wired one Arduino relay to PA7, +3V3 and GND. Then i wired 12V trough relay and wire no. 15 which was reverse pin, disconnected now. Then i took a motorcycle LED strip with red and amber LEDs and wired it directly to wire 15 and GND. I changed software and in software i set "brkout" parameter to -30 first. LED went on almost instantly when i lifted throttle. Then i set to -50 and LEDs went out and never lit! Oh well i set it to -45 and now i get normal response when regen is well pronounced and car is decellerating.


After the tryouts i tought on putting a diode after brake switch so not to regen on regen signal  (weird). Well i tought what if i just installed 3rd brake light - motorcycle LED strip. I left amber lights disconnected though. http://www.ebay.co.uk/itm/391475819793?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

It works like this:

- I push throttle and car accelerates

- i lift my foot off throttle and 3rd brake light is lit 

- if i touch mechanical brake this new light is also lit since brake regen is a little stronger than throttle


----------



## EVElvis (Jun 20, 2009)

Hi All

EDIT - Problem solved - it was indeed bad connections, and in this case my bad soldering on the sensor board - found R4 and R14 had bad joints, so explains intermittent operation that I had. Now happily in Manual mode! 

Think I have a bad connection somewhere.
I started playing with the parameters, and again got nowhere, and could not even get manual mode working with no motor connected, or whilst off the car with separate test connections. It always stopped on overcurrent fault. 
I did start thinking that it was the Olimex, since I noticed that when it was connected to the laptop during testing off the car the green LED was not flashing, but seems ok now, and flashes when connected with pins 11, 13, 17, 24 to 12V and 23 to GND now - I think it may have been my USB connection, which I thought always provided enough power to make the green LED flash. Think it maybe because I am using a different laptop. I did reflash it with the latest software which it did just fine. 
I have a spare Olimex, so just incase will have a go at getting the software on it. Think I need to follow post 836.
I then thought there was a problem with a gate driver as I read 5V in but no 15V out to one of the the IGBTs, so having a spare, changed it to find it made no difference. So checked again that 5V was going in, which it was, but as soon as the gate driver was connected (IGBT disconnected) the voltage dropped to 0.2, so I am thinking a bad connection somewhere on the main board or connector, since I guess the 5V for the gate drivers is direct from the IC5? At 12V power consumption was 0.197A, so less than 0.3A as it was during testing.
Will check my connections and play again tomorrow.

cheers
Tim


----------



## arber333 (Dec 13, 2010)

Ah that figures... I had some problems with circuit also in the beginning. Since then i found out that it is best to rinse PCB with nitro solvent after soldering. It disolves remaining flux that would later be cause of shorts and it cleans surface in general. Just use one bottle cap of nitro and apply it with small brush on the underside of PCB. Soak up excess solvent with cotton cloth and leave the rest to dry up. 
Also take care to leave small gap under resistors that are mounted over ground plane. In time elements touching copper can start to conduct and all sorts of trouble can appear. I use a piece of paper that i put under resistor, when element is mounted i remove it and it leaves small gap that cant conduct. Little things that benefit the future use...
Also if possible under large capacitors i put thin rubber film to cancel out vibrations that can mechanicaly damage caps. 

enough of my rambling, i want to see motor turning and wheels spinning. Bring out the high voltage!

A


----------



## EVElvis (Jun 20, 2009)

Hi All
After a very frustrating day yesterday, I have finally managed to run my cars main Hyundai motor and gearbox, albeit very slowly in both manual and auto.
Problem was indeed the bad solder connections to R4 and R14. Problem was intermittent, but now know to first check solder joints visually, pressing any suspect component which in this case allowed me to see the solder joints move. So pleased to find such a simple fault.
I also connected encoder with success. Heres a video:
https://www.youtube.com/watch?v=Rxc-8Ed36VI
Very pleased, and will now get on with my battery box and its connections. Hope to have a test setup with limited batteries at first very soon.
Cheers, and thanks again for all of the help on here! Learning loads


----------



## jhuebner (Apr 30, 2010)

Congratulations 


I noticed you have a pretty high deadtime of 193. Not sure what it works out to but must be a couple of µs. Most people run at 63 which works out to 1.5µs if I remember correctly. You may want to tune it a bit.


----------



## dima (Dec 1, 2015)

Anyone interested in alpha testing the new GUI? All Feedback appreciated.

php, dio and dependencies all-in-one.

Windows: https://github.com/poofik/Huebner-Inverter/releases/download/1.0/Huebner.Inverter.Windows.zip

OSX: https://github.com/poofik/Huebner-Inverter/releases/download/1.0/Huebner.Inverter.zip


----------



## jackbauer (Jan 12, 2008)

Linux version?


----------



## onegreenev (May 18, 2012)

dima said:


> Anyone interested in alpha testing the new GUI? All Feedback appreciated.
> 
> php, dio and dependencies all-in-one.
> 
> ...


I'll be giving the OS X version a spin this weekend. I opened it without any thing connected and so far it looks fine. I report back very soon. 

Pete


----------



## jackbauer (Jan 12, 2008)

How does this run / install? Have tried to get it setup on a windoze laptop. Is it web based?


----------



## dima (Dec 1, 2015)

jackbauer said:


> How does this run / install? Have tried to get it setup on a windoze laptop. Is it web based?


It is still web-based  but takes care of installing PHP and PHP_dio through PowerShell.


----------



## jackbauer (Jan 12, 2008)

Just back from first successful test drive in the Panzer with the manual gearbox. See attached plot of il1,il2 and potnom. The inverter doesnt seem to want to make much low end torque but when i get on the pedal the power comes in and i'm riding a rocket. Only thing slowing me down this evening were crappy ice cars. It is something to watch the tach climb all the way into the red at 6k rpm!


----------



## arber333 (Dec 13, 2010)

Nice work D. I have my 2c to share. 

Since you put in the manual without clutch, have you tried up/down shifting while driving? How did it go? 
I am asking because i was also thinking of making MB CLK manual conversion some time ago. 

Idea was to use transmission without clutch. I would put two actuators perpendicular to manage the shifting lever. I would use only 3 gears for easier actuator travel... 2nd, 3rd and 4th. Since motor doesnt have a lot of spinning mass synchros could be fooled by approximating shift RPM. Also i could use RPM sensor so i would know where to shift. I tried this on my MX3 and it works, but older Jap cars have troublesome downshift...

Now i could stop there and use 3 position switch with a button to release motor torque while shifting ( controler BMS input) and shift on.

BUT why stop there! I would already have actuators in place, i would have RPM output signal and i would have controling mechanism to order gear change. I would only have to add a driveshaft RPM sensor and microcontroller as comparator. Arduino would do, but PIC would be safer. 

Chip would compare RPM1 to RPM2 and decide either to upshift or downshift. There should be some hysteresis cca 800rpm difference involved. Of course comparator would disable motor torque when shifting and put it back when done. Should be a 1/2s delay when shifting...robotic manual drive . 

I think ACIM motor would natuarly compensate for error in RPM, since its rotor is reactive not magneticaly coupled to driveshaft. PMSM would be more of a problem.

What do you think?

A


----------



## PStechPaul (May 1, 2012)

Interesting idea. I think the way to do it would be to adjust motor torque to zero, and then shift. Depending on whether upshifting or downshifting, the motor speed would need to be changed so that its speed matches that of the transmission in the gear to be engaged. The transmission goes through neutral as it is shifted and there should be enough time to make the adjustment.


----------



## Tomdb (Jan 28, 2013)

Some sportscars do this already. Rev matching, some implementation are quite crude, throttle blipping. 

Some hybrids just use that dang handy electric motor.

However you should be careful with the control loops you would implement that these do not interfere with the ones the inverter uses.

But a robotic manual is nothing new, check out the oh so craptastic gearboxes from the first Smart's.


----------



## jackbauer (Jan 12, 2008)

Test driving the 8 Series with new inverter settings and manual gearbox :
https://www.youtube.com/watch?v=gXZ_CCwxs3s


----------



## PStechPaul (May 1, 2012)

Looked pretty good! What was the top speed you attained during the test drive? Looked like maybe 100 km/h? Not bad for cow paths!


----------



## jackbauer (Jan 12, 2008)

Yep bout 100kph. Next will be going to full 360v on the battery.


----------



## jackbauer (Jan 12, 2008)

Bit of a problem with the Panzer. Finally took the plunge today and wired in the full battery. No running approx 390v nominally up from 250v. As of this change the car is not driveable. Applying throttle results in the car jumping and surging. Playing with fmin , fslipmin and boost makes little to no difference. The problem seems to be trying to get the motor spinning. Low rpm torque is almost non existant.

Currently the inverter is running V3 software which Johannes tells me keeps fslipsetpnt at fmin until 50% throttle. I think this may be the problem as when i tried V3 last year with the automatic gearbox it shook so violently it blew an igbt. So I am guessing the Siemens motor does not like having a fixed fslip as you pour in current. Any thoughts? I have attached the current paramater file. I can barely move the car at this point without shaking it to pieces and tripping the current limit.

Going to see if i have an old version of the code somewhere. v2.75 i think worked with the auto. Any advice welcome.


----------



## jhuebner (Apr 30, 2010)

Did you try an accordingly higher value for fweak? Also ampmin is quite high at 50, start with 0.


----------



## jackbauer (Jan 12, 2008)

I had fweak up to 100Hz. Will have a play with ampmin now and report back. Thanks


----------



## jackbauer (Jan 12, 2008)

slightly better with these settings but still jerky and not driveable.


----------



## jackbauer (Jan 12, 2008)

with these settings i can roll the car but when i try to bring on power it trips. also the motor growls at low rpm.


----------



## jhuebner (Apr 30, 2010)

If fweak =90Hz worked well for 250V it should be 390/250*90=140Hz now. fslipmin=0.53 looks extremely low but I guess you arrived at it by trying?


----------



## jackbauer (Jan 12, 2008)

downgraded to v2.75. no difference. I can rev the motor in neutral no problem. attached are old params from automatic and v2.75


----------



## jackbauer (Jan 12, 2008)

Am thinking the automatic with the torque converter and idle mode may have masked this problem.


----------



## arber333 (Dec 13, 2010)

I think you have to treat it as completely new motor with different parameters. 
I think fslipmin is too small for a motor with such long rotor, also you should strive to make ampmin as small as possible to get good economy in steady state.

I had the same problem when going from 280Vdc to 370Vdc. Motor just jumped and wouldnt driveoff throwing oclimit.
Initially i set minslip at 1Hz and i had to make ampmin at least 30% to driveoff comfortably. Even then there was very little driveoff torque and motor was overheating in steady state driving. Now i know it was heating up cause i fed it too much dynamic component DOH.
When i set minslip at 3hz (which was slip before at 130Vdc system) i had to lower ampmin to 3% to get a smooth start. Torque and regen are great now and bonus is i get 15% more range!!!
When motor starts boost is very important and i keep it at 3000 since winding wire is thin so you have to fight its R at start.

Try with my checklist on post 1232. It worked on at least 3 cars now with zero motor data . 

A


----------



## jhuebner (Apr 30, 2010)

Yes it will mask startup issues.

So here's what I would do:

Set fslipmin=fslipmax to take varying slip out of the equation. Start at 1Hz or so. Whenever modifying make sure to change both.

Set ampmin=0, boost=0, fweak=120? (Is there some rating that says x [email protected] Volts?)
Keep increasing boost until getting a clean startup and run.

Arber posted his setup procedure a few pages back, maybe that helps?

Thats all I can think of right now.

EDIT: there he is, thanks


----------



## jackbauer (Jan 12, 2008)

Thanks Guys Will give it a try tomorrow.


----------



## jackbauer (Jan 12, 2008)

The Panzer is rolling Attached parameter file from latest test run. Very smooth on startup and plenty of power on tap. Might be worth putting this file on the website as there are a good few Siemens 1pv5135 motors going around.

Will do a full test drive later once i get the charger installed. Thanks guys for the great support.


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> The Panzer is rolling Attached parameter file from latest test run. Very smooth on startup and plenty of power on tap. Might be worth putting this file on the website as there are a good few Siemens 1pv5135 motors going around.
> 
> Will do a full test drive later once i get the charger installed. Thanks guys for the great support.


Great news! 
Mh, high boost there... I am still surprised how low is your minslip. I imagined siemens would have at least 2.4 if not 3.2Hz... 
My motor also had very smooth start with 1hz minslip but when on longer drives motor would heatup but i never knew i had it wrong.
Maybe you could try running with higher minslip only to try if efficiency is better on longer routes.

A


----------



## jackbauer (Jan 12, 2008)

Ok so i've been having a few doubts recently about converting the 8 series.I want the car to be as faithful to its heritage as possible while being electric.Today those doubts are no more.This friggin car goes like a bullet train on steroids 

Once I got the software dialed in the difference from last drive was crazy. Just a little throttle and the tach just winds its way up past the old V8 redline at 6k and sounds like a gas turbine. Shedding 65kg in going from the automatic to manual would have also helped. More videos on the way Thanks Johannes and everyone who has contributed to this wonderful project.


----------



## dcb (Dec 5, 2009)

It is really neat watching you guys sort this out!



http://www.diyelectriccar.com/forums/showpost.php?p=774930&postcount=1232
Arber, that is awesome! it is like carburetor tuning for your ACIM!


----------



## dima (Dec 1, 2015)

Amazing work! I am posting my video here https://youtu.be/JsQpqevrUAw

One question, I had to remove my snubber caps completely to make this work at low voltage (~50V). If I put 1uF snubber the over current kicks in and I cannot start (maybe get half rotation). Is this normal behavior or my snubbers are too high for this voltage? ...and yes I needed that much boost to max out speed.


----------



## arber333 (Dec 13, 2010)

dima said:


> Amazing work! I am posting my video here https://youtu.be/JsQpqevrUAw
> 
> One question, I had to remove my snubber caps completely to make this work at low voltage (~50V). If I put 1uF snubber the over current kicks in and I cannot start (maybe get half rotation). Is this normal behavior or my snubbers are too high for this voltage? ...and yes I needed that much boost to max out speed.


I dont think snubbers have anything to do with this. You have too low voltage for sensor operation and so you need very high boost. My motor needs cca 30V to start but i have 370Vdc nominal! With 50V there is very little left to spin motor up and it can quickly go to weakening of field. But since you have this set to 90Hz you would need at least 200V to get there. Try playing with fweak, set it 50 or lower... you will get better results. Give it some more batteries to up voltage or rewind your motor...

And put snubbers back in they are there to protect IGBTs from overvoltage spikes. The moment motor would make any serious regen you could damage your IGBTs. 

A


----------



## jackbauer (Jan 12, 2008)




----------



## tylerwatts (Feb 9, 2012)

Excellent news jackbauer 


Tyler


----------



## jhuebner (Apr 30, 2010)

Just back from holiday, I see things have proceeded 



dima said:


> Amazing work! I am posting my video here https://youtu.be/JsQpqevrUAw
> 
> One question, I had to remove my snubber caps completely to make this work at low voltage (~50V). If I put 1uF snubber the over current kicks in and I cannot start (maybe get half rotation). Is this normal behavior or my snubbers are too high for this voltage? ...and yes I needed that much boost to max out speed.


Could it be the deadtime too low? Although it looks sufficient to me.



jackbauer said:


> The Panzer is rolling Attached parameter file from latest test run. Very smooth on startup and plenty of power on tap. Might be worth putting this file on the website as there are a good few Siemens 1pv5135 motors going around.
> 
> Will do a full test drive later once i get the charger installed. Thanks guys for the great support.


I'm thinking about shipping a parameter database with the web interface. Taking your parameters as a base one could enter the DC voltage to adjust boost and fweak.

BTW if you run into problems with oscillating regen on low revs try setting encflt to 0 or 1.


----------



## jackbauer (Jan 12, 2008)

Well Ok. Good news is the inverter and siemens motor are running sweet. Bad news is it packs enough punch to eject the lay shaft through the side of the gearbox


----------



## arber333 (Dec 13, 2010)

Well i turned the Leaf motor using Johannes controler, albeit at some lower Hz! It is 4 pole motor so it works quite good... Although i couldnt put any load to it since it is still PMSM motor, only V/hz!
First i had to give it 3500 boost to start spinning at all. Than i tried all sorts of frequency changes vith marginal success. Last of all i set min slip at 10Hz and started motor by applying throttle. It turned at 600rpm! Hah! I then showed it 30Hz and bam! inverter threw OC limit. Well i tried more political approach. I went back to 10hz for start and when motor was turning i changed minslip in steps of 10Hz up to 60Hz. Rotation was on par.
Then i smelled something!!! It was a plastic smell... it came from inverter. I opened the cover and smoke came out. When i dissassembled it i found both wires from caps to DC rail were burned, isolation hanging off them (10mm2 cable)!!! 
PMSM motor must put some heavy pulse back to inverter. But i didnt saw any indication of regen!!!

Yesterday i propperly arranged two 100uF plastic caps and two 1500uF elcaps to get optimal current damping. I connected caps with copper rail and put one 25mm2 short cable from caps to DC rails to retain some flexibility. After some 50km of driving to work and cells being full i figured whole setup works good. At least that 8khz whine is gone, thanks to elcaps i think. I also found the car more responsive to throttle and regen has more power.
Also i am thinking of making some holes on lower front side and higher back side of inverter to provide some convection cooling possibility. I see controller is not overheating on the water cooling plate but in the area of control board! So i guess if i keep it ventilated i thnik it will be better. 
My friend already put a hole in the cover of his controller to keep it cooler.

A


----------



## dima (Dec 1, 2015)

You guys are spinning PMSM motor out of the box with default firmware? Wow, I thought it was only ACIM.

A. can you post your best params file for building a motor database list.


----------



## jackbauer (Jan 12, 2008)

Panzer fast


----------



## jhuebner (Apr 30, 2010)

Whole new rap songs will emerge 

Good to see you got it all fixed. Whats your rpm limit? And top speed?


----------



## jackbauer (Jan 12, 2008)

I currently have Fmax at 200Hz so 6000rpm. Not sure of top speed yet but it is fast


----------



## ALIE (Jan 28, 2015)

Hi everyone
Here are some pictures of my work.
http://www.evalbum.com/4961


----------



## dima (Dec 1, 2015)

In heat-shrink we trust  Those seem a bit too close for safety?  

Otherwise I like the idea how you routed the copper through the sensors!


----------



## ALIE (Jan 28, 2015)

All connections are protected by varnish all unprotected gaps is min 7mm.
I already drive 10,000 km in three months and work perfectly .


----------



## Ai! (May 9, 2014)

looks very nice and clean! Very very good work!


----------



## ALIE (Jan 28, 2015)

Inverter parameters
Very good except for the cruise control speed fluctuate +8 -3 kmh


----------



## jhuebner (Apr 30, 2010)

Recently I retuned cruise control. I found it worked better with higher filter values. I'm now running speedkp 0.21 and speedflt 5. It might also allow you to set a higher value for speedkp if the filter is higher.

Maybe it helps.

Congrats again on your EV work. Much nicer than what I did


----------



## ALIE (Jan 28, 2015)

Hi, I have just been tested at 40kmh and better + - 2kmh thank you. What they seem to be other parameters. My motor is wound for 125V battery has a voltage of 192V nom. The electric motor is quite small 21Kw nom. When it is cold and the battery is fully pulled out of the battery 350A when it warms 280A What do you think about perameters see some improvement. See the corrected parameters I've just uploaded.
This one file will be correct


----------



## ALIE (Jan 28, 2015)

This morning I tested the operation of the cruise control while driving to work.
Unfortunately, sometimes that happens when you switch on the cruise control for a moment, a car pulls up with all *strength for one second. any idea?
Thank you for congratulations.
Beautiful surroundings is not important for the electric current.
I am a mechanic engineer to program CNC machines and we are not difficult to create a good mechanical components.
In Slovenia three guys driving with Johannes inverters and one is under construction.
As our small country we are friends.
Sorry for the bad English, I use Google Translate


----------



## arber333 (Dec 13, 2010)

Also i tested the speedkp 0.21 and speedflt 5 setting and i got the same kick when i activated cruise control. It then stabilises a little below desired speed. I guess you could call it poor inverters PI(D) tuned to give a little stronger P factor. That way motor is at desired speed sooner and I factor can be further weakened.

I think i will lowered it to 3 tomorrow and observe motor behavior. In the morning rotor is cold and cells are high, so the kick should be even more pronounced.

A


----------



## jhuebner (Apr 30, 2010)

You're right, it's the same problem here. Because my motor is only 40kW it wasn't as disturbing but I imagine it is on a stronger motor.

The speed regulator sees a very low speed when it is first activated because of the phase delay of the low pass filter. I will look what I can do.


----------



## jhuebner (Apr 30, 2010)

Ok, small change, big fix.

Just constantly run the cruise control loop but only use its output when cruise control is active.

Just tested in the Polo, it's very smooth.

Download as usual:
http://johanneshuebner.com/quickcms/index.html?en_downloads,14.html


----------



## arber333 (Dec 13, 2010)

A month back Johannes helped me with the scourge of EVs. How to notify other drivers you are doing regen!

Idea was to find a port and use it to trigger brake light independently from braking. We decided to use PA7 MCU port that was not used onboard.

I found a suitable arduino opto relay module with high level trigger that i could use to supply 12V to brake lights. It worked with 3V signal so i just connected it to PA7 port.
Well initially i made a mistake and connected PA7 port directly after brake switch. DOH! I got the lights on but i forgot i also received brake signal to start regen at that time. Awkward... 

I went another way...
I lowered regen on brake switch since throttle regen is sufficent. I made brake lights lit when throttle pedal is almost released. Cca 30A+ regen shows brake light. 
First i wired one Arduino relay to PA7, +3V3 and GND. Then i wired 12V trough relay and wire no. 15 which was reverse pin, disconnected now. Then i took a motorcycle LED strip with red and amber LEDs and wired it directly to wire 15 and GND. I changed software and in software i set "brkout" parameter to -30 first. LED went on almost instantly when i lifted throttle. Then i set to -50 and LEDs went out and never lit! Oh well i set it to -45 and now i get normal response when regen is well pronounced and car is decellerating.



After the tryouts i tought on putting a diode after brake switch so not to regen on regen signal . Well i tought what if i just used 3rd brake light - motorcycle LED strip without connecting it trough brake switch. I left amber lights disconnected though. It works now like this:


- I push throttle and car accelerates

- i lift my foot off throttle completely and 3rd brake light is lit 

- if i touch mechanical brake this new light is also lit since throttle regen is a little stronger than brake regen!

Now i tried also the new code with cruise update and it works flawless smooth. Car maintained 130km/h level speed on highway and up a hill it lost only cca 10km/h. I could also smoothly drive with cruise at 30km/h! Well done Johannes.


----------



## jackbauer (Jan 12, 2008)

For anyone interested I have updated my IGBT gate driver board to use the connector in the Enova 90kw inverters doing the rounds. This should allow for direct connection of the gate driver to the same pigtail used in the inverter. Design files and bom attached. I'll have a few spare boards once i get the delivery from Seeedstudio.


----------



## jackbauer (Jan 12, 2008)

So something i have wanted to do for a long time is combine the logic , igbt driver and sensor boards on one pcb. This greatly cuts down on wiring and complexity and might even work out cheaper. Got the schematic worked out and now starting on the pcb. It will be mostly through hole and double sided. As usual all design files will be made available free of any charge or license.

Plan is to make it drop in replacement for the boards in the enova inverter but of course can be used for any application. Fully compatible with existing software.


----------



## Arlo (Dec 27, 2009)

jackbauer said:


> So something i have wanted to do for a long time is combine the logic , igbt driver and sensor boards on one pcb. This greatly cuts down on wiring and complexity and might even work out cheaper. Got the schematic worked out and now starting on the pcb. It will be mostly through hole and double sided. As usual all design files will be made available free of any charge or license.
> 
> Plan is to make it drop in replacement for the boards in the enova inverter but of course can be used for any application. Fully compatible with existing software.


Great work Jack. I am running the 337j driver as well.

Can you give me a link for the isolated supply with 15 on and -5 off?

I am currently using 2 sepreat supplies for this but would live something more elegant. 

Thanks for sharing your work for free! 

-Arlin


----------



## jackbauer (Jan 12, 2008)

The DC DC converter i designed around is a Murata MGJ2D051505SC which is readily available from online stockists like digikey :
http://www.digikey.com/product-deta...tions-inc/MGJ2D051505SC/811-2998-5-ND/4840065
body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Arial"; font-size:x-small } a.comment-indicator:hover + comment { background:#ffd; position:absolute; display:block; border:1px solid black; padding:0.5em; } a.comment-indicator { background:red; display:inline-block; border:1px solid black; width:0.5em; height:0.5em; } comment { display:none; }


----------



## Arlo (Dec 27, 2009)

jackbauer said:


> The DC DC converter i designed around is a Murata MGJ2D051505SC which is readily available from online stockists like digikey :
> http://www.digikey.com/product-deta...tions-inc/MGJ2D051505SC/811-2998-5-ND/4840065
> body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Arial"; font-size:x-small } a.comment-indicator:hover + comment { background:#ffd; position:absolute; display:block; border:1px solid black; padding:0.5em; } a.comment-indicator { background:red; display:inline-block; border:1px solid black; width:0.5em; height:0.5em; } comment { display:none; }


Thank you. I just noticed they are 1w I needed 3w so I will have to stick with my design.


----------



## dima (Dec 1, 2015)

Great stuff! Thank you so much - I like the surface mount improvement.

Damien may I suggest a repository (like Github), where you can place all "latest-and-greatest" one place for all your work instead of dumping into this 1000 post thread and overtime it will get lost/outdated.

Also I think Johannes needs to start his own forum  with all Hardware/Software/Feature Request sections.


----------



## jackbauer (Jan 12, 2008)

Updated with USB and CAN interfaces. Now just need to layout the pcb ...


----------



## Readykilowatt (Aug 11, 2009)

I have been trying to tune up the inverter to my motor but not with any great success. 

With the following settings and the wheels up of the ground the motor will spin up nice and smooth. 

Boost 20000, this seems rather high but will not spin at any lower.

Fweak 174 the motor is about 75V at 50 hz

Fslipmin 2
Fslipmax 6 have tried fslipmin = fslipmax but no change in running 

Ampmin 28
Fmin 0.5

But when back down on the wheels and accelerator applied car tries to move but motor oscilation is quite bad then cuts out on overcurrent. There is not much torque being developed. The dc buss current gets up to about 7 amps.

Any thoughts would be greatly appreciated. 

Peter


----------



## PStechPaul (May 1, 2012)

You might consider "rolling your own" DC-DC converter(s). Here is an excerpt from my post on sci.electronics.design for a 12V-12V DC-DC converter that was able to produce 4 watts. The parts are probably about $5.

I just received some EPCOS EE13/7/3 ferrite cores in type N87 and a matching bobbin for dual isolated windings. I was able to fit 12 turns of #24AWG magnet wire for primary and secondary. I used some heat-shrink tape to hold the core halves together, and the open circuit inductance when hot measured 156 uH, but then settled to 118 uH as expected at room temperature. Leakage inductance is 4.7 uH. Here it is in my simple test jig:










The output waveform with 13VDC input at about 30 mA:










The asymmetry is probably because of the ugly wiring. The IRS2453D has 1 uSec dead time, which you can see in the 90 kHz waveform. I added a 15 ohm (actually 17 ohm) 2W resistor to see how much the output dropped under load, and I was surprised it didn't drop very much, and looks like about 10.5 VRMS, or 618 mA and 6.5 watts. Input was 13 VDC at 590 mA, or 7.67 watts, and 85% efficiency.



















Then I connected the output to a FWB of 1N5818 Schottkys, a 20 uF 25V CM capacitor, and a 33 ohm resistor. Here are the results at various input voltages:

13V 0.37A 4.81W 11.77V 0.357A 4.20W 87%
15V 0.43A 6.45W 13.56V 0.411A 5.57W 86%
17V 0.55A 9.35W 15.08V 0.457A 6.89W 74%
18V 0.70A 12.6W 15.90V 0.482A 7.66W 61%

I am pleasantly surprised at the performance of this little transformer. The EPCOS catalog rates this size core at 5W for N27 at 25 kHz, but 28W for N87 at 100 kHz. I would have figured on 4x, but 5.6x is surprising. Probably because of greater surface area per watt for the smaller core.

The output voltage for a gate driver does not need to be tightly regulated, if the input is known and solid. It would not be difficult to wind the output for any voltage you want, and perhaps even two windings for the +15 and -5 or whatever for IGBTs. You could use a 12V-20V and then a 15V zener on the output for the positive voltage (which is more critical).

I also found that you can easily get 2 watts from a small common mode choke (less than $1 each). They have dual windings with inherently high isolation but also high leakage inductance and poor regulation.

This is a TLF9UA202:










Waveform open circuit:










With 33 ohm DC load:


----------



## arber333 (Dec 13, 2010)

Readykilowatt said:


> I have been trying to tune up the inverter to my motor but not with any great success.
> 
> With the following settings and the wheels up of the ground the motor will spin up nice and smooth.
> 
> ...


Lets see....

Dont try to rotate your wheels in the air. This is torque control so when you drive unloaded motor it should spin up instantly...
If you give too much boost then higher voltage will be applied from 0RPM and motor will try to surge forward. 
Also if you apply too much ampmin motor will oscillate from 0 RPM because of saturated windings and will draw even more current, finally throw oclimit.

I suspect your fweak is too high.
Try using procedure at post #1232

What is your DC voltage? 
What is the AC voltage on the motor at 90Hz? If you have 75V at 50Hz than you may assume 150V at 100Hz. So best DC voltage for that motor would be 220Vdc to account for voltage drop.
In that case you would want to try motor from fweak 120Hz and use boost 4000 and ampmin 5. That way you have small amps at start but you still can apply 100% amp using throttle.

If you use the motor with lesser voltage you must lower fweak so torque remains same.

A


----------



## dima (Dec 1, 2015)

Readykilowatt said:


> Fweak 174 the motor is about 75V at 50 hz
> Fslipmin 2
> Fslipmax 6 have tried fslipmin = fslipmax but no change in running


Your fweak is too high for low voltage - you want to reach it sooner.
fweak:40
I found that those two pole industrial motors slip is kind of "stretched out" try
fslipmin:10
fslipmax:50


----------



## Readykilowatt (Aug 11, 2009)

> Your fweak is too high for low voltage - you want to reach it sooner.
> fweak:40
> I found that those two pole industrial motors slip is kind of "stretched out" try
> fslipmin:10
> fslipmax:50


We have been tring to use the procedure in post #1232

The battery voltage is 320 nominal.

Will try with lower fweak.

So I take it that with a lower fweak it will not require so much boost to get the motor moving?

Peter

Peter


----------



## jhuebner (Apr 30, 2010)

Readykilowatt said:


> We have been tring to use the procedure in post #1232
> 
> The battery voltage is 320 nominal.
> 
> ...


Yes. Mathematically:
U=mx+b where b is boost, m=(Umax-boost)/fweak, and x is frequency

So the lower fweak, the higher m and the higher the resulting voltage at a given frequency.


----------



## arber333 (Dec 13, 2010)

Readykilowatt said:


> We have been tring to use the procedure in post #1232
> 
> The battery voltage is 320 nominal.
> 
> ...


Also check if you set correctly motor poles. If you have 4 pole motor you set number 2 (2 pole pairs) and if it is 2 pole motor you set 1!
It could be that motor cant produce torque since rotor gets excited only 1/2 times. 

A


----------



## jackbauer (Jan 12, 2008)

Go the components placed on the combi board and layed in the power and ground planes. Now just have to track the thing. 

Added CAN and USB interfaces. Used a nice big B socket for the USB.

So with this board just add igbts , caps and current sensors.


----------



## jhuebner (Apr 30, 2010)

Looks pretty clean 
Are you using an SMT part for CAN? There is this through hole part: http://www.digikey.com/product-search/en?keywords= MCP2562-E/P-ND


----------



## Readykilowatt (Aug 11, 2009)

> Also check if you set correctly motor poles. If you have 4 pole motor you set number 2 (2 pole pairs) and if it is 2 pole motor you set 1!
> It could be that motor cant produce torque since rotor gets excited only 1/2 times.


Still haven't found any good numbers but changing the encflt to 16 did help.
Is anyone using a 360 pulse per rev encoder?
We stll have to use boost about 18000 to get any torque. This seems very high ?
At the moment we have..
Tried fweak 60 to 174
Fslip min 1 to 2
Fslipmax 2 to 6
Ampmin 0 to 10
Fmin 0.5 to 1

Peter


----------



## ALIE (Jan 28, 2015)

Johannes says

Note that this controller only supports up to about 10000 pulses per second. So for example if you plan to spin your motor up to 10000 rpm which is 166.7 1/s the encoder mustn't generate more than 60 pulses per turn. The limit is imposed by the low pass filter and can be changed by populating a different resistor R3.

My parameters try

"boost": "4800",
"fweak": "125",
"fpconst": "400",
"fslipmin": "2.5",
"fslipmax": "8.5",
"polepairs": "2",
"ampmin": "2",
"encflt": "4",
"fmin": "0.25",
"fmax": "200",
"pwmfrq": "1",
"pwmpol": "0",
"deadtime": "63",
"numimp": "45", (360 is to much-the best is 64)
"potmin": "2000",
"potmax": "4000",
"pot2min": "4095",
"pot2max": "4095",
"idlespeed": "-100",
"idlethrotlim": "50",
"idlemode": "1",
"speedkp": "0.25",
"speedflt": "1",
"cruisemode": "0",
"bmslimhigh": "25",
"bmslimlow": "-1",
"brknompedal": "-90",
"brknom": "40",
"brkmax": "76",
"brkrampstr": "35",
"udcsw": "165",
"udcmin": "160",
"udcmax": "215",
"udclim": "220",
"ocurlim": "-600",


----------



## arber333 (Dec 13, 2010)

Hm... 

360ppr sounds like a lot. I dont think RC filter can count pulses anymore there. I remember talking to Johannes that 120ppr should be good to some 5000RPM. I dont know anymore. 
Check *here* i made simple 60ppr wheel and used arduino sensor and it still works good. Dont get scared of the little spin saw. Next wheel i made i only drilled 60 holes on equal spacing. It works good and it is even more rigid.
If you check how i made the mount you can see 3 bolts to secure flange to motor shaft and 3 little magnets inside the flange. Those are for car RPM gauge. Gas engine was V6 hence 3 ppr to display rpm propperly. RPM is read by one hall sensor that is connected to the dash.

A


----------



## jhuebner (Apr 30, 2010)

Readykilowatt said:


> Still haven't found any good numbers but changing the encflt to 16 did help.
> Is anyone using a 360 pulse per rev encoder?
> We stll have to use boost about 18000 to get any torque. This seems very high ?


encflt 16 is definitly just hiding a problem with the encoder.
Apart from that, 360 pulses should work up to 1500rpm. You can keep that encoder but like ALIE quoted, you need to adjust R3

boost 18000 is indeed way too high.

Before randomly changing values, make sure polepairs really matches your machine and numimp really matches your encoder. These two parameters need to be spot on or nothing will work.


----------



## jackbauer (Jan 12, 2008)

Combi board now tracked out and checked. Going to check again tomorrow and order some boards


----------



## Tomdb (Jan 28, 2013)

What kind of programming is there already for the canbus?

The board looks good, how big is it now?

Also why combine smd and through hole components? (i can understand the IC's but the resistors and caps?)


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> Combi board now tracked out and checked. Going to check again tomorrow and order some boards


Very good build! 

I still think we would need to make transformer power supply and totem pole drivers. Cca 10A at least! I think now we have the space. We could use one 24Vac transformer supply per driver and divide it to +15V and -8V with one 15V zener and one 2K2 resistor. See attachment.
I like the idea of remote LEM sensors. It is much easier to position the main board. 
I may order a board or two from you .

Can you tell me what would be the use for CAN interface? Would it work as active part in a car or would it just transmit as serial interface?


----------



## dima (Dec 1, 2015)

One comment from me, that surface-mount ATTiny13 will be hard to flash - maybe route a few AVR pins for _MOSI_, _MISO_, SCK,_ GND_ connector right on the board.


----------



## jackbauer (Jan 12, 2008)

One thing you could run with the CAN bus is pictured here. Designed this to display info from the inverter and be as simple , cheap and versatile. Now just need to work out a message format with Johannes


----------



## jackbauer (Jan 12, 2008)

Board is now 290mm x 135mm. I do have a reason for the mix of SMD and through hole parts. May have a nice surprise on the way 

Am not using the attiny , using an isolation amp but i do love the attiny system and may add it in a later version.

A Push pull stage can be added to the ACPL-337j drivers very easily.


----------



## Boxster-warp (Jun 22, 2014)

Hello
Have the Enova inverter a dc/dc Converter in this Box?
Greetings Boxster-Warp


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> One thing you could run with the CAN bus is pictured here. Designed this to display info from the inverter and be as simple , cheap and versatile. Now just need to work out a message format with Johannes


Hm...
I have a Digole Oled module here. Havent used it yet, since it was meant to work with EMW charger. I dont use display with charger now... It has all sorts of outputs, I2C, SPI or just plain TTL UART. Could it be used for this? It is very stable display. A little slow though.
http://digole.com/index.php?productID=859


----------



## jhuebner (Apr 30, 2010)

One guy (not sure if he's on the forum) enabled the can interface for his controller. It shouldn't be too hard to be able to set parameters and broadcast values in a CANOpen like manner. Plus maybe map some digital inputs to the CAN bus.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> One guy (not sure if he's on the forum) enabled the can interface for his controller. It shouldn't be too hard to be able to set parameters and broadcast values in a CANOpen like manner. Plus maybe map some digital inputs to the CAN bus.


Well i am now studying GEVCU module so i could use it to trick my new car it doesnt need gas engine to work. I think it will be Volvo V70 family car. The CAN BUS on the inverter should come very handy since you could communicate to inverter more than just throttle position... parking brake, hill hold, adaptive cruise control, regen reduction with a button etc... you could even make two different drive configurations and implement them on the fly. 

http://www.gevcu.org/


----------



## jackbauer (Jan 12, 2008)

Final check of component fits before ordering boards.


----------



## jackbauer (Jan 12, 2008)

Ten boards ordered from Seeedstudio


----------



## ALIE (Jan 28, 2015)

Good job JB

Something interesting.

https://www.youtube.com/watch?v=E-OvK_sgoOE


----------



## arber333 (Dec 13, 2010)

ALIE said:


> Good job JB
> 
> Something interesting.
> 
> https://www.youtube.com/watch?v=E-OvK_sgoOE


YES! I see the same happening with 3 of my Lipo cells. After a year of use 3 are consuming voltage on itself while connected in pack. I have to periodically refill some 3Ah per week. But when they are full they perform as other neigbouring cells. They hold their voltage trough whole range. So i keep 2A single cell charger handy and refil them after charge every weekend to 4.10V all the while i wonder what will happen to them in winter!?

A


----------



## arber333 (Dec 13, 2010)

Say D you included also currently not used I/Os like PA7 or others to your board? It would be good to put a place for resistor and another for input transistor so as to have some freedom to choose either input or output for additional pins.

A


----------



## dima (Dec 1, 2015)

Found a big problem.

DC-DC is wrong size in new "driver board v2" It is stretched out, I thought I ordered wrong components then checked with the old board and got confused 

Checked Eagle traces looks like the same component type but the pins are off by one.


----------



## Arlo (Dec 27, 2009)

dima said:


> Found a big problem.
> 
> DC-DC is wrong size in new "driver board v2" It is stretched out, I thought I ordered wrong components then checked with the old board and got confused
> 
> Checked Eagle traces looks like the same component type but the pins are off by one.


Been there. Got to watch those isolated supplies different manufactures have different pin-outs.


----------



## dima (Dec 1, 2015)

Attaching corrected Eagle.


----------



## jhuebner (Apr 30, 2010)

dima said:


> Found a big problem.
> 
> DC-DC is wrong size in new "driver board v2" It is stretched out, I thought I ordered wrong components then checked with the old board and got confused
> 
> Checked Eagle traces looks like the same component type but the pins are off by one.


Did I actually ship an "old" DC/DC converter with a new board? I intentionally streched the footprint to be able to use the new -9/+15V converters.


----------



## dima (Dec 1, 2015)

No, I just printed some boards locally myself and wanted to use the same parts. Surprise surprise ...what part# did you change it to?


----------



## jhuebner (Apr 30, 2010)

RH-051509D


----------



## dima (Dec 1, 2015)

Ah shit'aky mushrooms .... please update the BOM.


----------



## Tomdb (Jan 28, 2013)

What is the latest status for running magnet motors with the controller?

Got a new motor today that I would love to get working with this inverter.


----------



## jhuebner (Apr 30, 2010)

Basically Jack Bauer and me got a Honda motor spinning quickly in torque mode, i.e. closed loop.
We were using a resolver to digital chip sitting on a board available from Paul Holmes.
We used the pulse output, the north marker output and the dir output of that chip. If I remember correctly the first startup after reset was a bit jerky (when the controller does not know the rotor position yet).
We also never tested reversing direction and regen.

So I'd say the basics are sorted but some development is still needed.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Basically Jack Bauer and me got a Honda motor spinning quickly in torque mode, i.e. closed loop.
> We were using a resolver to digital chip sitting on a board available from Paul Holmes.
> We used the pulse output, the north marker output and the dir output of that chip. If I remember correctly the first startup after reset was a bit jerky (when the controller does not know the rotor position yet).
> We also never tested reversing direction and regen.
> ...


Im still here with my missing pulse in encoder wheel suggestion . Want to give your software a try? 

I have spun Leaf motor up to 100Hz but there is so much back EMF that phase cables are dancing and my BMS is off most of the time. You would have to recalculate Id and Iq but leave something so as motor accelerates/decelerates rotor has some back EMF still present. Maybe two constants in the equasion to scale Iq and Id from web interface?

I also rotated EMRAX motor up to some 30Hz, since it is 20pole motor. I would have to use 16kHz or maybe 20kHz PWM to drive it consistently. 
That would demand at least JB driver PCB with desat if not complete driver board redesign similar to Paul Holmes transformer drivers. 

EDIT: On second note i think driver redesign would not be such a bad idea. Since it would mean higher frequency at greater power, also driving those 600A IGBTs... 
We could still supply 5V or use another 12V to 24V regulator but it would go to transformers and from there you just need zener diodes and transistors to drive over 10A pulses.

A


----------



## jackbauer (Jan 12, 2008)

Driving an E46 cluster with CAN. Now if we can get the inverter to send out some CAN messages .....


----------



## dima (Dec 1, 2015)

Well, you can borrow CAN ideas from VESC https://github.com/vedderb/bldc/blob/master/comm_can.c but they use _AMR2_ STM32F4 which has some sort of CAN protocol built-in.

I believe our current STM32-H103 does not have CAN protocol handle in CPU. Don't know if this can be done through software emulation. 

...So maybe when you redesign your board next time have a surface mount ARM chip for soldering


----------



## jhuebner (Apr 30, 2010)

No worries, the STM32F103 also has a hardware CAN interface.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Im still here with my missing pulse in encoder wheel suggestion . Want to give your software a try?


Well it comes down to the _fund_amental question of funding. Basically this kit is a by-product of my own conversion. Now I've finished that and I'm happy with the result. So thats no longer a big motivation factor.

On one hand me and others have tons of ideas up their sleeve how to make this a more complete, easier to use inverter. On the other hand I'm selling like 20 kits a year. I spend hours here on the forum and on email doing support. So any expenses I may have (like building a sync motor test stand, testing new circuits) make this a completely uneconomical project.
I don't like that and the German tax office doesn't like that either, they want you to make profit and pay taxes on that profit. If you don't, stuff will no longer be tax-deductible and the whole thing would turn even more uneconomic.

Don't get me wrong, I love the excitement of people when their conversion smokes tires  I love it when people who never soldered before get their motor spinning. I just can't fully escape the capitalistic system.

So if anyone has any ideas how to cure that, please discuss!


----------



## jackbauer (Jan 12, 2008)

I'm in much the same boat. With the exception of some kind Patreon donations (which seems to be dying a death) I have now self funded 4 conversions and counting along with a lot of side projects. I love this project and it made it possible for me on a shoestring to make the transition to AC motors. I want to give back and push on with further developments but ....


----------



## jhuebner (Apr 30, 2010)

So, hardware-wise there are two options (that could both coexist):


An all integrated board for IGBT modules like JB designed. Good for using existing power stages and high power custom power stages
An even more integrated board including TO-247 discrete IGBTs and soldered bus capacitors possibly making it the cheapest mid-range power inverter
Both variants leave less room for error than the current version.


Software wise:


Support synchronous motors (by using the resolver chip or "missing pulse" encoder)
Do more autotuning. Setting up boost, fweak, numimp etc. seems to be a hard task for people not married with motor technology
All that needs tons of testing, maybe a few thousand € on PCB prototypes and components and a rigged up test stand. It's not a million dollar project but it definitly can not be funded by the margin of the kit or a Patreon page.


Is it a case for crowd funding?


----------



## jackbauer (Jan 12, 2008)

Not sure if crowd funding something like this would work but might be worth a go. Good news is PCBs shipped today


----------



## nitrousnrg (Feb 25, 2016)

Well, I'm pushing some investors to put money in the vesc project so we can build an integrated TO247 IGBT pack with TI IGBT drivers controlled by VESC MCU and firmware. The deal is to keep the whole thing open source just like vesc is.

If I get funds, or a prototype -whatever comes first- I'll make a post. For now I just jumped in to say hi and to point out that the TO247 path seems to me like the best path.


----------



## dcb (Dec 5, 2009)

I think there is a reason igbt's aren't usually paralleled like mosfets, 

http://www.ixys.com/Documents/AppNotes/IXAN0058.pdf

mpaulholmes even uses an extra 3' of lead to each igbt to add a bit of resistance in the 6 pack with dc logic version (and he has some experience paralleling things): http://www.diyelectriccar.com/forums/showthread.php/350v-1400amp-controller-first-test-170938.html

as an aside, there are a number of papers on paralleling mosfets WITH an igbt for faster turn on (though you are still stuck with tail current) and lower Vds, but that is probably overkill for now.

so I would be wary of parallel TO247 IGBT implementations, perhaps the that is the "room for error", i.e. the ixys document says they have to be carefully matched in addition to a number of other criteria, and that means production expense vs modules.

$0.02 worth.

edit: apparently tesla does use parallel to247 igbt's, but damn if they don't have a billion production controls in place too, and the margins to support it.
http://www.pointthepower.com/on-tesla-electric-vehicles-semiconductor-packaging/


----------



## jhuebner (Apr 30, 2010)

nitrousnrg said:


> Well, I'm pushing some investors to put money in the vesc project so we can build an integrated TO247 IGBT pack with TI IGBT drivers controlled by VESC MCU and firmware. The deal is to keep the whole thing open source just like vesc is.


Ok, what influence could that have on this project?
BTW the VESC hardware looks pretty cool 



dcb said:


> I think there is a reason igbt's aren't usually paralleled like mosfets,


Not sure how they obtain these numbers in the paper. All parameters creep away with temperature so even if they are matched in the cold, they will become unmatched when stuff heats up.
What they do not mention is that you should take care to choose IGBTs with a positive temperature coefficient of Vce vs. Temperature. That way the hottest IGBT drops the most voltage and you get a negative feedback loop. For example punch through IGBTs are not feasible for paralleling.
I think this paper has more in-depth information on current sharing: http://www.onsemi.com/pub/Collateral/AND9100-D.PDF



dcb said:


> apparently tesla does use parallel to247 igbt's, but damn if they don't have a billion production controls in place too, and the margins to support it.
> http://www.pointthepower.com/on-tesl...tor-packaging/


Edit: Interesting read, thanks!


----------



## jhuebner (Apr 30, 2010)

I finally got around to testing dimas web interface.
Of course it looks much better than mine and provides more general info. I also love the idea of the motor database.
Uploading Parameters worked, selecting a motor from the database works.

I'm running Linux Mint 18 with php 7. Maybe thats why parameter download didn't work:

Uncaught Error: Call to undefined function split() in /var/www/html/snapshot.php:12


----------



## jhuebner (Apr 30, 2010)

And one more post today 

I updated the software
- Ramp for brake pedal regen
- bugfix on throttle out of range (would crash the inverter at startup)
- Basic CAN functionality (sends speed and udc in fixed point format in high word and low word)

As usual here:
http://johanneshuebner.com/quickcms/index.html?en_downloads,14.html

and github


----------



## dima (Dec 1, 2015)

Interesting find http://web.mit.edu/first/kart/controller_rev1.pdf


----------



## jackbauer (Jan 12, 2008)

Dima , does your console program work with Linux?


----------



## dima (Dec 1, 2015)

Do not know - did not test, it uses same php_serial.class.php (which I might have played with to get osx working) should work same as original web-interface if you have your php set up right.


----------



## jhuebner (Apr 30, 2010)

It works for me, with some exceptions.
The "Compile from source" and other local operations seem to be targeted at Windows.

Just found you integrated the BOM with pictures and datasheets. Thats so cool 

Aha, replace "split" by "explode" in snapshot.php to be compatible with newer php versions.

Same in graph.php for the graph to work.


----------



## jackbauer (Jan 12, 2008)

Boards are here


----------



## Tomdb (Jan 28, 2013)

those look massive, outer size?

If it works out good might be a good replacement for all the available engine and inverters


----------



## jackbauer (Jan 12, 2008)

290mm long x 135mm high. Being exhausted from a 12 hour day in work fault finding 0402 size boards is clearly the right time to tackle placing the smallest pitch parts on the board


----------



## arber333 (Dec 13, 2010)

If you are certain they work i would take one board please .
So current sensors would be off board? Like theese

L31S400S05FS

http://eu.mouser.com/ProductDetail/...PDRSCoHb1XznkFWRHWmrwGh4iXmJSlpTmkIxG01dVLQ==

A


----------



## jackbauer (Jan 12, 2008)

Yeah the current sensors are off board. Will be building the first one up shortly for testing and will have a few spares


----------



## ALIE (Jan 28, 2015)

3D model 

https://grabcad.com/library/inverter-5


----------



## jackbauer (Jan 12, 2008)

My computer hates me


----------



## jackbauer (Jan 12, 2008)

So of course I screwed up and somehow managed to get the pad layout for the STM card mirrored. Just don't ask me how but it still happened 

The good news is the PSU and USB sections work great. Going to continue with the build and log any problems found and fix them with a revision. The on board USB is sweet. Hopefully will also get around random dropouts during high current pulls.


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> My computer hates me


It prints out plain php commands -> PHP not installed?



jackbauer said:


> So of course I screwed up and somehow managed to get the pad layout for the STM card mirrored. Just don't ask me how but it still happened.


If you jump back many pages you'll find it happened to me too


----------



## PStechPaul (May 1, 2012)

On the prototype charger board, I got one of the display board decals reversed and I also messed up the pinout for the Arduino Pro Mini. It was not clear where pin 1 was, and the display was on the back of the board.

I also had a wrong decal for some dual MOSFETs in SO8 packages, but I was able to bend the leads back and mount them upside down.

The PADS parts library is rather tricky and it does not clearly show the relation of pin assignments. You have to open the parts editor in both the schematic capture and the board layout programs to sort it out.

BTW, I did not know what the "STM card" was. Is it this (STM32F103)?

http://www.gravitech.us/starmcom3deb.html


----------



## jackbauer (Jan 12, 2008)

This is the STM board :
https://www.olimex.com/Products/ARM/ST/STM32-H103/

Have LAMP and php 7 installed. Just not happy for some reason....


----------



## arber333 (Dec 13, 2010)

Heres the power section I am working on for my Leaf motor. Note a simple design for cooling block. This method doesnt need milling machine. However you need long drill bit and suitable thread bit.
In future if i would be doing this again i would use smaller block and drill and would make smaller holes. 
Here i put in also some dampers to keep water flow the same trough all lines.

I used two 100uF film caps and two 2200uF 450V elcaps. Right now i have the same combination in my car and it works good. When i wanted to put in only film caps ALIE suggested inverter would be prone to resonance spikes. It is the job of elcaps to eat those spikes...

A


----------



## jackbauer (Jan 12, 2008)

Very nice work Arber


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> Very nice work Arber


My intention is to make a standard power section and a small footprint so this inverter could also fit on airplane or in a small car and still drive 100kW EMRAX motor. Now you actually gave us a choise in flavor - Johannes STM brain for ACIM motor or Pauls FOC dsPIC brain for PMSM motor. Now both PCBs look very much the same and have all elements onboard. I should congratulate you... 
Er... do please position STM pins the correct way in future release .
I too botched 40+ BMS boards when i forgot to enable a layer for +/- battery contact plating DOH! 

A


----------



## dima (Dec 1, 2015)

Ported new interface to Linux (Ubuntu distros). Tested with Mint18. Security is slack requires sudo to run but will fix that in the future. Download


----------



## arber333 (Dec 13, 2010)

dima said:


> Ported new interface to Linux (Ubuntu distros). Tested with Mint18. Security is slack requires sudo to run but will fix that in the future. Download


Hi Dima

Can you give some instructions on how to install and use this beautiful interface in Linux and Windows? I am not a programmer. Where to put your files and what command line to run?

tnx

A


----------



## jackbauer (Jan 12, 2008)

Tried it myself and can only get a background image on the webpage.


----------



## dima (Dec 1, 2015)

arber333 said:


> Hi Dima
> Can you give some instructions on how to install and use this beautiful interface in Linux and Windows? I am not a programmer. Where to put your files and what command line to run?
> A


Well if you don't know how to run Shell script in linux you should probably not use linux 

```
chmod +x Huebner\ Inverter.sh
./Huebner\ Inverter.sh
```
For Windows you will need PowerShell installed (usually comes with Windows 7 and up) and Mac ...well double click.


----------



## jackbauer (Jan 12, 2008)

Well the good news is the CAN works. Bad news is the boards are a write off. Seems the STM card pins are not only mirrored but upside down on header 2. Back to the drawing board.


----------



## jackbauer (Jan 12, 2008)

Fixed! The pins for the STM card were mirrored and back to front. Have added an 8 pin header with the spare pins brought out and upped the size of the el caps on the power rails. New cards on the way soon.


----------



## jackbauer (Jan 12, 2008)

Someone is transmitting CAN messages at 250kbps at 100ms intervals ...


----------



## Tomdb (Jan 28, 2013)

Any particular reason for choosing 250kb instead of 500kb? Is easy to change but just wondering.


----------



## jackbauer (Jan 12, 2008)

You'd have to ask Johannes. I just build the thing


----------



## jhuebner (Apr 30, 2010)

Cool 

I basically copied the code from a Turkish guy who bought the kit. He chose 250k for whatever reason 
I guess I'll eventually make it a parameter, this was just a first test.


----------



## jhuebner (Apr 30, 2010)

Tonight I did some promising experiments with setup scripts. The goal is to guide you through setting up polepairs, numimp, boost etc. by a setup script.

It will be written in python.

I set up an Analog Discovery (USB scope) to control all the inputs which makes a very comfortable experimenting rig and speeds up development a lot.


----------



## jhuebner (Apr 30, 2010)

Update time 

I have uploaded a new firmware and a configuration script.

Changes in the new firmware:


Pure Sine mode (ignoring encoder feedback)
Parameters are organized in categories (you also need to update the web interface to make use of that)
I have worked on the boost mode charger. It now has a current mode controller and according parameters. I will post a schematic on wiring it up soon.
I have added the experimental sync mode that I worked out with Jack Bauer (extra flying leads needed)
In the tools I have added an auto-setup script that tries to find values for boost, fweak, polepairs and numimp. Those seemed to pose the biggest problem.
I would be happy to obtain some feedback on the setup script. Does it arrive at the same parameters you tuned by hand? No worries about messing up your config, the script doesn't save anything to flash unless you tell it to. So reset and your old config is back.


----------



## ALIE (Jan 28, 2015)

Hi Johannes

Christmas is already here 

I'm tested together with Arber









I putting together inverter for Letrika motor (tvizy) and I tested your accessories when I'm done.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Update time
> 
> I have uploaded a new firmware and a configuration script.
> 
> ...


Will try the difference from autotuning and manual approximation soon. Let the better man (computer) win.
Otherwise i set the boost a little higher than usual together with fweak and i was shocked... motor took off smoothly, only in the begginning you can feel springs in the clutch and overall feel is better. I think boost and fweak have to be found together.
On the other hand i can feel sudden twitch from the motor irregularly when accelerating from traffic light to speed. I now have 90KKm and 30K of those is with your controller, not bad! It seems my encoder has some problems, maybe moisture? Do you think i could see what is going on while driving? Which parameter i have to record to see if this is the case?

tnx


----------



## jhuebner (Apr 30, 2010)

ALIE said:


> Hi Johannes
> 
> Christmas is already here
> 
> ...


Another inverter maniac  Very pretty. What car is it going to go into?



arber333 said:


> Will try the difference from autotuning and manual approximation soon. Let the better man (computer) win.
> Otherwise i set the boost a little higher than usual together with fweak and i was shocked... motor took off smoothly, only in the begginning you can feel springs in the clutch and overall feel is better. I think boost and fweak have to be found together.


Well, they both influence the voltage curve, thus the current curve and thus the torque curve. See attachment.



arber333 said:


> On the other hand i can feel sudden twitch from the motor irregularly when accelerating from traffic light to speed. I now have 90KKm and 30K of those is with your controller, not bad! It seems my encoder has some problems, maybe moisture? Do you think i could see what is going on while driving? Which parameter i have to record to see if this is the case?


Try recording "speed". That should show sudden twitches when the encoder misses a pulse or something.
My very exposed encoder has also been a source of trouble. First I had EMI issues which mostly showed at startup. Then the encoder wheel had moved and was scrubbing the encoder -> many pulses lost -> overcurrent error. The next time the encoder had gotten out of alignment -> overcurrent. Surprisingly I never had issues with dust or moisture.
I fixed everything more tightly, rerouted the cable (away from power cables) and fixed the low pass filter. The problems went away.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Another inverter maniac  Very pretty. What car is it going to go into?


I am now competing with him, he is making the most beautiful inverter and i the most compact .

I will try to get a fixed clutch disk from US. The springs in a clutch disk are the weakest element and they cause my clutch to degrade after only 40kKm! Regen takes its toll...

A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> I will try to get a fixed clutch disk from US. The springs in a clutch disk are the weakest element and they cause my clutch to degrade after only 40kKm! Regen takes its toll...


Clutchless FTW 



arber333 said:


> I am now competing with him, he is making the most beautiful inverter and i the most compact .


I want to be in that competition (not for beautiful) 

After I saw that Tesla is using 14 TO247 IGBTs in parallel I thought I should give it a go. So I made a phase board with 2 IGBTs. Drivers and bus cap included. Galvanic isolation must take place off board (the prototype board at the upper right).
I tested with 1 populated IGBT up to 80Arms, no problems. All three phase boards combined use only [email protected]

Oh, you may have guessed it: the threaded steel rods as DC bus are crap  The last phase delivers like 20% less current the the second. And probably the second 20% less than the first.


----------



## onegreenev (May 18, 2012)

ALIE said:


> Hi Johannes
> 
> Christmas is already here
> 
> ...



Clean, I like it.


----------



## ALIE (Jan 28, 2015)

(Another inverter maniac  Very pretty. What car is it going to go into?)

So you will not believe.
The drive will be powered T_KING .
Instead of the Chinese electric motor will be installed Letrika 15 kW motor but instead of 45V will operate at 72V maximum power is 40kW.(already tested on several cars)
This will be the Chinese dragrace car -street legal of corse


----------



## jhuebner (Apr 30, 2010)

I used to similar car, very fun to drive. It was only 20kW but quite angry because of the low weight.
How much is the motor? Are there higher voltage versions?

I made a video on boost mode charging:


----------



## ALIE (Jan 28, 2015)

Iskra-Letrika now Mahle electricmotor cost is about € 1K and not in the regular sale but if you want i can arrange  for VIP
They no engines for greater voltage
These motors are very robust bulitproff & for 72V no problem withstand higher voltage.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Clutchless FTW
> 
> 
> I want to be in that competition (not for beautiful)
> ...


You could use brass threaded rod. Would be stronger than copper and that way you could solder nuts on it to have a fixed point anchored from one end.

How do you drive two IGBTs with one driver? Wouldnt you just make a push pull transistor driver and use existing DCDC with larger caps?

A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> You could use brass threaded rod. Would be stronger than copper and that way you could solder nuts on it to have a fixed point anchored from one end.


Just checked a material table for specific resistance:
copper: 0.017 
aluminum: 0.027
brass: 0.07
steel: 0.1-0.2

So brass would be about 2x better but aluminum would be an even better replacement (apart from copper) 



arber333 said:


> How do you drive two IGBTs with one driver? Wouldnt you just make a push pull transistor driver and use existing DCDC with larger caps?


Each pair of parallel IGBTs has it's own driver, i.e. each board contains an unisolated lowside and highside driver. Each IGBT has it's own gate resistor and TVS.
The prototype board contains a six channel digital isolator and a DC/DC converter. The converter powers all six drivers.


----------



## dcb (Dec 5, 2009)

the grommet discussion gave me a quick fix idea, for better or worse.

You could use copper pipe (not the best, but better than what ya got) as a "standoff" and get rid of all the nuts and washers in the middle of the threaded rod. So 4 lengths of copper pipe, just the right length, and their ends cleaned up nicely, squeezed together by the threaded rod.

Also if you connect the blue lead where it is circled red, it should help balance out the resistance (even without the pipe rig).


----------



## dcb (Dec 5, 2009)

Sorry, bored enough to dig into it more 

Anyway, the taps would have to be catercorner, but in ~3/10ths from the corners to get rms balance as far as I can tell. (copper pipe standoffs or not).

I suppose you *could* fix balance in software too 

edit: here is a picture, the other attachment is straight catercorner and straight endtap, resistances chosen to show balance ratio only.

edit2: If you are using straight copper (or aluminum) bars, this still looks like the optimum location to connect the battery leads.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Just checked a material table for specific resistance:
> copper: 0.017
> aluminum: 0.027
> brass: 0.07
> ...


I used aluminum for standoffs a lot in my charger. But in the end i found out brass is just so much easier to work with. I can solder threaded brass piece directly to PCB and use it instead of nut, or i can reinforce contacts etc... Zinc ialso has very similar conductivity than brass.

And research that aluminum some more. You will find that number is relevant only for clean aluminum and maybe 2xxx designation. I consider 2xxx too soft to work with in a lathe... Every other designation is worse in electrical resistivity and besides Alu forms oxide layer that firther impedes conductivity. In the end there is negligible difference from brass... And in aluminum when you make threads with hand tools, use lubricant, because dry aluminum is more difficult to cut. I just use WD40.
But brass material is more $$$ yes?

Also i wouldnt go with copper pipe for standoffs, due to copper contracting under stress. Again brass is excellent standoff material, but if you use aluminum... your choice.
EDIT: Maybe you would just drill trough hex brass pieces and put them over your threads. Current will find its way through te path of least resistance . 


My 2c...


----------



## jhuebner (Apr 30, 2010)

Hmm I could use something like this:










Has to be around 60mm. And perhaps M6. They exist in all sorts of materials, brass, alu.

I tried that spacer idea last night. Got some aluminum pipe in the Obi hardware store (smallest copper pipe was too wide). It certainly looked good but I didn't get a chance to test it... When undoing the screws I forgot to disconnect the battery. Shorted 24V into one of the 5V input pin of the driver with my wrench. And I don't have spares .

I think I can also use the fixing bar as the AC out busbar. Just screw it down with one of these in between:









And connect to the AC output of the board with another 5mm hex spacer.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Hmm I could use something like this:
> 
> 
> 
> ...


Maybe something like this?

http://www.ebay.co.uk/itm/10-x-Stan...497062?hash=item465a591066:g:ko4AAOSwA3dYUpUl

Well i tried this, but wasnt impressed, because i couldnt fit the length just quite. So i bought brass 11mm hex bars and used my 300mm lathe to turn M5/M6 threaded ends. I can get a repeated result up to 0,2mm precesion. This lathe is usefull in other ways also; making plastic isolators or special conductive washers etc...

A


----------



## jhuebner (Apr 30, 2010)

Yes exactly. There is a screw shop down the road so I'll get em there. Once that driver is replaced...

If length is +/-1mm that ok because you can move the PCB forward or backward without losing thermal contact.

So the plan is a modular power stage. The IGBTs are 2x160A so should be fine to run at 2x80A continuous. So it would make a 160A, 450V half bridge. 
You could place multiple of them side by side scaling up to 320A, 480A and so on. Perhaps with some "paralleling derating".

I'm expecting a full inverter ([email protected]) kit including all mechanical parts excluding the heat sink (some will want water cooling, some air cooling) for much less than 1k€.

Also at the preferred voltage level of 350-450V the boost mode charging could be used making an extra charger redundant.

Edit: actually its [email protected] because the 160A are AC. 450/sqrt(2)*160*sqrt(3)


----------



## jackbauer (Jan 12, 2008)

is there a schematic for how to connect charging mode?


----------



## arber333 (Dec 13, 2010)

And how to connect moto and start autotuning scripts? Some procedure?

tnx

A


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> is there a schematic for how to connect charging mode?


Not yet. For a basic test connect GND of your DC source to B- and Vcc of your DC source to L3 or L1.
Make sure there is a current sensor on L2.



arber333 said:


> And how to connect moto and start autotuning scripts? Some procedure?


python tuning.py -d /dev/ttyUSB0

Motor is connected as usual.


----------



## jhuebner (Apr 30, 2010)

Real engineering takes place on paper 

So AC comes in, is being rectified and switches a contactor. The latter enables boost mode charging by 
a) supplying the inverter with 12V (instead of the key switch)
b) Pulling FWD and REV high (you might need some extra diode magic to not obstruct normal operation. I constantly have it in FWD mode so no issue there)

Then the rectified AC passes another switch that is controlled by the DCSW signal of the inverter (I have a 3-phase switch as main contactor and thus a free contact to use). Boost mode does the normal precharge sequence, closes the main contactor and starts charging.

Charging will go on until you either cut power to the inverter or disable one of the hardware inhibit pins (mprot, emcystop). So you will need a BMS with a relay output.

Of course you can also break the input into the rectifier instead of the output which would allow to place the rectifier inside the inverter.

EDIT: bottom IGBT of L2 does the switching, top diode conducts the current upward. All other IGBTs are for illustration only and are constantly off.
"Motor Phase" is basically L1 in parallel to (L2 in series with L3). Doesn't seem to pose a practical problem though.

More edit: the parameter "chargecur" controls the input current INTO the inverter. So the charge current into the battery will taper off as voltage rises. I found that more practical than controlling the current into the battery as the wall outlet is usually the limit of the charge rate.


----------



## arber333 (Dec 13, 2010)

Hm...

Would this charging be applicable for single phase only, or could you make it for multiphase system from phase to phase 400Vac also? 
In that case we would have to use buck system from 600V rectified down, could we ? That vould be really something, since i now use 3phase charger and somethines phase to phase. When its P - P i get 600Vdc rectified, but i can charge up to 6kW before IGBT starts to rattle and voltage is spent on caps.

But my car is the only one with 370Vdc nominal here in Slovenia. There are 4 guys now with your inverter and some 200Vdc nominal. They cant charge using your setup then. Couldnt we use inverter setup as buck charger with upper transistor working and lower one being always down and its diode working return current? Maybe you could prepare selection of charging mode in code so we could setup software after we prepare hardware, either buck or boost. We could then choose charger mode and current limit. 
I really like the way to activate charging with FWD/REV contacts, since you cant use both at the same time. 
I dont know anyone who wouldnt have any sort of BMS that can shutoff charger. Anyways i still suggest you setup the high warning voltage as a limit for the charging. Inverter monitors that anyways. That way everyone would setup their own limit and would have additional safety if BMS would fail. 

A


----------



## dcb (Dec 5, 2009)

this is the best I could come up with for buck, c1 represents the battery, i.e. it would connect to a phase leg for charging and to the main bus for operation. (and I haven't looked at it in a while)
You might need to switch d3 in unison to keep it balanced, and your inverter switches and capacitor bank have to handle peak mains voltage.


----------



## jhuebner (Apr 30, 2010)

Yes! Thats brilliant. So since the DC+ rail is disconnected by the main contactor anyway you would only need one charge current rated contactor to connect the B+ to a phase leg. I've chosen L2 as the switching leg again for consistency with boost mode.

So now in boost mode S1 and S2 are always open. S3 serves as a combined precharge, B+ to phase leg and logic switch. So needs 3 NO contacts. As the inverter precharge logic can now not be used an external one must be constructed that closes once the inverter caps are sufficiently charged.

If you have a bipolar main contactor you'd need another contact on L3 to close the B- path.

Will try to test this today and report back.

EDIT: just noticed in buck mode the output current will be measured and controlled


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Yes! Thats brilliant. So since the DC+ rail is disconnected by the main contactor anyway you would only need one charge current rated contactor to connect the B+ to a phase leg. I've chosen L2 as the switching leg again for consistency with boost mode.
> 
> So now in boost mode S1 and S2 are always open. S3 serves as a combined precharge, B+ to phase leg and logic switch. So needs 3 NO contacts. As the inverter precharge logic can now not be used an external one must be constructed that closes once the inverter caps are sufficiently charged.
> 
> If you have a bipolar main contactor you'd need another contact on L3 to close the B- path.


Nice!!! 
So now i think i could wire 3phase AC to have BUCK from 600Vdc. 
I think outside precharge with arduino and 570R resistor would be good. 10s should do it. 
Hm, i should use one 10mm2 wire from phase 3 to DC+ battery side BEHIND contactor. *DC contactor* (tyco EV200) would be off in case of charging. Another EV200 would be *phase contactor* to bring phase 3 to DC+. But for safety i would route gnd of *phase contactor* trough *DC contactor* wiring so that would be impossible to have both ON at the same time.

So if i wanted to have 3phase charging, this is how it would work...
1. presence of 400V (230V on AC contactor L1/N) sets on precharge (timer) relay 10s...

2. AC contactor is on, Phase contactor is on, inverter, water pump and cooling fans get 12V

3. Inverter charges with CC regulation.

4a. After BMS command, inverter shuts down softly, after that AC and Phase contactors go off

4b. Inverter reaches preset max voltage and stops softly. AC and Phase contactors go off! 

Observe that all contactors could run trough existing precharge system allready in place. We would only have to remove GND from (main)DC contactor and precharge relay so that charger or drive functions couldnt mix.
Precharge would be allways present on the AC side as 3x 570R 15W across AC contactor.

How would you manage boost circuit for single phase? How much current do you think we would get from single phase? PFC correction? I am still more for 3phase system!


----------



## jhuebner (Apr 30, 2010)

Of course 3-phase is better because there is much less ripple on the rectified DC. I will stick with 1-phase because you can find it anywhere. But thats your decision really, the software doesn't care where your DC comes from.

With the EMW charger (no PFC) I can charge at 3kW from a 230V, 16A outlet. The power factor is rather poor at 0.82 if I remember correctly.

Anyway, the good news is: it works! 

It was only a minor software mod. I made a video which is currently uploading.

I observed some unexpected things:
1. Efficiency drops as INPUT voltage rises
2. PWM frequency does not change efficiency (I tried 17.8kHz and 8.8)

I do remember there is a way to optimize power factor with only current measurement. That could be a next step.

Edit: once the video has uploaded:


----------



## arber333 (Dec 13, 2010)

J how do you expect to control current power when this charger will be connected? Would you limit charging with a parameter in web interface?
In that case i would suggest to measure caps voltage and control two parameters, limited and full power. If there is <320Vdc on caps system is on single phase, hence limit to 3kW. If there is >500Vdc on caps then apply full power of 11kW or 20kW ... .
I think i will be happy to shed some 20kg of weight from my car AND have a faster charger! 

As i also use EMW charger, i find PWM at 8kHz is enough for IGBT comfort, winding lossess are greater but we will have to see how this will play out. I have a large fan in front that i can trigger in case of motor overtemperature... 

You have another suggestion?

A


----------



## dcb (Dec 5, 2009)

fwiw, ideally you would have two motors and inverters (like the prius or volt) for charging, and one motor/inverter would be pfc/boost and the other buck. Then it would work with any input/output voltages and wouldn't be just for "emergencies" as it would be nice to the wall power 

not considering 3 phase power though. You really need 3 separate boost converters to pfc that right, so *maybe* if you had 4 motors and inverters... (unless 3 phase pfc boost is hidden in the standard topology somewhere)


----------



## jhuebner (Apr 30, 2010)

Not sure if you can take the motor abuse that far 

Just thought about voltage cutoff. The issue is in buck mode there is no voltage measurement on the battery side. I tried estimating it from input voltage and duty cycle but that turned out all wrong and non-linear.

It would be possible in boost mode but I think I'll just leave it to the BMS.

Edit: @dcb (missed your post): I smell complexity. I think this concept can replace a low power charger. If you need high power charging just take a separate charger with you on the respective trips or wait for DC charging stations to spawn. Or arber will find out that it runs fine at 22kW


----------



## dcb (Dec 5, 2009)

well, it is as complicated as any "real" charger, they have a boost/pfc stage and a buck stage, and if you have a two motor/inverter setup then you can accomplish it. I think this is what jdcircuit is working on with his prius charger experiments, and what the emw smartcharge does.

conceptually pfc is real simple (esp with a microcontroller handy), but you need the appropriate voltage/current signals. And it is what enables getting the most power out of the wall.


Here is a dead simple hysteresis boost example, but you probably want a fixed frequency, controlled on/off version, and followed up with a buck will make life nice for the battery.

so you force the input current into a sinewave that resembles the input voltage and is in sync with it, and it gets scaled by the battery charge rate.

without a boost and a buck, you will only be able to "pfc" the part of the wave below or above battery voltage respectively.

But it is multi-motor/inverter in regards to this discussion I think, so no biggie, just fyi.


----------



## PStechPaul (May 1, 2012)

I think PFC is pretty much unnecessary for three phase. The ripple voltage is only about 5%, and capacitors are mostly for obtaining a low impedance source at the high frequency PWM. 

Some links on 3-phase PFC:

http://www.ixys.com/Documents/AppNotes/IXAN0001.pdf

http://www.intechopen.com/books/tre...three-phase-utilizing-single-switching-device

http://www.slideshare.net/controltrix/3-phase-power-factor-correction-pfc


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Just thought about voltage cutoff. The issue is in buck mode there is no voltage measurement on the battery side. I tried estimating it from input voltage and duty cycle but that turned out all wrong and non-linear.
> 
> It would be possible in boost mode but I think I'll just leave it to the BMS.
> 
> If you need high power charging just take a separate charger with you on the respective trips or wait for DC charging stations to spawn. Or arber will find out that it runs fine at 22kW


Ok, i have BMS wired so in case comms fall out everything stops anyway.
I have tried 11kW on 3phase from EMW charger from 600Vdc down to 360Vbatt. I also found charger is much less efficient when battery is more than 50% lower from 600Vdc rectified. Also IGBT has to work much harder and margin of failure when switching is much greater. Driver desat detection would be welcome here. 
OTOH my inductor gains efficiency when loaded so from input/output calc i judge i have some 88% at 9kW and only 75% at 3kW! I think we should try higher load buck from 600Vdc 3phase and lower from single phase boost, maybe we will be surprised.

One thing is certain though; once you sort out firmware this way would be so much easier to charge. Since everything is designed to battery. Inverter cooling is allready set, motor is connected, all logic works, BMS is there... 25Kg weight and one system less to potentialy fail. 

A


----------



## arber333 (Dec 13, 2010)

What about two transistor buck-boost converter? non-inverting of course... I realise it needs another power diode from phase 3, but then input voltage is unimportant since it can make its own output anyway. 
Diode D2 would be cooled on existing cooling plate, and when driving, would be disconnected from batt+. 
So not much more wiring required. 
Only issue i see would be exit cap... would battery be able to act as final cap? Or would we add one 40uF 800V plastic cap from diode D2 to negative rail? 
EDIT: Hm, you can observe current out through phase 3 and maybe make additional comparator for measuring analog voltage on output; do we have any analog pins left on controler?
Or voltage measurement would stay the same and serve only to decide on how to operate charger in boost or buck mode. Reference point would be udcmin parameter yes?

http://www.ti.com/lit/an/slyt584/slyt584.pdf
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.8.5044&rep=rep1&type=pdf


----------



## PStechPaul (May 1, 2012)

I think a boost converter works hardest when input voltage is low and output is high, while a buck converter works hardest when input voltage is high and output voltage is low (for the same power output). It is a function of how much power must be stored and released by the inductor, as well as the current through the inductor and IGBTs.

A boost converter pulls a high current through the inductor and then releases the energy at a higher voltage. If the output voltage is close to the input voltage, the peak primary current draw will be less, and the IGBT will be handling less power, as it will be mostly OFF. 

A buck converter pulls a low current through the inductor over a longer period of time and releases a higher current over a shorter period of time. As the output voltage becomes close to the input voltage, less power will be transferred by the inductor, and the IGBT will mostly be ON and conduction losses will dominate.

That's not a great explanation, but the best I can come up with at the moment.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> What about two transistor buck-boost converter? non-inverting of course... I realise it needs another power diode from phase 3, but then input voltage is unimportant since it can make its own output anyway.
> Diode D2 would be cooled on existing cooling plate, and when driving, would be disconnected from batt+.
> So not much more wiring required.
> Only issue i see would be exit cap... would battery be able to act as final cap? Or would we add one 40uF 800V plastic cap from diode D2 to negative rail?
> ...


I see a problem with the boost converter: it wood boost straight back onto the DC bus through the top diode of the 1st and 3rd leg.
I guess an "auto" mode should work. If the inverter starts up in charge mode with udc > udcsw + x, then use buck mode, otherwise use boost mode. You'd have to adjust your switch gear to connect the battery correctly.
But later, let's start out simple 
Regarding output cap: I get practical EMI problems when omitting it, like lost USB connections. Shouldn't cause too much trouble having it (in buck mode)

@Paul: I guess you're right, the more energy needs storing in the sub-optimal motor inductor the greater the losses


----------



## dcb (Dec 5, 2009)

I might be doing something wrong, but it looks like 600v rectified 3 phase bucking into a 360v battery has pretty poor power factor. (the red line should line up with the green line in the attachment at power factor = 1. So in this example it looks like maybe a power factor of 0.58. Though I'm not terribly concerned about 3 phase since relatively few folks have it at their house where most charging happens (and isn't likely to be available in an "emergency")



arber333 said:


> What about two transistor buck-boost converter?


Will have to think about that. Initial issue is buck exposes the source to harsh switching, while boost exposes the battery, which is another reason why boost then buck is nice, as you have a large inductor in the way of the source and the battery, plus pfc boost voltage can be arbitrarily high.


----------



## arber333 (Dec 13, 2010)

dcb said:


> Will have to think about that. Initial issue is buck exposes the source to harsh switching, while boost exposes the battery, which is another reason why boost then buck is nice, as you have a large inductor in the way of the source and the battery, plus pfc boost voltage can be arbitrarily high.


Well in EU we have lots of 3phase 400Vac sources... never mind we can get 7kw from L2 stations and 3kW from home outlets single phase.

Then for boost-buck stage we would have to add another inductor from outside and it would have to be cooled. That way we would use boost from single phase to 420V and then buck down to appropriate Vbatt. Same as EMW charger...

Johannes you think you could control output in CC mode? I dont think CV is good for anything, since BMS would control this part.


----------



## dcb (Dec 5, 2009)

yah extra buck converter/inductor after the motor/boost would be more ideal.

fwiw, I took a peek and it looks like the best possible power factor for rectified 3 phase (into a purely resistive load) is 0.6. It IS possible to make a 3 phase boost pfc with wye wound and a tap, but the likelyhood of 3 phase availability and having a suitable motor make that kinda low priority. 

Though with only 3kw available at the wall (~1.5kw in the states) PFC for single phase becomes very important, though it doesn't require a terribly substantial charger.

Johannes, any ideas on how efficient the motor is when acting like a boost inductor?

what I envision is someone with a 50 amp/240v single phase circuit wanting to charge at ~12kw at home.

Probably should think in terms of j1772 standards though:
AC Level 1	120 V Single phase	
16 A 1.92 kW
AC Level 2	240 V Split phase	
32 A (2001) 7.68 kW
80 A (2009) 19.20 kW


----------



## arber333 (Dec 13, 2010)

Huh in that case it would be better to design inverter with 4 transistor modules, inductor and diode where first module acts as boost and is controlled by inverter brain. That way we could have boost - buck like EMW charger inside inverter package and it would adapt to any input voltage we could throw at it.

Not ideally but i think we have to think of the future. I for one would took apart my inverter and rebuild it to have this function added, since it would mean i could finally transfer 24 cells to front to rebalance the car .


----------



## jhuebner (Apr 30, 2010)

New firmware is up. Set chargemode to buck (4) to try it.

As a little extra I figured I could use the voltage on the mprot pin to measure the aux (12V) voltage. See uaux and let me know the accuracy.

I think before doing fancy things with extra transistors, PFC etc. let's try how well this goes.

@dcb: watch the video  I do the efficiency calculation towards the end.


----------



## jhuebner (Apr 30, 2010)

Ok, about efficiency: I just noted that I measured at the wrong end of the cable. Some connections are made with 1.5mm² lab cable. For example the output voltage of the power supply is 20V but the input voltage into the inverter is 19.26V.

So now


input voltage: 19.26V
input current: 14.3A
output voltage: 26.74V
output current: 9.5A
-> efficiency: 92,2% !


I think thats not bad considering the 2V IGBT voltage drop is already in there.


Then I did an experiment for the power factor. I have one of these energy meters which measure all kind of things. So I found my 20V/10A transformer in the basement and ran it at [email protected] So boosting to over twice the voltage. I got a power factor of 0.9. I'm quite happy with that.
Power factor drops as the current is lowered.


----------



## dcb (Dec 5, 2009)

jhuebner said:


> So boosting to over twice the voltage. I got a power factor of 0.9. I'm quite happy with that.


It probably isn't. Back in the day they used simplifying rules of thumb such that they assumed current was linear (i.e. sinusoidal) and power factor was a function of phase shift, or displacement. So something like change in zero crossing was sufficient.

But it really doesn't work today, for non linear loads. You have to compare the input current waveform with the input voltage, moment by moment, at a decent resolution, to get true power factor.

See the "rant" section of the first comment here:
http://electronics.stackexchange.co...ing-the-true-power-factor-in-non-linear-loads


----------



## jhuebner (Apr 30, 2010)

But why would they use an algorithm in that power meter that is useless for most loads? Fluorescent lamps, switch mode power supplies etc. are all non-linear loads. I mean integrating the product of two values is not so hard...

I also did a sanity check: DC current was 12A and AC current (into the rectifier) was 13.4A. 12/13.4A ~ 0.9 tadaa.

The reason to care about power factor isn't academic. In the given case 13.4A would be the current that heats up the cable and especially your fuse. But only 12A are actually going somewhere, the remaining 1.4 amps are swinging back and forth. So you lose 1.4A that you could use for charging had you a power factor of 1.


----------



## dcb (Dec 5, 2009)

Well maybe a part number for the meter might give an indication, but a good sanity test is to scope the input current (i.e. w/a shunt). If the waveform doesn't resemble the input voltage by a scaling factor, then it isn't PF=1.

Especially if you are doing buck-only, as the input current will have significant ripple if it isn't actually discontinuous.

I say "probably not", because I know there is a lot of misconception about PF, and you can add my own misconceptions to the mix 

But yah at low power outlets PF gets more critical, if you want to keep charge time as short as possible.

edit, and I apologize for any-derailing, very cool to see it bucking and boosting, that is useful in and of itself.


----------



## PStechPaul (May 1, 2012)

Just an observation, when using SPICE to calculate power and VA for power factor, be sure to take the sample over an integral number of cycles, and also do it after the values have stabilized. Another point is to use a real model for the diodes rather than the default "D".

Could you post the ASCII file for your simulation? I'd like to take a closer look at it. BTW, it is also helpful to use prefixes, so instead of 0.000001 F, use 1000 uF. You may need to set the equivalence of the Greek "mu" to the lower case "u". You can also use "m" for "milli". However, you can't use "M" for "Meg"; you have to use "1.5 Meg", for example.


----------



## jhuebner (Apr 30, 2010)

Power meter is a GT-PM-07

Attached is a waveform of input voltage and output current. Should have been input current, right? Ah no, I'm not powering it up again.


----------



## dcb (Dec 5, 2009)

jhuebner said:


> Power meter is a GT-PM-07


"power factor (cos)"

yah cos is doing a very simple zero crossing type thing (90 degrees off peak), not sure how it applies to a DC source either. Mostly it is in regards to wall power though.

paul, attached, remove .zip from name. I'm hoping to move on from this tedious portion of the discussion though 

edit, is this meter between the controller/motor and the wall? or is there a power supply plugged into this, then feeding the controller/motor? If the latter then that won't work for seeing how the controller does as your power supply may have pfc built in, or corrects it to some degree.


----------



## PStechPaul (May 1, 2012)

I tried that simulation and I played with some of the components, with surprising results in some cases. For the simulation below, I got 22.3 amps per phase at 247 VRMS for 5518 VA, and 3.21 kW per phase for 58% power factor. 









So, it seems that power factor correction may still be needed (or highly recommended) for three phase inputs. Here is the ASCII file for LTSpice.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> New firmware is up. Set chargemode to buck (4) to try it.
> 
> As a little extra I figured I could use the voltage on the mprot pin to measure the aux (12V) voltage. See uaux and let me know the accuracy.
> 
> ...


Hmmmm

I dont think anyone uses pot2, does any? Its a long time i used it last. In that case you could use pot2 as voltage sensor. Only one comparator (attiny) and opto needed with DCDC of course. We do need output voltage? You think it is wise to put any stuff to MPROT?

A


----------



## dcb (Dec 5, 2009)

PStechPaul said:


> 247 VRMS


Phase to neutral, yes, phase to phase is ~430v (600v peak), because apparently that is how it is measured commonly.



PStechPaul said:


> for 58% power factor.


Yup, that is what I figured, "true" power factor, not displacement or harmonic shortcuts, just point by point integration.



dcb said:


> So in this example it looks like maybe a power factor of 0.58.


So if you replace everything from the caps to the battery with just a resistor, do you get pf=0.60? This is why you need 3 boost converters for "proper" 3 phase pfc. 

Though looking at the graph, it seems like you *could* vary the load (without a capacitor there) so the ripple current follows the peak voltages better, and just leaves the lower corners uncorrected, for maybe pf =0.85? edit2: no, I don't think so, not without messing up the other phases, not sure.

Maybe "best" topology is leading boost (sans input capacitor), then use inverter/motor for buck? As it could pfc single phase just fine and help with 3 phase, and doubles as precharge possibly (or use the inverter to boost the cap voltage initially via reverse buck possibly, maybe not).

Edit, oh and mind neutral vs ground, here neutral is hundreds of volts above ground.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Hmmmm
> 
> I dont think anyone uses pot2, does any? Its a long time i used it last. In that case you could use pot2 as voltage sensor. Only one comparator (attiny) and opto needed with DCDC of course. We do need output voltage? You think it is wise to put any stuff to MPROT?


Yes, I use it to adjust regen in different gears and tone it down in cold weather, some others do as well.

The mprot pin does not have any security function by itself, it is also routed to the NAND gate whose output is used to shut down PWM on the various faults (using a different pin)


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Yes, I use it to adjust regen in different gears and tone it down in cold weather, some others do as well.
> 
> The mprot pin does not have any security function by itself, it is also routed to the NAND gate whose output is used to shut down PWM on the various faults (using a different pin)


Ah ok, not going to press the issue here. I just change value in web interface for winter/summer so i have only 5A regen now in winter.

I loaded new firmware. Looks good! I like the way you arranged it in modules. Also i like the error reporting. It got useful allready.
It seems encoder is really acting up. We will talk more about that flash version of error reporting module later .

Can you tell me what does "syncmode" parameter do? Is this the autotuning mode? 
I tried to use your tuning command "python tuning.py -d /dev/ttyUSB0", but it said something about not finding "serial"??? Can you help with that?


----------



## jhuebner (Apr 30, 2010)

syncmode is for running with synchronous motors. Still experimental! It needs a north marker and and direction input on yet undocumented pins that are not on the header. It's only in there because I didn't want to maintain two code bases. I still have your missing hole encoder in the back of my head. Still in need of it?

So the encoder message is thrown when an encoder pulse is less than 1/16 of time of the previous encoder pulse (time between two adjacent pulses). That is most likely bouncing. I admit I haven't even checked whether it comes up in my car.

The missing "serial" module can be installed by apt-get install python-serial


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> syncmode is for running with synchronous motors. Still experimental! It needs a north marker and and direction input on yet undocumented pins that are not on the header. It's only in there because I didn't want to maintain two code bases. I still have your missing hole encoder in the back of my head. Still in need of it?
> 
> So the encoder message is thrown when an encoder pulse is less than 1/16 of time of the previous encoder pulse (time between two adjacent pulses). That is most likely bouncing. I admit I haven't even checked whether it comes up in my car.
> 
> The missing "serial" module can be installed by apt-get install python-serial


DOH! Yeah i will install python....

Hm about that missing pulse . I have now both systems at home. 
I have nissan leaf motor with RLS encoder with mount moddeled according to leaf resolver. The thing works A B signal at 256 pulses and one Z north marker every rotation. It is 5V open collector output, so i have to wire pullup resistors on the master board side. So here i can use signal from A on encoder pin and Z to one other pin. Can you tell me of possible wiring. I would like to try it. Is there some other parameter to set? I can also figure sensor offset with Pauls inverter and use it vis-a-vis...

I also have EMRAX motor with optical encoder set up for missing pulse signal and prepared to physicaly apply force on shaft to simulate driving up to some 10kW strain... If anything could be done here, people are waiting. There are many EMRAX motors already mounted inside car transmission bells, but there is no comparable HV inverter to drive one at least nothing below €5k!
Did i mention it is 20 pole motor? Max 100kW water cooled motor, 40kW nominal. It rotates up to 5KRPM at 500Vdc at 800Hz with FW is possible it could go up to 6K RPM! So switching freq would have to increase yes? 

tnx

A


----------



## arber333 (Dec 13, 2010)

Grr... Johannes! I am angry at you!
One phase blew when i tried to perform autotuning. I will have to replace one IGBT and drivers. At least two phases still work, so i put car in garage...

I went into web interface and checked new code... ok
I have sarted autotuning... that part works
It asked me if i wanted to start tunung...yes
it asked me how much Arms i want to apply.... i set 500 as this was the value i had set inverter OC to.
It asked me to put car in high gear, apply handbrake and confirm...ok
Started tuning ..... and then BAM! I knew that sound. It was IGBT blowing top transistor....

Johannes, why dont you give clear instructions on how to procede with your procedures. There is no need for a video, Just setup points 1. trough xy and give short comment on what not to do!!!
I am sure i gave it too much Irms, but how am i supposed to know if inverter demands such value?
I will now bugg you for instructions every time untill i have a feeling you set up good procedure. I ve had lots of bad experience with EMW instructions before and here we go again... Even DIYers should learn to put somethin in writing. 

A


----------



## jhuebner (Apr 30, 2010)

Thats alarming, sorry to hear 

Until now I didn't know you could destroy your power stage with the tuning script. Of course 500A is a steep value to start with...

The part actually failing was the over current limit not so much the script. Even if you enter 1000A on a 100A power stage a correctly configured ocurlim would save you from rebuilding your power stage. What is your IGBT rated current BTW? Are the ilXgain values set up correctly?

I assume though the issue is that the script gradually raises the current and outputs it at 2Hz. Thats a long peak time compared to the same current at 50Hz. So what I could do is not let the user enter a higher value than 60-70% of the ocurlim.

When did it explode, right when it started tuning or later in the test?


----------



## jhuebner (Apr 30, 2010)

tuning script now displays some more warnings and checks your entered value against ocurlim.

I also updated the firmware, it was throwing encoder errors for no reason. Latest version is now 3.25


----------



## arber333 (Dec 13, 2010)

Ok, i replaced IGBT... 
I saw that IGBT no. 3 upper AND lower transistors were blown. that means so are the drivers... I will go and replace them... have 2 spares luckily.

Yes IGBT blew after cca minute or two into test. Before i was getting lots of errors from encoder before i could enter test. I really taught instructions required to set test limit the same as OC limit DOH!

Well from the bright side i will put 450A IGBTs in now. I dont have any 300A left. Should be better at take off now.

Also i will now finish Damiens drivers to have desat i see its benefit now .

EDIT: i found that drivers were toast. So were supression diodes. But DCDCs were just fine. I guess those Murata DCDCs can truly live continuous short.

A


----------



## jhuebner (Apr 30, 2010)

Quick repair for peace of mind, I prefer it 

Ok 500A limit on 300A IGBTs is quite courageous. But Damiens drivers will keep you out of trouble now.

Aha so probably one of the L3 IGBTs failed close and then the other died by shoot-through.


----------



## arber333 (Dec 13, 2010)

Ok iam fixed now. I did a triple check to be sure everything works fine. Then i did a test drive. 
Huh i put in 450A IGBTs but didnt change nothing... except remove two elcaps that were also toast. And the car is just wild. I am at 38% fuel and car can do 220Adc whereas before it could maybe give 190A. 
I do have derating set from 80Hz! Tomorrow i will try to boost amps some more without actually draw too much from battery...

Also will install new code...

A


----------



## arber333 (Dec 13, 2010)

Ok as a thought... I have replaced burnt driver chips, but Murata MGJ2D051509SC held and was ok. Its a good DCDC, i use it on my EMW charger also. Another thing that was burnt was suppression diode P6KE18CA. I have noticed that lot of other Gate drive design uses two 17V Zeners mounted back to back. And when i asked about it they said they prefer Zener to TVS because of sharper pulldown curve. Would it help more to put two 5W 17V zeners to GE contacts? 1N5354BG 17V. 

tnx

A


----------



## jhuebner (Apr 30, 2010)

About Zener vs. TVS - I really don't know, hope someone else chimes in.

Now about the tuning script.


It assumes that you have correctly calibrated your current sensor gain (il1gain, il2gain). So put a known DC current through the sensors (you use multiple windings, 10 windings with 10A result in 100A reading) and adjust the factors ilXgain until the reading matches your current
It assumes a correctly configured over current limit. Over current limit relies on correctly calibrated sensors - somehow it must convert A to the reference voltages for the comparator
It assumes you correctly set up precharge, which includes correct calibration of udcgain
I can include this steps into the script later on. So far it concentrates on motor setup.
The script then checks software version and key digital inputs and asks you to start the inverter with the start pin.
The following steps can be skipped if already set up



boost calibration - you enter your desired RMS motor current, meanwhile it checks your input against ocurlim - if its closer than 60% it will reject your input. It will then output a 2Hz sine wave and keep increasing the amplitude until your desired RMS current is reached. Keep in mind the peak current is higher - roughly 1.5 times the RMS current.
fweak calibration - it requires boost to be correctly configured, either manually or by the script. The script will output fweak/2 and fweak at 10% amplitude assuming a locked rotor (it will hardly spin at that amplitude anyway). It will keep doing this until the current at fweak is 2x the current at fweak/2. Thats because the locked motor is a transformer with the secondary winding shorted and twice the frequency transfers twice the current into the short.
Next comes the polepairs test. It will spin the motor at 2Hz and 50% amplitude and instruct you to count the number of turns the motor does within 10s. From that it arrives at the number of polepairs
Next up is finding the number of impulses per turn from the encoder. For that the motor is ramped up to 60Hz at 70% amplitude. That way the motor runs almost synchronous to the stator. numimp is set to 8. Now comparing the expected speed (assumed .1Hz lower due to slip) against the reported speed arrives at the actual number of impulses. Of course this test goes wrong if for some reason the slip is higher but at least it gets you in the right ball park. If it reports 63 than most likely it is actually 64.
So far nothing has been saved to flash, you can do so in step 5
Long post today, because next up is CAN.


I was recently lent a CAN to USB adapter and decided I should play with it so attached pictures show you how to attach an MCP2562 transceiver to the current board.


Pin 1 is connected to Pin 3 of JP1/EXT1 (CANTX)
Pin 2 is bent soldered into the ground pad of former JP7
Pin 3, as opposed to pic 2, is connected to 5V
Pin 4 is connected to Pin 1 of JP1/EXT1 (CANRX)
Pin 5 is connected to 3.3V (can be found on the close by via)
Pin 6,7 is CANL, CANH
Pin 8 must be tied to ground
And HW wise you're done. Now tell me what the software should do. I'm thinking about uploading a JSON file or something that maps CAN-Id and the data bytes to certain parameters or spot values, as well as overriding the existing analog and digital IO.


----------



## arber333 (Dec 13, 2010)

Now that is a good instruction, thank you!

I am interested in CAN output of following

1. most important for me would be motor RPM data. If i knew that i would be able to intercept this msg and use it for either RPM display and speedometer in case of fixed gearbox. Even software cruise control is not out if i use Arduino between throttle and inverter.
2. Motor temperature polling obviously
3. Inverter temperature obviously or maybe just digital OVERTEMP signal
4. brake light signal at preset AMP limit

Well then i would be interested if inverter could pick up signals
1. cruise control ON or OFF and "memory function" after using brake switch command
2. Various BMS signals a. overvoltage, b. undervoltage, c. overcurrent (to limit DC amps from battery)
3. Set Regen values. Preset some CAN signals to quickly change regen application in winter, wet road or for maximum traction...
4. Hill hold function signalling

Trough CAN you could use any other microcontroller and set lots of functions, even throttle and brake response. In example car braking to sonic sensors signal when reversing etc...

A


----------



## PStechPaul (May 1, 2012)

As far as I know, TVS devices and zener diodes use the same silicon avalanche phenomenon (as well as the true zener effect of quantum tunneling below about 6 volts) to achieve clamping above a certain voltage. But zener diodes are designed for voltage regulation over a specified range of current, up to a rated power dissipation typically 100 mW to 1 watt, although some are available up to about 50 watts in large packages. 

TVS devices are designed for transient overvoltage protection, and typically have high instantaneous (5 uSec or so) power dissipation, typically 500-1500 watts, and they also may offer faster response time. The actual response time is in the order of picoseconds, but inductance and capacitance increase effective response time. The temperature coefficient of TVS and Zeners also may be different. I think it is is most stable for 5.6 to 6.4 volt zeners, and adding a forward biased silicon diode in series can provide some compensation.

Here are some articles I found:

http://www.cooperindustries.com/con...ltage_Suppression_Diode_Application_Notes.pdf

http://www.semtech.com/images/promo/What_are_TVS_Diodes.pdf

http://electronics.stackexchange.co...tvs-or-zener-diode-for-overvoltage-protection

https://en.wikipedia.org/wiki/Transient-voltage-suppression_diode

https://en.wikipedia.org/wiki/Zener_diode


----------



## jhuebner (Apr 30, 2010)

It's a cold but sunny day so I decided to try the boost mode charger in the car.

I used one of the left over rectifiers from the EMW charger. 

Started out by connecting my 60V lab power supply to B- and motor phase L3.

I took a couple of steps before actually applying full power


Disconnect battery from inverter by pulling fuses. Apply a very small (8V) voltage, set a small current set point and check the DC bus voltage: 60V -> good
Connect battery, apply 60V to input. Currently there are 162 LFP batteries in series in the car. I was surprised to see that the inverter managed to boost 60V to 550V -> boost working -> good
Connected the rectifier with an additional 10A fuse. Now I had to be careful not to rush things:


Turn key switch on -> precharge engages
Make sure charge mode is boost and current set point is 0
Connect fwd and rev to 12V -> main contactor closes, boost mode becomes active
Make sure ampnom is <= 0
Plug in rectifier into mains
Now raise chargecur to whatever you feel comfortable with
Above 8A setpoint the 10A fuse melted rather quickly
Now I repeated #3 but without the fuse (the line is protected by the house installation anyway).
The maximum set point I tried was 14A which resulted in 17A being drawn from AC -> Power factor 0.82, this was displayed by the power meter as well.

Then I ran at 12A for about 30 minutes. I got an output current of 4.8A at 570V -> 2736W. The power meter displayed 2840W -> 96% efficiency

The inverter heated up to 2°C during these 30 minutes (7°C above ambient) and the motor to 6°C. The rectifier on the small heatsink became warm to the touch, like 30°C or 35°C above ambient.

I'm very happy with these results. So the next step will be permanently wiring up the contactors and inverter for boost operation. The EMW charger has given up the ghost (probably my fault though) so it's a good time to remove it.


----------



## jackbauer (Jan 12, 2008)

That's amazing  My next project lined up so!


----------



## Tomdb (Jan 28, 2013)

Mind creating a small diagram of the setup? 

What parameters are used when charging? Provided any fancy regulations in terms of current taper/charge pause to observe sag?

Unfortunately currently got my Johannes kit sitting on a shelf in the garage because an position sensorless motor control project is taking alot of my time.However, you could easily dram one of Johannes control boards into a Chevy Volt inverter, is there away of change the software to Active phase = LOW?

But you could in theory just built the Heubner kits into massive boost chargers.


----------



## jhuebner (Apr 30, 2010)

Tomdb said:


> Mind creating a small diagram of the setup?


Checks this out:
http://www.diyelectriccar.com/forums/showthread.php?p=828442#post828442



Tomdb said:


> What parameters are used when charging? Provided any fancy regulations in terms of current taper/charge pause to observe sag?


It's pretty much 4 parameters: chargecur, chargemode, chargekp, chargeflt



Tomdb said:


> Unfortunately currently got my Johannes kit sitting on a shelf in the garage because an position sensorless motor control project is taking alot of my time.However, you could easily dram one of Johannes control boards into a Chevy Volt inverter, is there away of change the software to Active phase = LOW?


pwmpol does exactly that. Careful when testing!



Tomdb said:


> But you could in theory just built the Heubner kits into massive boost chargers.


You should become a sales person  I have already built an extra charger with one of the main/sensor boards.


----------



## jackbauer (Jan 12, 2008)

Ok so this is my rough sketch of the boost mode charger.I have included a 3 phase rectifier. T4 does the switching and the body diode of T3 freewheels the inductor comprised of two of the three motor winds. All other igbts turned full off.

I think this can do serious power. The inductance of those motor winds will be huge compared to small wound parts so no need to go very high with switching freq.


----------



## jhuebner (Apr 30, 2010)

Right, thats the idea. Of course in your example if you have 400V input your pack needs to be >564V discharged for it to work.

Just realized I need to handle the case when the inverter is still switched on and the user plugs in mains. A simple relay as in my first drawing would dump rectified mains on the closed bottom switch of the respective phase.

So everyone whos eager testing: make very sure the inverter is not in Run mode when applying charge power! This is true for both buck and boost mode.

Currently the front of my car is pretty much taken apart, I have bolted the rectifier into the inverter and added a mains input cable.


----------



## PStechPaul (May 1, 2012)

I just read the parameters of one winding of a 1.5 HP 4 pole 3 phase motor:

R(100Hz) = 6.27 ohms
R(1kHz) = 27.9 ohms
R(10kHz) = 442 ohms

L(100Hz) = 30.7 mH
L(1kHz) = 27.4 mH
L(10kHz) = 18.5 mH

I'm not sure how that scales to an EV motor of, say, 30 HP, or to the current for use as a boost inductor, but let's say the EV charger was 30 amps while the 1.5 HP motor would be used at 1.5 amps (1 amp per HP). Also let's say the input is 72 VDC to be boosted 5x to 360 VDC. To get 360 VDC at 1.5 amps would require 7.5 amps from the 72 volt source. With 30 mH inductance and 72 volts it would take 7.5 * 30 / 72 = 3 mSec to get 7.5 amps peak, and a comparable time to transfer the energy to the output. So perhaps 10 mSec period or 100 Hz might work for such a boost converter. These are just off-the-wall calculations, but I doubt that the boost converter could run at any higher than 1 kHz. 

Please check my calculations and assumptions, and perhaps take similar AC resistance and inductance readings on the motor you are using. I might run a simulation, or even try making a boost converter with the motor I have. The reading is just for one winding, so with two in parallel the inductance should be the same but resistance would be half, and with all three phases connected the values are difficult to determine, especially since the windings have a common core and interaction with the rotor.


----------



## jhuebner (Apr 30, 2010)

Well, practically I tried 17.8kHz with my forklift motor and 8.8kHz with my 18.5kW Lenze Motor. That worked as described earlier, 92%/96% efficiency.

I tried earlier with a 1.5kW 230V motor like you described, that didn't work brilliantly indeed. But thats not a practical EV motor anyway.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Right, thats the idea. Of course in your example if you have 400V input your pack needs to be >564V discharged for it to work.
> 
> Just realized I need to handle the case when the inverter is still switched on and the user plugs in mains. A simple relay as in my first drawing would dump rectified mains on the closed bottom switch of the respective phase.


Well good luck with finding such nominal DC voltage (besides Johannes) at boost... I will probably try boost from single phase and if that works buck from 3phase. That should be interesting.

I have a solution for inverter still being active when AC comes online. 
I used a simple 230Vac relay to trigger the Emgcy pin when AC is on. So as not to drive off when charging. 

Johannes does your charger mode start only when the key is ON or anyway? Inverter should just get 12V somehow yes? Start pin is not needed for this.

A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Well good luck with finding such nominal DC voltage (besides Johannes) at boost... I will probably try boost from single phase and if that works buck from 3phase. That should be interesting.


A local company has built a couple of Mercedes Sprinter Vans on 800V. But you're right, it's still a pretty exotic setup. At least until car makers realize it's easier to fast charge a HV battery than a LV battery.



arber333 said:


> I have a solution for inverter still being active when AC comes online.
> I used a simple 230Vac relay to trigger the Emgcy pin when AC is on. So as not to drive off when charging.


Yeah but that way the charger won't start as you have disabled one of the inhibit pins. You would need just a short low pulse on the emgcy pin. Like connect it to both NO and NC contact and use the dead time. That way drive mode would be safely disabled. When charge mode is active you can't drive anyway.
Question remains: emgcy stop pin is 16Hz low pass filtered, so there is a small delay between AC coming on and PWM disable. I'm actually considering some kind delay-relay so AC into the rectifier arrives after (like 100ms) the disable pulse.

EDIT: this just got me thinking: I should check the startup time of my AC/DC converter for the aux battery, maybe that is around 100ms.



arber333 said:


> Johannes does your charger mode start only when the key is ON or anyway? Inverter should just get 12V somehow yes? Start pin is not needed for this.


start pin is indeed not needed. Just 12V power to the inverter (and inhibit pins)


----------



## jackbauer (Jan 12, 2008)

Well yes my plan would be to boost single and buck three phase. Does the current software support buck mode also?


----------



## jhuebner (Apr 30, 2010)

Yep, buck is supported.

I'm working on my web site to have the information easily available.


----------



## jhuebner (Apr 30, 2010)

Website updated: http://johanneshuebner.com/quickcms/index.html?en_battery-charging,27.html


----------



## onegreenev (May 18, 2012)

jhuebner said:


> Yep, buck is supported.
> 
> I'm working on my web site to have the information easily available.


Hoping to get back to my project here real soon. Nice to follow the charging abilities. Buck being the most desired for high current low voltage packs.


----------



## Tomdb (Jan 28, 2013)

Johannes, very clear update. I need to get a car built so I can actually start using my gathered EV components 

I wonder how much power you could pull with one of these from a three phase charging station (EU one so 230v x 3). Should be 32 amps x 230 x 3.


----------



## dima (Dec 1, 2015)

Johannes your website says Boost(4) Buck (5) but the firmware description says:

"chargemode 0=Off, 3=Boost, 4=Buck"

not to confuse with opmode that is also needs to be set same?

0=Off, 1=Run, 2=ManualRun, 3=Boost, 4=Buck, 5=Sine, 6=AcHeat

mistake somewhere on your website or firmware?


----------



## jhuebner (Apr 30, 2010)

Oh, thanks for pointing it out! Mistake on the website. Will fix it.

Have you updated your web interface to use the category/module names?


----------



## arber333 (Dec 13, 2010)

Hi JB
Would you be willing to make a new revision (V5) of your integral board that would include full quadrature encoder connection. It would be 5pin connector besides your spare pins connector. It would provide +5V, GND, signal A, signal B, Index or Z pins to connect encoder in future versions. Signal A could be existing encoder connection. 
Since STM is 3V3 level you would have to add divider network or small transistors to translate signal to 3V3 level. Would that be ok?

Johannes would it be ok to have signal A hooked on your old encoder pin? 
Would you be willing to make a module in code for quadrature encoder?
That way we would have a choise when we tried to use BLDC or ACIM.

tnx

Arber


----------



## jackbauer (Jan 12, 2008)

Yep. Can do. I have all the unused pins brought out to a header on the current version anyway.


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> Yep. Can do. I have all the unused pins brought out to a header on the current version anyway.


I checked on Johannes board for encoder pin and i think it should be made the same way, signalling from 5V level to transistor who would then switch the 3V3 to Olimex chip. Usually encoders are 5V or 12V devices. So i would choose 5V for the 2nd pin of output connector. The actual signal to the Olimex chip would be still 3V3 level.

So lets transfer single encoder signal from main connector directly (by track) to spare pins connector (5P) A pin. There 3 transistors should reside for A, B, I signals, each would get its base triggered from 5P header pins and send 3v3 signals to STM. Other pins should be 5V and GND. Also lets break track to pin 2 (3v3 supply) of main connector and put a jumper to power it either from 3v3 or 5V.

A


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Yeah but that way the charger won't start as you have disabled one of the inhibit pins. You would need just a short low pulse on the emgcy pin. Like connect it to both NO and NC contact and use the dead time. That way drive mode would be safely disabled. When charge mode is active you can't drive anyway.


Hm, there are still pins free on Olimex yes? So probably the best would be to take one small 230Vac relay and wire it NO with 3V3 to Olimex free pin. So in the presence of 230Vac inverter would only provide power as charger. That could be done with conditional in code. No special/unusual measures required .

A


----------



## jhuebner (Apr 30, 2010)

Just checked the pins.

PB0 can remain as A input. PA7 can become the B input. PD2 (current hard wired to PB0) would become the Z input.

The timer is then run in differential encoder mode. I.e. it is reset to 0 on Z, counts up on AB and counts down on BA. Even has a direction bit. Since there will be no interpolation the encoder might need a higher resolution. Will see.

It would also work with the A,B,Z output of the resolver->encoder board.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Hm, there are still pins free on Olimex yes? So probably the best would be to take one small 230Vac relay and wire it NO with 3V3 to Olimex free pin. So in the presence of 230Vac inverter would only provide power as charger. That could be done with conditional in code. No special/unusual measures required .
> 
> A


In my car I settled with the following: An AC relay will make sure FWD and REV are high (easy in my case, FWD is always high). So whatever happens, the inverter will go to charge mode and NOT drive as long as AC is plugged in.

The BMS relay will provide power to the inverter. So when it drops open, the inverter simply powers down and charging is stopped. Alternatively the BMS input could be used (not yet programmed to do so).

Additionally I will send the AC input to the rectifier through a programmable delay relay in case the inverter is still in drive mode when AC is plugged in. A 200ms delay will give it enough time to switch over to charge mode. The delay mustn't be too long, otherwise the PWM will open all the way resulting in a bad ass inrush.


----------



## dima (Dec 1, 2015)

jhuebner said:


> Just checked the pins.
> PA7 can become the B input.


a few posts back ...I thought PA7 was dedicated to "brkout" breaking lights or something?

Also if the board will be re-designed might as well include that CAN chip.


----------



## arber333 (Dec 13, 2010)

dima said:


> a few posts back ...I thought PA7 was dedicated to "brkout" breaking lights or something?
> 
> Also if the board will be re-designed might as well include that CAN chip.


Yes i tried experimenting with that. Went ok, made some people behind me curious but i am doing things none other does. Just to see if it would be worth implementing. Same with variable braking on brake pedal...
I have since reduced regen. It made a terrible mess of my clutch, so i dont brake at 30A anymore. So this function is obsolete now. Does anyone use this the way i did?

A


----------



## jhuebner (Apr 30, 2010)

dima said:


> a few posts back ...I thought PA7 was dedicated to "brkout" breaking lights or something?
> 
> Also if the board will be re-designed might as well include that CAN chip.


Good memory  
Arber rigged that pin up as brake output, it's not on a pin header. I will move it to PC9. PC9 is also the speed output that Damien uses, so I will have a parameter to choose between the two. It will be brought to the pin header via an open collector.
Never thought I'd run out of pins.

CAN will be on there.

Question: I'm thinking about replacing the discrete 3A transistors (dcsw, precharge etc.) by an ULN2001 chip. That would limit the output current to 0.5A. Will parallel 2 for the dcsw output. Anyone have an issue with that?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Question: I'm thinking about replacing the discrete 3A transistors (dcsw, precharge etc.) by an ULN2001 chip. That would limit the output current to 0.5A. Will parallel 2 for the dcsw output. Anyone have an issue with that?


I dont know what load others are using, but i dont see a need for 3A transistors. Maybe a good idea to put a notice instruction not to load the array more than 500mA, which is easy. I am using arduino 4 relay module to trigger DC contactor and precharge. Never ever connect EV200 directly to transistors as a load. Economiser causes stuttering. 
Also i use this to start water pump and "AC present" signal from charging socket. So as long people know this limit you may just use 500mA and single output to have more active outputs...

You would use darlingtons to lower drain on the circuit?

EDIT: I have to say here i changed my start configuration a little. I wish you to learn from my mistake.
I have built inverter with precharge relay and resistor inside. That means i had to bring 400Vdc inside inverter trough one thin wire. Mistake!!! Last week i had all sorts of problems with inverter and to make matters worse i had to avoid LIVE 400Vdc wire when i checked other wires inside. DO NOT CONNECT HV LINES to inverter other than main DC + and -. Even the sense wires connected to caps can be easily disconnected. 
Now i have rewired precharge as a 12V open collector signal to relay in my fuse box and that opens 400Vdc trough 470R resistor across EV200 contactor. It works without additional wires and when i remove fuse inverter current path is cut, but DCDC still works!


----------



## jackbauer (Jan 12, 2008)

So what we want are three inputs with a transistor buffer and optional pullup for an encoder or encoder emulator type signal?


----------



## dcb (Dec 5, 2009)

I think what you want is more I/O pins


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> So what we want are three inputs with a transistor buffer and optional pullup for an encoder or encoder emulator type signal?


Yes, currently i have push-pull type encoder so the signals would be direct 0 to 5V to transistor. Transistor would then switch 3V3 to Olimex. 
So if you leave mounts for 3x SMD pullups that would be great. 4K7 or 6K8 pullups would be sufficient. 

I agree with Johannes, you can use PA7 or PC0 brake input pin, as i dont actually use them to some great advantage. I dont even have PC0 connected.

I would like to have CAN, also for future connection with car and arduino Due CAN module i have. 

You could anticipate another digital input to sense AC presence and/or one output with BC547 for starting charger relay. 

How many pins that leaves us with?
I talked to Johannes about I2C port expander for digital ports, but i think he said serial pins are allready booked.

A


----------



## jackbauer (Jan 12, 2008)

Here is the current state of the combi board including bom. Will work on modifications to encoder and charger functions as soon as i hear from Johannes.


----------



## dcb (Dec 5, 2009)

combi.zip is empty btw

so what do you think is the major stumbling block to a 100 or 144 pin code compatible cpu? There are quite a few dev board options out there.


----------



## jackbauer (Jan 12, 2008)

Updated. Stupid windows pc. Stumbling block is time and money really. I'm designing this board for my own projects and am happy to share that work for free.


----------



## dcb (Dec 5, 2009)

much better, ty!

I recon the tradeoffs are:
different dev board means a significant branch in the design, but lots of future expand-ability and dedicated pins for future (existing?) functionality won't conflict. Largely single codebase and reference.

keeping the h103 means minimal effort now, but designs will get complicated by re-purposing pins so lots of little branches in hardware and code, and there might not be enough for some "must have" feature in the future. It will be harder to manage versioning going forward.

Just thought (maybe I'm a little late) that it would be a good time to bring it up when there is a complete redesign of the main board on the table already. It would ideally require some coordination.


----------



## jhuebner (Apr 30, 2010)

I'm kind of hoping for CAN to solve the problem. Are there any CAN port expanders out there? With that only the basic IOs are needed, anything fancy can be CANned. Will probably script the CAN interface with some sort of json-file so that it can be easily glued to existing hardware without changing the inverter software all the time.

I'm currently revisiting the encoder interface. I think the transistor is not really necessary. It can be setup just like the other digital inputs only with different values + optional pullup


----------



## dcb (Dec 5, 2009)

assuming DTC and the like is off the table for good, can would be useful, i.e. displays, bms/charger interface/ etc. Things that don't require micro/nanosecond timing. It makes it more expansive, but less deep. Something like PFC boost would also do well with more cpu pins. Also "sensorless" (or phase voltage feedback) and PM motors might benefit, etc. etc.

Just thinking out loud.

edit higher grained desat might use more pins as well, etc.


----------



## jackbauer (Jan 12, 2008)

I have both high speed CAN and fault tolerant CAN hardware on the current combi board. Plan to use the fault tolerant can to drive modern bmw instrument clusters directly.


----------



## jackbauer (Jan 12, 2008)

Johannes, might be worth retaining the transistors or some such as some encoders are very weak and noise prone. Just my observations.


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> Johannes, might be worth retaining the transistors or some such as some encoders are very weak and noise prone. Just my observations.


I'd keep the 500R pull up, this time to 5V. Then follows a 500R/1200R voltage divider and the proven 22nF filter cap. So now the encoder still has to pull down 500R and has the full 5V swing instead of 0.7V. Do you think the latter is an issue?



dcb said:


> assuming DTC and the like is off the table for good, can would be useful, i.e. displays, bms/charger interface/ etc. Things that don't require micro/nanosecond timing. It makes it more expansive, but less deep. Something like PFC boost would also do well with more cpu pins. Also "sensorless" (or phase voltage feedback) and PM motors might benefit, etc. etc.
> 
> Just thinking out loud.
> 
> edit higher grained desat might use more pins as well, etc.


Finally made an IO table. 3 pins of the Olimex board a left (with the latest plans, not the current board) and 6 extra pins of the STM32 are left but not brought out (used for JTAG etc.).

So just enough pins left for a common desat signal and 2 extra IOs.

I know thats not the most future-proof design but changing to a higher pin count STM means ditching the Olimex and start SMD soldering. Considering the scope of the project I'd rather not do that now.


----------



## dcb (Dec 5, 2009)

jhuebner said:


> changing to a higher pin count STM means ditching the Olimex and start SMD soldering.


I wasn't thinking smd, just a different $20 stm32 dev board, i.e. a discovery, or this looks popular (and exceedingly capable, plus you can plug a $5 arduino lcd keyshield on it): http://www.mouser.com/ProductDetail...0WPLDnYsI79VyEGU7o4m/3QnSSCyRl88nt/LYMmnI2g==

Just clarifying, I should go do it myself if I really felt strongly about it 

edit: not sure that was the one I was thinking of, lots of options just from ST.
http://www.mouser.com/Semiconductor..._/N-cxwk4?Keyword=nucleo&FS=True&Ns=Pricing|1


----------



## arber333 (Dec 13, 2010)

Ahhh... i had a startling thought. How do we know which phase is U to connect + charging line to for boost charger?
Johannes how can we determine this for everybody? Can this be determined according to driver PWM wires? Is there any other way?
I know which phase is 1st on my inverter, but which one to actually connect to AC bridge? We need a way to be always sure.

EDIT
Also i see there is 12V connection from key to reverse line. So we would have to leave key in a car? Hm... How about if we brought 12V to both reverse pin AND to inverter power by means of single AC relay? That way procedure would not require key to be in a car. Why diodes on 12V lines?
In case we need some time delay on relay for power i can add a time relay with 1s delay. 

1. We plug 230VAC
2. AC relay comes on and starts 
a. Time delay relay 
b. AC power contactor

3. Time delay relay after 1s brings 
a. 12V to inverter and starts it in charge mode. This then starts precharge and after Vout is ok PWM
b. brings FWD and REV pins to 12V (i would just bring REV to FWD) 

Main battery - line can remain allways connected yes?
Inverter checks voltage and starts precharge (caps are on output now!!!)
I connect + battery line with Tyco EV200 contactor like when driving.
Inverter starts charging.

If there would be desat event driver should be ok, but i would like signal line to MPROT as well. Would HW pin work in charger mode?


A


----------



## jhuebner (Apr 30, 2010)

The rule is: do not connect to the middle phase. Use one of the outside phases which are also on the outside of the ribbon cable to the drivers.

The key switch in the diagram is only for illustration, you don't need a key to charge. The diodes prevent enabling charge mode when using the key switch.

Still the diagram does not show the best way. The BMS is not in the diagram, but if wired as suggested once the BMS stops charging you could drive off. I will update the diagram.

B- can always be connected. B+ is connected the same way as in drive mode.

The HW inhibit pins work just like in drive mode - because they are HW pins


----------



## jhuebner (Apr 30, 2010)

Today I finished the wiring of the charger. I settled with the wiring shown in the attachments. For precharge and AC present I used these inexpensive but nicely mountable relays: https://secure.reichelt.de/index.html?ARTICLE=166118

So what happens:


Plug in AC
"AC present" relay K3 closes
If inverter is still running, it is immobilized because FWD and REV are high. Charging does not start and no AC goes into the inverter because relay K1 only closes once the precharge relay did it's cycle. This way there are no issues with feeding current into the closed lower IGBT
If inverter is not running it also gets the "start charge" input.
Power is supplied via the BMS relay. (Issue here: if you leave the key in "on position" charging would never stop. It could be handled with another NC contact before the key switch but I couldn't be bothered)
The inverter starts and closes the precharge relay K4.
This leads to the AC disconnect relay closing
Precharge is done, precharge relay opens. AC disconnect relay powers itself and stays closed
Main contactor K2 closes and makes the final connection of AC into the rectifier
Works great and apparently the dials are on the same power as the inverter. So they power on and the state of charge is displayed.


Last week I tried charging at 17.6kHz which is a lot less noisy but it also produces a lot more heat. After 3 hours of charging the heat sink was at 40°C while ambient was -1°C. With 8.8kHz it stayed below 15°C at similar ambient.


----------



## arber333 (Dec 13, 2010)

Hi all

I am overhauling my inverter now and i found something interesting. 
Johannes in his kit uses colour ribbon cable 26p to send signals from control board to the car... I am not particulary fond of explosion of thin wires and i was looking for something to use in place of connector. I used just screw terminals and they were very good for sorting wires, but whole installation looked like birds nest. Finally last month i found this PCB. You can also get them cheaper from china...

http://www.ebay.co.uk/itm/IDC-26-Ma...576430?hash=item51f39e1c6e:g:kPYAAOSwx-9W0WhM

I ordered one and tried it. It came out very neat. I can now install input wires from car directly to screw clamps on this PCB and from here i can use short 26p ribbon cable with connector on both sides directly. I tried continuity on the wires and every one came out numbered exactly as in Johannes table. So now even the cable colour doesnt matter. No loose wires and i still have terminals at hand for experimenting...

I strongly reccommend this to new builders as well as a mod for previous builts.


----------



## jhuebner (Apr 30, 2010)

Very neat, will definitely recommend it.
Seing this, I think I will keep the IDC connectors in the redesign. Damiens Ampseal version is cool but I think it takes away flexibility on where to place the board. I've seen IDC in so many applications it can't be that bad.

I also terminated the ribbon cable asap with a rather oversized Harting connector:


----------



## arber333 (Dec 13, 2010)

Hi Johannes

I was thinking... since inverter can be used to charge battery as boost converter, can it be used to make 3phase AC too?
I mean i have 380Vdc nominal. Would it be possible to make like 3phase output without motor connected. 
Purpose would be to connect car to house 3phase so basic utilities would be able to run in case of power shortage. Of course main contactor would be thrown, so household power would than be fed only from car battery. 
Could this work?

At least we could use motor winding to get 2 phase to boost voltage to 400V phase to phase from say 200Vdc? But then we would have to use one inverter phase to have N line also. At least for lighting to work.

Would that work or should i stop thinking too hard before i hurt myself .

A


----------



## jhuebner (Apr 30, 2010)

Yeah had similar thoughts before  I mean a regular 3-phase grid inverter is the same topology as a motor inverter. Plus a sine filter (LC) to get rid of the high frequency. 

In your case you could just get a 50Hz 3-phase transformer that reaches the desired voltage. Like 1:2 or so. That would also solve the neutral line issue.

Huh you could use your motor winding as the L part of the LC filter. Just open up the delta or wye connection... Could be that your car moves around when you fire up a kettle 

Inverter-wise you would just use pure sine mode (mode 5), fslipspnt=50Hz and play with ampnom to get your desired household voltage.


----------



## dcb (Dec 5, 2009)

jhuebner said:


> Plus a sine filter (LC) to get rid of the high frequency.


fyi, this is useful for sorting that:
http://sim.okawa-denshi.jp/en/RLCtool.php

even w/8khz pwm you need fairly large L and C to get any attenuation. So higher freq pwm will help there.


----------



## jhuebner (Apr 30, 2010)

Yeah I guess 17.6kHz won't be a problem as household currents will be much smaller than motor currents.

Judging from the sheer size of a motor I'd think it has enough L.

The calculator you linked always puts a resistor in series, any way to turn that off?


----------



## onegreenev (May 18, 2012)

arber333 said:


> Hi all
> 
> I am overhauling my inverter now and i found something interesting.
> Johannes in his kit uses colour ribbon cable 26p to send signals from control board to the car... I am not particulary fond of explosion of thin wires and i was looking for something to use in place of connector. I used just screw terminals and they were very good for sorting wires, but whole installation looked like birds nest. Finally last month i found this PCB. You can also get them cheaper from china...
> ...


Just got mine the other day. Installing mine today. I picked up two as I have two inverters.


----------



## onegreenev (May 18, 2012)

onegreenev said:


> Just got mine the other day. Installing mine today. I picked up two as I have two inverters.


Found I need the female connectors for this in order to get it to work. I don't need the cable. Got plenty of that. Just needed the 26pin for this board and you will need 24 pin female connectors for the inverter. I purchased 30 of the 26pin female connectors so if you need one I can ship it off to you. Let me know if any of you go this route and need some connectors. I don't have extra 24 pin connectors.


----------



## onegreenev (May 18, 2012)

Got the AC-35 to spin up just fine. Had an issue with one of my throttles and found it to be just dead or I need a full 5v on it. Now I need to get this in my Bus so I can do some real testing under load. I need now put on a key switch and precharge and set this up for a real drive.


----------



## jhuebner (Apr 30, 2010)

Exciting stuff, looking forward to your test drive.

I wonder if I should just ship two 26-pin female connectors. I currently ship 26-pin on the mainboard side as well with 2 pins torn. 

Next board will use all 26 pins.


----------



## onegreenev (May 18, 2012)

Still can't get my motor to run from the mac web app. I have use putty and when I give the command start1, it will let me throttle up. The web interface does not give a similar lar start1 command. I can however change parameters and upload new firmware from the mac web app. Can the web app be set so we can bench test with a parameter start1. ?


----------



## dima (Dec 1, 2015)

onegreenev said:


> Still can't get my motor to run from the mac web app. I have use putty and when I give the command start1, it will let me throttle up. The web interface does not give a similar lar start1 command. I can however change parameters and upload new firmware from the mac web app. Can the web app be set so we can bench test with a parameter start1. ?


Start 1? I thought "start 1" is a physical switch trigger, "start 2" is manual run. Tones of work has been put into the new interface recently, still buggy but getting there. I am happy with how the graph section is turning out.

Can't wait for the new board revision!


----------



## onegreenev (May 18, 2012)

A quick video of the inverter powering my HPEVS AC-35 on the bench with 24 volts under no load. With the encoder turned off it bucks around and moves rather slow. I only have 3.3v to the encoder but it seems to be working just fine when connected up. Im a happy camper. Need to remove the adapter and make sure its all on secure and square then mount it up to the VW Bus for further testing. I'd like to do more testing and see if I can get some better throttle control before taking it off the bench but for now this is what I have. I will need to connect up a key switch so I can turn it on and off without the computer being connected. That way I can use the web interface to do more tweeking. As it is now if I change any parameter from the web interface I loose my ability to turn it back on so I have to rely upon the windows program putty to do that. A pain yes but it works. 

Pete


----------



## jhuebner (Apr 30, 2010)

Running well, thats as much throttle control as you'll get in idle.

The encoder warning condition is a bit fuzzy. 10 implausible spikes (implausible acceleration) will cause the warning but I haven't done systematic research on it.

Just wondering, what is you fslipmax?


----------



## onegreenev (May 18, 2012)

Here's a file for you.

{
"boost": "36000",
"fweak": "90",
"fpconst": "400",
"fslipmin": "40",
"fslipmax": "80",
"polepairs": "1",
"ampmin": "3",
"encflt": "4",
"fmin": "1",
"fmax": "90",
"pwmfrq": "2",
"pwmpol": "0",
"deadtime": "50",
"numimp": "100",
"potmin": "0",
"potmax": "4095",
"pot2min": "4095",
"pot2max": "4095",
"idlespeed": "-100",
"idlethrotlim": "50",
"idlemode": "0",
"speedkp": "0.25",
"speedflt": "1",
"cruisemode": "0",
"bmslimhigh": "50",
"bmslimlow": "-1",
"brknompedal": "-50",
"brknom": "5",
"brkmax": "1",
"brkrampstr": "10",
"udcsw": "48",
"udcmin": "44",
"udcmax": "53",
"udclim": "54",
"ocurlim": "-100",
"minpulse": "1000",
"il1gain": "-4.62",
"il2gain": "-4.62",
"udcgain": "5.87",
"pwmfunc": "0",
"pwmgain": "100",
"pwmofs": "0",
"speedgain": "6000",
"snshs": "0",
"snsm": "2",
"fslipspnt": "-40",
"version": "3",
"ampnom": "0",
"opmode": "0",
"udc": "21.59",
"idc": "0",
"il1": "0",
"il2": "0",
"uac": "0",
"il1rms": "0",
"il2rms": "0",
"id": "0",
"iq": "0",
"p": "0",
"q": "0",
"s": "0",
"pf": "0",
"t": "0",
"fstat": "0",
"speed": "0",
"amp": "0",
"pot": "10",
"pot2": "50",
"potnom": "-1",
"dir": "0",
"tmphs": "7.96",
"tmpm": "170",
"din_cruise": "0",
"din_start": "0",
"din_brake": "0",
"din_mprot": "0",
"din_forward": "0",
"din_reverse": "0",
"din_emcystop": "0",
"din_ocur": "0",
"din_bms": "0",
"tm_meas": "59652322"
}
__________________
Change comes, one conversion at a time.
http://onegreenev.blogspot.com/

https://www.youtube.com/user/onegreenev/videos.


----------



## jhuebner (Apr 30, 2010)

I'd say your running pretty much open loop.
numimp is off, you said it's a 64 pulse encoder but it's set to 100. Also polepairs must be set to 2 as you have a 4 pole motor.
Then boost is way too high, for your low voltage setup set it to 7000-9000
And last but not least the fslip values are off any scale, set fslipmin to 2 and fslipmax to 4 for now.

You can also try the setup python script to correct the parameters mentioned above, but please set up the over current limit before doing so.

Then you'll actually be running in torque mode, before that it won't be worthwhile to mount the motor in your VW.


----------



## jhuebner (Apr 30, 2010)

Now, some news on the redesign.

I did some testing with AB encoder mode yesterday and (no surprise here, embedded doesn't work right from the start) the counter would just toggle between 0 and 1 instead of counting up to 128.

Turns out only channels 1 and 2 can be used for encoder mode. So far I'd used channel 3. As a consequence I can not stay backward compatible with the old board and there will be 2 versions. They will still come off the same code base, no worries here.

On the upside the TIM3_CH1 also happens to be SPI1_MISO i.e. the SPI data input. SPI1_MOSI usable as SPI clock signal is on TIM3_CH2. And TIM3_ETR can be used as an strobe pin. What this means is that the AD2S1200 resolver to encoder chip could be directly interfaced. And this means the absolute angle of a resolver equipped PMSM could be determined directly at startup without any funky search algorithm.

Good thing I haven't ordered any PCBs yet


----------



## onegreenev (May 18, 2012)

Ooops. I guess my parameters got changed to a default setting. I'll get on that straight away and do another video run this afternoon. My bad on numimp and other stuff.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Turns out only channels 1 and 2 can be used for encoder mode. So far I'd used channel 3. As a consequence I can not stay backward compatible with the old board and there will be 2 versions. They will still come off the same code base, no worries here.



Well i dont see it as bad news. New board will still be able to drive ACIM motor yes? I got a very simple magnetic sensor to use with an old gear wheel for my motor. It has open collector 64pulse per channel so 256 pulses in all. Voltage can be anything from 5V to 30V.
https://www.rls.si/products/rotary-...mental-encoders/gts35-gts45-gear-tooth-sensor
For now i will use only channel A. But with new board i could use A and B and later drive leaf motor with RS422 differential encoder i have on it. 
I still like the decesion where the motor will turn though lets keep it still, but use only one pin to signal it. Like 0 and 1 on FWD or REV decesion.

A


----------



## onegreenev (May 18, 2012)

Did some changes today. Played with the web interface but I still need to add that key switch. Here is the newest parameter file. 

{
"boost": "7000.00",
"fweak": "10.00",
"fpconst": "1000.00",
"fslipmin": "2.00",
"fslipmax": "4.00",
"polepairs": "2.00",
"ampmin": "40.00",
"encflt": "1.00",
"fmin": "1.00",
"fmax": "300.00",
"numimp": "64.00",
"syncmode": "0.00",
"syncofs": "0.00",
"snsm": "2.00",
"pwmfrq": "1.00",
"pwmpol": "0.00",
"deadtime": "50.00",
"ocurlim": "-100.00",
"minpulse": "1000.00",
"il1gain": "-4.68",
"il2gain": "-4.68",
"udcgain": "6.15",
"udclim": "540.00",
"snshs": "0.00",
"chargemode": "0.00",
"chargecur": "0.00",
"chargekp": "80.00",
"chargeflt": "8.00",
"potmin": "1450.00",
"potmax": "3865.00",
"pot2min": "4095.00",
"pot2max": "4095.00",
"brknompedal": "-50.00",
"brkpedalramp": "100.00",
"brknom": "30.00",
"brkmax": "100.00",
"brkrampstr": "10.00",
"brkout": "-50.00",
"idlespeed": "-100.00",
"idlethrotlim": "50.00",
"idlemode": "0.00",
"speedkp": "1.00",
"speedflt": "5.00",
"cruisemode": "0.00",
"bmslimhigh": "50.00",
"bmslimlow": "-1.00",
"udcmin": "90.00",
"udcmax": "120.00",
"udcsw": "0.00",
"pwmfunc": "0.00",
"pwmgain": "100.00",
"pwmofs": "65000.00",
"speedgain": "6000.00",
"fslipspnt": "-2.00",
"ampnom": "0.00",
"version": "3.25",
"opmode": "1.00",
"udc": "1.93",
"idc": "0.00",
"il1": "0.18",
"il2": "0.40",
"uac": "0.00",
"il1rms": "0.25",
"il2rms": "0.40",
"id": "-0.15",
"iq": "-0.03",
"p": "0.00",
"q": "0.00",
"s": "0.00",
"pf": "0.00",
"t": "0.00",
"fstat": "0.00",
"speed": "14.00",
"amp": "0.00",
"pot": "165.00",
"pot2": "1356.00",
"potnom": "-100.00",
"dir": "1.00",
"tmphs": "-16.25",
"tmpm": "170.00",
"uaux": "13.78",
"din_cruise": "0.00",
"din_start": "0.00",
"din_brake": "0.00",
"din_mprot": "1.00",
"din_forward": "1.00",
"din_reverse": "0.00",
"din_emcystop": "1.00",
"din_ocur": "0.00",
"din_bms": "0.00",
"tm_meas": "13.00"
}



I was able to turn on the inverter using putty in my windows environment then just moved over to the mac side and opened the hubner inverter web interface. As long as I don't change a parameter I can actually use that as shown in the recent video just posted. Input is welcome.


----------



## jhuebner (Apr 30, 2010)

Much better 
Not really sure why you're only getting 8V AC. Looks more like 12V DC going in? Or your meter is just confused by the PWM.

EDIT:
some news from the encoder front. I have rewired my board to resemble the rev2 pin mapping and successfully used AB encoder mode - yeeha


----------



## onegreenev (May 18, 2012)

When I checked my battery at the terminals of the battery without the motor running I was getting 25 volts from the pack. I figured that each IGBT was getting approx: 1/3 the voltage and when I added up the three voltages I got from each IGBT while running it came out to just about 1/3 of the voltage. So if I have a static 25 volt battery each IGBT should be seeing 25 volts ideally into each IGBT. Maybe someone can explain a bit better the way these use power? I know when you put a load or use power the voltages will drop which I saw. 

I'll do that again after I charge up the battery pack. 

So I got my 26pin ribbon cable clips so I can use my new toy to rid myself of the tiny wire rats nest of wires. It will make it so much better to control the wires I will use and not have any other wires in the way. Each to its own place. I have plenty of spare 26 pin ribbon cable. I'll be sure to match up the wires end to end so there is no confusion as to which is which. 

Went to watch the movie Logan last night so no playing with the motor. 

I also get to setup a 2kW Solar array to compliment my current system. All the parts came in. Im using 200w Kyocera Panels matched to its own microinverter. Got the trunk cable and bits needed for the main setup. Still waiting on the rails and clamps for the roof. It will be a much needed addition due to the extra from charging the electric car daily.


----------



## onegreenev (May 18, 2012)

jhuebner said:


> EDIT:
> some news from the encoder front. I have rewired my board to resemble the rev2 pin mapping and successfully used AB encoder mode - yeeha


So what does this mean for my setup? 

PS. I'd like to get a new current sensor board for this project. I still have those tiny little original ones that have the pins in the way from one of the sensors. The new one would be much better. Let me know what I need to do in a PM please. 

Pete


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Now, some news on the redesign.


I have rebuilt my inverter now. I have lots of free space now and i installed one 3phase bridge to heatsink to prepare connections for charging. 
Also i checked the boost wiring and it seems i dont need to install any additional contactors. Why did you then draw that you break AC line again with main contactor? I only use SPST contactor. 
Dont you use single AC contactor for that purpose? If there is need for double AC trigger i can simply use another 240Vac relay to carry enable signal to AC contactor. Can you comment?

My idea is to have additional AC port on my car under front bumper with one blue AC camper connector. That way this line will be safe. 
So basically i need one AC contactor to break AC line one 240Vac relay and one 12Vdc NO relay to release start line? A 20A fuse and couple of diodes too. 
It is rather simple wiring . Pics follow...

Thanks


----------



## dcb (Dec 5, 2009)

arber333 said:


> Why did you then draw that you break AC line again with main contactor? I only use SPST contactor.


Not sure what you are looking at, or if it is related, but we have the dumbest 240v setup in the states, center tapped 120-ground-120. So not only do you have to worry about loading one branch more than another, when using 240v BOTH power leads are hot. Plus mixing 120 and 240 everywhere is just stupid, we should lose the 120 and the both leads live part and dual breakers on everything everywhere.

Literally the worst of both worlds.


----------



## arber333 (Dec 13, 2010)

dcb said:


> Not sure what you are looking at, or if it is related, but we have the dumbest 240v setup in the states, center tapped 120-ground-120. So not only do you have to worry about loading one branch more than another, when using 240v BOTH power leads are hot. Plus mixing 120 and 240 everywhere is just stupid, we should lose the 120 and the both leads live part and dual breakers on everything everywhere.
> 
> Literally the worst of both worlds.


I am commenting a boost setup for EU single phase (L1, N) 230Vac. Why did he use another contact of DC contactor? Does AC need time delay when plugged in? Other stuff?

In your case you would use 120Vac (L, N) and boost it to your DC voltage. In my experience you would also have to use 1.3 * Iac fuse because of losses in cables since PFC is nonexistent. 

A


----------



## dcb (Dec 5, 2009)

fwiw, 120 really needs pfc, the outlets are 15 (sometimes 20) amps. You would not do any serious charging on 120 and maybe 1500w if you had pfc. 

Even then a pfc boost module using the motor to buck would be more universal, and efficient, and nicer on the power line and battery having a big inductor in the way of each. Just saying  Too bad both our 240 leads are @#[email protected]# hot, otherwise isolation wouldn't be as big a deal (worth keeping in mind for US readers anyway). So some high frequency transformer bla bla is in order.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> I am commenting a boost setup for EU single phase (L1, N) 230Vac. Why did he use another contact of DC contactor? Does AC need time delay when plugged in? Other stuff?


Because of precharging. Otherwise rectified AC would be dumped straight onto the DC bus through the bridge rectifier and upper diode -> huge inrush, breaker trips.

The way it is now the DC bus is precharged to the battery voltage, which in case of boost mode is higher than the rectified mains. Then the contactor is closed and there is absolutely 0 inrush.

Regarding "being nice to the grid" I think an extra filter might be needed. I can still hear the 8kHz up in the fuse box of our flat. Oh well, it doesn't do any noticeable harm so I couldn't be bothered just yet.


----------



## arber333 (Dec 13, 2010)

Hmm... Can you explain about buck charger? I would go for 3ph 600Vdc down to 410Vdc at full battery. Do i need K4 to be true DC contactor or would a stronger AC contactor suffice? Do i have to use outside phase with current sensor? 

Where to connect BMS? Is that covered by existing BMS pin?

What would be appropriate precharge logic? A timer relay set for 5s? Hm... i use DC film caps so they are full in 2s .

tnx

A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Hmm... Can you explain about buck charger? I would go for 3ph 600Vdc down to 410Vdc at full battery. Do i need K4 to be true DC contactor or would a stronger AC contactor suffice?


K4 will never interrupt DC current, so can be AC type.



arber333 said:


> Do i have to use outside phase with current sensor?


No, the current sensor on L2 is always used. Just make sure you have a sensor on L2 (or swap phases around at gate driver level until you do)



arber333 said:


> Where to connect BMS? Is that covered by existing BMS pin?


Currently the BMS relay would interrupt the inverter 12V supply. But I will definitely tie in the BMS pin.



arber333 said:


> What would be appropriate precharge logic? A timer relay set for 5s? Hm... i use DC film caps so they are full in 2s .


Yeah that should do. I think I have found a way to use the inverter precharge for buck as well, will draw a diagram and post it here.


----------



## onegreenev (May 18, 2012)

This evening I finally got my inverter re-wired with my little gadget I purchased on ebay. Seen below. The one the other guy purchased was from the UK but they won't deliver to the US. You will notice that mine is laid out different. I had assumed that it was the same layout but I was wrong. I wired it up like the other guys then put power to the inverter and got nothing. I checked and checked and quadruple checked before I figured out what was wrong. I then re-labeled mine to match and checked continuity of all the wires to the inverter and checked that they matched how the pinout is on the inverter. All checks out great but now it won't power up. The light on the olimex is not coming on either and I checked three of them to be sure it was not my olimex. I can pretty much rest assured its not. When I had connected it to power I did not have the olimex connected to the computer. So Im thinking that because I had power switched around a bit I may have blown another cap. Did not have time to check the little caps on the board yet. I know all the wires are good and connected properly as per the connections. So if you are going to go this route I'd suggest you check very carefully before connecting power and if you can get those from the UK then you are good to go. 

So remember that the outside pin is not pin 1 but pin 2. 


Im hoping I did not screwup the whole board. I have already replaced caps before. 

Pete


----------



## onegreenev (May 18, 2012)

Good news. I had power to pin 7 and not pin 24. Once I changed that all was well with everything including my rewireing. I had to re-label my little wire harness connector but after I did that all is well. The other thing is the web interface with start 1 implimented works perfect. I tested with 12 volts and later I will go again with 24 volts. I checked battery voltage drain from the battery and it was minor. Amperage from the battery was like 7 plus amps and amperage to the motor was like 45amps testing single leads to the motor from the IGBT module. So all seems rather well. Here are a couple graphs from the latest short run.


----------



## onegreenev (May 18, 2012)

Anyone here have a visual of their Pre-Charge Circuit?


----------



## onegreenev (May 18, 2012)

Got a simple start switch connected so I don't have to use the computer to test spin. I installed my 8lb flywheel and pressure plate and clutch disc. It is stock so I can't jump on it because it will slip the clutch. If Im easy it will be fine. I did a test spin and found a very very small hint of vibration. I will take off the pressure plate and clutch disc and retest that to see if I can find the source of the slight imbalance. I may go get a stage III pressure plate and clutch then go have it all balanced. Not sure where to go for that. Our machine shop out here is just terrible expensive and slow. I pretty much refuse to use them. 

But having the flywheel on and looking real good and no visible wobble Im happy at this point. Just about ready to go into the Bus. 

Pete


----------



## arber333 (Dec 13, 2010)

onegreenev said:


> Anyone here have a visual of their Pre-Charge Circuit?


Nothing special here.
Its just one wire to outside 12V NC relay that gets turned on at precharge. One 570R resistor from main contactor + to that relay and from there to other side of contactor towards inverter. It works, but i burned 2 relays up to now. Little 12V relay cannot disconnect 380Vdc. It can connect it good though. If everything works normally in 5s caps are full and there is no dV across relay, so it is fine. Trouble is if something happens and caps are drained. Then relay is usually toast and resistor doesnt disconnect.

Now i intend to use one panasonic AEV52012 DC relay, it seems it has silver contacts and magnetic plasma blowout... Should also work as heater relay.

http://eu.mouser.com/ProductDetail/...vices/AEV52012/?qs=3E71RmoOZ/hiqQUnMUVN%2bg==


----------



## onegreenev (May 18, 2012)

When I did my first conversion I only put a resistor between the main contact points on my contactor and then turned on the key to position 1 then let it sit for a few seconds and then turned on the controller. This allowed pack voltage to trickle charge the caps before turning on the controller. Worked like a champ. I have seen elaborate pre-charge setups but wanted to see what others have done. I do fine off of schematics but like to see the real deal along with that. Combined it solidifies my understanding of how it all works out. Schematics and reality rarely ever look the same. So visual and written are good. 

I have some good 24 volt contactors for low current applictions that might do well with the precharge setup. 

Anyone with schematics and visual to back up the schematic would be very helpful. 

Thanks
Pete


----------



## arber333 (Dec 13, 2010)

onegreenev said:


> When I did my first conversion I only put a resistor between the main contact points on my contactor and then turned on the key to position 1 then let it sit for a few seconds and then turned on the controller. This allowed pack voltage to trickle charge the caps before turning on the controller. Worked like a champ. I have seen elaborate pre-charge setups but wanted to see what others have done. I do fine off of schematics but like to see the real deal along with that. Combined it solidifies my understanding of how it all works out. Schematics and reality rarely ever look the same. So visual and written are good.
> 
> I have some good 24 volt contactors for low current applictions that might do well with the precharge setup.
> 
> ...


Well first i used 12V relay and 20W 470R resistor INSIDE inverter. That didnt work well since when relay went... i had to deal with live 380Vdc wire!!! Try it in the evening when raining...
I decided to move relay and resistor in contact box near main contactor/fuse. That worked better. Now there is just 12V drain to trigger precharge relay. Mainly i looked up to this drawing, i just didnt use SSR maybe i should. I got it somewhere on this forum...


----------



## dima (Dec 1, 2015)

onegreenev said:


> Anyone with schematics and visual to back up the schematic would be very helpful.
> 
> Thanks
> Pete


Here you go, hi-res images of my test/experimental setup. If you use those cheap 120v relays for pre-charge: GND & CTRL are shorted and go to pin 20.


----------



## jhuebner (Apr 30, 2010)

I heard a very suspicious frequency from out TV today. So I unplugged the car and found the noise was gone. Boost mode charging without any filtering really pollutes the grid!

I'll no order a netfilter like this (http://www.ebay.de/itm/171978290699) and hope for improvement.

The other day a public charging station shut down on me after 30 minutes. Could that be a reason?

Also on an average 13A input current setting I see 38A peak. Not that the circuit breaker worries about it but I don't like it and it's probably part of the pollution problem.


----------



## dcb (Dec 5, 2009)

jhuebner said:


> I'll no order a netfilter like this (http://www.ebay.de/itm/171978290699) and hope for improvement.


those R and C values look too small, won't be much attenuation at 10k or less.

i.e. 02DBAG5 has similiar values, peaks at 10MHZ, but only a couple db insertion loss at 10khz. maybe I'm not understanding it.
http://www.mouser.com/ProductDetail...LV74dRd3TfPjzqSDoemGb1K858BGQqWtimYrNa%2bSg==



jhuebner said:


> The other day a public charging station shut down on me after 30 minutes. Could that be a reason?


mebbe, what model was the charging station? any lights? could be power factor, could be a gfci thing, or something else 

Note I don't think you want to ground it like they have it, it appears the whole case is grounded, which would be at 120vrms above actual ground in europe (but still at ground in the states...), so careful there.

maybe a rlc band stop if you want to keep component values low. You need a bit of R to make the LC branch more appealing to the pwm current though.
edit: i.e. http://sim.okawa-denshi.jp/en/RLCbekeisan.htm try 1 ohm, .000016H and .000016F and hit calculate, should see a 36db loss at ~10khz on the bode diagram (what pwm freq?)


----------



## jackbauer (Jan 12, 2008)

Here is a first look at one of the combi boards back from the pcb builder. Looks good. Let's hope it works


----------



## Tony Bogs (Apr 12, 2014)

dcb said:


> i.e. 02DBAG5 has similiar values, peaks at 10MHZ, but only a couple db insertion loss at 10khz. maybe I'm not understanding it.
> http://www.mouser.com/ProductDetail/...a%252bSg%3d%3d


I'm pretty sure you have got it right. Those small filters don't do much for the 8kHz base frequency. 
Let's assume that the fundamental is 3Arms (probably low value) at the motor/transformer. 
It takes two large inductors (think 1mH / 10A / 12cm diameter x 10cm each ) to get the differential current down to the 100 mA range at the plug. 
And a high value line filter capacitor: 0.47uF


----------



## dcb (Dec 5, 2009)

Tony Bogs said:


> 8kHz base frequency.


ah ty. Tony, what do you think about a stop band with a 20uh and a 20uf and some small resistance (or some combination of uh and uf who's square root when multiplied is ~ 20u)?










Also worth noting you (johannes) didn't mention if it was a 60hz hum or a 8khz. If it is 60hz then active pfc is possibly your best bet in terms of hardware costs/weight, again just speculating a bit, but making the load look like a resistor to the line has its benefits. Of course "emergency use" might not justify it, but ya know people are gonna use it regularly


----------



## jhuebner (Apr 30, 2010)

It's the 8kHz.

I have simulated a PFC that jut relies on the current to obtain the AC phase and the modulates an inverse sine wave to make the current at least more sinussoidal.

I took the term "emergency" from a magazine where they wrote about some cars only having an "emergency" 3kW charger on board and using DC charging or a costly add on charger for fast charging. As for me, it's always emergency 

Is it possible to replace the "R" of the stop band filter by an "L"? Even though [email protected] would only be 20W.

Forgive my ignorance, but which side is grid input?

@Damien: sweat piece of kit


----------



## dcb (Dec 5, 2009)

jhuebner said:


> I have simulated a PFC that jut relies on the *current* to obtain the AC phase and the modulates an inverse sine wave to make the current at least more sinussoidal.


did you mean to say voltage? would like to understand better otherwise how it stays in sync.



jhuebner said:


> Is it possible to replace the "R" of the stop band filter by an "L"? Even though [email protected] would only be 20W.


adding reactance mucks with the frequency, but you can re-arrange it to be a 2 port filter using the left diagram in the attached and lose the series resistor. But the components have to handle more current themselves FYI.



jhuebner said:


> Forgive my ignorance, but which side is grid input?


right after the bridge, see right diagram. Keep in mind I am just a filter hack and might be completely clueless about all this too.




jhuebner said:


> @Damien: sweat piece of kit


true that!


----------



## dcb (Dec 5, 2009)

fyi, looking at the line current profile, just doubling the component values and turning it into a low pass filter is a lot prettier... (lower right), though there is about a 1.5khz sine, still lower magnitude than the notch peaks, so I dunno.

edit: adding the 8khz notch downstream of the lowpass, makes a HUGE difference fwiw (attachment 2), might just be luck or maybe it is supposed to work like that 
the phase reversals on the notch probably make it look like a 16khz+ signal to the lowpass.


----------



## dcb (Dec 5, 2009)

ok, done w/filters for now. Sorted out bode for lowpass + notch + both, tolerance is a bit tight on notch. I added the ltspice source if anyone wants to mess with it more (remove .txt from filename).


----------



## dcb (Dec 5, 2009)

ok NOW I'm done w/filters 

so I made a shorthand boost converter (using time modulo behaviorial resistor), 10% DC, discontinuous, right of the bridge, and tried various filters, just to better emulate the non pfc boost converter worst case.

I emulated the filter in a box, doesn't do much at 8khz.

and I emulated the other filters (on the AC side of the rectifier, to avoid dc offset vs UH rating issues).

Now it might be a simulation anomaly, or an unrealistic implementation tolerance, but the combined filters (cyan, lowpass + notch) are definitely far greater than their individual contributions would imply.



jhuebner said:


> Is it possible to replace the "R" of the stop band filter by an "L"?


if you throw in a cap too, to make a reactive divider, you have a lowpass filter.


----------



## Tony Bogs (Apr 12, 2014)

jhuebner said:


> It's the 8kHz.


May I add "current, that is injected in the mains outlet". 

To bring it close to the motor controller comfort zone: dampening of the current is what the objective is, 
similar to what the phase inductances of the motor do to the output currents of the inverter.

Motors with high value phase inductances show nicely smoothened phase currents, even at lower frequencies than 8 kHz. 

For a motor 1A ripple is a very low value, but that is not the case for mains pollution.

So big inductances are needed in the L and N lines of the mains.


----------



## dcb (Dec 5, 2009)

fwiw, when the "motor" inductance is increased, the on-time has to be increased to bump up the current, and the power factor goes downhill and the filter starts ringing at 1.3khz everytime the current goes non-linear. So without specific values and loads there are limits to what you should expect from a passive only solution (and even then tweaking pwm frequency might be in order for the notch filter tolerances).

I don't expect "good" results without proper pfc, which could be implemented as a high frequency (easy to filter) pre-stage with motor as buck converter for final stage. And even then some understanding of the operating parameters are in order.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> It's the 8kHz.
> 
> I have simulated a PFC that jut relies on the current to obtain the AC phase and the modulates an inverse sine wave to make the current at least more sinussoidal.
> 
> ...


Hi
I dont know enough about theoretic magnetism to attribute to debate here... as long as it works .

Johannes, regarding boost mode charging. I use one 20A 230Vac contactor to break AC current. To switch this i will use one 12V relay that would carry 230Vac to contactor. For inverter to have report on AC i will use one small 230Vac relay to switch on REV signal. 

Alternatively i can use one 12V 1A ACDC PSU to provide power for inverter when car is not in operation and trigger other relais.
Do you think 12V 1A would be enough power?

Edit: DOH, i figured i will need power from car battery anyway to trigger DC contactor when key is out. I have to draw schematic first...

A


----------



## jackbauer (Jan 12, 2008)

So today I finally got a few hours to play with the combi board. Power up check went fine , drivers working and usb coms to the pc. Sadly the enova inverter uses a LEM HAL type current sensor that won't be usable so I'll have to replace them with LEM HASS. Hopefully get a motor spinning at the weekend.


----------



## jhuebner (Apr 30, 2010)

This is looking extremely clean, nice job!

As for the sensors, I replied to another builder:
you can theoretically use the existing sensors. You need one isolated ±15 V 2W DC/DC converter. You tie -15V to sensor board ground. The sensors are supplied with ±15V and possibly ground. Then you connect the output of your current sensors to the input of the sensor board via a 47k resistor (this forms a voltage divider 15V -> 2.6V). The resolution won't be very good (like 2 A/digit) but sufficient for over current detection and diagnosis. Don't forget to calibrate via the ilXgain parameters.


----------



## arber333 (Dec 13, 2010)

onegreenev said:


> This evening I finally got my inverter re-wired with my little gadget I purchased on ebay. Seen below. The one the other guy purchased was from the UK but they won't deliver to the US. You will notice that mine is laid out different. I had assumed that it was the same layout but I was wrong. I wired it up like the other guys then put power to the inverter and got nothing. I checked and checked and quadruple checked before I figured out what was wrong. I then re-labeled mine to match and checked continuity of all the wires to the inverter and checked that they matched how the pinout is on the inverter. All checks out great but now it won't power up. The light on the olimex is not coming on either and I checked three of them to be sure it was not my olimex. I can pretty much rest assured its not. When I had connected it to power I did not have the olimex connected to the computer. So Im thinking that because I had power switched around a bit I may have blown another cap. Did not have time to check the little caps on the board yet. I know all the wires are good and connected properly as per the connections. So if you are going to go this route I'd suggest you check very carefully before connecting power and if you can get those from the UK then you are good to go.
> 
> So remember that the outside pin is not pin 1 but pin 2.
> 
> ...


DOH! I installed mine, but in the end i found pins are still mixed ie. 2, 1, 4, 3.... etc. So precharge transistor blew before i found this. Luckily i had nothing else connected AND my +/- 12V connection is reversed from start . Lucky error from my end. 
EVERY pin has to be confirmed and i reccommend to put a table up. I use numbered wires and can verify them against connector table easily now.

my 5c

A


----------



## jackbauer (Jan 12, 2008)

inverter installed in the car with Combi board. Hope to spin the wheels next weekend.


----------



## onegreenev (May 18, 2012)

Got my new Current Sensor Board today so I can now get rid of that original dinky pretty much unusable current sensor board.


----------



## jackbauer (Jan 12, 2008)

Enova motor running with the Combi board : 

https://www.youtube.com/watch?v=ckndZQhy8XY


----------



## jacobcheng (Apr 11, 2017)

If you start test 1:1 model of car, you will need power supply like this 
https://www.octatronics.com/pds-pwm-series
to protect your controller.


----------



## arber333 (Dec 13, 2010)

Where to start...

I had quite an unfall couple months ago. One of the LiPo cells developed short to chasiss and it seems that caused catastrophic failure in IGBTs and drivers. I lost 2 of three half bridge modules while in regen downhill. 
When i tried to replace IGBTs and drivers i havent solved root cause and again one IGBT fell victim. 
That was it. I decided i wasnt going to suffer original drivers anymore. While they be simple and effective they havent got any protection at all. 
I decided to try JackBauers desat drivers. I ordered some PCBs and materials and made them. 

While i also converted my car - again! I put all the cells from the back to front. That way weight distribution is as close to original as possible. Handling is now better and tail feels lighter of course...

Well after drivers i decided to make a new master board. I got it from Johannes and i built it in one evening. Then i went on and test it. Idouble and triple checked and still i managed to burn precharge transistor... Everything then connected and i started car. Motor spun and everything seemed good. There was a bit more vibrations than i was used to though. I tried to take off... ARGH!!! Car rocked violently and tried to go forward half a turn and than in reverse... When i pushed brake motor started to rotate backwards.....! 

It took me 1 month of tests and scoping to figure what was wrong. I even took motor out as i suspected that there could be intermittent failure in stator wiring. Then i used different sensors. I even borrowed old drivers from a friend and still problem persisted.

Finally friend lent me his master board. I tried and motor ran good. So the failure was isolated there. I went element by element and i found wrong cap in C1. BOM shows 22nF but i guess i used 22pF? Cap was the same form, the same colour etc... When i found it i replaced it and presto motor rotated smoothly.

Now in my wisdom i used 6R8 Rg on new driver boards. I tought not to strain IGBTs too much. Well i was wrong again. When hard pushed inverter generated sound out of tune and desat kicked in. 
Then i replaced Rg with originals 4R7 and put small schottky diodes to suppress fake desat effect as datasheet suggest. 
Difference is in order of magnitude. With the same settings i can run the car normally and shift gears up/down... Desat still kicks in if you push throttle very hard. I will try to tune up blanking time a bit. 

I reccommend new drivers very much. They are consistent and predictable in action. I can see higher regen with new Rg resulting in stronger driving current. I even decided to try and expand on them, to build half bridge transistors in to have some 8A driver capability, which would allow to drive 600A IGBTs.


----------



## dima (Dec 1, 2015)

Wow motor reversing on brake, that is scary 

Where are the source schematics (none PDF) for this nice looking SMB driver board? Or JackBauer has separated himself into a commercial version?


----------



## jackbauer (Jan 12, 2008)

All files relating to my work on the Inverter are completly free at github :
https://github.com/damienmaguire/Inverter


----------



## arber333 (Dec 13, 2010)

dima said:


> Wow motor reversing on brake, that is scary
> 
> Where are the source schematics (none PDF) for this nice looking SMB driver board? Or JackBauer has separated himself into a commercial version?


Yes i was just backing off from garage and since reverse gear is very fine i didnt feel vibration. But after i changed gear to fwd i tried to drive back in but motor started rocking back and forth. While i pressed brake to regen a bit and stop motor rotated in reverse and car smoothly rolled back. Cold sweat!!!

Well now everything works. Motor rotates smoothly. 
Since i use new drivers their effect is good but they are a bit unrefined. 
I use infineon 400A IGBTs that have declared Rg 1R8. I first used Rg 6R8 and then 4R7. I found significantly less aural noise with 4R7, but still driver is reacting to false desat signal when throttle is applied quickly. 
This reaction has improved significantly last night when i installed additional 100uF film cap directly to rails. I dont bother with snubbers anymore. Film caps can absorb enough for IGBT safety. 

I think of changing desat blanking capacitor C15/C16 a bit to tune up the sensitivity of circuit. Also i reccommend putting U1/U2 diode on circuit. It can reduce false desat reporting, or so datasheet tels us...

I am considering also adding Rg design with two resistors in paralel with reverse diode to open gate and to close it diode blocks one resistor so Rg is higher and gate closes slower. Like 2x 10R and ultrafast diode like BYV27. 



jackbauer said:


> All files relating to my work on the Inverter are completly free at github :
> https://github.com/damienmaguire/Inverter


 Tnx JackBauer for material. I think those drivers will save a lot of IGBTs now...


----------



## arber333 (Dec 13, 2010)

I have found why car felt sluggish. I had pwm set to 4kHz. When i gave it 8kHz there was much more energy available and less distortions. Desat still kicks in when i use throtttle very fast. I am waiting for pF signal caps to arrive.


Also i found 200uF may be enough on paper. In reality when i put another 100uF cap on rails improvement was tremendous. Both in tone and in response to acceleration. I am thinking of buying 150uF 700Vdc caps and putting 3x in place of current 100uF 800Vdc. 450uF of capacity will be able to cover every voltage drop with my 230A meagre current.

There is still a matter of clutch. Since i had to dissassemble my motor i took off the clutch also. After inspection everything was ok, but i also found springs inside were loose. When i asked my mechanic he said regen is banging on springs from the other support, which is not designed to carry load. We came to a conclusion EVs likes to eat clutch springs . 
Is there something to be done here? Maybe in software? Johannes did put a function of delay to regen, but at 2.3Hz regen, 20% delay and 35% brake i still feel clutch vibrating/oscillating when i push brake. Could this PIDed in code like a shock damper? 

A


----------



## piotrsko (Dec 9, 2007)

40 shore urethane backfill on the springs to make them solid?


----------



## jhuebner (Apr 30, 2010)

I could add a ramp to off pedal regen, maybe it helps?


----------



## arber333 (Dec 13, 2010)

piotrsko said:


> 40 shore urethane backfill on the springs to make them solid?


Hah! Good one. I will check if i can get it. Wouldnt force of clutch bang urethane to pieces?

Further update on my testing of desat drivers. I have tried to add more capacitance to DC rail. There was some improvement but not much. 
Largest improvement came as a surprise. I tried to increase boost in case motor would demand more voltage for better acceleration. Nope! Motor was oscilating at start. I then reduced boost and presto, desat took more amps and higher torque to activate. I then lowered this even further. I guess PWM applied voltage has influence on desat. Back EMF maybe?

Now i can drive with 120km/h and force 40kW power uphill with no desat. Still i have to be gentle with throttle or else... I soon get schottky diodes and pF caps to calibrate drivers.

A


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> I could add a ramp to off pedal regen, maybe it helps?


I am not sure it would help, since the same happens on brake. Its feels like clutch disk is trying to deccelerate and motor skips a liittle and then springs release disk back and cycle repeats. It is just less pronounced since brakeing is dampened by car mass as well. Maybe you could add a sort of PI function from start of regen to some time after its application. 
I can feel this effect up to a second of regen when on crossroads or reducing speed.
But off pedal ramp will be very welcome. Please.

I am now using settings for same power on off pedal and brake. It seems to be best because difference in negative torque can cause weird car behaviour on slippery road. At least it feels strange.

A


----------



## gunnarhs (Apr 24, 2012)

arber333 said:


> I am not sure it would help, since the same happens on brake. Its feels like clutch disk is trying to deccelerate and motor skips a liittle and then springs release disk back and cycle repeats. It is just less pronounced since brakeing is dampened by car mass as well. Maybe you could add a sort of PI function from start of regen to some time after its application.
> I can feel this effect up to a second of regen when on crossroads or reducing speed.
> But off pedal ramp will be very welcome. Please.
> 
> I am now using settings for same power on off pedal and brake. It seems to be best because difference in negative torque can cause weird car behaviour on slippery road. At least it feels strange.


Sorry I have not followed this thread for a time so I have to ask first before answering to the question

1) I assume you are using an Induction motor?
2) Generally I would not not recommend a standard clutch connection when using regen 
(or I would turn regen off if using a standard clutch connection). 
Do you use clutch in connection with an inertia wheel or is the clutch somewhat modified?
3) Do you use original ABS/ESP of the car?


----------



## arber333 (Dec 13, 2010)

gunnarhs said:


> Sorry I have not followed this thread for a time so I have to ask first before answering to the question
> 
> 1) I assume you are using an Induction motor?
> 2) Generally I would not not recommend a standard clutch connection when using regen
> ...


Yes i use ACIM.
Well tough luck, i use this setup for 90kkm now and i replaced like 3 clutches. I use flywheel albeit i had it turned down some for less mass. It is still heavy since screw holes for clutch basket have to remain. 
I am prepared now to buy rigid disk from US. I think this will be better and still retain some comfort for shifting. Mazda gearbox doesnt want to downshift without clutch. This is the reason i decided to keep clutch.

ABS doesnt work since i removed some cables in the begginning. I think there is a reference point missing somewhere since not even ABS relay works. 
Car works great without ABS though.
ESP wouldnt work without inverter connection to CAN but since it is torque/slip controled this is operated by me anyway . 
I just use dedicated computer to process parameters for that function - my brain, then i use specialised actuator to adjust throttle - my foot. 
It all works in a perfect feedback loop .

A


----------



## dima (Dec 1, 2015)

arber333 said:


> I just use dedicated computer to process parameters for that function - my brain, then i use specialised actuator to adjust throttle - my foot.


That is just funny .

What is the status of Hardware 2.0? I've seen some code go through on GitHub. Beta testers?


----------



## EVElvis (Jun 20, 2009)

Hi All
Just had a few days off work and made some good progress, but I do need some expert advice/help please.
I have just powered the inverter and Enova motor (same as jackbauers one) from 48V of batteries, but I cannot get the motor to turn smoothly in either direction, and nor does not seem to reliably reverse direction. Heres a video, including showing the parameters, which I know will not be right, but I have tried many different values of fslipmin, fmin with no big improvements:
https://www.youtube.com/watch?v=4zP5unzLe8Q
I have successfully run a smaller motor with the same parts before so confident the IGBTs and drivers are ok, so im hoping parameter value changes will help.
Cheers
Tim


----------



## jackbauer (Jan 12, 2008)

I'll dig out my paramters tomorrow but you will need a lot more boost on such a low voltage and have you set polepairs 2?


----------



## EVElvis (Jun 20, 2009)

Thanks Jackbauer, yep polepairs is 2. 
cheers


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> I'll dig out my paramters tomorrow but you will need a lot more boost on such a low voltage and have you set polepairs 2?


Can you tell me which value blanking cap do you use on your drivers? And how many uF in your DC-link caps? Do you use snubbers? What values? I think those things are linked for desat...

tnx 

A


----------



## EVElvis (Jun 20, 2009)

Hi Arber333
I have 8 x 470 μF on the main bus.
Snubbers are labelled 105K630, I think 1 μF each.
Not sure what you mean by blanking cap, but driver caps are as per Johannes original kit.
cheers
Tim


----------



## EVElvis (Jun 20, 2009)

Todays update...
Just had another go at getting it spinning reliably to no avail. I feel it is like only two phases/IGBTs are working with it rocking back and forth so strongly.
Thinking I will check the gate driver outputs, before I suspect it is a faulty IGBT. Wondering if there was a fault with an IGBT whether the inverter would allow it to try and operate the motor?
cheers


----------



## jhuebner (Apr 30, 2010)

Do you have the speed sensor connected yet or running open loop? I suggest the latter to get started.

If I'm into the unknown I usually start with a really low frequency like 5Hz and then play with the amplitude until I get a smooth spin. That is in "Manual Mode" using parameters fslipspnt and ampnom.

On the parameters I noticed deadtime is near its maximum. Can you gently dial it down again? I.e. test with a power limited supply until you get shoot through then go up again.


----------



## arber333 (Dec 13, 2010)

EVElvis said:


> Hi Arber333
> I have 8 x 470 μF on the main bus.
> Snubbers are labelled 105K630, I think 1 μF each.
> Not sure what you mean by blanking cap, but driver caps are as per Johannes original kit.
> ...


I was asking Jackbauer since i use his driver design. Old Johannes driver is very simple and rugged, but if (and when) something goes wrong, consequences will be catastrophic. That is why i am trying to tune up JBs drivers. I need his info to have reference point to which to compare.

Since i discuss this i may as well tell my findings.
1. I dont use snubber caps since i have 2x 100uF DC link foil caps bolted directly to DC rail. Calculations say 180uF should work. And it works! 
2. Well this may as well be source to desat premature triggering. Last month i put another 100uF film caps in and resilt was a bit better
3. Yesterday i put in two 2200uF 450V elcaps in series. Desat triggering changed dramatically. Inverter allowed me to use throttle faster and more agressively. Ultimately it did trigger desat, but that was at so sharp demand that it is usually not needed. 

Next i am prepared to add a single 4700uF 500V elcap. I think that would be it. Its just i have to think how to mount relays that trigger charging mode without disturbing capacitor mount.


----------



## EVElvis (Jun 20, 2009)

Thanks Guys
Johannes, will try again with speed sensor both open and closed loop. It was a little better when I disconnected the speed sensing, but still pulsing strongly back and forth Forward & Reverse.
I tried in manual with 48VDC batteries via 25 Amp fuse with fslipspnt - first 1, then 2, then 3, and ampnom = 50 then 100, and the motor did not spin afaik, but could hear the inverter trying. Any higher fslipspnt and i need to get better temporary cabling / fuse will blow. My cables got rather hot trying this - theyre probably only rated for 10A or so being banana connector test leads.
I think i can set deadtime down to about 70 or so, will try. Hopefully that is the problem, most easy and I had not played with this parameter believing it was not possible for it to be the problem.
Hopefully jackbauer will let me know his settings used (for the same motor and inverter)
Pleased you do not immediately think I have a driver or IGBT issue. I already broke one IGBT.
cheers


----------



## Tony Bogs (Apr 12, 2014)

arber333 said:


> I dont use snubber caps


Great desat test. COOL!


----------



## arber333 (Dec 13, 2010)

EVElvis said:


> Thanks Guys
> Johannes, will try again with speed sensor both open and closed loop. It was a little better when I disconnected the speed sensing, but still pulsing strongly back and forth Forward & Reverse.
> I tried in manual with 48VDC batteries via 25 Amp fuse with fslipspnt - first 1, then 2, then 3, and ampnom = 50 then 100, and the motor did not spin afaik, but could hear the inverter trying. Any higher fslipspnt and i need to get better temporary cabling / fuse will blow. My cables got rather hot trying this - theyre probably only rated for 10A or so being banana connector test leads.
> I think i can set deadtime down to about 70 or so, will try. Hopefully that is the problem, most easy and I had not played with this parameter believing it was not possible for it to be the problem.
> ...


Ok, i had similar problem and it was a single defective cap on the encoder RC line. I also replaced caps and resistors on L1, L2 lines. 

Before you try to go further with testing you check values of installed components against BOM. Check every resistor and cap. Time spent there will later ease your mind since you know you assembled correctly.

Then you connect driver boards to master board and sensors and power it up so you connect 12v to all required pins. You command "ampnom 1" and "fslipspnt 1" and inverter should give you nice 50% duty PWM on all driver GE contacts. You do have scope? 

Drivers are good then. Now you assemble inverter and power it up as per instruction. You calculate boost and leave minslip and maxslip at 1. Leave encoder disconnected for this test. Then you command manual start. 
You then input fslipspnt 1 (enter) and ampnom 15 (enter). 
Motor should move at 1turn per second. This is usefull so that you see smooth rotation at slow speed. In case IGBTs are bad you should see some jittering here. Remember encoder is not connected here, so it cant be blamed. 

If this passes try to put fslipspnt 2 and then 4 and 6... 8 ..10...15...30Hz. If motor stalls give it more ampnom.

If everything passes you connect encoder and start inverter true. Try to give it less boost than you calculate first. Have fslipmin at 1 and fslipmax at 3 ampmin at 2% and try to spin. Be sure to set fweak at large value motor will feel smooth but sluggish. Later you can use my procedure to tune up motor in post #1232.

Hope that helps

A


----------



## EVElvis (Jun 20, 2009)

Good news... I just scoped the gate driver outputs to find one not working at all, so when pulling connnector to check input power supply from main board a wire broke free of connector, which was fortunately the power lead. Resoldered and ok it seems, but do wonder why i only get about 11V output to gates with the others giving 15V, but seem to recall I found this before in anycase. Possible it is the one feeding the new IGBT i got, will check - it was same part number as original and was not cheap, just hope it isnt a fake one.
Thanks for all of your time helping me out, and thanks arber333, will follow your setup procedure. Was a good learning/experience exercise for me.
cheers
Tim


----------



## arber333 (Dec 13, 2010)

EVElvis said:


> Good news... I just scoped the gate driver outputs to find one not working at all, so when pulling connnector to check input power supply from main board a wire broke free of connector, which was fortunately the power lead. Resoldered and ok it seems, but do wonder why i only get about 11V output to gates with the others giving 15V, but seem to recall I found this before in anycase. Possible it is the one feeding the new IGBT i got, will check - it was same part number as original and was not cheap, just hope it isnt a fake one.
> Thanks for all of your time helping me out, and thanks arber333, will follow your setup procedure. Was a good learning/experience exercise for me.
> cheers
> Tim


You were lucky. If loose wire should come into contact while powering inverter there would be power surge trough caps and that IGBT gate would be busted. Watch out.
I suggest you took the single PCB off and desolder TVS diode from G or E contact. Try to power driver and check supply. Maybe TVS was defect and was draining power. 

Id you only use 11V your IGBT will never fully open! You need at least 12V and a long time. That is why 15V and a sharp Rg is a must. Si drivers are cheap i bought them on stock so i can replace them. They often fail shorted so IGBT will not be destroyed.

DCDC murata MGJ2D051509SC is one very tough mother... it can withstand shorts indefinitely. I only saw one dead when i powered it from 12V instead of 5V by mistake. In my EMW charger i use exactly the same DCDC just 12V variety. I recommend them very much. 
Driver SI8261BBC is 4A and also tough but is more sensitive to static etc... maybe yours is half dead. Try giving PCB 50% PWM pulse and scope GE for voltage output. You can also put one old IGBT on so gate inductance and capacitance are true. With it you should use 6R8 Rg for faster gate turn on. In case you use 4R7 you have to change DCDC to MGJ2D051505SC so power stays within drivers 4A.

Well i hope your drivers are good. I will never go back to basic design. I find it too risky.
I have just started to drive with JB drivers and i am impressed how easily system recovers from audible schreech when PWM is distorted by high current. I think i will also put one opto on the MPROT pin and trigger it with desat. That way whole inverter will shutdown in case of desat event. 

A


----------



## gunnarhs (Apr 24, 2012)

arber333 said:


> I am prepared now to buy rigid disk from US. I think this will be better and still retain some comfort for shifting. Mazda gearbox doesnt want to downshift without clutch. This is the reason i decided to keep clutch.


I am not a mechanical engineer / specialist but as i remember we looked into some options regarding a conversion which was using clutch. We ended up not using regen in setups with clutch and also with ATM (automatic transmission). The other option would have been to get a special clutch fabricated. In our driving cycle, regen was not a major factor (only adding 3-5% to range). When using standard clutch however one thing was pointed out by our mechanics, not to use aluminium flywheel but of solid steel, even if it would be heavier. 

The other thing was the compromise between electric motor performance and original drive-train regarding torque/speed. Especially when using ATM. The problem (and advantage also) with the E-motor is the high torque in the lower speed region which hits the drive-train much harder than the original ICE. If you compare the torque/power vs speed curve to the original ICE you will see the obvious difference but also it lies in the time the change in torque is applied (micro-seconds vs 10 of milliseconds). By using ramping functions (or torque/power control) this effect can be reduced and the high torque curve in the lower speed region reduced.
This reduces the efficiency of the electric drive but increases the living time of the original material. If you are not doing a lot of low speed city-driving the effect is minimal.
The same applies of course to the regen behaviour.
The beauty of using the induction motor is that you have full control of the magnetisation by just using the Voltage/slip relationship meaning that you can shut off regen by just shutting of the magnetisation if necessary without a fancy control.



arber333 said:


> ABS doesnt work since i removed some cables in the begginning. I think there is a reference point missing somewhere since not even ABS relay works.
> Car works great without ABS though.
> ESP wouldnt work without inverter connection to CAN but since it is torque/slip controled this is operated by me anyway .
> I just use dedicated computer to process parameters for that function - my brain, then i use specialised actuator to adjust throttle - my foot.
> It all works in a perfect feedback loop


Well this takes a lot of problems out of the equation


----------



## jhuebner (Apr 30, 2010)

Some news from the boost front. I'm sitting in my car while charging and the touchpad of my laptop is working flawlessly  Also the PWMish sound in the fuse compartment is gone.

I simply recycled the inductor from the EMW charger and one of those 10µF film caps. So simple LC input filter.

Grid - L - C (to Neutral) - rectifier - the rest

Also the power factor (as far as the cheap meter can be trusted) has gone up to 0.95 (from 0.88) and I'm charging at 3.6kW for hours without the breaker tripping.

Of course I'm not sure if I'd satisfy the respective regulations but this is already an order of magnitude better than without a filter.


----------



## arber333 (Dec 13, 2010)

Great! Good job. I still have old EMW inductor 180uH (its quite heavy). I could use it for filter. Also i have some small 300uH inductors and 40uF 500V caps. 
Do you think just any filter will do? What are the specs for your inductor? Iron powder core? 

What would be your parameters recommendation?

EDIT: It occured to me... since i use 3phase EMW design charger without PFC... Could i put one coil on each phase and 10uF cap BEFORE rectifier bridge. Wouldnt that drastically improve power factor on all phases? What about cooling those inductors? 
It would demand more space but if PF would improve... now i am at 68% PF with buck 500Vdc to 410Vdc max!


----------



## jhuebner (Apr 30, 2010)

I don't know the inductor specs, it's just the one from the very first EMW kit.

I took a measurement with my scope today, using a flux gate current sensor. Unfortunately I didn't graph the AC voltage, I thought it was a bit dangerous without a differential probe.

The RMS current measured with my trusty clamp meter is 16A. So 70mV/16A = 4.3mV per A.

EDIT: zoomed in a bit. You can see the 8kHz ripple of about +/-0.5A . Anyone know the common limits?

What do you think about it?


----------



## arber333 (Dec 13, 2010)

Hmm..., i dont know. I think i will use smaller T300 core and wind wire for 300uH. 
After i talked to Valery he said that at heavy load powder iron toroid reduces inductance to 1/2! So if design requires 180uH i will use 2x that. 

Those cores are rather inefficient. A friend had my EMW toroid tested and he found 65% at low loads, whereas some 88% at heavy loads.

I found one 10uF 500Vdc film cap. I think we i am good to try .


----------



## EVElvis (Jun 20, 2009)

Hi All. 
Turned out the suspect gate driver that would only give 10.5V PWM signals was indeed at fault. Pleased the main board and IGBT were ok. Fortunately having a spare gate driver to hand I quickly got up and running again. Drive i much smoother straight away and reliably forwards and reverses. Suspect the driver had been damaged when I blew up the previous IGBT it was driving, when due to my inexperience and knowledge connected my scope to both output sides, one each channel causing IGBT shoot through. 
Ran on 50VDC batteries ok, but need to do some homework on the motor parameter values, could not get much rpm out of the motor.

Heres a few more vids:

https://www.youtube.com/watch?v=k5FWRAQ6Dak

https://www.youtube.com/watch?v=89YJDFU4G_o

You can hear AM 540 kHz? radio interference in one video.

cheers


----------



## arber333 (Dec 13, 2010)

EVElvis said:


> Hi All.
> Turned out the suspect gate driver that would only give 10.5V PWM signals was indeed at fault. Pleased the main board and IGBT were ok. Fortunately having a spare gate driver to hand I quickly got up and running again.


Yep! Everytime IGBT is busted driver has to be replaced. Its not that its de facto broken, its just good practice. In any case those drivers are just optos with transistor outputs worth some $...

On desat front i put in the big mama 4700uF 500Vdc elcap. Instantly motor turns smoothly. I can load my cells to 200A and IGBTs with full take off. 
I did put another 47pF cap over my 220pF blanking cap to cancel false desat triggering. Hmmm...I think I should have tried only with the big cap and see if it got any better. Now i cant be sure desat will catch the bad electrons in time... But it is difficult to dissassemble everything and i have coolant in... 

EDIT: i put 22pF caps in paralel with 220pF and this configuration shows as best now. Have yet to see a desat thrown and motor runs smoothly. Well i see big cap is running a bit hot at 55°C but i dont thing this is an issue.

Bottom line is car handles well and i can charge and drive again.


----------



## ALIE (Jan 28, 2015)

EVElvis said:


> Hi All.
> Turned out the suspect gate driver that would only give 10.5V PWM signals was indeed at fault. Pleased the main board and IGBT were ok. Fortunately having a spare gate driver to hand I quickly got up and running again. Drive i much smoother straight away and reliably forwards and reverses. Suspect the driver had been damaged when I blew up the previous IGBT it was driving, when due to my inexperience and knowledge connected my scope to both output sides, one each channel causing IGBT shoot through.
> Ran on 50VDC batteries ok, but need to do some homework on the motor parameter values, could not get much rpm out of the motor.
> 
> ...


Attempts to fweak 60 dedtime 64


----------



## ALIE (Jan 28, 2015)

The project is coming to a close.
Next weekend (May 20) we meet fans of electric vehicles.
Then the car will already drivable.


----------



## jhuebner (Apr 30, 2010)

ALIE said:


> The project is coming to a close.
> Next weekend (May 20) we meet fans of electric vehicles.
> Then the car will already drivable.


Looking forward to seeing it live 


Arber, how is the charging going? What mode do you use and how much power?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Looking forward to seeing it live
> 
> Arber, how is the charging going? What mode do you use and how much power?


I havent gone very far, since left front wheel hub refused obedience and turned on the inside of a bearing resulting in worn bearing seat. DOH!
Well i think today or tomorrow i receive new hub and bearing. Its an old car and parts are harder to find.

Regarding charging i decided not to tempt fate before 20th may and i will suspend further experiments until after... . After that i plan to wire inverter in boost for automatic charging.
Now that we are discussing that... can you put in code the command to stop inverter charging on active BMS pin? That would ease interfacing charger/inverter a lot. 

see you on 20th

Arber


----------



## jackbauer (Jan 12, 2008)

So I have been messing about a little with can bus. Here we have an E90 instrument cluster I picked up for 15 Euros. An arduino due converts the CAN messages from the inverter at 250k to fault tolerant CAN at 100k and feeds them to the cluster in the correct format. Currently have RPM (speed) and speedometer (calculated from rpm) and fuel gauges working.


----------



## onegreenev (May 18, 2012)

jackbauer said:


> So I have been messing about a little with can bus. Here we have an E90 instrument cluster I picked up for 15 Euros. An arduino due converts the CAN messages from the inverter at 250k to fault tolerant CAN at 100k and feeds them to the cluster in the correct format. Currently have RPM (speed) and speedometer (calculated from rpm) and fuel gauges working.



Sweet. that will be a nice addition. Excellent work.


----------



## ALIE (Jan 28, 2015)

TKING -Johannes inverter -TWIZY Lectrica electric motor -72V leadacid battery 100Kmh﻿ -Ludicrous mode

https://www.youtube.com/watch?v=pH4QthuewCY


----------



## EVElvis (Jun 20, 2009)

Hi All
Think i made progress with the parameters and got smooth acceleration up to higher rpms. It appears that the inertia of motor and gearbox limits the acceleration rate somewhat with the limited power supply of 40Vdc via 20amp fused wire, but appears to be some good torque at low rpm. Boost set to 11000, ampmin 20.
The key to this appears to be that I adjusted fslipmax way more than ever before, 30 was the value if i recall right, so i think i misunderstood the parameters meaning. I was thinking you do not want slip more than a few percent as it is inefficient, but the parameter value is frequency, so does not directly influence slip percentage? Correct me if im wrong, but my understanding is that slip is to some extent fixed by the motor design as an asynchronous machine and that fslipmax being set at 3 was limiting the rpm of the motor?

Video here:
https://www.youtube.com/watch?v=7NOOQ5GIz6Y

cheers


----------



## arber333 (Dec 13, 2010)

EVElvis said:


> Hi All
> Think i made progress with the parameters and got smooth acceleration up to higher rpms. It appears that the inertia of motor and gearbox limits the acceleration rate somewhat with the limited power supply of 40Vdc via 20amp fused wire, but appears to be some good torque at low rpm. Boost set to 11000, ampmin 20.
> The key to this appears to be that I adjusted fslipmax way more than ever before, 30 was the value if i recall right, so i think i misunderstood the parameters meaning. I was thinking you do not want slip more than a few percent as it is inefficient, but the parameter value is frequency, so does not directly influence slip percentage? Correct me if im wrong, but my understanding is that slip is to some extent fixed by the motor design as an asynchronous machine and that fslipmax being set at 3 was limiting the rpm of the motor?
> 
> ...


Hmmm...

I think that is ok for testing. But for running motor in a car i have ampmin 2 and slip from 3hz to 6hz. Fweak is also very important. Boost can be calculated with a small natural compensation...

A


----------



## jackbauer (Jan 12, 2008)

EVElvis said:


> Hi All
> Think i made progress with the parameters and got smooth acceleration up to higher rpms. It appears that the inertia of motor and gearbox limits the acceleration rate somewhat with the limited power supply of 40Vdc via 20amp fused wire, but appears to be some good torque at low rpm. Boost set to 11000, ampmin 20.
> The key to this appears to be that I adjusted fslipmax way more than ever before, 30 was the value if i recall right, so i think i misunderstood the parameters meaning. I was thinking you do not want slip more than a few percent as it is inefficient, but the parameter value is frequency, so does not directly influence slip percentage? Correct me if im wrong, but my understanding is that slip is to some extent fixed by the motor design as an asynchronous machine and that fslipmax being set at 3 was limiting the rpm of the motor?
> 
> ...


You are probably not running in closed loop mode. By setting fslipmax that high you just feed V/Hz to the motor depending on throttle position. Is this the Enova motor?


----------



## EVElvis (Jun 20, 2009)

Hi Jackbauer
Yes, this is the Enova motor. 
It should be in closed loop since I have encoder connected, and if i recall right disconnecting it did not make any difference? But good point, worth me checking. 
I will have more of a play at the weekend with fully charged 50Vdc test battery, and make up some better test cables so I can draw more amps. 
cheers


----------



## arber333 (Dec 13, 2010)

EVElvis said:


> Hi Jackbauer
> Yes, this is the Enova motor.
> It should be in closed loop since I have encoder connected, and if i recall right disconnecting it did not make any difference? But good point, worth me checking.
> I will have more of a play at the weekend with fully charged 50Vdc test battery, and make up some better test cables so I can draw more amps.
> cheers


Maybe you have different logic on encoder? It can work on 5V, but when powered with 3V3 it cant find signal? I had this problem in the beginning and i had to use encoder that worked on 3V3. 
http://www.ebay.co.uk/itm/HC-020K-P...hash=item3f79e7aed0:m:mLePGMr6OvdoATBxBff-YZQ

But since there is transistor between encoder and olimex you can use 5V to supply encoder without problems. I stole 5V from sensor board connector and it runs fine. 

A


----------



## EVElvis (Jun 20, 2009)

Thanks for the link. I would like to use existing encoder, so perhaps supplying 5V is what I need to do. Will have a look at the datasheet for the encoder again. Just watching one of Damiens vids looking at this: https://www.youtube.com/watch?v=vEx4IIEsMZE
Seem to recall i have used 3.3V, so may well be the problem, so thanks in advance for the solution.
cheers


----------



## EVElvis (Jun 20, 2009)

The encoder datasheet does state 4.5V min. Will do as you say and take 5V straight to it and remove pin 2 connection.
http://www.infineon.com/dgdl/Infine...N.pdf?fileId=5546d46147a9c2e40147d3d593970357
cheers


----------



## Tomdb (Jan 28, 2013)

Anyone gotten the BLDC code to run a motor under load yet?

I got a couple of bldc motors laying around I might want to try running with the JHeubner inverter.


----------



## EVElvis (Jun 20, 2009)

Sure now that the 3.3V to encoder was the issue. 5V to encoder and things are different, but had to change encflt value it seems. Keep blowing 20A auto fuses when from low rpm all of a sudden the motor spins up rapidly, almost as if it suddenly registers encoder signal and realises rpm does not match throttle value? Need to find a re-settable circuit breaker for testing and/or make up some more heavy duty cables.
cheers


----------



## jhuebner (Apr 30, 2010)

Tomdb said:


> Anyone gotten the BLDC code to run a motor under load yet?
> 
> I got a couple of bldc motors laying around I might want to try running with the JHeubner inverter.


Anyone, anyone, Bueller, Bueller? 
A redesign will be on sale shortly that would at least provide the appropriate encoder inputs. Will see where we go from there.



EVElvis said:


> Sure now that the 3.3V to encoder was the issue. 5V to encoder and things are different, but had to change encflt value it seems. Keep blowing 20A auto fuses when from low rpm all of a sudden the motor spins up rapidly, almost as if it suddenly registers encoder signal and realises rpm does not match throttle value? Need to find a re-settable circuit breaker for testing and/or make up some more heavy duty cables.
> cheers


Yeah encflt is recently winding up as an issue. Filtering the encoder might not be as useful as I first thought and mainly causes delays in the control loop. Setting it to 0 disables filtering entirely.


----------



## EVElvis (Jun 20, 2009)

Thanks Johannes.
i set encflt to 0 and now its just like before i changed encoder power supply from 3.3v to 5v, perhaps it disables the use of an encoder entirely?
Any idea what I can try next?
cheers
Tim


----------



## jackbauer (Jan 12, 2008)

Sorry for the delay. Here is my current enova parameter file. running at 380vdc.


----------



## EVElvis (Jun 20, 2009)

Thanks jackbauer
Was hoping you would let me know what values had worked for you. 
Ill have another tinker. Fingers crossed.
cheers


----------



## EVElvis (Jun 20, 2009)

Success! Took a couple more hours more after spending all day tinkering, and for a time had the motor run away without throttle, so think adjusting potmin sorted that. Deadtime made little difference, thinking fmin setting was the big one? 
Ended up using 25 Amp fuses, and blew a few of them in the process.
No regen apparent.
Seems the encoder and encflt set to 4 is fine.
Video here: https://www.youtube.com/watch?v=BD7ln4yzc4g
Thanks for all the help! cheers


----------



## Bundão (Jul 20, 2015)

Hi,

I’m trying to install the bootloader and firmware for a couple of new Olimex H103 boards.

I’m using the same JTAG programmer used by Tomdb and Onegreenev in conjunction with CooCox’s CoFlash software. I have the adapter type set ColinkEx and the hardware set to STM32F103RB but it seems the software fails to recognise the adapter, message reads "Adapter not found". A green LED does appear on the adapter so I guess it does at least have power. 

I’m running windows 10 and I didn’t have any obvious issues installing CoFlash. Has anybody got any thoughts on possible causes of this problem?

I did notice there is now an option to install bootloader/firmware on the latest frontend from Dima (which have loaded). Is this a better option for the non software guru?

Thanks
Graham.


----------



## dima (Dec 1, 2015)

For Bootloader, your image does not seems to be CoLinkEx. But in your case you have original Olimex which is even better.

You will need to install OpenOCD



> openocd.exe -f ./scripts/interface/ftdi/olimex-arm-usb-tiny-h.cfg -f ./scripts/board/olimex_stm32_h103.cfg -c "init" -c "reset init" -c "halt" -c "flash write_image erase C:\sine.bin 0x08000000" -c "reset" -c "shutdown"












Flashing firmware requires sending CRC checks, so you need to use python updater in Johannes zip. I re-wrote it for PHP if interested.


----------



## Bundão (Jul 20, 2015)

Thanks Dima,

The adapter I have is the ARM-JTAG-COOCOX (https://www.olimex.com/Products/ARM/JTAG/ARM-JTAG-COOCOX/open-source-hardware) not the ARM-USB-TINY. So the one I have isn’t in the dropdown list of adapters in CoFlash or your front end. However the Olimex documentation said this adapter behaves like the ColinkEx which is why I tried that option with CoFlash. I don’t know if any of the options in your console are going to work? I should have bought a Tiny!

However it seems a couple of guys have managed to get the CoFlash/Arm-JTAG-Coocox combination to work so I figured it must be my settings, or perhaps it’s the cable?


----------



## dima (Dec 1, 2015)

Ah cool, a new adapter. You probably need to use


> olimex-arm-jtag-swd.cfg


 with openOCD. I'l try to add it to new front-end.


----------



## Bundão (Jul 20, 2015)

Thanks, I'll look out for a new version.


----------



## arber333 (Dec 13, 2010)

I managed to sort out my problems. It seems they were NOT encoder related. One of the drivers must have been throwing UVLO fault. It seems that UVLO is not time resettable. You have to manually reset that system. Huh i will have to connect this to main board MPROT pin somehow, so that when this is thrown whole system resets.

What i did to make desat drivers work...

1. I traced wires between driver PCBs and found swapped Fault/UVLO wires. I repositioned them and now this is as it should be.
2. I replaced 33uF tantalum caps on DCDC output side with normal 100uF elcaps. Tantalum should work better but... Looks like this was major improvement. But still can have driver shutoff at takeoff. 
3. I added one 7uF 1206 SMD ceramic cap to all cap contacts. It seems now agressive UVLO event doesnt happen anymore.
4. I used 300pf blanking cap instead of default 220pf and i got desat event at 185Adc and fast acceleration. Finally i added one 22pf in parallel for a total 322pf. Now i can takeoff with full throttle and desat doesnt throw anymore. Same with high RPM acceleration.

I didnt have differential probe on my scope so findings are mainly empiric. *Anyone has a procedure to easily determine blanking cap value for desat?*

I will try experimental code V3.28 now. 
It supposed to have automatic encoder reset, throttle and brake pedal ramp and power/regen derating an all caution events. 

A


----------



## jackbauer (Jan 12, 2008)

New "test" motor for the inverter


----------



## Tomdb (Jan 28, 2013)

So you are planning to mod the tesla controller?

However it being an induction machine the Jhuebner inverter will definitely spin this puppy.


----------



## Bundão (Jul 20, 2015)

I'm still working on flashing the bare Olimex board with the bootloader and firmware. I now have a Segger J-Link adapter which looks like it will flash the bootloader just fine but one thing I need to specify in the command line is the address to load it to.
Can anyone help with that?
Many thanks
Bundao.


----------



## dima (Dec 1, 2015)

Here is a full flash dump, you can start @ 0


----------



## jhuebner (Apr 30, 2010)

So, back from holiday. As Arber keeps having problems with the drivers DESATing at surprisingly low current, I looked into the datasheet a bit

On page 16 it says:


```
When t DESAT(MUTE) expires, LED input needs to be kept low for t DESAT(RESET) before fault condition is cleared. FAULT
status will return to high.
```
t DESAT(RESET) is about 4ms. Since the inverter does not know about the desat event it will keep sending PWM and the driver never recovers from the fault.

The new main board has a desat input that would shut down the PWM and allows you to restart with the key switch.

Next I calculated the blanking time. Also on page 16 it says:

```
t_BLANK = C_BLANK × (V_DESAT /I_CHG ) + t_DESAT(BLANKING)
```
C_BLANK = 220pF
V_DESAT = 7V
I_CHG = 1mA
t_DESAT = 0.6µs

So: 220*10^⁻⁶[µF]*(7/0.001)+0.6[µs]=0.60154µs

So 220pF doesn't really change much even though it's the application circuits value. It only starts to take shape if you go to the upper nF region, e.g. 100nF:
100×10⁻³[µF]×(7/0001)+0,6=1.3µs

Can someone please confirm that? Damien, whats your blanking caps value?


----------



## jackbauer (Jan 12, 2008)

I have used the default value of 220pf on cm600du-12nf igbts. The combi boards shutdown the pwm if desat trips. The equation looks right and keep in mind when driving higher powered igbts than the device is rated for the turn on will be slower hence the desat trips incorrectly and a larger Cblank value would be required.


----------



## arber333 (Dec 13, 2010)

Yeah... ifigured out as much. Though they keep holly grail of desat tuning very close. I couldnt get specifics of how it works untill i found some info on ebike forums. That really opened my eyes... 

With Cblank I went as far as 330pF and then i stopped. 
Then i put 9V1 zener diode across Cblank to channel negative spikes back to E like in fig28 of ACPL337J datasheet. http://www.mouser.com/ds/2/678/V02-4...-09-909393.pdf
It proved beneficial if only to make desat trigger more softly. 

I am now just mounting 3V Zeners to ZD1 and ZD2 place. I found my IGBTs 2MBI300s have Vsat across CE some 2.8V at 125°C and max 2.6V in general use. So from equasion Vce= 7V–Vf–Vz i would use Vf voltage across schottky diode 1.2V and to have Vce threshold at 2.6V i should use 3V2 zener. Can you confirm my idea?

Zeners would have to be small fwd current type capable of operating at only 240uA! I tried with normal zeners and it doesnt work. 

A


----------



## arber333 (Dec 13, 2010)

Hi Johannes 

Good to have you back. 
So you think it wouldnt be a problem if i changed Cblank to 400pF?
It seems that i brought desat of my IGBTs somewhere on edge of inverter envelope. 
I calibrated sensors to 500A and i got OClimit thrown before desat was triggered. So then i set my OClimit at 550A and OC leaves me be . 
Now i figure desat is also triggering at 500A momentarily and i have Cblank at 330pF. If i use steps in 47pF i think i can be good.

Also i tried to set my deadtime at 63 and it seems to be some 1.2us or 1,3us. I will verify.


----------



## arber333 (Dec 13, 2010)

Johannes

There is another thing i wanted to ask for the benefit of audience. 
I tried to setup my current sensors LEM HASS 600-S so i used 17A drain and i put 4x wire loop round the sensors. I got good accuracy with this method but i cant seem to get sensors to 0A when inverter is not operating. I constantly get +3.xxA on both channels. How bad is that?

A


----------



## jhuebner (Apr 30, 2010)

3A sounds like a lot but since it's not used in the control loop it's not going to hurt. Maybe there is a voltage sag when the gate drivers are fired up leading to the offset.

As for the blanking cap, every pF increases the blanking time by 0.7ns. So 330 to 400 -> ~50ns longer blanking.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> 3A sounds like a lot but since it's not used in the control loop it's not going to hurt. Maybe there is a voltage sag when the gate drivers are fired up leading to the offset.
> 
> As for the blanking cap, every pF increases the blanking time by 0.7ns. So 330 to 400 -> ~50ns longer blanking.


Hm...

That would mean that for 1us of desat response time i should use cca 300pF more capacitance. 600pF then? That is quite a lot of difference from datasheet. 
Yesterday i put one 47pF on top of 330pF and i can now comfortably driveoff and i can heavily accelerate while in rpm. Still with heavy foot desat still trips on takeoff. I think i will add another 100pF cap over 330pF i now have to lengthen time a bit. I saw in datasheet that Ton can be up to 1.2us!!! 

I will report back when i have results...

On other front i drew totem pole transistors to JBs driver PCB. Adding 2 push pull transistors didnt present a problem in size. I just had to redraw some connections. However in datasheet fig. 23 there is another transistor to amplify Miller clamp. I dont know how to find place to put it in there. Hm maybe i can use different casing for that transistor... 
JB, do i need to add that? 

Also i am thinking of making driver board in one PCB. It is a hassle to try to make them compatible with all IGBTs out there. I will just give it pads for faston connectors so anyone can decide wheather soldered wire or faston connector is best... 

A


----------



## ALIE (Jan 28, 2015)

After a year and 30tkm without problems-- shit happens.
It blew the IGBT and destroyed it.
Damaged one gate (dcdc murata, chip and diode).
I hope to drive again in a couple of days


----------



## jackbauer (Jan 12, 2008)

Arber , adding a totem pole will square up the waveform of your igbt drive but will introduce problems of it's own the primary being turn off overshoot. Driving an igbt a little slower is not a crime As long as you have enough energy to blow through the miller knee reasonable fast you will be fine. I can pump 130kw into my Siemens motor using 600v 600a igbts driven from stock Huebner gate drivers. In fact it probably saves the transistors driving them a little slower. IF you want to bang them on and off really hard ensure you have your dc link capacitance sorted out and snubbers on each part and liminated busbars. Think SBE ring cap or multiple C4DE caps.


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> Arber , adding a totem pole will square up the waveform of your igbt drive but will introduce problems of it's own the primary being turn off overshoot. Driving an igbt a little slower is not a crime As long as you have enough energy to blow through the miller knee reasonable fast you will be fine. I can pump 130kw into my Siemens motor using 600v 600a igbts driven from stock Huebner gate drivers. In fact it probably saves the transistors driving them a little slower. IF you want to bang them on and off really hard ensure you have your dc link capacitance sorted out and snubbers on each part and liminated busbars. Think SBE ring cap or multiple C4DE caps.


That is why i want to use paralel Rg resistors with a fast diode. That way i could switch IGBT on with 3R3 and off with 6R8 joint resistance. 
I tried that with my EMW charger and IGBT is happily chewing current for 2 years now. 

I also want 600A IGBTs !!!! They work good for you? So what do you do? You stretch dead time so they are able to punch trough and drain gate on time?
What about desat then? You use 1us timing or 0.5s?


----------



## jhuebner (Apr 30, 2010)

ALI, looks terrible 

Same here though  After 20.000km it seems my inverter died on strong regen. Quite a few battery connections had shaken loose thus allowing the voltage to blow past any safe limit. The over voltage detection is too slow because there are numerous low pass filters in place.

Already ordered replacement IGBTs on ebay, I wonder what the drivers look like and whether there's a mess like in ALIs inverter.

EDIT: remember the first post in this thread by etischer? He definitely has a point.


----------



## jackbauer (Jan 12, 2008)

I'll have to make a video on driving igbts at some point. In the mean time this guy on youtube has some of the best info on practical use of igbts and drivers that I have seen :
https://www.youtube.com/user/subcooledheatpump


----------



## ALIE (Jan 28, 2015)

Hi Johannes
It's really terrible. Everything is black and now I have cleaned up most.
I've never seen it destroy the IGBT like that.
They're usually just a little black.
It happened when I crossed the edge into the garage.
I added a little more power to zero engine turns.
I've already installed the new IGBT.
Arber today brings me parts for a gate driver repair.


----------



## jhuebner (Apr 30, 2010)

Hmm, that makes me wonder: have you calibrated your current sensors and set a good ocurlim?

The instruction page now has something on calibration in the sensor board chapter.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Hmm, that makes me wonder: have you calibrated your current sensors and set a good ocurlim?
> 
> The instruction page now has something on calibration in the sensor board chapter.


It seemed like temp sensor was giving trouble also... I had to replace it too. I feel sorry for the thing. Its wires have to bare all sorts of strain.

I noticed something i consider dangerous though. 
Couple of times now i got OClimit thrown just after i start inverter. At first i just reset and drove away. But yesterday it happened the fourth time now. I got really upset since i havent applied any throttle. I connected scope to GE and checked values at the moment of start. 
I noticed when i put 12V to inverter i got GElow at -5V and GEhigh at +15V!!! What! When i toggle start both values go to -5V. 
Is it possible that for a very short time High to Low transistor would be open and current would flow from precharge?

Johannes i think maybe you should put a ms delay from all gates going low to DCswitch starting. What do you say?


----------



## jhuebner (Apr 30, 2010)

wow, I really need to look into that!

Was it GEHigh of all IGBTs or just one specific channel? If so, which one?

The start sequence should be as follows:

1. Power up - all 6 PWM signals low
2. Start - Close DC switch, open precharge switch
3. 500ms delay - start PWM generation, i.e. all lowside transistors on, on highside off

I'll check for a glitch in that sequence tonight.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> wow, I really need to look into that!
> 
> Was it GEHigh of all IGBTs or just one specific channel? If so, which one?
> 
> ...


I dont know if this is a glitch. It is too consistent to be an error.
On every GEHigh channel voltage was +15V when i applied 12V and gnd. GELow channel was down at -5V. 
When i turned the key and added 12V pulse to start pin of inverter all GEs were then pulled low to -5V. Every time. Then DCswitch is thrown. 

Is it possible driver channel signals would need pulldown resistors to keep them from going high unintentionally? Doesnt Olimex have internal pulldown resistors? I use like 200mm of wire from main board to drivers...

So there should be no damage, but i see this as a potential failure point. 
Remember, only two phases are protected by sensors. Third one has to pass trough motor winding and two igbts before it is detected...
Murphy says whatever can happen WILL happen.

A


----------



## ALIE (Jan 28, 2015)

Who killed my inverter.
I think I found it.
R3 or R6 10ohm resistor in the gate driver. (died without visible damage)
I broke it and found oxidation under the covers on both sides
I will replace all six for 4.7ohm for minor losses on IGBT.
I saw them in the new BOM


----------



## jackbauer (Jan 12, 2008)

Spun up the Tesla motor with the Heubner inverter today. I will break off a new thread on this project including reverse engineering the tesla inverter and a Heubner based logic board.


----------



## arber333 (Dec 13, 2010)

There is also one other problem i see. Maybe for others it is not so visible. 
Zero throttle position is a point yes? That means when i drive and try to hold my foot level car vibrations are moving it back and forth. I can feel motor alternating from drive to regen. It is only noticable at slow rpm but since my motor has slipmin 3Hz i can feel clutch vibrating back and forth. 

Johannes can you put this on your to-do list. I would like to have a user setting for throttle 0 position width. That way 0 position could be held easier. Maybe from 4 points up to 40points of throttle. 20pt takes from drive side and 20pt from regen. That seems fair.

A


----------



## ALIE (Jan 28, 2015)

jackbauer said:


> Spun up the Tesla motor with the Heubner inverter today. I will break off a new thread on this project including reverse engineering the tesla inverter and a Heubner based logic board.




Good work, video please.


----------



## jackbauer (Jan 12, 2008)

https://www.youtube.com/watch?v=BASio7Tfcnk


----------



## jackbauer (Jan 12, 2008)

Rather then fill up this thread with a load of Tesla inverter stuff I have broken off a separate one here :
http://www.diyelectriccar.com/forums/showthread.php/diy-tesla-controller-185753.html

Johannes , I hope your up for another road tuning session when I get this thing in a car


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> Johannes , I hope your up for another road tuning session when I get this thing in a car


Absolutely  
Let's find the real Ludicrous mode.


----------



## EVElvis (Jun 20, 2009)

Great work on the Tesla inverter. 

I have been informed that the reason my motor increased rpm up by itself in closed loop mode is to do with the way Torque control works. I do not fully understand, but without any or little resistance this is what can apparently happen and is normal, so thats good, because I could not understand why the throttle signal would be at fault. 

I am also curious as to what everyone is using for insulation / isolation monitoring HV to chassis? I know of Bender units, but any other ways? I hear that some inverters incorporate this function.

cheers

Tim


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> It seemed like temp sensor was giving trouble also... I had to replace it too. I feel sorry for the thing. Its wires have to bare all sorts of strain.
> 
> I noticed something i consider dangerous though.
> Couple of times now i got OClimit thrown just after i start inverter. At first i just reset and drove away. But yesterday it happened the fourth time now. I got really upset since i havent applied any throttle. I connected scope to GE and checked values at the moment of start.
> ...


So I scoped all 6 gate outputs and they all looked perfectly low on power up with all signals in sane regions, i.e. emcy and mprot high etc. Is it only the gate drivers that you measured high or the 3.3V drive signals as well?



EVElvis said:


> Great work on the Tesla inverter.
> 
> I have been informed that the reason my motor increased rpm up by itself in closed loop mode is to do with the way Torque control works. I do not fully understand, but without any or little resistance this is what can apparently happen and is normal, so thats good, because I could not understand why the throttle signal would be at fault.
> 
> I am also curious as to what everyone is using for insulation / isolation monitoring HV to chassis? I know of Bender units, but any other ways? I hear that some inverters incorporate this function.


In fact the very first sensor board (non-isolated, non-differential) could tell when there was something wrong with insulation. As soon as some resistance lies in parallel to the 2M measure resistors the voltage reading would be too high accordingly.

So thats what you could build, independently from the inverter, 
HV+ --|\/\/|----|\/\/|-- Chassis --|\/\/|-- HV-

The two outer resistors (say R1, R3) should be in the megohm region and the inner one (call it R2) sized to drop 3V. Also put a capacitor in parallel to it to filter capacitively coupled stuff. Have an Arduino measure from Chassis over R2 and either just shine a light or do fancy math with the obtained value.

Concerning torque control, yes thats how it works  Even small torque values will deal with the rotor mass pretty quickly and accelerate it until the fmax limit is hit.


----------



## jhuebner (Apr 30, 2010)

So, here is a first shot at some dynamic CAN programming
There will be a new command set for CAN mapping. I did TX first:


```
cantx <param> canid offset length
```
I might want to add a scaling parameter. Other things to do is saving the configured CAN configuration and make things like throttle controllable via CAN.


----------



## jackbauer (Jan 12, 2008)

Oh I like this I wouldn't worry too much about throttle control via can as yet. Parameter setting and data logging would be fantastic. BTW what program is that you are using for CAN?


----------



## jhuebner (Apr 30, 2010)

It's the software that comes with the Analog Discovery 2
How does the Tesla throttle pedal communicate with the inverter?


----------



## jackbauer (Jan 12, 2008)

Ok cool. The Tesla pedal is plain analog. 2 seperate hall sensors.5v supply.


----------



## ALIE (Jan 28, 2015)

Hi guys
I'm driving again.
Now I've set up current sensors correctly.
I had to lower the bust from 6000 to 5000 and fslipmax from 8.5 to 7 because my current protection was turned off PWM.
I set the Oculim -600 (Infineon 400A 1200V -192V batery).
The car is lazy, but it works.


----------



## EVElvis (Jun 20, 2009)

> In fact the very first sensor board (non-isolated, non-differential) could tell when there was something wrong with insulation. As soon as some resistance lies in parallel to the 2M measure resistors the voltage reading would be too high accordingly.
> 
> So thats what you could build, independently from the inverter,
> HV+ --|\/\/|----|\/\/|-- Chassis --|\/\/|-- HV-
> ...


Thanks Johannes. Good to know there is some protection already, and I recall the Orion BMS i plan monitors this as well. 
Found the info attached today which may be of interest to some whilst researching vehicle standards, some of it covering insulation. cheers
View attachment standard6235.pdf


View attachment standard6236.pdf


View attachment standard6234.pdf


View attachment R100r2e.pdf


----------



## jhuebner (Apr 30, 2010)

Made a short news video: https://youtu.be/N_dFu0de1RU


----------



## jhuebner (Apr 30, 2010)

jhuebner said:


> EDIT: zoomed in a bit. You can see the 8kHz ripple of about +/-0.5A . Anyone know the common limits?


Just found something on grid impedance and limits (page 75).

So the limit at 10kHz seems to be 110dbµV. The grid impedance is sqrt(0.24²+0.15²)=0.28 Ohms.

So 0.5A ripple current translates to 0.5*0.28=140mV. 140mV translates to 20 * log(140 * 1000)=102 dbµV.

So apparently I'm within the limits then, any objections? Hit the link of the quote to see the original plots.


----------



## Tony Bogs (Apr 12, 2014)

Hey, great!! Both the effort for the higher power kit and the check on the EMV.

If 0.5A is the RMS value of the base frequency of the Fourier sequence, then it seems that the current is within the limits of the info from the links.


----------



## jhuebner (Apr 30, 2010)

Thanks 

I attached an ltspice file that lets you play with a grid simulator. (Page 3)

So many limit out there, don't which one is right.
http://rfemcdevelopment.eu/index.php/en/emc-emi-standards/en-55022-2010
This one actually ends at 150kHz.

Here is a converter db to dbµV http://www.radiomar.net/convDBWen.htm

The image shows the FFT with a stop band filter and a 33mOhm series resistance on the filter cap. Without it there is a pronounced spike at around 3kHz.


----------



## dcb (Dec 5, 2009)

using the home rolled modulo function, w00t 

might want to add a realistic amount of resistance to the components, getting ringing on the input current.
edit, doh, you already did.


----------



## Tony Bogs (Apr 12, 2014)

jhuebner said:


> So many limit out there, don't which one is right.
> http://rfemcdevelopment.eu/index.php.../en-55022-2010


Yeah, do you have the right one for your product and have there been amendments?
Don't have the answer, sorry! Seems that EN55022-2010 applies to emissions of IT equipment. 
I'm sure rfemcdevelopment can tell you which standard applies to your product if you are willing to part with a bundle of euros. 
Maybe you can find the right one in the list under the "standards" button.


----------



## Tony Bogs (Apr 12, 2014)

Maybe this helps :

http://www.iec.ch/emc/emc_news/pdf/2015/5_Delaballe_TC69_APEMC_Symposium_May_2015_v2.pdf

Title sheet: "EMC for E-Mobility"

Seeing low end of the FFT result, EN 61000-3-2:2014 (line harmonics) may very well be applicable.
Compliance does not seem to be an issue if the method of measurement complies.


----------



## EVElvis (Jun 20, 2009)

First spin of the wheels today  

https://www.youtube.com/watch?v=yW_Qb6j_TKE

Still not the smoothest control, the rattle on startup you hear has been worse at times, so much so I thought the drive splines between motor and gearbox were knackered. Anyone else come across this? 

cheers


----------



## jhuebner (Apr 30, 2010)

hmm, AC cables and sensor cables shielded? Seems to pick up some noise at startup.


----------



## arber333 (Dec 13, 2010)

EVElvis said:


> First spin of the wheels today
> 
> https://www.youtube.com/watch?v=yW_Qb6j_TKE
> 
> ...


Is this allways in the same spot or does it come and go?
I suspect my clutch is banged up and out of center a bit. Since there is quite some play there i get vibrations in the 1800rpm region sometimes. The cure is to put it in neutral and rev it to 3000rpm. This centers the clutch plate and there is some peace for a time .

Othervise i see a lot of noise on my lines comming from kilovac contactor economiser. 
It is a 100khz heartbeat. What do you use for encoder? Does it have open collector output? You would maybe have to connect motor to chassis with a cable to ground it? Likewise for inverter.


----------



## EVElvis (Jun 20, 2009)

Good points, and likely the issue since i have not looked at the interference aspect of the inverter in any detail, so apart from connect the obvious previous shielding connections remaining on the original Enova parts i used. A good time for me to learn more about this design aspect.
The rattle is always just at the start, often before any complete motor rotation. I have no clutch, it is a splined connection motor to single reduction gearbox, and because the noise was so mechanical, it seemed to me to sound like a motor shaft spline grinding away. Quite sure thats not the case now, which is a relief. 
I know the encoder cable is shielded, and i think the ac cables are, but i need to check as i had to modify what i had, and perhaps i disconnected the ac shield connections? I read that a lot of intereference can come from these otherwise.
Just looked at the Avago encoder (HEDM-55xx/560x & HEDS-55xx/56xx ) datasheet and it would appear to be an open collector, as far as I can understand with my limited experience. Please correct me otherwise.
cheers!


----------



## jackbauer (Jan 12, 2008)

Just one thing to note those Enova motor/gearbox systems sound like a bag of hammers at the best of time. A friend of mine has one and has had to replace all the motor bearings as they were shot. My one will likely need the same.


----------



## Boxster-warp (Jun 22, 2014)

Hello
The motor bearings ore the bearings from the gearbox Are Bad?
Greetings Boxster-Warp


----------



## EVElvis (Jun 20, 2009)

The bearings feel smooth on both motor and gearbox, so in my case i am sure its parameters, EMI, or just the nature of the torque control?
Perhaps the bearing failures are due to arcing?


----------



## jhuebner (Apr 30, 2010)

So I got my test bench rigged up again and after years of saying that you don't need current sensors for motor control I wanted to know what happens if you DO use current sensors.

So there are a few issues with pure V/f: 


it's a bit hard to configure
It does not account for voltage sag (on the positive side thats natural derating)
It tends to oscillate on regen at very low rpm because the speed and thus the sine amplitude is lagging behind on low pulse count encoders
So I did a minor modification: 



The slip control is left as is
the maximum of i1, i2 and i3 absolute values is calculated (it's fairly constant, with a small ripple 3x base frequency)
Instead of V/f the sine amplitude is determined by a P-regulator on said value that gets its reference from the throttle
I didn't use the output from the Park transformation as it is a bit hard to set up. Basically if you swap a phase, change motor direction, invert the current signal something changes in the transformation and you no longer get a DC value.


On my bench I can't test much all I can say the motor still accelerates and brakes but also oscillates on regen depending on the regulator amplification. Will probably have an extra factor for regen.



I will definitely try this in the car once it's up again.


----------



## Tony Bogs (Apr 12, 2014)

jhuebner said:


> Basically if you swap a phase, change motor direction, invert the current signal something changes in the transformation and you no longer get a DC value.


If you swap two phases, direction is reversed. Also in the axis system. How does this affect Clarke and Park? 

Well, you could work with negative angle values. A reversed rotational motion results in a minus sign for the angle. That's it. That is where the minus sign has to be placed.

*OR* 

Just swap two vector coordinates, i.e. [a b c] to [a c b], but then the stationary reference axis system has to stay unchanged. 
So it assumed that the Ialpha (Clarke output) axis and the Ia axis are the same and stay the same. 
And luckily, both the Ib and Ic axis can be mirror translated with respect to the Ialpha (Ia) axis. 
So: do NOT swap the coordinates that will be multiplied by 1 in the Clarke transformation, but the other ones that will be multiplied by the root values.

It has been a while since I have done some vector math. Please correct me if I am full of it.


----------



## jhuebner (Apr 30, 2010)

It sounds right and thats what I used to do. I had to change the signs for every inverter. Since it is a kit I cannot rely on "correct" sensor placement thats why I'm reluctant to use Park/Clarke.


----------



## gunnarhs (Apr 24, 2012)

jhuebner said:


> It sounds right and thats what I used to do. I had to change the signs for every inverter. Since it is a kit I cannot rely on "correct" sensor placement thats why I'm reluctant to use Park/Clarke.


OK this is exactly the problem with using the Park transformation it does work best for synchronous motors or stable mode (forcing constant slip for induction motor by controlling either speed OR torque). 

Better to work from the first step using only Clarke to create the two phase system (which is two sinus currents!! shifted by about 90 degrees). You have to use 3 sensors, one for for each current leg, and calculate the resulting two alpha / beta currents . One method to avoid the problem of the multiplying factors is to use your supply frequency as reference frame.

(Instead of the stationary frame (Phase A for example) or rotor frame which is same as Park Transformation in most examples)

The alpha and beta currents amplitude values (momentan or max-values over an short period) give you a better hint of your performance for a system based on V/f 
(provided you are in the right reference frame and have adapted / corrected to your slip algorithm ("the offset angle") and that you have fast microprocessor current calculation).

So input variables are DC Voltage, three measured currents (Ia,Ib,Ic), your given reference frequency f(set) and the measured rotor frequency from your encoder (frot)
(note that f(slip) is f(set) - f(rot).


----------



## Tony Bogs (Apr 12, 2014)

The position of the current sensors with respect to the stationary 3 axis reference system can be determined by software. 
Not that difficult. Run the routine every time the system is restarted in case the physical connections may have changed (DIY!).

Maybe I'll submit a post about the method in my SiC inverter thread.

Although Park gives d-q control, it still takes time to build up the magnetic field in an ACIM, Unlike the PM. Synchronous == PM, and stable mode == constant flux, or did you mean something else, gunnarhs?


----------



## gunnarhs (Apr 24, 2012)

Tony Bogs said:


> The position of the current sensors with respect to the stationary 3 axis reference system can be determined by software.
> Not that difficult. Run the routine every time the system is restarted in case the physical connections may have changed (DIY!).
> 
> Maybe I'll submit a post about the method in my SiC inverter thread.
> ...


Hi sorry for late reply. What I meant is that in a universal control system of an ACIM, which has only speed feedback of the rotor (not the position) , is not synchronously rotating, and slip might be varying, the rotor frame provided by a additional Park transformation will not do any improvement of finding the optimal I(d) and I(q) currents.
(For a synchronous machine, PM or not, Park transformation should be used, it works also fine for ACIM if you have a stable system with constant either speed or torque and for bigger ACIM encoder position feedback too).

The reason is that there are to many variables involved, for example you have to calculate the reference angle from the slip over time.The problem is to keep the reference angle calculation and the current model calculation working together (you have a calculated value as feedback input for another calculated value). In praxis this means that your Id and Iq currents will not be DC-values all the time.

The V/f(slip) control has the simplicity of just feeding back the rotor speed and command new Voltage and new f which sets both voltage AND slip. However if load changes quickly the reaction is change in slip (rotor speed) and we need to react again. So by measuring the current we have better information about the load situation and we can use this information directly for Sinusodial- or SVM - modulation, 
See an example here in http://ww1.microchip.com/downloads/en/AppNotes/01299A.pdf, the paper is titled for PMSM but I used it because of the good explanation of the modulation
I did long ago provide a code example for how to use this to "correct" V/f.
So the only use for a current model transformation (in this case only Clarke) is to give a hint about the power efficiency and the current overload situation (the code previously posted only shows the usage for over-current protection).
The advantage of this model is the simplicity of the current sensor setup and the current /power model calculation.
The drawback is the low speed or low load situation but here you would rely on the V/f (slip control) only.


----------



## jhuebner (Apr 30, 2010)

Some more hardware has arrived. Beefy 7A EiceDrivers driving 2 not so beefy 1200V/40A IGBTs (enough for the Polo though).

The Melexis current sensors are located on the other side under the AC bus bar and give reliable readings.

Can't wait to put it in place


----------



## jhuebner (Apr 30, 2010)

And a video on it: https://youtu.be/OnZ1STE4xfU


----------



## dcb (Dec 5, 2009)

That is coming together very nicely!


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Some more hardware has arrived. Beefy 7A EiceDrivers driving 2 not so beefy 1200V/40A IGBTs (enough for the Polo though).
> 
> The Melexis current sensors are located on the other side under the AC bus bar and give reliable readings.
> 
> Can't wait to put it in place


Very good, compact... 
I see you use melexis chips under AC bus. So if each phase would have such chip then there would be less need for desat. 
I must tell here that EVERY TIME i had IGBT pop it was the one without sensor on its line. I can deduce then that information about OClimit was sensed only after OC passed trough motor into sensor on the other side. By that tim OC had already overheated first IGBT.

Would it be possible to connect three sensors to have more protection or make a desat sensing in paralel with drivers? I can see new drivers pack a punch...

A


----------



## jhuebner (Apr 30, 2010)

Funny you say that, because:

We took the Polo apart yesterday. The diagnosis was good and bad. Good because we found a clear root cause for the break down, bad because it makes me look rather ignorant.

So the AC line filter I put in a few months ago was inside the main fuse box. And for whatever reason I hadn't considered it necessary to fix it in place  So the inductor could roam around freely in there and eventually touched the DC+ rail. So that injected DC+ through the rectifier straight into the phase output. As a consequence the rectifier died in a ball of fire (I suppose) leaving yellow smear throughout the case.

Next the IGBT was taken out, yes the one without current sensor. Next it was the drivers turn, apparently DC/DC converters operate on Maple sirup and that had all come out (pictures later).

So, we replaced the IGBT and driver, checked all phase outputs and gate drivers with the scope and it all went back into the car. Test drive ok, yay 

So, what can we learn? Don't leave stuff floating around freely. But actually we knew that before...


----------



## arber333 (Dec 13, 2010)

Today i was trying to calibrate minslip with ampmin so i could takeoff more softly. All the banging makes a clutch go at 50KKm...
Since my motor has longer rotor than normal motors of this size its starting torque is a monster. It feels most comfortable at 2.8Hz to 3Hz for start. And it likes 3% to 5% duty for start. This makes for a very springy car but such start is destroying the clutch springs. 

When i was experimenting with combinations with fweak also i saw settings group Automation. There are parameters for cruise and hillhold parameters. I tried to set hillhold to comfortable level to takeoff but at 800rpm and 30% amps all i got was jumpy car. 
Then i set max amps to really low value e.g. 15%. Rpm was 800 and damper at 0.12 and gain 5. That made no effect in automatic takeoff or hillhold, but i could feel difference with start. Car wouldnt just lurch anymore or bang at the clutch when throttle is released. Instead it would drive much smoother.

Downside is there is at least 380W (1A at 380Vdc) consumption when level but not holding brake. I imagine at 30V per phase for start that ammounts to some 12A on the motor coils when car is not moving. I dont think leaving energised car on handbrake for long is a good idea. Going to heat up motor eventually...

Try it motor now runs much smoothly.


----------



## jhuebner (Apr 30, 2010)

First test of the new inverter today. Back to the drawing board  While all went well with my 24V table motor it didn't in the car.

I tested with 2/3 of the pack, 370V.

Started right up after setting up the new voltage gain. Gently touched the throttle and 'blopp' the contactor dropped out - over current shut down.
Played with the limit a bit more, no change. Whenever the shutdown happened I lost communication for a split second. One time the motor at least made some noise before shutting down.
I increased the PWM frequency to 17.6kHz, intended to run at that frequency anyway. Touched the throttle, loud bang from the trunk. Not sure what it was but now I had 0V on my DC bus. Switched everything off and measured into the bus: <1 Ohm. Shit.
Removed the DC bus link and found the first phase board to be the culprit. One IGBT fell apart when I removed the cover, the other has an obvious crack. The remaining ones are also shorted out.

Maybe the gate resistors (4.7 each) are too low for these small IGBTs? Maybe it was something stupid again like the charge cable touching something it shouldn't.

Anyway will have to recover from this, then do further investigation.

EDIT: just checked, 4.7R is definitely below specification. Lowest value they specify is 10R. Could that explain it?


----------



## ALIE (Jan 28, 2015)

Hi Johannes
It happens in development.

Well, a little better news.
With that Chinese car we drive successfully (72V system)
It's difficult to move into the hill (only start from zero) because the gearbox has a transmission of 1: 7.3
When the engine develops 500 turns, it goes well.
I installed the infineon FF400R12KT3 IGBT I ocurlim at -700.
If I change the parameters for better response, the iverter turns off.
I find it's best to somehow change the ratio of the gearbox.
The electric motor is from TWIZY (gerbox chinese) and has original gear ratio of 1: 11.
But the car is driven.
You may have some idea.


----------



## dima (Dec 1, 2015)

Don't discourage Johannes. I've been following this new development to simplify and shrink the inverter with great interest! Hoping to use a small version in an e-bike - oversized bicycle with induction motor bolted to it


----------



## jackbauer (Jan 12, 2008)

At a guess it switched way too fast and overshot Vce max. Can you scope the Vce on the 24v test rig? I bet it has a nice big turn off spike.


----------



## arber333 (Dec 13, 2010)

Yes J 4R7 is too much for a single TO247 IGBT! I had this when trying to built small EMW charger for single phase only. Even then 10R is on the very limit of 40A IGBTs. I think problem is with ringing after transistor pulldown. GE voltage quickly goes beyond 18V. TVS diode can drain load for some time but eventually after an hour of 10A load every 40A transistor failed. 
Also you may have too small DC capacitance. Try to connect some elcaps with your setup.

Also with my setup i designed each of FGY160T65SPD_F085 transistors its own Rg of 10R despite datasheet 5R. 
Ideally i would use about 6R8 to open IGBT and 10R to close it, but i dont have the space on PCB. 

Also use desat.... DOH! No matter how cheap the driver setup, when unprotected IGBT fails zipper travels to its neighbour and kills it too + driver and possibly its PSU. Unless you have desat, then just the one IGBT fails and system recovers. Then you can still crawl home on 5 transistors. Been there too many times....


----------



## jhuebner (Apr 30, 2010)

Thanks everyone for the encouragement, well appreciated.

Will try higher values then. Wouldn't you usually turn on fast (low Rg) but turn off slow (higher Rg)? I have separate resistors for turn-on and turn-off.

So I think I will try 10 for turn on, 20 for turn off. Will scope with the current resistors once fixed.

I really want to get it working with the current capacity (240µF i.e. 80µF per phase). Adding external elcaps will complicate the design so I hope to get around it.

I found a broken 5V reg on phase board 3 so couldn't check drivers. Gate drivers on phase board 1 and 2 still produce a nice rectangle, might have survived. Isolator board and everything else is definitely ok.


----------



## [email protected] (Oct 6, 2017)

Hello all,

I am making an isolated Motor controller ,

I am struggling with the feed back circuitry for isolated voltage sense of 
phase voltages and the Bus voltage.

The non isolated version uses a voltage divider 

kindly help


----------



## jhuebner (Apr 30, 2010)

Despite not having measured the gate signal I do assume that my problem is ringing. It can be dampened with greater gate resistor.

Arber was right, turn-on resistor can be higher than turn-off resistor.

https://www.infineon.com/dgdl/Infin...N.pdf?fileId=5546d462518ffd8501523ee694b74f18

Also the series resistors between the digital isolator and the gate driver are 1k. That could allow EMC to couple into the control signal.

Will change these values and then test again.


----------



## Tony Bogs (Apr 12, 2014)

Yah, I think the gate resistor for turn-on might need to be quite high, because the Safe Operating Area of the trench IGBT is not a square.
The amp rating @ 370V is pretty low. Only ~23A if I have seen it correctly in figure 18.

May give issues with excessive losses.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> I really want to get it working with the current capacity (240µF i.e. 80µF per phase). Adding external elcaps will complicate the design so I hope to get around it.


Hmmm... i have done extensive driving tests using two different inverters on film caps only. Film caps are not by themselves enough. Only when i put enough elcaps in i got good response from desat circuit. 

I did drive some 5Kkm on film caps alone, but i could feel inverter straining. I could also hear my DCDC ringing when i operated like that.
In the end whole power stage failed without a sound. IGBTs failed open!

There has to be enough film caps to get a normal response from power stage and i think in volume is just about the same as elcap application. 

Also i put additional snubber cap on each transistor. Yes the second one! So with 2x 1.5uF on each IGBT i got infinitely better results while less elcaps than before. 
Might be that you will need just enough elcaps to have enough uF. I suggest to try with 2x 2200uF paralel elcaps just connected on +/-. Later you remove them and see result. 

A


----------



## arber333 (Dec 13, 2010)

I have been working on something for a long time now. Idea started when i read about Johannes inverter and Tumanako. 

Basically i got one 3phase 300A 650V IPM module 6MBP300RA060 
http://pdf.datasheetcatalog.com/datasheet/fuji/6MBP300RA060.pdf
http://www.fujielectric.com/product...bt/application/box/doc/pdf/RH983a/REH983a.pdf
I cant find it on Fuji site exactly so i leave the option of counterfit parts...

It looks like it has all the driver and signalling done inside on a chip. There is fault detection that includes SC, desat and UVLO as well as over temp protection. All those signals are run trough one pin. Rest are control pins for the module.

I made a board to interface Johannes controler brain directly. 
There are 4 DCDCs and optodrivers that separate singnals from GND plane. I choose Si8261BBC driver chips in SOIC case. 
Since all the power and complicated processes will run inside IPM parts count is really cheap. I estimate 40€ for BOM and 10€ for PCB. IPM module you can also get online... 
http://www.ebay.de/itm/1PCS-NEW-FUJI-IGBT-MODULE-6MBP300RA060-6MBP300RA-060/201763915841?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649

Should be a good inverter powerstage for not so demanding conversion. 300A and up to 400Vdc should give good power in a small package. Even 300A and 200V should run good, since this IGBT can sustain 600A for a short time when cool! I will experiment with it and report how it goes....


----------



## jhuebner (Apr 30, 2010)

Good addition to the ecosystem 

What exactly is a pre-driver? So you need to have your own gate driver or just isolated drive signals?


----------



## jhuebner (Apr 30, 2010)

So I scoped Vce of the bottom transistor (i.e. GND vs. L1) yellow and the DC bus voltage when the gate resistors are 4.7R. Then I swapped all resistors to 22R RGon and 15R RGoff. I'm not posting the scope plot as it looks pretty much exactly the same.

In both cases the DC bus shows some high frequency ringing (+-2V) and a positive spike of about 8V. Vce overshoots by 30V i.e. the spike is 70V for 40V bus voltage.

The overshoot get more pronounced as the current into the motor rises. The picture shows the overshoot at 20A rms into the motor.

Is that normal switching behaviour or does it point to a design problem?


----------



## Tony Bogs (Apr 12, 2014)

I have seen similar spikes with fast punch through IGBTs in one of my motor controllers. 

Placing snubber caps would have lowered the PWM frequency too much. 
An avalanche rated mosfet (gate shorted to source) in parallel with every IGBT solved the IGBT popcorn.
The connections between IGBT and mosfet were as short as possible.


----------



## jhuebner (Apr 30, 2010)

Wow, mosfet in parallel thats funky. Where did you find that? I'm not using punch through IGBTs though.

I observed something strange. I disconnected 2 modules to see the plain switching. Increased the deadtime to see it clearly. You can see both gate signals (directly on the pins) with respect to ground. C2 is low side, C1 high side - not grounded, forgot...

So you see even at 5V there is a small hump on the low side gate as the high side switches on. When I increase the voltage to 60V that hump reaches 5V which is above the threshold. I get 15mA cross conduction current.

I checked my other power stage with the generic driver and it didn't show this hump. There was 4mA cross conduction on that power stage. I guess there is always some?

So does the collector gate capacity cause this? What is going on? All supply voltages are stable with some +-200mV ringing.

EDIT: I read in some appnote that you shouldn't use the ground plane as the gate return to the driver. I did anyway because I thought the distance was short enough.


----------



## Tony Bogs (Apr 12, 2014)

I did not find the parallel mosfet solution anywhere. Funky? No way, I had to use IGBTs for the low Vcesat. Back then, that is, almost ten years ago. I'd go with mosfet now if I had to do it again. 
I know that you are using trench. Trench and PT are similar in a number of features. Both are fast, they don't avalanch nicely  and they have low Vcesat.



> So does the collector gate capacity cause this? What is going on?


The hump is probably caused by feedback collector > gate. The IGBT is a switching very fast plus inductive load, resulting in high dV/dt > high capacitive current feedback in gate resistor. Guess a bit of snubber might be helpful. The trench has a very low output c at higher Vce(~60pF). Image two does not have the Miller plateau on the high side, could mean that the anti-parallel diode is already conducting.

Tracks to the gate: keep them as short as possible and and lay out the return line from the Kelvin pin on the opposite side of the PCB (without intermediate layers of course).

Edit: Ok, wait, just read that Ch1 is low side, Ch2 is high side. No, the other way around. Hmm, maybe not the collector - gate C. Not enough data to be sure.The trench has a much higher output c at low Vce. Might have something to do with it.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Good addition to the ecosystem
> 
> What exactly is a pre-driver? So you need to have your own gate driver or just isolated drive signals?


Well its like this: You supply 4x isolated 15V DCDC PSUs and use 3dcs to provide power for upper transistor drivers. You use the last one, this is proportionally larger to provide power for lower drivers and fault logic. Since PSUs are isolated you then have to use opto isolator to carry signal to driver. It doesnt have to be power amp, it just has to translate 5V pulse to 15V.
In datasheet i see they use optos with 20K pullup resistor. That means inverted logic yes? I can see it is a failsafe thing. In case opto would die short, signal would pull transistor down. 
There you have it, signals and PSU for 50€. Everything with failsafe margin allready built in. 

Problem is it was built up to 420V max.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> So I scoped Vce of the bottom transistor (i.e. GND vs. L1) yellow and the DC bus voltage when the gate resistors are 4.7R. Then I swapped all resistors to 22R RGon and 15R RGoff. I'm not posting the scope plot as it looks pretty much exactly the same.
> 
> In both cases the DC bus shows some high frequency ringing (+-2V) and a positive spike of about 8V. Vce overshoots by 30V i.e. the spike is 70V for 40V bus voltage.
> 
> ...


I had the same spikes in my inverter without any elcaps. BUT i didnt use snubbers either. I got rid of them when i used normal snubbers AND elcaps. 
My point is try adding FAST snubber caps across +/- directly over halfh bridge.
I suggest later try to connect elcap to +/-. You should see the difference immediately. 

Also you can use TVS per gate to absorb spikes.
Hm... i dont see you use 10K decoupling resistor over GE...

EDIT:
I saw a design that puts 2x Rg in paralel with fast diode reversed, so that you use half resistance to turn gate on and only one resistor to turn off. Diode is blocking voltage in reverse. I have seen lots of UPS designs use this gate options with A3120 drivers up to 300A IGBTs.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> I had the same spikes in my inverter without any elcaps. BUT i didnt use snubbers either. I got rid of them when i used normal snubbers AND elcaps.
> My point is try adding FAST snubber caps across +/- directly over halfh bridge.
> I suggest later try to connect elcap to +/-. You should see the difference immediately.
> 
> ...


Yes thats two things I can at least try. It's going to be hard to put a capacitor even closer to +/- as the main capacitor is already just 2cm away. Will link an elcap to the bus but you can see the DC bus ringing is low anyway.
The EiceDriver has separated high and low outputs so the diode is not needed. I have separate resistors for turn off (15R) and on (22R). Also the Miller Clamp (aka TVS diode) and the pull-down resistor (aka 10k resistor) is integrated into the driver.


----------



## jhuebner (Apr 30, 2010)

Tony Bogs said:


> I did not find the parallel mosfet solution anywhere. Funky? No way, I had to use IGBTs for the low Vcesat. Back then, that is, almost ten years ago. I'd go with mosfet now if I had to do it again.
> I know that you are using trench. Trench and PT are similar in a number of features. Both are fast, they don't avalanch nicely  and they have low Vcesat.


So what sort of mosfet would I need in parallel? Small SOT23?



Tony Bogs said:


> The hump is probably caused by feedback collector > gate. The IGBT is a switching very fast plus inductive load, resulting in high dV/dt > high capacitive current feedback in gate resistor. Guess a bit of snubber might be helpful. The trench has a very low output c at higher Vce(~60pF). Image two does not have the Miller plateau on the high side, could mean that the anti-parallel diode is already conducting.


No inductive load on these images because I'm only operating one half-bridge. Anyway, what do you mean by "a bit of snubber might be helpful"? Across +/-? Would it help to further increase the turn-on resistance?



Tony Bogs said:


> Tracks to the gate: keep them as short as possible and and lay out the return line from the Kelvin pin on the opposite side of the PCB (without intermediate layers of course).
> 
> Edit: Ok, wait, just read that Ch1 is low side, Ch2 is high side. No, the other way around. Hmm, maybe not the collector - gate C. Not enough data to be sure.The trench has a much higher output c at low Vce. Might have something to do with it.


Yes, will have Kelvin connections on the next run.

Hopefully all this together will solve the problem.


----------



## Tony Bogs (Apr 12, 2014)

jhuebner said:


> So what sort of mosfet would I need in parallel? Small SOT23?
> <snip>
> No inductive load on these images because I'm only operating one half-bridge. Anyway, what do you mean by "a bit of snubber might be helpful"? Across +/-? Would it help to further increase the turn-on resistance?


Just my suggestions based on years of experience, app notes and some (scope) images: haven't seen a schematic. 
So it is for a significant part also a step in the dark. For instance, I assumed a motor as load in the latest scope images, but it turns out to be ohmic?

SOT23 probably not a good idea  as a snubber. More like :high amp / energy rated TO 247/264 and all other relevant specs have to match your application: dV/dt, Vdsmax, ...

Maybe pick another IGBT with a higher amo rating @ 370V in the Safe Operating Area?

The IGBT also has a very low parasitic output cap. An avalanche mosfet with a little bit higher Coss is placed in parallel, it also acts as a capacitive snubber. Lowers dV/dt, which is much easier on basically all parts including the motor windings. 

The 5V hump is less of a mystery (ohmic load) and so is the absence of a Miller plateau still (turn-on, high side): parasitic caps of the IGBT.

So higher gate resistors are not a good idea. You might even need a clamp output on the driver.


----------



## jhuebner (Apr 30, 2010)

So, apart from the power stage trouble there is some good news: the kit now includes the revision 2 mainboard.

It adds CAN communication, quadrature encoder support, IGBT driver fault signaling and some minor design improvements.

The CAN support is being worked on. Currently you can get/set all parameters using the CANOpen SDO method and you can map parameters/values to arbitrary CAN frames.

CAN throttle control and IO is not yet supported, I'll wait for some practical applications to spawn.


----------



## jhuebner (Apr 30, 2010)

Now, some more fault finding. I did a simple test where I put a transient on a single IGBT, i.e. 40V between E and C. The gate is connected to the emitter via a 22 Ohm resistor. The probe is between G and E.

So the 1200V part shows the very pronounced hump of 4V while it's only 2V on the 600V part.

I also checked on the running circuit that it's not an inductance issue. The hump is there on the gate pin and it's barely noticeable BEFORE the gate resistor. So the resistor (I've lowered it down to 10 Ohm) allows the Cgc capacity to build up 4V across G and E.

One obvious cure would be a negative gate drive on the low side. So I tried that. Biased the gate with -5V over the same 22 Ohm resistor.

Result looks promising, just a minor hump in the negative voltage.


----------



## Tony Bogs (Apr 12, 2014)

That is as clear as it can be.



jhuebner said:


> It adds CAN communication, quadrature encoder support, IGBT driver fault signaling and some minor design improvements.
> 
> The CAN support is being worked on. Currently you can get/set all parameters using the CANOpen SDO method and you can map parameters/values to arbitrary CAN frames.
> 
> CAN throttle control and IO is not yet supported, I'll wait for some practical applications to spawn.


Wow, that looks very promising. 

If fault signaling includes desat, it won't be of much use with 1200V trench IBGTs. I haven't seen one with a short circuit rating (SCSOA). 
There are 600V trench IBGTs that have a square FBSOA + RBSOA and a SCSOA rating. For instance the Infineon IRGP4063D (5usec SCSOA)
https://www.infineon.com/dgdl/irgp4063dpbf.pdf?fileId=5546d462533600a401535655ee0c2450.
It does need a mosfet clamp @370V: for instance two Onsemi FQA65N20 in series.
http://www.onsemi.com/pub/Collateral/FQA65N20-D.pdf

The Infineon IRG7PH46U (no anti-parallel diode) and Onsemi FDL100N50F (diode is here) look like they are a good 1200V match.


----------



## dima (Dec 1, 2015)

Very cool rev 2!

So did you put ATTiny on the main board for voltage detection? I assume revision 2 will only have the main and driver boards - no sensor board right?

Once driver boards are figured out will order one


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Now, some more fault finding. I did a simple test where I put a transient on a single IGBT, i.e. 40V between E and C. The gate is connected to the emitter via a 22 Ohm resistor. The probe is between G and E.
> 
> So the 1200V part shows the very pronounced hump of 4V while it's only 2V on the 600V part.
> 
> ...


Very good. Also i have seen a lot of driver designs use 10k resistor directly ON the GE contacts just before Rg. Obviously in-driver resistor is not effective when something happens between G and Rg. I think you should put one 10k resistor directly between G and E. Try this with your test setup and tell us the result. A


----------



## jhuebner (Apr 30, 2010)

dima said:


> Very cool rev 2!
> 
> So did you put ATTiny on the main board for voltage detection? I assume revision 2 will only have the main and driver boards - no sensor board right?
> 
> Once driver boards are figured out will order one


Seems I created some confusion here. So the Rev 2 main board is an evolution update. It does what Rev 1 did and adds CAN etc. So it's still the same basic layout with sensor board, main board, gate drivers.

On the other hand the new power stage integrates the current sensors and the isolator board integrates the voltage measurement. Thats when the sensor board becomes redundant.



arber333 said:


> Very good. Also i have seen a lot of driver designs use 10k resistor directly ON the GE contacts just before Rg. Obviously in-driver resistor is not effective when something happens between G and Rg. I think you should put one 10k resistor directly between G and E. Try this with your test setup and tell us the result. A


Yes that 10k resistor is supposed to keep the gate discharged on drivers that float their output when unpowered. I have done that on the A3120 gate drivers. As you noticed that is built into the EiceDriver. It wouldn't help the Cgc problem as not even a 22R resistor directly accross G-E can short that out as my test showed.


----------



## aeroscott (Jan 5, 2008)

is there any problem using this controller for a welding machine . The idea is to use the ev as a portable welder.


----------



## jhuebner (Apr 30, 2010)

If that means generating some 3, 2 or 1-phase sine wave I'd say yes.

Currently someone is trying to use the inverter as an offgrid battery inverter. Why not.


----------



## jhuebner (Apr 30, 2010)

The zip file on my website now contains a new firmware and web interface.
Here are some key features
- Support of quadrature encoders with optional index signal
- Better debouncing algorithm for single channel encoders
- Inverter can launch into a running motor
- Added udcofs parameter support analog isolator chip
- Added CANOpen SDO style parameter messages (documentation to be done)
- Added arbitrary mapping of values to CAN messages, supported via web interface
- Miscellaneous Tesla board things

There are now 2 firmware images as there are minor deviations between the REV1 and REV2 main board. There will be a third image for the Tesla board.
Improvements apply to all images as they share the same code.


----------



## aeroscott (Jan 5, 2008)

Thanks for your response, I just bought a 200amp inverter about $1000 . It will tig ac,dc,pulsed and stick .
Talked with a welding repair tek today the Miller Dyinisty $3000 to 4000 the state of the art for small portable tig inverter s.
He said the welding company's are just now working on combining mig (wire feed constant voltage ) with the stick/tig units(constant current ) 
I will ask him if I can feed these inverter welder's with 300=400 volt dc battery power.
I looked at your kit and it said 400 amp and 1200 volt max . I have some 600amp 1200volt igbt's and 6 1000 amp 1200 volt units . Is there a limit on the driver's power that make these units incompatible with your kit.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> The zip file on my website now contains a new firmware and web interface.
> Here are some key features
> - Support of quadrature encoders with optional index signal
> - Better debouncing algorithm for single channel encoders
> ...


I have tested new code and i can attest it works very good on old main board. I had some instances when inverter threw OClimit due to low setting. I was able to restart my inverter while driving at 100km/h EVERY TIME! I did use clutch to decouple motor from transmission, but i think it works even without this feature. 
I have yet to test this on new revision of main board since i use my car every day . 
I did notice however that my web interface doesnt get data every time i have inverter started. I have to reload page a lot. But connection works when i order some parameter.

I have a plan to make inverter with 300A IPM module and driver interface so that everything we would need would be 
1. main board pcb
2. sensor board
3. cheap driver interface since IPM has drivers inside

I think i will use air cooling for this one with 24V fans because of their speed and i can use 24V as supply also due to converter chip already present .

Johannes you said you use some new version of sensor interface. I am interested in seeing that in action. Since melexis chips would be a cheap alternative to LEM sensors.
Would two melexis chips on parallel phase lines 10cm apart interfere with current reading from each other? What is the distance from conduit you use them on?

tnx

A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Johannes you said you use some new version of sensor interface. I am interested in seeing that in action. Since melexis chips would be a cheap alternative to LEM sensors.
> Would two melexis chips on parallel phase lines 10cm apart interfere with current reading from each other? What is the distance from conduit you use them on?


So far I'm impressed with the Melexis chips. Here you see it mounted about 3mm away from the bus bar (5mm stud - chip height). Gives me 9 digits/A. 800A LEM sensors are more like 2 digit/A.
Didn't see any interference.


----------



## jackbauer (Jan 12, 2008)

Has anyone installed the pc software on a windoze machine? If so any pointers?


----------



## jhuebner (Apr 30, 2010)

What PC software?


----------



## jackbauer (Jan 12, 2008)

The webserver for the inverter


----------



## jhuebner (Apr 30, 2010)

It has a readme file:

```
On Windows you need an apache+php stack. For example Easyphp (www.easyphp.org).
In addition you need the php_dio library:
http://windows.php.net/downloads/pecl/releases/dio/0.0.7/php_dio-0.0.7-5.4-ts-vc9-x86.zip

Unpack the contents of the zipfile to your easyphp installation, typically:
c:\Program Files (x86)\EasyPHP-DevServer-13.1VC9\binaries\php\php_runningversion\ext\
(Don't copy and paste, as you'll have a different version of EasyPHP!)

Open the file
c:\Program Files (x86)\EasyPHP-DevServer-13.1VC9\binaries\conf_files\php.ini

and find the line that reads "extension=php_bz2.dll"
Add a new line:
extension=php_dio.dll

Now unpack the web interface to

c:\Program Files (x86)\EasyPHP-DevServer-13.1VC9\data\localweb\inverter

and start EasyPHP.

Navigate to localhost/inverter and you should see the web interface.
```
That said, try to grab exactly the mentioned versions, as php_dio and the php version must match.


----------



## dima (Dec 1, 2015)

jhuebner said:


> What PC software?


Damien might be referring to "the beautiful" interface. Yes it went through many revisions and more less stable for PC.


----------



## jackbauer (Jan 12, 2008)

It is very nice but sadly won't connect on any of my pcs.


----------



## jhuebner (Apr 30, 2010)

After much begging from Arber I added a new parameter called udcnom 

It is used to scale fweak and boost as the actual DC voltage changes. So when DC voltage is above udcnom fweak is increased and boost decreased proportionally.

The resulting new values can be seen at fweakcalc and boostcalc.

If udcnom=0 the old behavior will apply, i.e. no scaling with DC voltage


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> After much begging from Arber I added a new parameter called udcnom
> 
> It is used to scale fweak and boost as the actual DC voltage changes. So when DC voltage is above udcnom fweak is increased and boost decreased proportionally.
> 
> ...


Being persistent is what i call it .

Anyway the instant i got new software i put it in and set it by my calculation of a motor. 

Difference is night and day! When i had fixed fweak i had to set it to nominal voltage that i calculated for motor/battery 360Vdc. That means for 40% of driving this setting was wrong. That was seen in take off with SOC 80% when motor would jump and then loose power for an instant before settling on some power setting. If i tried this fweak at SOC 30% motor was very sluggish.

Now i can take off and torque is constant up to actual fweak point.

Boost setting is not noticed as much. I have to pass some level so desat doesnt notice IGBT ramp and it works in a broad spectrum. 

Hidden benefit now is regen is somewhat constant value that depends only on RPM. Whereas before regen was limited by actual voltage.

I tried to play with fweak and udcnom setting along the voltage line. I can see this applies even if i would have too small Udc for a motor. So even industrial motors could be used with 400Vdc and lower fweak.

A


----------



## aeroscott (Jan 5, 2008)

Can 2 controllers be run in almost parallel so the switching is shared ie;one pulse from one and the next from the other, to cut the switching times by 2X.
Weberauto on youtube just did a video on the chevy volt inverter which is 2 very high power inverters 1000 amps and 650 volts/unit.
Just reread pages 20 threw 29 on this thread ,great stuff.


----------



## arber333 (Dec 13, 2010)

While resolving some issues with one inverter we saw something which may interest you all. 
First we had trouble with inverter constantly dropping one or more phases. We blamed it on drivers, then on IGBT, on encoder... In the end we were out of options since on desk all those things worked good. 

Then we tried and put heat on components while PWM was in operation. First drivers, then main board. The instant we started to heat Olimex chip PWM dropped out! We measured °C with laser temp and got 42°C. We tried several times. Each time chip dropped out above 40°C. 
When querried, error reporting stated "inverter overvoltage error". 

We replaced chip with a spare and heat this one. It held above 60°C and PWM was steady. It is still spitting out PWM for 20 hours now. 

I also replaced one Olimex when it started to throw OC limit into the blue with no power applied.
I think that probably we would have to think about looking for a replacement for STM32H103 chip with a SIL chip in the future. What do you think Johannes? Would it be possible to port the code to STM32F4 SIL chip?


----------



## jhuebner (Apr 30, 2010)

Do you think the STM32 is the problem or could it also be the 3.3V voltage regulator?
Because spurious over voltage error could mean the ADC ref dips. Would you mind measuring the 3.3V line on your faulty board?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Do you think the STM32 is the problem or could it also be the 3.3V voltage regulator?
> Because spurious over voltage error could mean the ADC ref dips. Would you mind measuring the 3.3V line on your faulty board?


Yes i think that could also be it, but we also checked system with FLIR camera and since we heated up only the chip we concluded some internal instability over 42°C. 
I dont think he has the system back in a car just yet. We will try with the regulator again. It is the lm1117 sot23 transistor like thing near the USB port yes? 

A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> It is the lm1117 sot23 transistor like thing near the USB port yes?


Yes I think so. What would be interesting to know is the voltage while in "fail-state" you described.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Yes I think so. What would be interesting to know is the voltage while in "fail-state" you described.


I checked only supply voltage Vin and it was 4.98V so that wasnt a problem. We had scope connected to driver PWM inputs, so i could see distortion in PWM function as chip grew hotter. Finally it stopped PWM but not whole operation. Interface stated inverter as "off" but reported "overvoltage error". Voltage sense pin wasnt connected, i only faked 220V so it would work on desk...
When i put Olimex in reset it wouldnt start PWM if it was over 42°C however. Will try to measure 3V supply next time.

A


----------



## Tony Bogs (Apr 12, 2014)

My Olimex board has a LM1117 chip from an unknown manufacturer (at elast for me). 
The original National Semiconductor LM1117 (yes, I still have a 2 inch thick NS datasheet book from the 70/80's) has stability issues with low ESR output caps.

If I remember correctly, I am reaching a certain age, the Olimex board has low ESR caps, but they might be OK with the obscure LM1117 copy.


----------



## ALIE (Jan 28, 2015)

Hi Johannes!
I've uploaded last code for version 1 and I found a bug.
If you push the pedal to have the engine running and pressing the brake, the engine turns up a lot.
This could be dangerous.
I am pleased with the smooth operation.
Regards Ales


----------



## jhuebner (Apr 30, 2010)

So you press gas & brake at the same time? Then motor spins up?

Will test in my car later, of course the brake pedal is supposed to have priority.


----------



## ALIE (Jan 28, 2015)

first press the gas motor running abaut 500rpm
then simultaneously press the brake pedal 
motor accelerates


----------



## jhuebner (Apr 30, 2010)

Yep, can confirm it, thats horrible. Fill fix it asap


----------



## jhuebner (Apr 30, 2010)

Throttle problem fixed. Updated zip file and git. New version is 3.43.
Also some more tweaking of single channel encoder debounce


----------



## jackbauer (Jan 12, 2008)

Just linking to a post on the Tesla thread about wifi access for the inverter :
http://www.diyelectriccar.com/forums/showpost.php?p=930282&postcount=290


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> Just linking to a post on the Tesla thread about wifi access for the inverter :
> http://www.diyelectriccar.com/forums/showpost.php?p=930282&postcount=290


Good idea! 

I also have RS232 BMS that transmitts cell values in real time.
And i use EMW charger that actually sends all its data to RS232 and in turn expects instruction through RS232 as well.

All this could be linked inside RaspPI and sent online (GPRS or LTE) to some SQL database. There one could have access to all information of the car.
Some tables could be edited and some just read...

I just dont have enough of me to learn programming and implement this. Maybe i should clone myself....

A


----------



## jhuebner (Apr 30, 2010)

Yes, thats a brilliant idea! Just yesterday I exchanged like 10 emails with a guy who had no clue about linux and thus couldn't get the web interface to run. The web interface is often a support burden.

So replacing the 3€ USB/TTL converter by a 11€ Pi Zero W sounds like a bargain.

Actually I'm doing something similar in my car with a BeagleBone. It does the web interface and BMS.

EDIT: Just found the gadget driver works on Pi Zero as well. It allows to tunnel ethernet over the USB port. So if someone doesn't want to use wifi they can always fall back to that.


----------



## jackbauer (Jan 12, 2008)

Turns out what stopped me the last time is the Pi installs php under the "www-data" user name. Which of course I hadn't added to dialup! After that the server to inverter interface came right up. Then I just followed a tutorial to configure the Pi as an access point. Tested with both USB uart and on board Uart.


----------



## jackbauer (Jan 12, 2008)

Here is a demo of some car hacking over wifi using the pi to bridge wifi to serial on the inverter. https://youtu.be/25HzGP2PnOE


----------



## dima (Dec 1, 2015)

I started a raspberry pi project for Dash (same idea for web interface) but just don't have time to work on it.


https://github.com/poofik/Huebner-Inverter-RaspberryDash/blob/master/setup




> sudo chown www-data:www-data /var/www
> sudo chmod 755 /var/www
> sudo adduser www-data pi





> ls -la /dev/ttyAMA0
> sudo systemctl mask [email protected]e
> sudo usermod -a -G dialout www-data


----------



## jackbauer (Jan 12, 2008)

dima said:


> I started a raspberry pi project for Dash (same idea for web interface) but just don't have time to work on it.


Now that is very cool. Well done


----------



## jhuebner (Apr 30, 2010)

good stuff!

Are you powering the Pi over Olimex 3.3V or vice versa?


----------



## jhuebner (Apr 30, 2010)

Finally I could test the new power boards with -5V low side gate turn-off voltage.

I think the scope images speak for themselves 

DC bus voltage is 60V output is loaded with a small 100µ inductor between output and GND


----------



## jackbauer (Jan 12, 2008)

Don't like that miller knee on the second photo. Can you measure it?


----------



## jhuebner (Apr 30, 2010)

Yes, the Miller plateau is 112ns long. I have a very high gate turn-on resistor to reduce ringing, it's 22 Ohms. Would you suggest using a lower value?

10 Ohms is the lowest gate resistor specified in the datasheet. I use 10 Ohms for turn-off.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Yes, the Miller plateau is 112ns long. I have a very high gate turn-on resistor to reduce ringing, it's 22 Ohms. Would you suggest using a lower value?
> 
> 10 Ohms is the lowest gate resistor specified in the datasheet. I use 10 Ohms for turn-off.


Can you try and connect fast snubber cap to DC rail of IGBT? Just to try the difference. Maybe use some brass washers to provide better surface? 
Like i said i had much ringing with desat tripping on start. When i added 1.5uF snubbers across DC link ringing went down audibly and desat would trip later. When i added large elcaps instead of film caps i could pull full amps on takeoff. Try adding some large cap there.

You could add 2x 17V 2W zeners back to back on GE so they would drain excess voltage when ringing occurs. 

EDIT: What abour adding a 1R resistor from - pole of film capacitor to actual - of the system. That would make some form of snubber circuit.

A


----------



## chentron (Nov 13, 2017)

Hi to all.
I received the kit from Johannes. 
My electronics is very limited and will be a big help if somebody can answer two questions:
This part is the first time I see  . Could You confirm pin 1 is in the left side ? 











I am also planning what capacitors to choose. I see some people is using film cap + snubber. Other Elcap + snubber. Film cap are really expensive !!
I found some good deals and want your advice what could be a good choice.
option 1: 2 units *EPCOS (TDK) B43456A9158M000 + snubbers

https://www.digikey.com/product-detail/en/epcos-tdk/B43456A9158M000/495-4235-ND/2269444

or 

option 2: 1 unit FFLI6U0437K-- - CAPACITOR PP FILM PP, 430UF, 10%, 1.15KV + snubbers*

http://es.farnell.com/avx/ffli6u0437k/capacitor-pp-film-pp-430uf-10/dp/1867543

option 2 is really big cap, 85x180 and 1.3kg so I like better option 1. 

or maybe none of this is good option... I am hearing your conseil.

thanks


----------



## ALIE (Jan 28, 2015)

3 pcs
http://si.farnell.com/epcos/b43713a9228m000/cap-alu-elec-2200uf-400v-screw/dp/2750378
3pcs
http://si.farnell.com/epcos/b32656s0155k561/cap-film-pp-1-5uf-1kv/dp/1200819
3 pcs IGBT 
https://www.ebay.com/itm/New-Infine...991798?hash=item3af8e700f6:g:iQQAAOSw3jBZlGeF

The configuration, of course, depends on the volts and power you want to use.
I have 192V and about 50KW peak power.

But for resisting a decade, I do not know the answer, somebody else will tell you


----------



## ALIE (Jan 28, 2015)

3 pcs


----------



## jhuebner (Apr 30, 2010)

chentron said:


> Hi to all.
> I received the kit from Johannes.
> My electronics is very limited and will be a big help if somebody can answer two questions:
> This part is the first time I see  . Could You confirm pin 1 is in the left side ?


Yes pin 1 is where the small round dot is.


----------



## chentron (Nov 13, 2017)

thanks.
I finish to solder the components. I power on the mainboard and the web inside is answering correctly.
I am now buying other parts, if it can help to other people : 
precharge relay:
https://www.mouser.es/Search/Produc...Wvirtualkey52910000virtualkey817-FTR-J2AK012W
precharge resistor:
https://www.mouser.es/Search/ProductDetail.aspx?R=HPC5C560Kvirtualkey66000000virtualkey660-HPC5C560K
snubber cap:
https://www.mouser.es/Search/Produc...irtualkey64600000virtualkey80-C4BSNBX4200ZBLJ

I dont see in Johannes web how do i charge the batteries. I found the section
http://johanneshuebner.com/quickcms/index.html?en_battery-charging,27.html
After reading, nothing is clear to me. I dont know if I can plug a 230VAC or if I must plug a source from a 12VDC and where do I plug.
Could somebody explain with easy languaje for dummy, the steps to get charging and If I need to buy additional parts ?


----------



## jhuebner (Apr 30, 2010)

Snubber is good, any relay is fine, maybe a socketed relay is easier to handle.
The resistor has to be quite substantial because it has to handle short bursts. I found using small ones worked for a few months then they burned out. Try that: https://www.digikey.de/product-deta...-passive-product/HSA2550RJ/A103853-ND/2731204

Charging: I did my best explaining so I guess someone else must chime in 
You add a rectifier and some switches. In the diagram the turquoise wires are grid AC.


----------



## jhuebner (Apr 30, 2010)

I had Arber over this weekend and while having a fun weekend he also brought along a small BLDC motor. BLDC is almost like PMSM and runs fine on 3-phase AC. He also brought a pretty slick encoder that outputs a quadrature signal and an index pulse.

So now I'm finally able to tune the PMSM algorithms.

Video is currently uploading: https://youtu.be/Lt689ATDTnQ

The algorithm basically reads the rotor position and adds a constant offset of about 90°. Torque is controlled by the sine amplitude.

I also have a theory what "field weakening" means in the physical world: while you want the stator field to lead the rotor field by 90° in normal operation, it has to be more like 70° in field weakening mode. Basically the closer you move to the stator field the higher the motor can spin.

One lesson learned is that the index pulse interrupt must have absolute top priority. Unfortunately the timer can not hardware-reset in quadrature mode.


----------



## jackbauer (Jan 12, 2008)

So does this mean I can run my BMW i3 motor ?


----------



## jhuebner (Apr 30, 2010)

I think so 

Just some small issues to resolve, like forward/backward is still a little weird and I'm not sure if regen is really feeding back power.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> I think so
> 
> Just some small issues to resolve, like forward/backward is still a little weird and I'm not sure if regen is really feeding back power.


Would it help if you got larger BLDC motor? Maybe problem is start current skew, when torque is not 90deg offset.


----------



## lastcyrol (Dec 12, 2015)

jhuebner said:


> ...I also have a theory what "field weakening" means in the physical world: while you want the stator field to lead the rotor field by 90° in normal operation, it has to be more like 70° in field weakening mode. Basically the closer you move to the stator field the higher the motor can spin...


Could you share some more thoughts on this topic, please!

Because I have always thought that field weakening is implemented by advancing the stator field even more. That way the stator field will have a chance to build up before the rotor pole goes by and induces a reverse voltage that will resist the stator coil current.


----------



## jhuebner (Apr 30, 2010)

I will have to investigate further, maybe you're right. Currently I'm on to other things, namely the new power stage design.

I tested in the car today and results were better than last time. Motor spins up ok with both 8.8 and 17.6kHz PWM frequency. 

I think because I haven't installed proper shielding the encoder signal was pretty disturbed so the car isn't drivable yet. It moves but with a lot of rocking back and forth.

So will work on the shielding and see if I can get it running before Christmas.


----------



## jackbauer (Jan 12, 2008)

I have setup a Github repo for the WiFi adapter :
https://github.com/damienmaguire/Inverter-WiFi

Any contributions or modifications can go in there to keep things tidy.


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> I have setup a Github repo for the WiFi adapter :
> https://github.com/damienmaguire/Inverter-WiFi
> 
> Any contributions or modifications can go in there to keep things tidy.


I tried this on my inverter brain and it works! It is so easy that it is strange we didnt do this before. 

I tried it on different devices with wifi enabled:
tabletop win 10
laptop win 7
laptop linux
5" phone android

a friend also should be able to try it with 7" winxp slate in his car

I noticed one fact! If i use old R1 board i can directly connect RaspPi W pins 6, 8, 10 (gnd,rx,tx) to JP7 or JP6, no +3V3 supply required. Former connection also leaves JP6 ready for serial connection in case of programming. R2 board has only JP6 to connect and it works good. 
Is there somewhere on RaspPi to connect 5V from main board? So we wouldnt have to power it from USB connector.

There is another question now. Could the web interface be optimised for phone screens? To condense view to 5" display on options that can be changed.

A


----------



## jackbauer (Jan 12, 2008)

Pin 2 and 4 on the Zero W can take 5v input. Great work Arber  I think this is a major leap forward as it removes the largest support headache with the inverter.


----------



## jackbauer (Jan 12, 2008)

Would be great if we could use it for firmware updates also.


----------



## jackbauer (Jan 12, 2008)

No problem running from the inverter 5v supply. Takes about 100mA when booting then settles to about 50-60mA running. Also works perfectly on a generic android tablet.


----------



## jhuebner (Apr 30, 2010)

Yes will se about the firmware updates this week. In fact I think Dimas frontend already supports upgrading?
Maybe it would be worthwhile to extend JP6 to 5 pins. Like GND, RX, RX, 3V3, 5V.

Now on to todays tests. I have moved most of the Polos signals to the superseal connector. Not so easy because of the variety of wire thicknesses.

I then found two design glitches: the ULN2003 has integrated freewheeling diodes all tied to pin 9. I connected it to the 12V input which does make sense. But if you're contactors happen to be connected to a permanent 12V source, current will make it's way through the diodes and half power on the inverter. That can lead to really strange effects. So, if the contactors are not on the same 12V source as the inverter you'll need to cut pin 9 of the ULN2003 and take care of freewheeling yourself.
Next glitch is on the not yet public isolator board: It ties the UVLO pin to 5V on a non-5V tolerant pin. Thankfully that did not lead to destruction of the STM32 but through the ESD diode it raises the supply voltage to 4V! Not good either. So I cut that pin as well.

I also installed a push-pull optical encoder but it needs more mechanical adjustment to work good I think. It conks out at higher speeds.

So I did some simple open-loop tests instead, 3Hz, 50% amplitude. Then came the bang and a cloud of smoke and the inverter looked like below.

Not sure what happened here but it seems the AC line filter which is supposed to be passive in inverter mode was not so passive after all. The trace towards the rectifier vaporized so for some reason current must have gone through it. The "epicenter" is the screw clamp, that even vaporized some of the heatsink below it.

One high side IGBT lost 2 legs, only the gate pin left. The one parallel to it might even still work, will see tomorrow. The drivers and the digital isolator are gone as well. All else is good including the other phase boards.


----------



## jackbauer (Jan 12, 2008)

I might see if I can get the Dima frontend running on the Pi. I think it only gives instructions on firmware updates though. Could be wrong as I never got it to run

If you are working with power electronics and have never blown something up you have never worked with power electronics


----------



## jhuebner (Apr 30, 2010)

Yeah I'm getting my share now  I never killed an IGBT module in the former inverter in normal operation. But now I kill lots  Thankfully it's just 5€ IGBTs that I'm testing with.

I have a theory on what might have happened: maybe the rectifier diodes are too slow to cope with the extreme dv/dt of the phase output and decided to conduct when they shouldn't?


----------



## jhuebner (Apr 30, 2010)

Hmm it's a the GBJ2006TB with an RMS reverse voltage of 420V, 600V peak. That might be the reason


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> Pin 2 and 4 on the Zero W can take 5v input. Great work Arber  I think this is a major leap forward as it removes the largest support headache with the inverter.


Very good! I tried and Pi booted up. I got tone and ...
I think i will make a serial connector with 5V from the side. That way everything will fit. No unneccessary wires. 

Slowly rolling forward with my Skyper 32 driver interface... Everything works up to GE outputs. I have to check why i dont get signal. I think i saw an error in my interface board. I didnt connect HALT INPUT and HALT OUTPUT. must have made error in designspark... Will drill out this board and provide some wires .

A


----------



## jhuebner (Apr 30, 2010)

Finally, success with the new power stage 
https://www.youtube.com/watch?v=w0Vdx2hPjh8

Longer test drive tbd


----------



## jackbauer (Jan 12, 2008)

Very nice work I have found the ABZ encoder mode on the Tesla motor makes so much difference when starting from a standstill or even driving forward while rolling back. No judderring or jerking at all.


----------



## jhuebner (Apr 30, 2010)

Good to hear it works well.
I should consider putting in another encoder with a phase shift as startup is were I get over current events.


----------



## jhuebner (Apr 30, 2010)

So since weather was friendly today I decided to bolt the inverter in place and do an actual test drive.
I ascended the small slop in front of my house a couple of times. Even just that quickly heated up the IGBTs to 50°C pretty quickly. The heatsink didn't seem to sink much of that heat it was warm to the touch, I suppose 20-25°C.

So far, so worrying.

Anyway I drove a bit further while using second gear for going up hill. That went well. I accelerated up to 60 in 3rd and then went back up to my house up hill, still in 3rd. Just as I was passing a pedestrian - BANG! You can see the steep temperature slope shortly before the current drops to 0.

Turns out my EMI shield shields particles as well 

So I definitely have to do something about heat sinking. Maybe replace the aluminum bars by copper ones? Any ideas?


----------



## jackbauer (Jan 12, 2008)

That's actually a very positive result. Believe it or not it proves your power stage works electrically. Had it been doing something stupid like shoot through or missfiring it would have blown instantly (don't ask me how I know!). I would consider liquid cooling. I know it's a pain but the gain is huge


----------



## jhuebner (Apr 30, 2010)

Thanks, good way to look at it 

Yes I have considered liquid cooling, but then 50% of almost-breakdowns of my Diesel car were caused by the cooling system. Broken pipes, broken pump and right now leaking radiator.

I think if I can actually transport the heat to the heat sink quickly, it'll be fine. I also consider a redesign were the IGBTs are so low down that I don't need some intermediate piece.

After all the old power stage worked brilliantly just air cooled - without even using a blower.


----------



## arber333 (Dec 13, 2010)

I saw the same result with my TO247 charger. I only gave it 20A to chew on but whatever i did it blew IGBT in 15min just after it changed tone. Remember i used 12kHz. I also used air cooling... 

So i would recommend water cooling block with 1mm recess cut for IGBT placement and a clamp to hold them down much like you have now. A clamp doesnt need to go trough IGBT center...

Though i seriously think those 40A IGBTs are worth up to 20A in the real automotive world. We have to solve the core issue here. Not just remove heat. 
1. I think two of IGBTs are too close together to dissipate heat.
2. Copper under DC and AC outputs is too thin and is probably heating up IGBT contacts. Remember heat transfers and moves towards greatest sink... that are IGBTs. I suggest adding copper sheet under/over DC link PCB plating and soldering IGBT to this sheet directly while leaving holes to separate opposite connection. I would only use PCB traces for gate signaling.
The same with phase connection. I would put copper sheet there and solder only correct legs, rest i would drill out and separate with pressed silk or other isolator. 
3. Also i think you should add more capacitance to DC rail. You can try next time, just add one large cap you have to +/-.

A


----------



## jhuebner (Apr 30, 2010)

Yes, moving the IGBTs further apart should certainly help.

About the PCB heating I did some measurements and math, see attachment
So the total heat dissipated by the PCB at 100A would be
(500 µΩ + 563 µΩ + 375µΩ + 437µΩ) * 100A² = 18.75W

EDIT: the PCBs only have 35µm copper layer, right? So with the proper size of 70µm or 105µm the resistance is 1/3.

At the same time 2 IGBTs combined are dissipating 2V*100A=200W (+ switching losses) either at high or low side. So only 9% of heat come from the traces.

I think working on the AC output could be worthwhile (as in replacing it with a copper sheet or something), as it generates heat very close to the IGBTs. The DC bus has a lot of area for dissipation.

I think the main task is to remove those 200W from the IGBTs themselves. 

I deliberately chose small IGBTs to find the limits. That said, stronger parts would generate the same amount of heat as Vce is always around 2V.


----------



## Tony Bogs (Apr 12, 2014)

Air cooled, 50W per package is the rule of thumb for a TO247 and similar packages.
35 micron on a 2 layer PCB is usually not enough for power devices when currents exceed 20Arms.

I have a sheet of 300 micron Cu ready for lamination in my 100kW+ inverter build. 
The final bus bar will have layers of 500 micron epoxy glass sheet and 300 micron Cu sheet.


----------



## dima (Dec 1, 2015)

Interface is mobile ready. Happy New year!


----------



## jackbauer (Jan 12, 2008)

Dima, I'd really like to use your interface but I have never been able to make it connect to an inverter board. Tried Linux (Ubuntu), Windoze and RaspberryPi. Heubner interface works fine so it's not server or permission related. Could you help? I'd really like to use it on the Pi.


----------



## jackbauer (Jan 12, 2008)

This is what I get when running the heubner inverter.sh script. Buttons greyed out. Same on RasPi.

Get this error on the terminal : stty: 'standard input': Inappropriate ioctl for device

So I changed the -f switch to -F which gets rid of this error but still no communication with the inverter. On occasion when I have been playing with it I get the display to come up and warn me of the dangers of high voltage but still no communication with the inverter.

In all cases when I dump the Heubner interface into /var/www/html it pops straight up. Leads me to think the Dima interface needs more library support but I am struggling to understand.


----------



## dima (Dec 1, 2015)

Seems stty -F does not do its job (some linux distros use -f ) sometimes works sometimes doesn't. Raspberry Pi ttyAMA0 worked but not with ttyUSB0 - permission issue (dialout group) or driver lock.

This is a fix for now.


```
minicom -b 115200 -o -D /dev/ttyUSB0 &
killall minicom
```


----------



## jackbauer (Jan 12, 2008)

Ok so right now I have it running on then Pi but still not connecting to serial. either Pi onboard serial or USB0. If I deliberately use a non present serial device then the webpage loads fine but obviously does not connect. If I use a working serial device it partially loads and locks on a white screen.


----------



## chentron (Nov 13, 2017)

Now I close to understand how the batt charges.
but have a question: which component is limiting the amperes charge ?






chentron said:


> thanks.
> 
> I dont see in Johannes web how do i charge the batteries. I found the section
> http://johanneshuebner.com/quickcms/index.html?en_battery-charging,27.html
> ...


----------



## jackbauer (Jan 12, 2008)

This is as far as i get when using Pi serial0 or usb.


----------



## jackbauer (Jan 12, 2008)

chentron said:


> Now I close to understand how the batt charges.
> but have a question: which component is limiting the amperes charge ?


The pwm duty cycle of the IGBT.


----------



## dima (Dec 1, 2015)

jackbauer said:


> This is as far as i get when using Pi serial0 or usb.


you are running php as pi try as www-data


```
sudo usermod -a -G dialout www-data
sudo -u www-data php -S 0.0.0.0:8080 -t /var/www/html/
```


----------



## jackbauer (Jan 12, 2008)

Gave that a try. New error in the picture.


----------



## chentron (Nov 13, 2017)

I am sure your answer has a sense but I dont know how to translate this info to the amperes that will charge my IGBT semikron SKM400GB126D (470 A at 25º)

I was trying to decide which bridge rectifier to buy for charger circuit. candidate was a 50 amperes unit. 
I dont want charge more than 20 amperes/hour in AC, ... could this rectifier be the limit for charge ? 




jackbauer said:


> The pwm duty cycle of the IGBT.


----------



## kennybobby (Aug 10, 2012)

This is not likely the right thread for charger info, but language translation may be a factor. here is the pilot signal, that is the pwm duty cycle chart vs charge current in amps. Thru this signal, the EVSE tells the charger how much current is available.


----------



## jackbauer (Jan 12, 2008)

You can set the desired charge current on the web interface when connected to the inverter.


----------



## jackbauer (Jan 12, 2008)

Dima wrote an excellent setup script to install the interface on a RaspberryPi. I tested it today with a pi3 and usb interface. Worked well on desktop , tablet and phone when running firefox. Would not work on Android phone or tablet browser but fine on firefox. 

Tried to change to onboard serial and then the fun started. The Pi3 and Zero W have made a real mess of the serial ports with bluetooth. The default serial0 device is a software serial port which has some limitations but it worked well with the Heubner interface. Not so with Dima's version. So I went through the procedure to disable bluetooth and make the hardware serial port accessible on the pin header. I can honestly say I have pulled out what few hairs I have left. For some reason it decided the port should now be owned by root not tty. Fought through that and got it kinda working but it hangs after fetching the firmware version.

I'm getting too old for this shot.


----------



## jackbauer (Jan 12, 2008)

For some reason /dev/ttyAMA0 is changing from the dialout group to tty and can not be accessed. Anyway, it seems the interface is too heavy for the RPI Zero W.


----------



## jhuebner (Apr 30, 2010)

Just glad you guys are taking care of this  Good job so far anyway.

Had some new thoughts on thermal management. I think I will use two individual copper bricks under highside and lowside IGBTs, respectively. No electrical isolation there. Electrically isolating TIMs (thermal interface material) tend to have worse thermal conductivity then non-isolating ones. So I'm trying to maximize the area to compensate for that. Here's one that looks promising: https://www.digikey.com/product-det...ermal-materials/A14692-30/926-1157-ND/2445486

After all even Pentium 4 CPUs were air cooled and dissipated up to 115W on a similar area. So not quite giving up on air cooling just yet.


----------



## jackbauer (Jan 12, 2008)

One thing I will say about liquid cooling in evs is it gets nowhere near the temps and pressures of engine cooling. Never had a leak in 4 years of driving the E39. Coolant rarely sees 20C unless it's a warm day and works at atmospheric pressure.

Regards the web interface I'm leaving it for a while. I don't think the Pi has the horsepower to run Dima's version.


----------



## jhuebner (Apr 30, 2010)

Thats a good point, will consider it.

I will put more work in the "Huebner" interface then.


----------



## jackbauer (Jan 12, 2008)

jhuebner said:


> I will put more work in the "Huebner" interface then.


i have a little surprise on the way


----------



## jackbauer (Jan 12, 2008)

Sneak preview


----------



## jackbauer (Jan 12, 2008)

Can someone with a working inverter give this a test for me? 
https://github.com/damienmaguire/Tesla-Drive-Unit/blob/master/interface_dash_test_v1.zip

just go to localhost/index3.php

Works on my desktop pc so far but I'm not able to test for changing values from the inverter.


----------



## jackbauer (Jan 12, 2008)

Up and running on the Pi Zero W and Android tablet


----------



## jhuebner (Apr 30, 2010)

Wow thats cool  Do you mind if I integrate your work using tchart? Just for the matter of sticking to one charting component?


----------



## jackbauer (Jan 12, 2008)

jhuebner said:


> Wow thats cool  Do you mind if I integrate your work using tchart? Just for the matter of sticking to one charting component?


Sure I think I screwed up the refresh somewhere. It pulls the data from the inverter when the page loads and I thought I had it refreshing every 5 seconds but I'm not sure it's actually doing it. Need to test in the car next week.


----------



## jhuebner (Apr 30, 2010)

Web interface update round 1: firmware update now possible 
It uses the exisiting update.py script but I've added a single step mode to it. That way you get some feedback during the update.

Please test
http://johanneshuebner.com/quickcms/files/inverter.zip


----------



## jackbauer (Jan 12, 2008)

No luck with the Pi as yet. Naturally it's missing python-serial


----------



## jhuebner (Apr 30, 2010)

Yes, you would need that.
Round 2 update: gauges included 

They update at fastest possible speed of 115200 comms.
While using gauges you can't do anything else comms wise


----------



## jackbauer (Jan 12, 2008)

I'm loving the gauges Much better than mine. Just need to get a nice background going!

Got python serial sorted and I can run the update from the command line on the Pi no issues but when run from update.php the led stops flashing on the inverter and the progress bar stays at 0%. Will try from the laptop on usb to see if it's a pi problem.


----------



## jackbauer (Jan 12, 2008)

Removing -s $step from the call to updater.py and it runs on the Pi but obviously no progress bar. Will investigate further.


----------



## dima (Dec 1, 2015)

Pure php version https://github.com/poofik/Huebner-Inverter/blob/master/Web/firmware.php

... and progress on gauges https://poofik.github.io/Huebner-Inverter-RaspberryDash/index.html


----------



## jhuebner (Apr 30, 2010)

Weird, runs all the way through from PC. Steps until there:

1. send "reset\r"
2. Wait for "S" (send size)
3. Send number of pages (1 byte)
4. Wait for "P" (send page)

What happened to me on step 3 was that the uploaded file could not be read and size sent was 0. In that case the P is never sent and the script locks up.


----------



## jhuebner (Apr 30, 2010)

dima said:


> Pure php version https://github.com/poofik/Huebner-Inverter/blob/master/Web/firmware.php
> 
> ... and progress on gauges https://poofik.github.io/Huebner-Inverter-RaspberryDash/index.html


Certainly more beautiful again 

Some comments on firmware.php:
- Some time back I added the "T" reply to the boot loader. It is issued when the page is not sent in time. Please check updater.py on how to handle it.
- Unify indentations 

Certainly better to to it in php directly. I remembered not getting it to work so stuck to python. Good job you did it


----------



## jackbauer (Jan 12, 2008)

Wow. Can't wait to get this stuff running


----------



## jackbauer (Jan 12, 2008)

Still struggling with the Dima interface. Something is messing the permissions on the pi serial ports


----------



## jhuebner (Apr 30, 2010)

So "tty" only has write permissions on ttyAMA0 aka serial0. Strangest thing.

Tried that?
https://raspberrypi.stackexchange.com/questions/48211/set-permission-for-dev-ttyama0-on-boot


----------



## jackbauer (Jan 12, 2008)

That got the permissions back for ttyAMA0 but still can't connect with a terminal (screwed up output) or with the interface (hangs on loading the main page). Maybe the Pi zero W can't handle it?


----------



## jackbauer (Jan 12, 2008)

For the fun of it I put Dima's dashboard into /var/www/html

Looks great Now if I can just get it to play nice over serial ....


----------



## jhuebner (Apr 30, 2010)

New kits on the way!
Just in the progress of ordering material for 50 more kits.

I have completely reworked the sensor board:
- 1 voltage sense board with Si8920 iso opamp and dc/dc (much like Damien approach)
- 2 Melexis boards that are fixed to the phase output cables with a cable tie and can be padded with some plastic to adjust the current scale.

I do consider replacing the USB/TTL adapter by a Pi Zero but I haven't found a Pi Zero source that accepts bulk orders. Any hints?

With the Pi Zero kit price would stay the same, without it 10€ less than now.


----------



## jhuebner (Apr 30, 2010)

Maybe there is an even cheaper way to add wifi connectivity. One of the many ESP32 variants, for example this: https://www.olimex.com/Products/IoT/MOD-WIFI-ESP8266/open-source-hardware

Anyone ever done a web interface on one of these?


----------



## jackbauer (Jan 12, 2008)

I have emailed RS and Farnell about a bulk buy of the Pi zero w. Should not be too hard to find especially as schools seem to use them a lot.


----------



## jackbauer (Jan 12, 2008)

Aliexpress is another option :
https://www.aliexpress.com/wholesal...80107033058&SearchText=raspberry+pi+zero+wifi


----------



## Arlo (Dec 27, 2009)

Banggood?

https://www.banggood.com/Raspberry-...-p-1204454.html?rmmds=search&cur_warehouse=CN


----------



## ALIE (Jan 28, 2015)

http://www.en.galagomarket.com//item/display/1790/5136_raspberry-pi_raspberry-pi_raspberry-pi-zero-w.

I ordered my Resbbery here.
Call the phone maybe sell them more than one


----------



## Tony Bogs (Apr 12, 2014)

Did U DOO some connectivity team work here on a Pi? 
Certainly looks that way. Great!


----------



## jhuebner (Apr 30, 2010)

Implemented some of the web interface on a 5€ ESP8266 board 

Getting and setting values works like before, now have to see about plot, gauges and update. It has 1M of user flash so all the js files should fit.

The firmware is a simple gateway arduino script that passes through commands to the inverter (and returns their response). It's based on the FSBrowser example so updating the web interface is just a matter of some simple http commands.
It can start up in access point mode and can be reconfigured to join an existing network via web interface. Not done that yet but there's examples for it.

It's cheaper, smaller and easier to obtain than the Pi so I'll be shipping that with future kits instead of the USB<->TTL adapter.


----------



## dima (Dec 1, 2015)

Very interesting ...so there is no PHP? it just passes the commands with http/ajax?


----------



## jhuebner (Apr 30, 2010)

Yes exactly, most logic is now shifted to javascript.
Of course it could be done in C++ but thats more cumbersome. Also the binary is harder to upgrade than the js/html files.

The js/html/png etc. files reside on a small file system on flash. They can be updated with a simple POST command. I think even the form for upgrading firmware will do just that.

If you want you can try porting your interface. The firmware-update code will be in C++. I will put the ino sketch into git once it's finished.


----------



## jhuebner (Apr 30, 2010)

Some more hardware experiments with this isolator: https://www.digikey.de/product-deta...ermal-materials/A14692-30/926-1157-ND/2445486

It's some phase change material on a Kapton film.

Thermally I'm now very pleased, heat now transfers almost immediately to the heat sink.

But because the isolator is so thin it gets punctured very easily and then no longer isolates. Even if it isolates at first, as soon as I heat stuff up and the phase change material melts I get isolation break down. Still have to work on that.


----------



## jhuebner (Apr 30, 2010)

And heres a lab update video: https://youtu.be/Jd1rXaZKTbk


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> And heres a lab update video: https://youtu.be/Jd1rXaZKTbk


Wow! I didnt know you could update software through wifi! Thats brilliant. 

I really enjoy running inverter through my phone now. I still have it connected to 25V to test desat and higher functions, but that should be really nice interface. 
Those dials will make life easier on people with CAN dashboards.

Since charger will run on your core also i will try to use this gizmo to control it through phone also.


----------



## arber333 (Dec 13, 2010)

Hah....


Yesterday i tested R2 PCB with AB encoder on my motor and it ran good. Precise motor control. Very smooth.
It helped that i extensively used new RaspPi with my phone as web interface and it never ever failed as was the case with TTL cable. 


Whats more i used drivers Semicron Skyper 32 Pro. Officially you get them for some 80€, but you can get them on ebay for a lot less. For some 150€ total they are very close to Damiens driver but have a lot more features. You just have to make an interface board for them. I did it and it works. I just have to correct some basic errors on my part and i will put design rev. 2 available here and on this forum. 
They are supposedly able to run IGBTs up to 20kHz at 16A!!! For me it will be enough if they manage to run my IGBTs at 17kHz. 
For now i tested them at 8kHz with motor in neutral. 
I also tested I/Os of the new R2 board. They work good. 

About the only thing that was giving me problems was precharge. I use 150R. Should give 2s precharge. When it operated everything seemed fine, except voltage rose at slow 2V/s!!! 
When i measured resistance across EV200 contactor i got 500K!!! So i went and checked everything there. Sure, my trusted AEV52012 relay is welded to 500K. How is that possible? I think i found root cause of my blown IGBT, DOH!

Johannes what do you use for precharge @500V? I need to get my car on the road fast!!!


----------



## jhuebner (Apr 30, 2010)

I use this
https://www.reichelt.de/Koppelrelai...623&artnr=FIN+58.P3.9+12V&SEARCH=koppelrelais

and a 11W wire-wound 120Ohm resistor.

EDIT: I only have 840µF bus caps, if you use multiple 1000µ elcaps you want a 50W resistor (tested with charger)


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> I use this
> https://www.reichelt.de/Koppelrelai...623&artnr=FIN+58.P3.9+12V&SEARCH=koppelrelais
> 
> and a 11W wire-wound 120Ohm resistor.
> ...


I figured that out yesterday. I tried to force 150R 20W ceramic resistor to carry 1kW load to 6600uF caps. Of course it burned out!!! Yes, i made a mistake when calculating capacitance....
I will use 470R or 330R as before as it can withstand this load for quite some time. It means i will have to wait 4s for precharge to finish, but even modern EVs need 5s to start computers. They show you fancy annimations but behind this something is trying to initialise. 

EDIT: I have 6600uF this is why 150R 20W was toast LOL! Yes 470R 20W resistor now works good. I get 300V in 3s and up to 360V in 4s. It is enough for me. I have to put everything together now...

I got one 24Vac 16A relay now and to my surprise it seems to draw even less current as 12V relais. I think i will keep it .


----------



## jhuebner (Apr 30, 2010)

Some news from the follow up kit.

You can see the new Melexis-based current sensor board. It's fixed to your output busbar (extra isolation plastic needed) or cable. It's a lot more compact and cheaper than the Tamura/LEM sensors.

The voltage/temp sense board has been split off and is now based on an analog isolator Si8920. Unfortunately I bought the wrong pinout opamp and there is a glitch on the temp sense section. I'll get new opamps but keep the boards and write an errata on how to fix the temp sense issue.

Last but not least I sort of bought into Dimas idea of having a stream command.

stream 100 il1,il2

Will get 100 samples of il1 and il2 and dump them on the serial port as fast as possible. Format is
10.00,12.00\r\n
11.00,9.00\r\n
So one comma separated line for each sample.

You can see the plot of a 50Hz sine wave now actually looks like a sine wave.


----------



## jhuebner (Apr 30, 2010)

Video about the new kit:





It's on sale now.


----------



## PStechPaul (May 1, 2012)

Those are some nice products. For the current sensor, I see you are using the Melexis 91210 which is about $4:

https://www.digikey.com/product-det...-CAS-102-SP/MLX91210KDC-CAS-102-SP-ND/6173906

A cheaper alternative might be the TI DRV5053 which is about $1:

https://www.digikey.com/product-detail/en/texas-instruments/DRV5053CAQLPGM/296-40053-ND/5177930

I like the Si8920 analog isolator. Not bad for about $4. If you only need unipolar DC high side measurement, there is the HV7801 for about $0.66:

https://www.digikey.com/product-detail/en/microchip-technology/HV7801K1-G/HV7801K1-GCT-ND/7065563


----------



## jhuebner (Apr 30, 2010)

Wow nice, should have consulted you earlier  At least that DRV5053 seems like a really good replacement and isn't SMT. Oh well, will be on the next run.

I don't think the HV7801 is an appropriate replacement as it's not galvanically isolated. Though I do like their supply voltage range. Was thinking about replacing that 5V DC/DC by some resistors and a Zener to power the Si8920 directly from bus voltage. But then it seemed the power resistor would cost more than the DC/DC. Any ideas?


----------



## PStechPaul (May 1, 2012)

Depends on how you are using the Si8920. For bus current you might be able to use the high side IGBT power supply. 

To read phase current, you will need isolation, but maybe you can use the DRV5053 or the Melexis magnetic sensor for those.

For bus voltage, you can just use a differential amplifier with resistors high enough in value to be almost as good as isolation at a fraction of the cost. Something like 1 megOhm would only be a leakage path of 300 uA on a 300V bus. The RECOM DC-DC has a capacitance as high as 75 pF, which is 35 megOhms at 60 Hz, but at a PWM carrier frequency of 15 kHz it drops to 141k or as much as 2 mA leakage.

You might also consider using a cheap common mode choke for a DC-DC converter. The Si8920 supply current is only about 5 mA, so you may be able to drive it with PWM directly from a pair of PIC output pins.


----------



## [email protected] (Oct 6, 2017)

hello all,

Kindly suggest the changes required in the code 
inorder to adapt it for a pmsm motor.


Thanks and regards


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Some news from the follow up kit.
> 
> You can see the new Melexis-based current sensor board. It's fixed to your output busbar (extra isolation plastic needed) or cable. It's a lot more compact and cheaper than the Tamura/LEM sensors.
> 
> ...


Nice revision of your kit. 
Since Melexis chips are so low cost i would like to suggest another board for melexis chip, this time with a small comparator onboard. Maybe small AT or PIC chip. Current would be sensed as usual, but for this third melexis chip comparator would trigger on preset overcurrent condition and send signal directly to FAULT pin thus stopping PWM. Should replace short circuit protection and to some extent even desat condition monitoring. But only if all phases were protected.
Should work with all mainboards. You could also use this third sensor board as an interface for other inputs if needed. As long as comparator has free pins available.

EDIT: Hey can your new interface with top buttons be used with new firmware directly? Like with TTL cable or is just for WiFi module?


----------



## arber333 (Dec 13, 2010)

Hi Johannes


I finally got all IGBTs home. I assembled it together and now inverter works on manual and on throttle command with 25V. Current draw is reasonable.

I use new Revision 2 board with rev. 3 sensor board. I made driver interface board and i am using skyper32pro drivers. Firmware is for Rev2. Wifi interface is such a relief, i no longer have to rely on TTL and Linux.

Wifi even works trough sheet metal covering and car hood! And i just use my phone and configure inverter.

But wait! While inverter works with V/Hz on manual, i could only get encoder working on "single" channel setting. ABZ mode is causing motor to strain, but no movement. 
I did populate all channels for ABZ like from the plans. I am using AB induction pickup encoder with toothed wheel 64teeth and on scope i see it work. 
Should i delete Z channel components for AB channels to work together?
Any suggestions? What does the code says?

A


----------



## jackbauer (Jan 12, 2008)

Did you try swapping the A and B channels? Don't forget that AB mode now gives the cpu direction. If the motor is turning forward but the encoder says it's going in reverse then it won't run. Don't ask me how i know


----------



## arber333 (Dec 13, 2010)

DOH! If this is the only thing to do, i feel very lucky. I havent tried to swap them back since direction is now good. I will just try and change A and B. Hope that would be it...


----------



## jhuebner (Apr 30, 2010)

I've been in touch with people using Damiens Tesla version of the logic board. In the process I was sent a logic board that does not have a silk screen and thus no copyright message on it. 
Apparently some polish guy is selling Damiens design. Thats ok, thats how open source works. But omitting the copyright message is certainly not how it works.

Also the situation is a different now then it was when I started this thread. I was purely working away on a controller that I used for my own fun and decided to make it public. Nowadays I'm explicitly developing things that I will not use myself. To keep motivated I at least need to be able to cover my expenses and cover for my support time at a reasonable rate.

For the reasons stated I have now decided to take the board designs offline and not publish new ones. This does not affect the schematic screen shots as they are essential for working with the kit. It also does not affect Damiens designs, thats purely his decision.

I hope my reasoning is logical and does not put anyone off.


----------



## Kevin Sharpe (Jul 4, 2011)

jhuebner said:


> I hope my reasoning is logical and does not put anyone off.


It is and it doesn't... thanks for everything you've done todate


----------



## dima (Dec 1, 2015)

jhuebner said:


> For the reasons stated I have now decided to take the board designs offline and not publish new ones.


''

Nooo ...It is such a rare and incredible project! Mr. Nikola Tesla would be proud. 

Life is sad - but there are still creative people who still care, just watch the "starman"


----------



## jhuebner (Apr 30, 2010)

Thanks Kevin.

No worries, I'm not stopping the project. It's far too exciting 

I just evaluated the situation and found it is time to make adjustments to stay motivated. Who is "starman"?


----------



## JRP3 (Mar 7, 2008)




----------



## arber333 (Dec 13, 2010)

Well first i will comment on the fraud committed there. I could recognize error if you make your own boards and omit designer statement that is on the board YOU use. However to SELL the PCB publicly i should think this is something else. Problem potentially arises is something goes wrong and this seller is stupid enough to point to Johannes direction... conclude Johannes reaction yourself...

@Jhuebner & Jackbauer
I did switch channels AB to BA and true enough i got full power at start! Very good. I just need a new pipe adapter from 3/8" to 1/2" to be able to use new water cooling arrangement.

I did notice something strange. My RPM goes up to 4500rpm and stays there. My limit for fmax is 200Hz. Am i missing something?
My A channel of encoder used 64 pulses from single channel A. Now that i use AB encoder what should i set? How does your encoder count pulses? Does it count each rise/fall step or just the rise trough 1.8V?
Should i set count to 128 or 256 then? 

tnx

Arber


----------



## jhuebner (Apr 30, 2010)

Yeah I'm still struggling what to conclude. Should a few be able to ruin it for everybody? What are my motives to go partly closed source apart from this?

Anyway...
You can leave pulses at 64, it is converted to 4x internally in ABZ mode.
Apart from that the ABZ code is kind of new, is there a way to confirm the speed info is correct? 4500rpm is more like 150Hz, right?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> You can leave pulses at 64, it is converted to 4x internally in ABZ mode.
> Apart from that the ABZ code is kind of new, is there a way to confirm the speed info is correct? 4500rpm is more like 150Hz, right?


Well i was so happy for motor to be spinning in force and car to be moving again so i forgot to try to record the interface. I got the RPM info from my rpm indicator which is isolated from inverter. It works with old car spark plug count. 
Since tomorrow i will work on my cooling system and then i will be able to drive and record actual Hz.

EDIT: Curiosity wouldnt let me sleep so i went and started the car. I fed it throttle slowly and surprise: i got to 6000rpm! So this thing works. I can get a steady stream of Hz. However when i tried to put more than 3000pt throttle suddenly rpm went from 6000 to 4500! EMI playing with me? I tried several times and it happened at various throttle values somewhere around 3000pt to 3500pt. It seemed like i have problem with throttle ground reference? I couldnt try further because inverter gets hot fast since there is nothing under IGBTs. I have to bring water to them and then i can try as i like. But why would it drop to 4500rpm or 140Hz every time? Is there a default value for this in the code? 

A


----------



## jhuebner (Apr 30, 2010)

hmm, post a parameter dump...
At what value of potnom do you get this?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> hmm, post a parameter dump...
> At what value of potnom do you get this?


I will post today when i do the cooling system.
Usually i press throttle slowly from 1000pt to full at 4090pt and unloaded motor responds and goes to 6000rpm. But when throttle is at 3000pt or something more motor qiockly jumps from 6000rpm to 4500rpm and holds there at steady speed! I confirmed this with interface, it jumps from 200Hz to 140Hz. 

I have nothing set for 140Hz, my fweak is at 170Hz and i dont yet use voltage adapt option.

Today i will be able to make a prolonged test on the road. Maybe i will have to equalise GND connections in car!? 
I see this as ground reference problem. But why return to 140Hz every time? 

A


----------



## jhuebner (Apr 30, 2010)

is fslipmax < fslipmin?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> is fslipmax < fslipmin?


fslipmax = 2.78
fslipmin = 5.59

So i dont see a problem. Attached is my snapshot...


----------



## jhuebner (Apr 30, 2010)

Parameters look ok (you've swapped min/max in your post). All I can say is that at 3000 the amplitude has reached it's full value and the slip starts to increase when you go further. Can you confirm that?. For some reason that seems to brake your motor. Hope that helps.

There is certainly no constant of 140Hz anywhere.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Parameters look ok (you've swapped min/max in your post). All I can say is that at 3000 the amplitude has reached it's full value and the slip starts to increase when you go further. Can you confirm that?. For some reason that seems to brake your motor. Hope that helps.
> 
> There is certainly no constant of 140Hz anywhere.


Hm... so it could just be EMI of unloaded motor. I will have to go on the road to see that, it is a torque mode after all. 

To think of it now... my inverter sits in chassis on rubber blocks that suppose to isolate vibrations, but they isolate electricity too! I will add one cable to the case so it can be on the same potential as chassis. 
Encoder has shielded cable, i also used some shielding for DC cables and phase cables are twisted. 

A


----------



## arber333 (Dec 13, 2010)

Yup! I made my water hose connections and run the inverter. It worked. I could use throttle and reach 6000rpm. But after some pedal travel RPM is reduced to 4500rpm 140Hz. If i reduced throttle inverter offered 6000rpm 200Hz back.

Sooo... i connected my laptop and made some graphs of throttle travel vs motor speed. Sure enough over 2900pt of throttle i got only 140Hz. This Wifi thing is just so easy now...

Then i considered what i havent changed yet. Well i havent touched the voltage adapting parameters. So i tried to set udcnom 330V as i calculate my motor was wound for. Since then my motor is turning under full speed, no restrictions. 

This must have been something inside code that was calculating final Hz output. When i satisfied input it worked. 

I didnt go for a drive though since snow is falling and inverter cover is not done yet. Wouldnt want to get water inside...


----------



## arber333 (Dec 13, 2010)

How can i raise the inverter frequency? Do i just change parameter in web interface or is there some procedure involved?

My Skyper 32 drivers now have a capacity for 15A peak so they should be ok with 4A output at higher frequency. For supply i am using stable 15V 3A source with plenty of capacitance. 
I would like to try 17kHz.

tnx


----------



## jhuebner (Apr 30, 2010)

Set pwmfrq to 0 (integer) or 17.6kHz respectively


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Set pwmfrq to 0 (integer) or 17.6kHz respectively


I tried that but my sistem refused to accept it and throttle travel didnt do anything. All drivers are linked so if there would be a problem one fault triggers faults on all driver boards. 
Well i will try again with saving to flash and resetting the power. If no I guess i am stuck at 9kHz then...

A


----------



## jhuebner (Apr 30, 2010)

Oh, yes of course... The parameter takes effect on the next restart of the PWM. So you could "stop" and then trigger again with keyswitch or like you say, save to flash and restart.


----------



## jhuebner (Apr 30, 2010)

Haha, first results with the Leaf inverter. Simpler than I thought!

Video is still uploading and I'm about to leave, so look here in an hour or so:
https://youtu.be/9qZQ0X7KdMA

EDIT: Are there any teardown videos on youtube? Couldn't find any...


----------



## jackbauer (Jan 12, 2008)

I can't wait to see this


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Haha, first results with the Leaf inverter. Simpler than I thought!
> 
> Video is still uploading and I'm about to leave, so look here in an hour or so:
> https://youtu.be/9qZQ0X7KdMA
> ...


Which model LEAF you have?
Here is one video
https://www.youtube.com/watch?v=4GG3QRPGlPc
https://www.youtube.com/watch?v=8OBHiTLkANc

And components torn down from a perfectly good LEAF
https://www.marklines.com/en/report/rep1049_201202

It goes to part 2 and part 3
https://www.marklines.com/en/report/rep1104_201209
https://www.marklines.com/en/report/rep1119_201211

A


----------



## Boxster-warp (Jun 22, 2014)

Hello
Johannes when you Need a leaf BMS fore testing, i have One.

The Nissan Leaf Motor inverter is a good Option.
In Germany is the Tesla drivetrain Not so easy with TÜV.

I think the Leaf ore the BMW i3 Motor is better.
Build on the Original gearbox and ready 

Greetings and good Luck fore the Projekt Boxster-Warp


----------



## jhuebner (Apr 30, 2010)

Ok, video is up now.

@arber I meant inverter teardown Jack Bauer style  "This is dc bus voltage, this is fault feedback" and so on. If there isn't one, I'll make it 

@Boxter: maybe that would be good for ckidder, inspecting a BMS will overload me 
The Leaf inverter offers a lot of space for control board retrofitting. even the 2-story through hole board should fit in. I don't think I'll make a custom logic board, maybe a simple adapter board though. But for now it's time to get that sync motor running reliably.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Ok, video is up now.
> 
> @arber I meant inverter teardown Jack Bauer style  "This is dc bus voltage, this is fault feedback" and so on. If there isn't one, I'll make it
> 
> ...


Here is Leaf inverter CAN control.  How much Jack Bauer does it have to get?
http://www.mynissanleaf.com/viewtopic.php?f=44&t=25027
http://mynissanleaf.com/viewtopic.php?f=44&t=25027&start=10
http://productions.8dromeda.net/c55-lea ... tocol.html

EDIT: But i would rather be able to drive PM motors using your inverter mainboard directly. Gives us greater options.
Since my ampera inverter driver board works with 5V signal. I could just make an adapter board and supply 3V3 signal directly (inverted) adding pullup to 5V. The way i see this i could use V3 sensor board directly. Connecting current sensors to available slots. I would have to use additional temperature sensor, but maybe you could include one of 3x Ampera temp sensors in your code. Interface even has fault line, but i havent been able to determine if it works open collector or push pull.

Here a guy is showing his Leaf inverter insides:
https://endless-sphere.com/forums/v...354786&hilit=lebowski+motor+inverter#p1354786

And differences from rev.1 to rev.2 inverter
http://saegtl.org/ev/data/uploads/ev-content/gtlev_tp_2014-01-1879.pdf

A


----------



## zippy500 (Apr 3, 2017)

Are there any "how to" guides to building a power stage .

Thanks


----------



## arber333 (Dec 13, 2010)

Aaaand at last i have made working Rev2 inverter. It works very good with my ACIM currently on 380Vdc. My car went 110km/h last night . 

Now would be the time to try leaf motor with ABZ sensor like i gave you last time. Aleš made for me one mount for the magnet at the rear of the shaft. Above that we made another mount that puts encoder PCB in center. With that i can simply put 3 phase cables to inverter in my mazda and one 5pin cable for encoder connection.

Software is setup for PMSM now? I just enable syncmode parameter yes?
How then i determine syncofs parameter? Is there an equasion to determine this?. I have offset from Pauls inverter and on the motor case there are hex markings underneath. They suppose to determine offset for Nissan inverter.

A


----------



## arber333 (Dec 13, 2010)

zippy500 said:


> Are there any "how to" guides to building a power stage .
> 
> Thanks


Check this:
http://www.instructables.com/id/200kW-AC-Motor-Controller-for-Electric-Car/

this:
http://johanneshuebner.com/quickcms/index.html%3Fen_inverter-kit,10.html

or this: 
https://endless-sphere.com/forums/viewtopic.php?f=30&t=57877

If you can read schematic, i suggest you buy one honda IMA inverter or Prius inverter dissassemble it and trace its functions. They are relatively cheap and can be controlled with diferent interfaces. 
You have idea what motor to run with it?

EDIT: I no longer recommend building DIY inverter for a drivable car. If that is the purpose I think better alternative is to get a used inverter and replace its brain. This would actually be cheaper and faster on the road. But if you want to learn yourself on the inverter insides, then go ahead, build one. But expect occasional lightning and smoke $$$.


----------



## zippy500 (Apr 3, 2017)

arber333 said:


> EDIT: I no longer recommend building DIY inverter for a drivable car. If that is the purpose I think better alternative is to get a used inverter and replace its brain. This would actually be cheaper and faster on the road. But if you want to learn yourself on the inverter insides, then go ahead, build one. But expect occasional lightning and smoke $$$.



I want to convert my classic car, eventually I want use a Leaf motor with johannes controller board when its perfected.

Your Edit quote has left me with concerns now, this is just a fun project for me and do have a strong interest in EV its just my electronic knowledge is limited but i am keen to learn.

I am happy to read up on anything anyone recommends


----------



## arber333 (Dec 13, 2010)

zippy500 said:


> I want to convert my classic car, eventually I want use a Leaf motor with johannes controller board when its perfected.
> 
> Your Edit quote has left me with concerns now, this is just a fun project for me and do have a strong interest in EV its just my electronic knowledge is limited but i am keen to learn.
> 
> I am happy to read up on anything anyone recommends


Yes, i meant if you like to thinker with electronics then go ahead, have fun... destroy some IGBTs and learn plenty in the process... First use second hand stuff untill you get sure of yourself. Costs less $$$. It was fun for me. Power electronics are like an addiction! 

But if your intention is to assemble the EV and use it every day for a prime mover, then i suggest you stick to an established vendors that have quick support and are built with no thinkering allowed. I tried to have both and it worked... until it didnt. Quite frustrating discovering what i should have known not to do... But fun nontheless when i got things moving again. So now i try to share what i learned. 

One truth to me is evident. Today there is so much EV inverters in scrapyards that it simply isnt worth it to spend $$$ on building your power stage design. Some production plant has allredy made it cheaper, more powerful and with correct safeties in mind. I can never make a power stage as good as Delco or other firms. What is left for us tinkerers to do is make our logic boards and use the functions that are built in those power stages... hear my ranting... 

Well i found with Ampera/Volt i got for 300€ not one powerstage but 3!!! One PS A, PS B and a PS for oil pump inside transmission (or is it AC compressor?). If i use only one PS i get 500A(1000A) 400V drive ready to obey my command. If i had one small gas engine i could use the second logic board to drive the PS B in regen mode with some generator. 
I dont consider yet to use the third PS yet, but it could easily drive Prius AC compressor.... Building 3x PS would mean extra $$$ and development for me, investment in time i dont have. 
Lets rather concentrate on how to run them motors...

end of rant!


----------



## zippy500 (Apr 3, 2017)

many thanks for the reply,

I completely agree with you, but wannabees like me dont have the skill set to reverse engineer a production invertor to fit a logic board. I would love to be able to do that.

All I can do is wait till a logic is made to fit the nissan leaf invertor.

No pressure Johannes


----------



## arber333 (Dec 13, 2010)

Hahaha!

I just saw Paul Holmes made dual logic board for Ampera/Volt inverter! Great minds do think alike. I may try his design if it is complete package. Probably it would be the quickest way to run the motor. 
However it would be a drop in part, so i could still make my own logic board someday and put it in... or test Johanness board.
https://www.youtube.com/watch?v=wol8Uck_C1A

A


----------



## jhuebner (Apr 30, 2010)

Actually the purpose of the donation was merely to have a testbed for the sync motor control. I'm not planning to do a custom Leaf logic board, I will just hook up the generic one.

I will document the process in case anyone wants to repeat in order to have analog controls and more power from the motor.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Actually the purpose of the donation was merely to have a testbed for the sync motor control. I'm not planning to do a custom Leaf logic board, I will just hook up the generic one.
> 
> I will document the process in case anyone wants to repeat in order to have analog controls and more power from the motor.


Well what am I waiting for? I have a working 400A inverter in my car and all i have to do is bring Leaf motor to it and select syncmode. 
I think i may actually try this tomorrow...


----------



## jhuebner (Apr 30, 2010)

Running my async test motor with the Leaf inverter and the generic Rev 2 logic board:
https://youtu.be/CFqhGHBDIxQ

Up in an hour...


----------



## zippy500 (Apr 3, 2017)

be really good if someone made a drop in board for the leaf and us mere mortals 

I cant afford a Tesla drive unit yet ( or any time soon )


----------



## jackbauer (Jan 12, 2008)

Well, if someone donated an unused Leaf logic board .....


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Running my async test motor with the Leaf inverter and the generic Rev 2 logic board:
> https://youtu.be/CFqhGHBDIxQ
> 
> Up in an hour...


Very nice test. I guess i will have to do something similar with Ampera inverter.
What voltage did you use to run the motor at? 

@Jackbauer: I can donate free Ampera board .

A


----------



## jackbauer (Jan 12, 2008)

Got that covered

It seems the internet wants more reverse engineering. Who am I to argue with the AI ....


----------



## jhuebner (Apr 30, 2010)

I wonder if it's worthwhile to design one generic inverter board and add a "shield" for glueing it to the respective OEM device?
the generic board could even be on *top* of the shield to keep the smooth mounting on the original screw holes. Just like the STM32-H103 is on top of the main board now.

It would save the routing overhead of doing essentially the same board again and again.

Nice timing on the your Leaf inverter. I have an original logic board left over now as well.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> I wonder if it's worthwhile to design one generic inverter board and add a "shield" for glueing it to the respective OEM device?
> the generic board could even be on *top* of the shield to keep the smooth mounting on the original screw holes. Just like the STM32-H103 is on top of the main board now.
> 
> It would save the routing overhead of doing essentially the same board again and again.
> ...


I tried to fit your main board to Ampera inverter. It has a nice alu shield for logic section. I am now taping holes for nylon studs. It should work with components as they are, though i still think i should make an interface for driver section to pullup signals to 5V. 
Now I just need some 40V of batteries to drive the power section.


----------



## arber333 (Dec 13, 2010)

Boards setup, I will wire drivers and current sensors and i still have to make interface board. IGBTs will close on 5V command. Currently mainboard outputs 3V3. I dont want to release smoke.
But... height is a problem! PSU capacitor and both relays are quite high above and lid cannot be closed. Hm... it would probably require an extention. Maybe 3D printed border from ABS with 2x O-ring grooves. That should keep moisture away. Or custom board would have to be made with SMD components to keep low profile.


----------



## jhuebner (Apr 30, 2010)

First resolver experiments today. Got a resolver to digital Eval board from Damien - yay thanks!

It features the AD2S1205 chip. That has ABZ emulation and an SPI interface.

Tried the SPI interface with my analog discovery and after figuring out the basics, that went well i.e. I got a nice and stable angular reading. I noticed the resolver measures 2 rotations on 1 real shaft rotation.

Next I tried hooking up the inverter with ABZ. I do get a reading up to 5Hz which equals 2048*5=10kHz on the encoder input. Any faster than that and it cuts out because of the RC low pass. Will remove that for the next try.

I also consider using the SPI bus instead, because ST surprisingly put the SPI pins on the same as the encoder input  
The encoder chip has 6 signals of which 2 can be constant and 2 are equivalent


CLK - clock
SAMPLE - prepare data to be put on the bus
CS (chip select) - can always be low
RD - Put data on bus
RDVEL (select angle or velocity) - can always be high
SO - serial output
There's supposed to be a delay between SAMPLE and RD but it worked perfectly when they were pulled low together.
So basically the A-channel is SPI data in (SO), the B-channel is SPI data out and the Z-channel can be used for the SAMPLE/RD signal. Only issue being, that I will have to emulate the clock with SPI data out and will read every bit twice. So a bit pattern of 1 0 0 1 would turn into 11 00 00 11.


----------



## jackbauer (Jan 12, 2008)

Wow thats quick work


----------



## arber333 (Dec 13, 2010)

Hi J

I have one of this things at home and i put the magnet to it. It is an adapter for the Nissan end shaft. I have the old version and i see you have the newer one. Can you try the thread on the end shaft? You can just unscrew the nut and measure it. Mine is M12. Aleš and I have made this magnet holder so it can be setup in center and adjusted for height. Then you torque the small Allen bolt on the side, which locks the threads in place.

We designed also an additional mount for encoder PCB plate to keep it in center of rotation. We used resolver to copy holes and dimensions. With old motor everything fits. Can you take a photo of new motor insides?

https://leafdriveblog.wordpress.com/2016/11/16/encoder/

I must contact Aleš, but if you like we can try and make a fit for the encoder i brought you last time. It should work ABZ, which is incidentaly what i would like to use. So my motives are not entirely altruistic .


----------



## aeroscott (Jan 5, 2008)

Looking for the bell housing bolt pattern for the volt /ampera transmission.
Mount a mercedes 6 cylinder diesel to it to power a old steel sail boat .
it,s great to see interest in the controller .


----------



## jhuebner (Apr 30, 2010)

So, I have also decided to launch a Patreon campaign to become more independent from my day time job as a software consultant and eventually be able to work full time on EV stuff.

I think commercializing this project and keeping stuff secret is not the path I want to go, as the open source nature is it's very uniqueness.

https://www.patreon.com/openinverter


----------



## Kevin Sharpe (Jul 4, 2011)

jhuebner said:


> So, I have also decided to launch a Patreon campaign to become more independent from my day time job as a software consultant and eventually be able to work full time on EV stuff.


Great! Happy to support 



jhuebner said:


> I think commercializing this project and keeping stuff secret is not the path I want to go, as the open source nature is it's very uniqueness.


That's good news for everyone in the EV community


----------



## jhuebner (Apr 30, 2010)

Wow, I've been out for lunch and when I came back I found 3 patrons  Thanks for that!


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> I must contact Aleš, but if you like we can try and make a fit for the encoder i brought you last time. It should work ABZ, which is incidentaly what i would like to use. So my motives are not entirely altruistic .


Hi Arber,

currently I use the Leafs stock resolver through the AD2S chips. But actually your encoder board is smaller than the resolver to digital board could ever be 

Good news is, when it works with the stock encoder it will work with your encoder as well as they are both ABZ type.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Hi Arber,
> 
> currently I use the Leafs stock resolver through the AD2S chips. But actually your encoder board is smaller than the resolver to digital board could ever be
> 
> Good news is, when it works with the stock encoder it will work with your encoder as well as they are both ABZ type.


Hm... Check here... Paul is selling AD resolver converter boards. They are quite small, maybe a little bigger than my encoder PCB.
https://pandspowerelectronics.ecwid...to-Encoder-Board/p/99847539/category=16287307

I see he also has some finished ones. Just so you dont go reinventing the wheel. 
I have one of his boards at home. It works, i tested it, but i am not certain if it doesnt pickup more EMI. Maybe it was my assembly though, i made some mistakes and resoldering there.

A


----------



## arber333 (Dec 13, 2010)

Well this weekend i had to do some car surgery... I replaced LH rear shock. It siezed on me while driving trough the city and it felt like someone was banging the hammer in the trunk. Now the ride is smoother. 
I confirmed something else though... 
AB encoder is dropping out when there is a lot of shock from the road. Like when i drive across railway tracks or some hole in the street. I thought webasto would disturb encoder somehow, but it was the other way. When i had to restart inverter, final start key position would take down 12V to protect system against starter pulse - that would never come now. So webasto lost power for 1/2s and complained. 

I tried to fasten cable to motor in case connector got loose because of vibrations, but it made no difference. I use ampseal 4p connector which should be tight and sealed.

Any ideas what would cause instant dropout and/or overcurrent when driving across bumpy road?

A


----------



## jhuebner (Apr 30, 2010)

Happened to me when the encoder was misaligned. Like the IR beam barely shone through the hole. Re-aligned it and problem was gone.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Happened to me when the encoder was misaligned. Like the IR beam barely shone through the hole. Re-aligned it and problem was gone.


Hm.. i am using toothed wheel with inductive pickup probe. So IR diode does not really apply. 
I will check sensor gap though. It is said sensor can read trough up to 2mm gap. 
I can also check if wheel is propperly fastened by M6 bolts. It could slip under heavy jump.
Next thing i can try is giving sensor more voltage. Like 12V instead of 5V from main board. Sensor should be good up to 24Vdc.

tnx for ideas Johannes

A


----------



## jhuebner (Apr 30, 2010)

Well, good luck! Unfortunately there is no encoder diagnosis in quadrature mode as it all runs in hardware.

Today I learned a lesson about mosfets, ringing and RC snubbers.

So basically on the scope you see phase 2 which isn't snubbed and phase 1 that is. That is even idle PWM with no current flow. Gets worse with current.

To get it right you have to do some actual math, which is all described here: www.nutsvolts.com/uploads/wygwam/AN11160_Designing_RC_Snubbers__NXP.pdf

So I arrived at 2.2 Ohm and 6.8nF. Instead I'm using 22nF because thats all I have. It's not even die-hard power parts, just stuff from the parts bin. I'm amazed 

Will make a video later this week.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Well, good luck! Unfortunately there is no encoder diagnosis in quadrature mode as it all runs in hardware.
> 
> Today I learned a lesson about mosfets, ringing and RC snubbers.
> 
> ...


Well i got the bugger... crimp pins were loose inside encoder connector and with bumpy ride they lost connection for a moment. Fixed!
I also put vacum switch directly to brake switch. Now pump works good it just keeps on buzzing when i keep my foot on a brake. 

Hm it seems logical since gate is a bit smallish so every bit of RC helpes.


----------



## jhuebner (Apr 30, 2010)

As mentioned on the i3 thread I'm trying to interface resolvers directly. Some good resources have been posted there already.

So here is the plan


Generate a square wave at pwmfrq/2
Make a sine from it by 3-pole low-pass filtering
Amplify it with a cheap LM386 audio amp -> thats our excitation
On the rising edge of our self-generated square, start a timer (because of phase shift)
When timer times out, do the two injected conversion of sin and cos signal
use atan2(cos,sin) function to determine the angle
So I will use the existing encoder pins again, PD2 will generate the square, PA6 and 7 read the feedback. The signal conditioning will sit on a bread board but can be easily integrated onto the main board. Extra part cost is like 50 cents.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> As mentioned on the i3 thread I'm trying to interface resolvers directly. Some good resources have been posted there already.
> 
> So here is the plan
> 
> ...


Hm... i can see the appeal here. 
But how do you think you will connect the outputs? Dont forget sin/cos resolver has 6x wires. 2x excitation, 2x sin, 2x cos. Will you use diode bridge and rectify sin/cos return signal? Or do you wish to sense only sin and will just generate 90deg cos in the code?

A


----------



## jhuebner (Apr 30, 2010)

2x excitation goes to GND and amplifier output - capacitor takes care of removing the DC component
2x sin and 2x cos goes to 1.65V and ADC input (1.65 via resistor divider)

both sin and cos are sensed and serve as input to atan2 function


----------



## jhuebner (Apr 30, 2010)

First cut done, software resolver works 

What you might be able to see in my creative chaos is the 3-pole low pass filter, then a cable disappearing under my table (it goes to my Yamaha amplifier). Then you see the Nissan Leaf resolver being excited by the Yamaha 8V peak-to-peak. This results in about 1V peak-to-peak using my tool socket 
The neg outputs are pulled to about 1.4V using 2 series elcaps and the pos outputs are being low-pass filtered and fed to the ADC.

ADC timing is critical to get a good SNR. You want to hit the peak of your generated sine wave to make good use of the ADCs dynamic range. So far the jitter is about +/-0.5° .

Therefor the resolver routine starts out with an offset calibration while excitation is off. Then it pulls the output pin high and starts the timer. The timer then triggers the ADC after some µs (currently 80). On the next cycle the pin is pulled low, values are read and the angle calculated. 

Currently doing this at 5kHz resulting in 2.5kHz excitation. It will probably go with thw PWM frequency later on.


----------



## arber333 (Dec 13, 2010)

You ve done it again....! 

I see that in newer leaf motor resolver is much different than in mine. Should be same signals though. 
I am ashamed i didnt get far with my Leaf motor since i need my car a lot lately. I will pull wires from my motor and connect Leaf motor to my car tomorrow in the evening. 

Untill tomorrow evening then...

A


----------



## jackbauer (Jan 12, 2008)

Just be aware the resolver will act as an alternator when its running and the amplitude of the Sin and Cos will increase with RPM.


----------



## onegreenev (May 18, 2012)

Revision 3 Current Sensor Board. Does anyone have an image of the main board that is not populated and one that is? I want to see how best to connect up the thermal sensor on this board. Looks like I got the rest finally done. I will be looking into the newest current sensor boards but for now I need to get this one connected up. Its been busy at work studying for my CT National Certification Test coming up at the end of April. Once done I can once again get involved with my project using the inverter. 

Question, one of the resistors had the coating chip a bit and left a bare metal spot. What would be a good thing to coat it with that will be durable. I don't want to leave it exposed. The light blue stripped one on the top. 

Thanks for everyones help.

Pete


----------



## jhuebner (Apr 30, 2010)

This is the best I could find, it's now buried in the car.
Two of your resistors will look different as the are 82k instead of 100k for bigger current range.


----------



## jhuebner (Apr 30, 2010)

And heres a quick video on my resolver efforts.
https://youtu.be/0V_kb0N5ONg


----------



## Kevin Sharpe (Jul 4, 2011)

Really good progress with the Leaf motor and a timely reminder about measuring torque with gloves


----------



## Tomdb (Jan 28, 2013)

Probally time to start designing some more boards  Thinking of doing a volt/ampera one


----------



## jhuebner (Apr 30, 2010)

Haha, Kevin was faster, less work for me 

I'm currently working on an SMD version that could serve as a basis for custom boards. So all signals are on pin headers and then you design a mainly mechanical board to fit into a certain inverter.


----------



## onegreenev (May 18, 2012)

onegreenev said:


> Thanks for everyones help.
> 
> Pete



Got the current sensor board finished. Thanks for the pic. I also took a look at my original board. Question. Where does the thermal connection go? What do I connect it too? The heat sink? 

Got my soldering issues ironed out. I now have a real nice tip on my iron and it does a bang up job. Took a bit to get it deoxidized and taking on a tin. Once that was done it was all down hill from there. I use rosin core solder but still dip the solder into the flux. Without that the solder joints just look like garbage. Getting better. Going to try my hand at SM soldering.


----------



## dima (Dec 1, 2015)

Got to get out my heavy-duty torque measuring glove


----------



## arber333 (Dec 13, 2010)

That was amazing J! Even more the theory of voltage control. 
Do you think that would leave room for feild weakening? I would like to run my motor at 10000rpm in a vehicle.

Speaking of road driving. I remember couple of years back when we tried to use BLDC LRK outrunners on transmission with powerful ESCs. What we got was really good start and quite good riding experience - on a flat road. As soon as the ride got bumpy we got anomalies like surges of torque to busted ESCs. 
Do you think we could simulate a bumpy road to the motor. Like couple of -G worth? It could be done by rocking the motor, but it would have to be under load...

Probably a good way to start now would be to couple one ACIM to Leaf motor.


----------



## jhuebner (Apr 30, 2010)

Thanks Arber and everyone who just decided to jump on the Patreon campaign 

So field weakening is definitely just changing the phase shift in *some* direction. Interesting observation with the bumpy road, hope it won't happen with an OEM motor.

Would love to couple it to an ACIM but the splined shafts don't match and I'm rather mechanically inept.


----------



## ALIE (Jan 28, 2015)

Johannes
Just draw the mechanical parts you need and I'll do it for you.


----------



## jhuebner (Apr 30, 2010)

Hi Ales, thanks for that! I will see which motor makes the most sense to couple to. I might use a belt for easier alignment. Unfortunately the HEPU ones are not mine.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Hi Ales, thanks for that! I will see which motor makes the most sense to couple to. I might use a belt for easier alignment. Unfortunately the HEPU ones are not mine.


Well i talked to Ales and i also think that direct coupler should be best. No slack in control loop that way. Maybe clutch disk coupler? 
Hm.... can you measure and draw a sketch of a Leaf motor input shaft? Do you have a vernier caliper?
If shaft is splined like with my motor i need to know the diameter, number of splines and depth of spline groove. That will give me enough data to check amongst used car clutch disks.
Then we can make a direct coupler for the ACIM motor. That way we would have partly flexible coupling so any missalignment is dampened by clutch springs. Because lets be honest DIY setup will allways have some missalingment present. 

A


----------



## zippy500 (Apr 3, 2017)

I have been told that a 1970 fiat 500 clutch plate has the correct spline for the leaf.

Paul coupled one onto a lovejoy connector

https://youtu.be/lnQ3Ynl5wxs


----------



## arber333 (Dec 13, 2010)

Haha... that old ... they still make parts for it.

https://www.ebay.co.uk/itm/Kupplung...868150?hash=item35d3ee2c36:g:LLQAAOSwQYZWuGOe

https://www.ebay.co.uk/itm/Kupplung...369855&hash=item36195dd5ed:g:1AwAAOSwZJlXNFqw

Check dimensions Johannes. Under main ad it says fi160mm and 20 splines.
Maybe we can make a flex coupler the way BMW has on driveshaft?

A


----------



## jackbauer (Jan 12, 2008)

Double post here from the Tesla thread :

With some help from Johannes I got the ESP8266 WiFi module working on the bench with a Tesla board.

Johannes's interface works great and the ESP has a much shorther boot time than the Raspberry Pi. The Dima interface errors out with "unexpected token in json string".


----------



## jhuebner (Apr 30, 2010)

Ok will check dimensions tomorrow. 
Today I tried regen using my Makita and 17mm tool socket  It seems my voltage theory holds true. Also spinning backwards and forward is really easy, just shift the field by 180°. So, 4-quadrant control in place  No video yet, but if weather permits I'll make one tomorrow.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Ok will check dimensions tomorrow.
> Today I tried regen using my Makita and 17mm tool socket  It seems my voltage theory holds true. Also spinning backwards and forward is really easy, just shift the field by 180°. So, 4-quadrant control in place  No video yet, but if weather permits I'll make one tomorrow.


Neat idea using power tool, though you can only rev so much. By hand human can hold/clench cca 100W worth. 200W if they would use their legs... 

Ales said he can make the coupler, I can provide the spline part of the clutch. 

We can trust Paul judjment or you can tell me:
1. How much splines on Leaf motor
2. What is the diameter of Leaf motor shaft across the splines

Next dimensions of ACIM motor
3. What is the diameter of ACIM motor shaft? 
4. Length of ACIM shaft protruding from motor
5. Dimension of ACIM shaft key ("nutkeil" in german)

Measurement should be accurate to 0.1mm! Caliper is a must!!!!

Your job after would be to effectively setup two motors one against the other in center with enough precision. Probably you could effectively use wooden construction with some shims.

A


----------



## arber333 (Dec 13, 2010)

I almost forgot to ask. Is the encoder logic still the same ABZ? Can i just use digital encoder with inverter? How about offset? Did you have problems setting it up?

A


----------



## jhuebner (Apr 30, 2010)

Well I guess it's getting time to decide on the second motor then. Here is what I have at hand:
1. 24V forklift motor of unknown power with a stupid exterior bearing
2. 380V good ol 2kW industrial
3. 190V 2kW industrial

I can make a quick count of splines tomorrow just to be sure.

I'll be out of office/shed from June to August but I'm confident to get some results before that.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> I almost forgot to ask. Is the encoder logic still the same ABZ? Can i just use digital encoder with inverter? How about offset? Did you have problems setting it up?
> 
> A


So with the Leaf motor I interface the resolver directly without any resolver-to-digital chip. Otherwise the AB(Z) mode is still available and works as previously.
I also tested the SPI bus of the AD2S resolver to digital which works great but I think is sort of obsolete now.

Anyway having absolute angle information right from the start is preferable for PMSM motors.

The offset is yet very experimental. The Leaf spins forward at 0° offset and backward at 180°. When spinning forward and decreasing the offset to say 350° the motor spins faster, so I reckon that is field weakening. As I don't want to do another glove-test I will have to wait for the test rig to get good values for the offset.

My guess is that they set up the resolver with 90° phase shift because I was expecting about 90° to spin forward and 270° backward.


----------



## onegreenev (May 18, 2012)

Having issues connecting my Huebner Inverter on my Mac. I changed HD's on my laptop. Not sure what is not working. I have the same server setup on both machines. Same system software. 

Been awhile since I have fired up this little thing. Cleaned up the wiring so it is nice and clean. 

Motor not running properly either. I can only get the motor to do a super quick bump. No continuous spinning like before. 24 volts and I even checked to see if the voltage was dropping out when I it did bump. Nope, Power stays up just fine. 

I'll keep pecking away but may need some assistance getting around this Web interface.


----------



## jackbauer (Jan 12, 2008)

Pete , setup a Raspberry Pi for the interface : https://github.com/damienmaguire/Inverter-WiFi

Gets rid of a ton of headaches. No more server needed.


----------



## onegreenev (May 18, 2012)

jackbauer said:


> Pete , setup a Raspberry Pi for the interface : https://github.com/damienmaguire/Inverter-WiFi
> 
> Gets rid of a ton of headaches. No more server needed.


I'll have it here on Tuesday and give it a spin. Thanks.


----------



## onegreenev (May 18, 2012)

While I am waiting for the pi I decided to have a go with the web interface again. I was successful at getting it going and was able to get this to change parameters. However I am still unable to get the motor to do anything else but a little bump. I also noted a bunch of extra parameters that were not there before after I updated the Inverter Application. It still retained my parameters for the AC-35. Im thinking now maybe the encoder but don't know. All the pins are providing the proper power as stated in the paperwork. Not sure if the drivers are all working. Its been out in the garage for a year and the garage is not a nice place to sit. Nothing looks corroded and I have removed all the pins and replaced them to see if there was any noticeable corrosion. 

Just wondering if anyone has a set of parameters for their motors that are being tested at a low voltage that I could try out. Ive been out of this fun for some time so I need to get re acquainted with the software and motors. 

Could just be the motor. I'll put up the AC 50 on the bench and see if that runs. Heavy little sucker.

PS. I have version 1 Inverter Board.


----------



## onegreenev (May 18, 2012)

Dug through some old parameter files I saved. I have had a little luck in getting the motor once again moving albeit rather slow. Throttle is not very responsive. Im suspecting some of the issues are in the new parameters I see on the web interface and thinking maybe I need to update my firmware or software on the inverter. New parameters may not be playing nicely with the older firmware. 

Yes, No? 

Pete 

Need to also charge the batteries. Not thinking that is the issue because the voltage does not really drop when the motor is spinning. Should still have some usable voltage available.


----------



## arber333 (Dec 13, 2010)

onegreenev said:


> Dug through some old parameter files I saved. I have had a little luck in getting the motor once again moving albeit rather slow. Throttle is not very responsive. Im suspecting some of the issues are in the new parameters I see on the web interface and thinking maybe I need to update my firmware or software on the inverter. New parameters may not be playing nicely with the older firmware.
> 
> Yes, No?
> 
> ...


Hi Pete

Last month i was doing some diagnostics on drivers for my inverter and i supplied my inverter from 30V!!! I lost two days figuring why it wouldnt move motor. Well it is my fault .

Last year on my behest Johannes put equasion in the code which keeps the voltage the motor sees on the same level no matter the SOC. It works wonderfull and actually motor can keep the power up even in winter when batteries sag quite a bit. Long story short there is a parameter or two that you have to set to your application.

udcnom - you set this to calculated voltage your motor was wound for (maybe a little higher). I have it set to 330V which is what my motor was wound for. Really i have 385Vdc nominal in my car. 

fweak - you set this to your motor and voltage. I use 155Hz for weakening and get fine results. Johannes states that here: http://johanneshuebner.com/quickcms/index.html?en_parameters,24.html

boost - this is voltage to overcome motor ohm resistance. I have it set to 5000 cca. some 40V. 

Those parameters are changed if you run on lower voltage. Then you have to use fweak 50, boost 10000 and udcnom 30.... Try it!

A


----------



## jhuebner (Apr 30, 2010)

Thanks for stepping in Arber. So with udcnom you only have to configure your motor ONCE no matter the input voltage. If you configure for 300V the inverter will change fweak and boost for you even if you run at 30V.

BTW the web interface only displays parameters that are actually present in the firmware. There is no list in the web interface but the list is retrieved from the inverter.


----------



## arber333 (Dec 13, 2010)

I have a question Johannes or anyone...

For long time now i wondered what fmin parameter means for motor drivability. My motor has unusually high slip for 132S frame motor maybe because rotor is longer 4cm. Fslipmin 3Hz pulls quite good but if i release throttle to 0% i find oscillations around 0 torqe. If i apply regen or more throttle vibration stops. First i expected this to be mechanical or mass issues, but i have tried multiple settings and vibrations are not constant. 

I tried lots of settings and i gathered the following result: 
With 3Hz minslip, boost 5000, fweak 155Hz
- fmin = 0.01Hz annoying vibrations when throttle at 0%.
- fmin = 0.1Hz vibrations are the same
- fmin = 0.5Hz vibrations are the same, maybe a little better
- fmin = 1Hz vibrations are the same or even larger
- fmin = 2Hz It seems like vibrations are smoothed some

Can you explain Johannes what *fmin *does when at 0% throttle or accelerating/regen? How should this parameter be set? Like 80% of fslipmin?

tnx


----------



## jhuebner (Apr 30, 2010)

Below fmin the PWM stops completely. Thats the only influence of the parameter. Here is the source code from fu.cpp:


```
if (frq < minFrq)
{
   amp = 0;
}
```


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Below fmin the PWM stops completely. Thats the only influence of the parameter. Here is the source code from fu.cpp:
> 
> 
> ```
> ...



So why would there be higher vibrations with fmin = 0.01Hz than 2Hz? Sounds illogical. 
How would you propose i set this? Like i use 2Hz or 2.5Hz or 2.8Hz? Does it matter how is it set within *fmin < fslipmi? *What does the rest of the loop say? It is a PI loop so it should oscillate near 3Hz then, but not quite? 

TNX 

A


----------



## jhuebner (Apr 30, 2010)

Yes any fmin < fslipmin is fine.
There is no PI loop anywhere in the main control so oscillation must originate in some "parasitic" feedback loop


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Yes any fmin < fslipmin is fine.
> There is no PI loop anywhere in the main control so oscillation must originate in some "parasitic" feedback loop


Hah it seems like i was my own damping. Now motor works smooth and only vibrations left are in the 3K RPM zone. They are caused by either clutch disk or basket. Should have this solved by changing clutch disk 180deg. If not i will have to spin motor with basket on and manually balance assembly.

A


----------



## onegreenev (May 18, 2012)

I did some parameter changes and did an update of the firmware. None of the changes helped and I have pretty much chocked it up to something going on with the motor. So I pulled the motor off the bench and put my AC-50 on the bench. Im topping off the batteries and going to try this again. I need to go find my paper on what the pinout is for the HPEVS motor encoder. Should be pretty easy to find again. I'll try again. I also got my Raspberry PI for connecting via wifi. I'll have to get that project started this evening as well. 

Hoping for a better outcome with the AC-50 motor. I still have the Flywheel and pressure plate installed. 

Pete 

Bummed I could not get the little Raymond Induction motor up and running again.


----------



## onegreenev (May 18, 2012)

Installed the image file on my Raspberry Pi and connected it up to power. Let it sit and was able to connect via my iPhone. I was however not able to connect via my LapTop even though I was connected to the wifi connection. So the iPhone or iPad it will be. I think I'll use the iPad. Larger retina screen than my phone so it will be easier to read and input information. I'll try connecting to the inverter tomorrow after I get home from work. Good day over all. Should be good tomorrow. Looking for old parameter images I saved from prior settings that worked. 

Pete


----------



## arber333 (Dec 13, 2010)

onegreenev said:


> Installed the image file on my Raspberry Pi and connected it up to power. Let it sit and was able to connect via my iPhone. I was however not able to connect via my LapTop even though I was connected to the wifi connection. So the iPhone or iPad it will be. I think I'll use the iPad. Larger retina screen than my phone so it will be easier to read and input information. I'll try connecting to the inverter tomorrow after I get home from work. Good day over all. Should be good tomorrow. Looking for old parameter images I saved from prior settings that worked.
> 
> Pete


Try it first to run in sensorless mode. If it will turn the motor then you can try setup with encoder.

Huh theres a thought: 
Did you load correct firmware? There is board rev 1 and rev 2. Softwares are not compatible. You should first check if all I/Os react to your input.

Also did you select which encoder you use? Single channel or dual channel for rev 2.


----------



## jhuebner (Apr 30, 2010)

I'm sure you still have Rev 1. If JP5 is 24 pins you have Rev 1. So if you download the recent firmware use stm32_sineHWCONFIG_REV1.bin


----------



## onegreenev (May 18, 2012)

arber333 said:


> Try it first to run in sensorless mode. If it will turn the motor then you can try setup with encoder.
> 
> Huh theres a thought:
> Did you load correct firmware? There is board rev 1 and rev 2. Softwares are not compatible. You should first check if all I/Os react to your input.
> ...


Yes I got the correct firmware uploaded. I was sure to check and did notice the differenced between version 1 and version 2. Im getting the same results as prior to the update. Im using a single channel encoder. 

I can check again in senseless mode but I will have to change where I have the motor. Did not think to do another sensorless setup. 

Pete


----------



## onegreenev (May 18, 2012)

jhuebner said:


> I'm sure you still have Rev 1. If JP5 is 24 pins you have Rev 1. So if you download the recent firmware use stm32_sineHWCONFIG_REV1.bin


Got it. Yes, I only have version 1. I want to get version 2. 

Pete


----------



## onegreenev (May 18, 2012)

Oh poo. Getting the same clicking and bump as the other motor. So its not the motor. Back to square one. Then dig out all the prior emails and information on settings I have done in the past. I'll dig this issue out. Im sure its totally something simple and if its a snake Im being strangled. Im sure its right in front of my face and Im just not seeing it. Back tomorrow afternoon. I have to do CPR class tomorrow morning. Not much will be done tonight. 

Heading out to start at zero.


----------



## onegreenev (May 18, 2012)

Back from some forward movement. I had my current sensor plugged in to the main board but had no power to the sensor board. When I unplugged the sensor board the motor spun up again. But it was real slow and jerky. I played with some parameters and eventually just reset it all then started again. Did not get it away from the slow jerky movement of the motor. The last time spinning it up resulted in a kickback into the opposing direction and a smoked driver board. Smoked real good and one of the other drivers got pretty hot. I have spare driver boards. Good thing. Not the first smoke job of this long winded project of mine.

I'll get back to this after I replace the driver boards. May put the smaller motor back on the bench but I should get the large motor running too as I want to use one of these inverters on the AC-50 that is going into my 67 Beetle. I don't want to use the Curtis controller as its limited in voltage. I want to run this at 156 volts minimum in the vehicle.


----------



## arber333 (Dec 13, 2010)

Well you can certainly run your motor with higher voltage. You can run it at 200V if you like. You just have to setup parameters so inverter can adapt.

If you posted your parameters there are some errors there

1. boost for 36V should be higher. What is your motor wound for? I recommend at least 10000.
2. Fmin parameter should be less than slipmin parameter. Lets set it to 0.8
3. what are the pole pairs?
4. Fpconst is off then
5. OClimit should be higher maybe at least -300 or -400. What value are your IGBTs?
6. did you calibrate sensor gain?

7. UDCmin = 100V
8. UCDsw = 120V
9. UDCmax = 160V

A


----------



## arber333 (Dec 13, 2010)

You still use old driver boards. They like to go up in smoke. 
I decided they are good to try and build the system, but really to drive the car on long term you need something better. 

It is why i built my own interface board and i am using Skyper 32 drivers supplied from 15V 3A regulator. I got them for 35€ each and i think it offers best drive and protection for money. 

I did have to set unusualy high dead time between pulses on encoder. But they also offer hardware protection from shoothrough.
I will add here BOM and some instructions, not that there is anything different from Skyper manual.

Well since i can drive pretty good now i can show my product here.

It is revision 1 and i found some small errors on it, but it does not impare the basic function. 
The greatest error is that i assumed skyper use positive signal to drive fault output and now i cant signal main board to stop PWM. No matter since all boards are linked together and if one stops other are stopped also.

See attachment... really it is a .rar file and contains gerbers and design file to make interface board. I had to change it for upload.

EDIT: I will start my own github for projects like this....
https://github.com/arber333/Skyper-32-interface


----------



## onegreenev (May 18, 2012)

arber333 said:


> Well you can certainly run your motor with higher voltage. You can run it at 200V if you like. You just have to setup parameters so inverter can adapt.
> 
> If you posted your parameters there are some errors there
> 
> ...


The IGBTs are 1200volt 400amp
In my next version I will be using 600 volt 600 amp (I have two sets)
Looking for 600 volt 800 amp (in no hurry here)

Calibrate Sensor Gain? No. Guess I'll have to go read up on that. But that said, I did not have power connected to the sensor board so I figured it would be the same as having it unplugged. Guess not. 

When I get back from CPR training I'll put on a new driver, change some parameters and give it a spin again. 

Motor is mounted on the bench and locked down tight. 

I'll be running 24 volts for the testing.


----------



## arber333 (Dec 13, 2010)

Hm... If you dont connect sensors your master doesnt let the pwm run i think. 
Step back and first make pwm run without drivers. Check all i/o. 
Use scope to confirm signals and deadtime. I would set deadtime at least 65 possibly 80 so as not get shoothrough. 
Then setup drivers and check GE signal. 
Now i usually connect igbts and put 3X 12v bulbs to RST and run pwm sensorles with 1hz. Then i connect motor and run it.

EDIT: I decided to write a manual on how to prepare inverter for use after assembly. I will include Johannes instructions and my experiences. Also some troubleshooting diagrams.


----------



## onegreenev (May 18, 2012)

I have all my parts for the gate drivers. 5 total spares and 3 extra boards in case I screw up a board. But I can't find my paperwork for what goes where for the gate driver board. I must have lost it at some point. Been through all my papers in the office and just don't see it anywhere. Is there anyone with a copy that they could take a pic of and post it so I can finish building my gate drivers? One gate driver I built quite awhile back has bad soldering so I won't even attempt to use it. I guess I could use that as my template but I'd rather know for sure as all my parts for the inverter board, drivers and sensor boards are all in one package. My new package did not ship with the instruction pages for the first gen sensor board or the drivers but it did have the paper for the main board. I have two of those. 

In the mean time I'll do some other work like putting the small motor back on the bench now that I know it was not the motor issue. 

Pete 

Going to bust out the O-Scope too. Been a long while since that has been out.


----------



## onegreenev (May 18, 2012)

I got the driver built. Did not need any paperwork after all. Found all my parts and used my other driver as a template. Worked great. Question. The connections to the IGBT on my original drivers are twisted pairs but I see on the web site that the connections are just straight wires and non twisted.

Im assuming its ok to do wires like this. Do they need to be exactly the same length and can you mix and match?


----------



## onegreenev (May 18, 2012)

jackbauer said:


> Pete , setup a Raspberry Pi for the interface : https://github.com/damienmaguire/Inverter-WiFi
> 
> Gets rid of a ton of headaches. No more server needed.


I have the raspberry working and I have it connected to the inverter using the USB. However, I see no list of parameters to change. How do I get the list of parameters onto the Raspberry? 

Pete


----------



## arber333 (Dec 13, 2010)

onegreenev said:


> I have the raspberry working and I have it connected to the inverter using the USB. However, I see no list of parameters to change. How do I get the list of parameters onto the Raspberry?
> 
> Pete


You first have to download image for SD from Damien and install it. Then put the SD on Rasp and it will do the rest. Instructions are on site.
https://github.com/damienmaguire/Inverter-WiFi


----------



## arber333 (Dec 13, 2010)

onegreenev said:


> I got the driver built. Did not need any paperwork after all. Found all my parts and used my other driver as a template. Worked great. Question. The connections to the IGBT on my original drivers are twisted pairs but I see on the web site that the connections are just straight wires and non twisted.
> 
> Im assuming its ok to do wires like this. Do they need to be exactly the same length and can you mix and match?


I am not sure. You have short wires, might be ok. I allways make twisted wires for drivers, but i do have at least 3cm length to cover. 

A


----------



## onegreenev (May 18, 2012)

I’ll stick with the twisted pair.


----------



## dedlast (Aug 17, 2013)

onegreenev said:


> I’ll stick with the twisted pair.


Twisted pair will help minimize the noise getting into the signal on the wire. With a gate driver that seems like a very good thing to do.

Bill


----------



## onegreenev (May 18, 2012)

arber333 said:


> You first have to download image for SD from Damien and install it. Then put the SD on Rasp and it will do the rest. Instructions are on site.
> https://github.com/damienmaguire/Inverter-WiFi


I have it all loaded up and when I connect to the RaspberryPi I get a similar interface as this. I am using the USB from the actual inverter to my laptop which is now connected to the RaspberryPi. Im assuming it is now in direct communication to the actual inverter. 

When I used the old command line setup I had a list of parameters to change. Im not getting a list of parameters. Because no list of parameters is available either the list is missing or I am not in direct communication to the actual inverter.


----------



## jhuebner (Apr 30, 2010)

I think the interface is configured to the raspis integrated serial port.
You can either use that or change config.inc.php to /dev/ttyUSB0 
I'm not sure were web files are, you can type

```
find / -name config.inc.php
```
to find it.

Now, here is some more news on the Nissan Leaf project:
https://youtu.be/EmdEKFrjdMc


----------



## onegreenev (May 18, 2012)

Well, this went deeper than I had thought. Another driver board is part dead so will be replaced. One IGBT is dead as well. So I now need to replace at least one IGBT. My other modules are too wide to replace with them as the mounting points are different. Using the same aluminum plate would leave hot spots under the IGBT so I'd need a new plate as well. 

Bummer. So this project is on hold until I source more IGBT modules. The modules I have on this project are CM400DU-12f They are 600v 400amp IGBT modules. I can get them but they must ship from China. Slow boat. 

The slow boat will give time to build some new drivers. 

Pete


----------



## onegreenev (May 18, 2012)

Modules on the way. What other IGBT modules are a good choice for these inverters?


----------



## onegreenev (May 18, 2012)

Here is the main offending Gate Driver after it died. Lots of magic in these.

Bad, new, pulled and installed. Then figured out the IGBT is bad and the other driver on the right in the image.


----------



## arber333 (Dec 13, 2010)

onegreenev said:


> Here is the main offending Gate Driver after it died. Lots of magic in these.
> 
> Bad, new, pulled and installed. Then figured out the IGBT is bad and the other driver on the right in the image.


The good, bad and the ugly you mean .

I used 300A Fuji IGBTs for some time. Those 400A Mitsubishis are very good. 
I can see you had a shoottrough. TVS Diode is broken on one driver.
Try using deadtime 80. On the scope with both channels connected you should see if the tail of G1 is cutting into rising edge of G2. 

Also now that you show your power stage, i can tell you something. You need more capacitance. That lonely film cap is not enough. For 400A you need elcaps to smooth out spikes. I use 6000uF. I used 400uF and inverter sang to me  until IGBTs gave out. You can hear it on the motor when caps are drained out.

If you like i could send you one Skyper 32 interface board. I have them enough. You have driver configuration to fit it.
You would have to buy 3x driver modules like here: 
https://www.ebay.co.uk/itm/PP1887-S...e=STRK:MEBIDX:IT&_trksid=p2055119.m1438.l2649

Also i looked up CONCEPT 2SC0108T2A0 driver. It should not be a problem to redesign Skyper interface for this board. https://www.mouser.com/pdfdocs/Power_Integrations_2SC0108T.pdf

And last i have made a complete board for 6x new Infineon Eice 1EDI60I12 driver chip Johannes used for his small inverter experiment. I tried to run it with my motor and it works good. It supposed to have two outputs each for its own resistor so turn on and turn off can be fine tuned. Those chips have better protection and are quite powerfull. I also designed it with direct connection with 14p ribbon cable. No wire splitting required, hence less points to err.
I can send you one board if you would rather start anew.

Attached are pics of possible driver boards.
First is Skyper interface board. 
Second is integral Eice driver board.


----------



## jhuebner (Apr 30, 2010)

wow, I'm liking that EiceDriver board! nice and compact. Maybe watch out for 90° traces and make them 45° instead. Supposed to be EMV relevant...

Sometimes the TVS dies AFTER the IGBT. Basically the gate becomes shorted to the collector and on the next turn-on of the highside... bang.

But deadtime tuning is important, there's a section about it in the instructions.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> wow, I'm liking that EiceDriver board! nice and compact. Maybe watch out for 90° traces and make them 45° instead. Supposed to be EMV relevant...
> 
> Sometimes the TVS dies AFTER the IGBT. Basically the gate becomes shorted to the collector and on the next turn-on of the highside... bang.
> 
> But deadtime tuning is important, there's a section about it in the instructions.


Yes that is correct. It forms a loop, but there is little i can do with it. Some traces need to be corrected for future rev. 
Also i use 2x 5W 17V Zener diodes. The best is 17V due to correct triggering. Paul uses them so i did too. I never had busted diode since. It has to do with faster clamping of the zener or something.
I will put this board online when i get home...
EDIT: https://github.com/arber333/Simple-driver-board

A


----------



## onegreenev (May 18, 2012)

Im using these Caps. I have two of the white ones and two of the black ones. I was told these will be very good to use. So that is what I have. The two white ones I purchased directly the black ones came in an OEM induction motor inverter. I scavenged the parts. Not much usable for my setup but some parts were kept. 

I'll get back with you on the drivers. 

I'll start resetting parameters for when my board is back up and running. 

Pete 

That said, I have two white caps on my inverter power stage.


----------



## arber333 (Dec 13, 2010)

onegreenev said:


> Im using these Caps. I have two of the white ones and two of the black ones. I was told these will be very good to use. So that is what I have. The two white ones I purchased directly the black ones came in an OEM induction motor inverter. I scavenged the parts. Not much usable for my setup but some parts were kept.
> 
> I'll get back with you on the drivers.
> 
> ...


Can you put another one of those in the middle? I think 600uF film caps would cover demand same as 6000uF elcaps would. You can put copper, alu or brass hex spacers under the bolts and then tighten from under the rail. This is what a have done. But i had only 3x 100uf caps and it wasnt enough.

A


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> wow, I'm liking that EiceDriver board! nice and compact. Maybe watch out for 90° traces and make them 45° instead. Supposed to be EMV relevant...
> 
> Sometimes the TVS dies AFTER the IGBT. Basically the gate becomes shorted to the collector and on the next turn-on of the highside... bang.
> 
> But deadtime tuning is important, there's a section about it in the instructions.


Oh yes! I forgot to mention this new driver board is meant to be installed on the opposite side from IGBTs. So if you put it on the same side you have to reverse GEhigh and GElow leads so IGBTs can work in the designed sequence. Hence twisted pairs have to be longer some. This isnt a problem if you fix driver board vertically. 
My main goal was to design driver board around 14P connector, so there wouldnt be any doubt how to connect it to main board.
Also integrated is Fault signaling and separate Rg for High/Low signal.
There is also place for TVS or Zener diodes. 

A


----------



## onegreenev (May 18, 2012)

arber333 said:


> Can you put another one of those in the middle? I think 600uF film caps would cover demand same as 6000uF elcaps would. You can put copper, alu or brass hex spacers under the bolts and then tighten from under the rail. This is what a have done. But i had only 3x 100uf caps and it wasnt enough.
> 
> A


Not sure if I can fit another one with the snubbers where they are located. I'll try to fit.


----------



## onegreenev (May 18, 2012)

Well, that slow boat from China ended up being a fast jet across the ocean. My IGBT modules arrived today. Im going to replace all three just to be sure. Got my other driver board built too so I should have three good drivers and another three available to build. So I need to clean the heat sink and reinstall them. Need to reset the parameters and see what I can do. I'll start from the very beginning. Need to find a new fuse. Blew a fuse too on my battery pack.


----------



## arber333 (Dec 13, 2010)

Wery well. 
First try drivers connected to mainboard without IGBTs. I connect 2ch scope, first ch. to G1E1 and second ch. to G2E2 and confirm propper voltage and signal form. 
Next connect IGBTs and again start pwm with 1st probe connected to G1E1 and 2nd probe to G2E2. *Warning!* Do not connect inverter to battery power since scope probes have GND connected common inside.
By checking this you can confirm corect signal form and you can optimise deadtime. Use couple of us overhead because in the end us doesnt mean much lag whereas shootrough can kill IGBT. 

Finally connect 30V and test inverter pwm in manual mode. *Warning!* If you still have scope probe connected use only one channel to observe gate. Second probe must not be connected unless you use differential probe. Set 10Hz and 75% amp. If rotor turns correctly stop it and set 1Hz to check propper start. 

A


----------



## onegreenev (May 18, 2012)

Quickie Question. For thermal conductivity of the IGBT what would you recommend. Thermal Adhesive Tape or Thermal Grease and if grease, what would you recommend. I have some but in small amounts for computer cpu's. Not enough to cover three IGBT modules. 

Pete


----------



## arber333 (Dec 13, 2010)

onegreenev said:


> Quickie Question. For thermal conductivity of the IGBT what would you recommend. Thermal Adhesive Tape or Thermal Grease and if grease, what would you recommend. I have some but in small amounts for computer cpu's. Not enough to cover three IGBT modules.
> 
> Pete


I would recommend you order this grease: HY510 from China or you can get it in US also.
https://www.ebay.co.uk/itm/HY510-30...410524&hash=item2cbb48fb3e:g:4ccAAOSwCU1Yu3NT

Dont use any squegee or credit card, it will take care of gaps itself.
Apply it linearily to IGBT directly by syringe... just make 3x continuous longitudinal stripes about 1/2" apart. When you press IGBT to heatsink grease will conform and fill the space...

Now i actually dont use grease anymore. Aleš made excellent heatsink for me with three cutouts in alu plate where IGBTs are. Those are connected by straight bored channels for water to flow through. IGBTs are bolted to plate and sealed by o-rings. That way water is in direct contact with IGBT surface.


----------



## onegreenev (May 18, 2012)

Arrrrg, Bout ready to bail on this project. Put in three new IGBT modules, two new driver boards and pulled out the O-Scope. I have a singe probe so I can only test with a single instead of the dual channel like was stated in the instructions. No power to the IGBT modules and fired up the inverter. I tested all three drivers. The old driver had strange looking trace on the scope. The first of two drivers I just built had an odd trace and the last driver looked OK. I only say OK but you can help. I then pulled off the probe and probed one of the other drives so I could get a pic of that but when I connected my probe my good, or what I thought was a good board, smoked the DCDC on the driver. So yet another driver dead. Now I have no idea where to start in either fixing this or deciding to just build a whole new inverter and drivers. I have the parts to do that. If I go that route and it does not workout I'll bail out of the project. Just getting too frustrating. I'll give it a go but need help on where to start and how to proceed.

The short video is of the most recent driver board and also the driver board that cooked again. 

The trace is off the ETOP. All the outputs looked like this on this board. The other boards did not. This board smoked before I could shoot a short video. It smoked just after finishing this short vid. 

Not connected to the IGBT modules.


----------



## arber333 (Dec 13, 2010)

onegreenev said:


> Arrrrg, Bout ready to bail on this project. Put in three new IGBT modules, two new driver boards and pulled out the O-Scope. I have a singe probe so I can only test with a single instead of the dual channel like was stated in the instructions. No power to the IGBT modules and fired up the inverter. I tested all three drivers. The old driver had strange looking trace on the scope. The first of two drivers I just built had an odd trace and the last driver looked OK. I only say OK but you can help. I then pulled off the probe and probed one of the other drives so I could get a pic of that but when I connected my probe my good, or what I thought was a good board, smoked the DCDC on the driver. So yet another driver dead. Now I have no idea where to start in either fixing this or deciding to just build a whole new inverter and drivers. I have the parts to do that. If I go that route and it does not workout I'll bail out of the project. Just getting too frustrating. I'll give it a go but need help on where to start and how to proceed.
> 
> The short video is of the most recent driver board and also the driver board that cooked again.
> 
> ...


I would say your driver chip was at end of its life. Probably this was caused by last event. Are your IGBTs still good? They can get zapped by static only touching GE terminals with bare fingers. I wear grounded bracelet when working with it. Faulty IGBT gate will almost allways take its driver chip with it.
Can you verify by taking off rails and make a light bulb test? It is not conclusive though. Only desat sensing will find partialy blown IGBT. 
Which DCDCs do you have? Are they SC proof?

If you have DCDCs to spare i can send you a driver board to try. You would have to buy 6x Eice driver chips. I think the single PCB would fit on your driver support perfectly. 
When you would receive PCB i can provide some instructions still. 

Also i recommend you build at least one Damiens driver board with desat. I modified one of his PCBs to diagnostic tool so i can connect one IGBT side and quickly identify if IGBT is good. LED shines if Fault pin is active so i know something is wrong. This is always correct, while light bulb test is not always conclusive. I would recommend building something like this as a tool. 
I will check if i have any of Damiens boards for you.

A


----------



## onegreenev (May 18, 2012)

Well, the driver that cooked this time was a virgin driver. Never been hooked up. Can't imagine that an expensive IGBT module can get ruined so easily. So I guess no safety features to prevent failure due to stray static. Odd but ok. I would have expected the IGBT modules to be GOOD. I actually expect them to STILL be good but maybe not from what you say. If I can't get something going again with my new setup I'll leave it to someone else to build for me and just pay to have it done. Not as much fun but I do want something that will work pretty much out of the box. I know, not really DIY then. But for non engineers it can be a bit daunting. 

So virgin IGBT modules and the one driver that smoked tonight was also a virgin. And only 12v to the inverter. No other power and no IGBT connections.


----------



## jhuebner (Apr 30, 2010)

What PWM frequency are you running at? Especially the old -15/+15 DC/DC converters tend to overload with large IGBTs and 17.6kHz. 8.8kHz should be ok though. Ringing don't look too good either, make a short test without the TVS diode once you're up again to see if its gone.


----------



## onegreenev (May 18, 2012)

jhuebner said:


> What PWM frequency are you running at? Especially the old -15/+15 DC/DC converters tend to overload with large IGBTs and 17.6kHz. 8.8kHz should be ok though. Ringing don't look too good either, make a short test without the TVS diode once you're up again to see if its gone.


Are these TVS Diodes bi-directional or unidirectional? From what I see they look bi-directional.


----------



## dima (Dec 1, 2015)

I don't think "static" is a big problem (unless you have a cat in your house or something)

I did the "finger" test on my IGBTs multiple times all is working no static shot-through. *Warning:* Touch the battery first.


----------



## jhuebner (Apr 30, 2010)

onegreenev said:


> Are these TVS Diodes bi-directional or unidirectional? From what I see they look bi-directional.


Yes, bi-directional


----------



## arber333 (Dec 13, 2010)

The problem is not touching the gate, that is only to drain or charge small cap inside. Real problem happens when you move/brush clothes in your seat etc... and then touch both G and E at the same time. Static jumps trough and 10000V will fry the insulating barrier in no time. 
That is why you receive your IGBTs packed with GE contacts covered. And i recomend using bracelet connected to computer case or other appliance that is grounded to your house.


----------



## ECOENERGI1 (Oct 19, 2017)

An update on my small drive unit. Had to remove the USB to make it fit. Got it to run the motor, What I rush!!!


----------



## PStechPaul (May 1, 2012)

Could the IGBTs or drivers be Chinese defective or counterfeit? I have recently encountered some devices that did not work at all, and other people have reported problems with much smaller devices hidden in larger packages.


----------



## jhuebner (Apr 30, 2010)

One thing has been brought to my attention (again). Again because Arber reported it but I was never able to reproduce. Anyway, Nail Güzel reported that the PWM outputs behave strange on some boards.



> I am writing this email for a glitch I found in the hardware of Olimex (or at least in the Olimex boards that I have). Normally, all 6 PWM output pins must be low at the power up, and when I push the start, only the lower ones must go high if I am correct. However, I don't know the reason but, when I power up the inverter, one of the six PWM outputs (a high side one) goes high at startup and it never goes low until I give the pulse to the start input. When I give the start pulse, it goes low which sounds OK, but while it's going low, the low side goes high and a small overshoot occurs at that moment. I killed many IGBTs by only giving the start pulse because of this issue . What's more interesting is, I thought that it must be an issue with the hardware and then I replaced the Olimex board with another one (which was also a used one) with the exact same software. I noticed that this second board also has the same issue, but on a different output. So, the very same code makes different outputs on different Olimex boards go high at power up. After the inverter is started, PWMs are very good though. PWM frequency, dead time etc. settings look OK on the oscilloscope. It looks like I have two glitchy Olimex boards and the base software does not make all PWMs go low


So in short: some STM32 will kill your IGBTs!!
Nail also suggested a fix to force all PWM outputs low at power on. Will do so and post again.


----------



## arber333 (Dec 13, 2010)

Yes, but i dont think just STM32 is to blame. I think its like its output transistors are damaged, maybe from static? It then behaves unpredictable when powered up. I burried two Olimex boards that were working good but had issues when powered up. 

In the end i use complex drivers with shoothrough interlock and other goodies. They are slower than originals but much safer. Also they are more expensive, but not more than two additional IGBTs.

A


----------



## jhuebner (Apr 30, 2010)

So, I have updated the firmware AND bootloader to pull down the PWM pins as early as possible. Even if you update just the firmware you will be safe, just 0.5s later.

Images for all hardware variants are found here
http://johanneshuebner.com/quickcms/index.html?en_downloads,14.html


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> So, I have updated the firmware AND bootloader to pull down the PWM pins as early as possible. Even if you update just the firmware you will be safe, just 0.5s later.
> 
> Images for all hardware variants are found here
> http://johanneshuebner.com/quickcms/index.html?en_downloads,14.html


Tnx Johannes i will try it over weekend...


----------



## arber333 (Dec 13, 2010)

I would like to ask for your opinion Johannes.

Lately i had lot of trouble with my clutch. It is simply consumable part to my motor. It gets banged up as soon as 35000km and fails close to 40KKm no matter what quality it is. It seems that motor has so powerful slip that causes springs to jump out of its case and the frame around springs is broken. 

So i decided for now i will just buy reasonable priced clutch plate and have a spare on the shelf before 30KKm. 

In the meantime i experimented with clutchless driving. I noticed to upshift i had to get the motor to 3000rpm and to downshift at 1800rpm. Those are the speeds that synchros are aligned.
Now throttling to 3000/1800rpm and then shifting with no clutch is slow. 
My idea is, why not make motor/controler do that for me? 
Could you exploit the fact that inverter already knows RPM each moment due to cruise function? You could add 2x options RPM Upshift and RPM downshift different for every car model.

Example:
- I decide that i would like to shift from 3rd to 4th at 80km/h
- I put the transmission in N (condition)
- I press the button on shift handle to tell controller i would like to shift. (condition)
- Olimex checks in its memory where does the RPM gradient show. If RPM are progressing it will decide to shift up, if the RPM are falling it would decide to shift down.... (direction)
To shift up it will meet 3000rpm where i will decide when to move the handle. 
When button is released inverter function is returned.
For the signalling pin we could repurpose BMS input and program a selection box where we can select function for BMS pin. 

Could this be done in code? 

If we continue with this in the end we would have functioning controller for robotic transmission . Could even be done trough CAN signals to another chip.


----------



## onegreenev (May 18, 2012)

arber333 said:


> I would like to ask for your opinion Johannes.
> 
> Lately i had lot of trouble with my clutch. It is simply consumable part to my motor. It gets banged up as soon as 35000km and fails close to 40KKm no matter what quality it is. It seems that motor has so powerful slip that causes springs to jump out of its case and the frame around springs is broken.
> 
> ...


Ever try a stage III pressure plate and racing clutch that has no springs? The torque from the electric motors is hard on the clutch disc springs.


----------



## arber333 (Dec 13, 2010)

onegreenev said:


> Ever try a stage III pressure plate and racing clutch that has no springs? The torque from the electric motors is hard on the clutch disc springs.


I dont know what to say... my last clutch was stage 3 rigid clutch and it went after 30KKm. Not the springs but the splines were ripped off. I guess they made them as sacrificial element and they were softer than splines on transmission shaft. Of course on transmission they are hardened and cemented, whilst on clutch only heat treated.

So i surrendered and will go from on condition maintenance to time limited. I will simply changed clutch after one year, period. That would mean cca 35KKm.


----------



## onegreenev (May 18, 2012)

arber333 said:


> I dont know what to say... my last clutch was stage 3 rigid clutch and it went after 30KKm. Not the springs but the splines were ripped off. I guess they made them as sacrificial element and they were softer than splines on transmission shaft. Of course on transmission they are hardened and cemented, whilst on clutch only heat treated.
> 
> So i surrendered and will go from on condition maintenance to time limited. I will simply changed clutch after one year, period. That would mean cca 35KKm.


Well, don't accelerate so hard then. LOL

A first hearing about the splines giving way. Well, I'll just have to be a bit more careful then.


----------



## aeroscott (Jan 5, 2008)

sounds like misalignment ,needs to be .003 inch max


----------



## arber333 (Dec 13, 2010)

aeroscott said:


> sounds like misalignment ,needs to be .003 inch max


OK, lets say it is. So how would you go about it? 

My motor is mounted in the hole of circular plate by a flanged edge. This plate is then flange mounted on top of another plate that is bolted to transmission. But to align this plate i use two brass tubes in a close fit.
That way assembly and dissassembly is guaranteed allways the same. The only way misaligment would happen would be at centering the second plate to transmission. To remedy this i would have to:

1. Make a totaly new flange system
2. Make a new circular flange with corrected centering hole for motor AND properly turned edge that will fit on the second plate. Center of the motor and first flange then will be off for a few mm/100.

How to make this excentric plate? Any idea?

A


----------



## piotrsko (Dec 9, 2007)

Can you go double clutch disc? Sounds more like a overtorque problem to me rather than a mis alignment. If that is true, then expect input shaft to follow soon. In my experiences, the seals wear funny when it's misaligned or you get a seal groove on the input shaft.

The hemi we had used an 11" clutch disc, my ranger with the smaller disc smokes the clutch when the Kostov is at high power levels.


----------



## aeroscott (Jan 5, 2008)

It's done with a dial indicator . posted about this , can't find it ,maybe you can search it out.


----------



## arber333 (Dec 13, 2010)

aeroscott said:


> It's done with a dial indicator . posted about this , can't find it ,maybe you can search it out.[/QUOT
> 
> I put another normal clutch in and inspected the carnage up close.
> 
> ...


----------



## zippy500 (Apr 3, 2017)

Hi arber333

I can ask what you set up you have.What car do you have. what electric motor are you using. did you make a build vlog.

thanks


----------



## arber333 (Dec 13, 2010)

zippy500 said:


> Hi arber333
> 
> I can ask what you set up you have.What car do you have. what electric motor are you using. did you make a build vlog.
> 
> thanks


https://mazdamx3ev.wordpress.com/


----------



## zippy500 (Apr 3, 2017)

arber333 said:


> aeroscott said:
> 
> 
> > It's done with a dial indicator . posted about this , can't find it ,maybe you can search it out.[/QUOT
> ...


----------



## aeroscott (Jan 5, 2008)

Sounds like the way to go. 
But if you need to center something you mount the dial indicator on the flywheel (the base to the flywheel ,the whole unit turns) . the needle end indicates on the bell housing machined hole( if it does not have one mount a bearing race on bell with bolts clamps etc.) , move bell housing until zeroed out or close , then drill and pin to block. If transmission is being adapted to bell housing do the same to it.


----------



## Kevin Sharpe (Jul 4, 2011)

zippy500 said:


> All we need now is a "drop in board for the Leaf Invertor" come on guys  there is alot of tesla work going on, how about something more affordably like the LEAF motor. Please


A number of forum members have donated BMW, Nissan, Tesla and other hardware to the open source projects. Indeed, without those donations we'd still be looking at $$$$$ inverter solutions from commercial entities today 

I agree that we need low cost solutions that end users can use in more affordable cars... indeed Damien's 1000 Euro conversion will be hard to beat  However, if you want the joys of regeneration and the Leaf drivetrain, how about crowdfunding some funds to commission one of the developers to spend time making it a reality? Johannes has already shown the Leaf motor spinning with the open source inverter and I guess 5K would allow a developer to ignore the day job for a while


----------



## electro wrks (Mar 5, 2012)

zippy500 said:


> arber333 said:
> 
> 
> > You know I think you have hit the nail on the head. I want to use a leaf motor conversion. I have a old BMW Rear wheel drive, the rear boot well is rotted out. so will need cutting anyway.
> ...


----------



## jhuebner (Apr 30, 2010)

Kevin Sharpe said:


> A number of forum members have donated BMW, Nissan, Tesla and other hardware to the open source projects. Indeed, without those donations we'd still be looking at $$$$$ inverter solutions from commercial entities today
> 
> I agree that we need low cost solutions that end users can use in more affordable cars... indeed Damien's 1000 Euro conversion will be hard to beat  However, if you want the joys of regeneration and the Leaf drivetrain, how about crowdfunding some funds to commission one of the developers to spend time making it a reality? Johannes has already shown the Leaf motor spinning with the open source inverter and I guess 5K would allow a developer to ignore the day job for a while


Been keeping quiet for a while but there is stuff happening  Heres I deliberately low res preview.
It's an 80x80mm low profile SMD daughter board (it works stand-alone as well) that should greatly simplify the design of drop in boards.
It has the new resolver interface on board and of course the various pulse encoder support.
It has a 0.1 inch (2.54mm) pitch on the headers so a drop in board can be a simple prototype board that holds the OEM connectors and hooks them up to the respective signals.

That said, I have some other plans for summer, I hope my Patreon supports will bare with me... I will be biking 2-3 months through Norway and Sweden (south - north - south). I don't think I will manage to release the board before that but maybe the footprint so folks can start designing drop in boards in the meanwhile.


----------



## electro wrks (Mar 5, 2012)

arber333 said:


> aeroscott said:
> 
> 
> > It's done with a dial indicator . posted about this , can't find it ,maybe you can search it out.[/QUOT
> ...


----------



## arber333 (Dec 13, 2010)

electro wrks said:


> arber333 said:
> 
> 
> > We are off topic, but here is your alignment problem, from your blog:
> ...


----------



## jhuebner (Apr 30, 2010)

electro wrks said:


> We are off topic


Yes you are


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Been keeping quiet for a while but there is stuff happening  Heres I deliberately low res preview.
> It's an 80x80mm low profile SMD daughter board (it works stand-alone as well) that should greatly simplify the design of drop in boards.
> It has the new resolver interface on board and of course the various pulse encoder support.
> It has a 0.1 inch (2.54mm) pitch on the headers so a drop in board can be a simple prototype board that holds the OEM connectors and hooks them up to the respective signals.
> ...


That is excellent. Can you send me the pinout with I/O functions. I have the Ampera interface board drawn and fixed to fit the case. I only have to reconnect the original headers with your brain board design. I will definitely use one Lebowski brain for sensorless control of small aux inverter to drive AC compressor. I can have interface board (for Ampera) ready and made in a month since your inverter has most of signals already on the main board. 
For other inverters board configuration would be different, but that could be reconfigured quickly in Designspark.

Will you use same sensor interface as on rev 2? Or is it already built in main board?

Oh! I already use your input power supply idea for 5V on the interface board. Can you make a redesign for your brain board so it could also be supplied from external source? Like use two additional pins on your header for +5V/GND. PSU components could then be omitted. 

tnx

Arber


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Will you use same sensor interface as on rev 2? Or is it already built in main board


What sensor do you mean? Except for the resolver function the board is pretty much identical to rev2.

I think I will make a sort of datasheet for the board and an eagle library. Might create a new github account for all that.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> What sensor do you mean? Except for the resolver function the board is pretty much identical to rev2.
> 
> I think I will make a sort of datasheet for the board and an eagle library. Might create a new github account for all that.


I thought you managed to fit voltage sensing input and current sensing interface on this board also. I will have to think about that also, since signals from Ampera powerstage are pretty much straightforward. I think i will just make an interface without board limits and post it on github so anyone can design their own board for inverter from it. 
On Ampera some things are doubled and i still think about using 12V input for whole layer and to have each board its own regulator supply. But lets make it flexible. Could you put dedicated 5V/GND input with a smoothing cap on PCB? Or do you use 3V3 regulator?

A


----------



## arber333 (Dec 13, 2010)

Oh yes! I forgot... From yesterday we managed to enable another car that works with Johannes inverter in Slovenia. It is a Mazda RX8 and it uses a small water cooled 200Vdc ACIM motor. Inverter is rev 1. with single thread encoder. That is what was available at the time. Next owner would like to put a leaf motor in. When we fix interface enough. Your next board will work as a dropin replacement probably.

A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> I thought you managed to fit voltage sensing input and current sensing interface on this board also.


Meanwhile the current sensing input has come down to a simple voltage divider instead of the opamp (if you look at the Melexis current sensor boards). But good point, I will put the voltage divider on board.
I don't want the voltage sensing on board for 2 reasons:
1. Don't want high voltage on the small logic board
2. If you have an existing voltage signal from your inverter, you can't use it



arber333 said:


> On Ampera some things are doubled and i still think about using 12V input for whole layer and to have each board its own regulator supply. But lets make it flexible. Could you put dedicated 5V/GND input with a smoothing cap on PCB? Or do you use 3V3 regulator?


There are a couple of 5V pins that you can also feed 5V to. But keep in mind for resolver operation you need 12V. There is also a 3V3 reg for STM32.



arber333 said:


> Oh yes! I forgot... From yesterday we managed to enable another car that works with Johannes inverter in Slovenia. It is a Mazda RX8 and it uses a small water cooled 200Vdc ACIM motor. Inverter is rev 1. with single thread encoder. That is what was available at the time. Next owner would like to put a leaf motor in. When we fix interface enough. Your next board will work as a dropin replacement probably.


Nice to hear! Any coverage on it?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> I don't want the voltage sensing on board for 2 reasons:
> 1. Don't want high voltage on the small logic board
> 2. If you have an existing voltage signal from your inverter, you can't use it


Yes i realized it could be a hazard. Ok i can implement it on the interface board then. 
What kind of existing voltage signal would inverter have? Like a digital signal?



jhuebner said:


> There are a couple of 5V pins that you can also feed 5V to. But keep in mind for resolver operation you need 12V. There is also a 3V3 reg for STM32.


I would rather have a dedicate 5V and GND pins with smoothing caps so supply is covered. Can you put a 2x3 pin header near the edge of board. You could alternatively populate either regulator components or just header with caps. Also you could use those pins as mechanical support on interface board.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Yes i realized it could be a hazard. Ok i can implement it on the interface board then.
> What kind of existing voltage signal would inverter have? Like a digital signal?


It has an analog signal that needs a pull-up resistor. Its swing can be controlled by the value of that resistor. So I scaled it 0-3.3V. I would expect something similar on any OEM board or did they connect HV to their logic boards?

As for the dedicated 5V header I don't quite understand. There are caps distributed throughout the board anyway.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> As for the dedicated 5V header I don't quite understand. There are caps distributed throughout the board anyway.


OK then, if you agree i would power board trough ex sensor board input header. Would that be ok?

EDIT: I would now just need new board headers so i can position those on interface board. Can you send them to me? You use eagle?

A


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> OK then, if you agree i would power board trough ex sensor board input header. Would that be ok?


Yes, if you don't intend to use resolver.

Yes I use eagle. Just give me some time I will make an eagle lib. I don't want to send around the actual design files just yet.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Yes, if you don't intend to use resolver.
> 
> Yes I use eagle. Just give me some time I will make an eagle lib. I don't want to send around the actual design files just yet.


Ok then i will make 12V layer on the interface board, GND is the same still.

Whenever you are ready J. Can you at least confirm if the 26p header is the same configuration as rev. 2 so i can begin connecting functions.

Arber


----------



## aeroscott (Jan 5, 2008)

electro wrks said:


> arber333 said:
> 
> 
> > We are off topic, but here is your alignment problem, from your blog:
> ...


----------



## arber333 (Dec 13, 2010)

aeroscott said:


> electro wrks said:
> 
> 
> > On this the dial indicator gets clamped to the shaft .Sometimes the shaft has to much flex or looseness, replace by removing shaft, jamming a dog leg stick (LOL,no centering necessary,the body of the dial indicator will be orbiting around the center of the hole/bearing,needs to fit tight ). Then cut a hole in the plate so stick/shaft and dial indicator can orbit on the other side of the plate , as you turn the trans shaft/stick . You will be clamping a bearing race on the outside face of the plate. When dialed in that will give you the center when you chuck in the lathe . Then you can cut a concentric seat for the trans .If thats done (stock trans/ bell) then mount the trans side of the bell in the 4 jaw or face plate ,center with dial indicator in the tool post of the lathe , turning by hand and adjusting the jaws until centered , then cut the grove to fit the motor.This last step needs to be done for ether side to be machined (bell to trans or bell to motor)
> ...


----------



## aeroscott (Jan 5, 2008)

If you have 2 plates and want to get them parallel . You can use a dial indicator in a large C clamp. Measuring with the gap in the C and the dial indicator making one leg . If you need to know the thickness ,put a known block in between the "C" legs .


----------



## JRP3 (Mar 7, 2008)

Maybe take this to another thread since it has nothing to do with the topic?


----------



## arber333 (Dec 13, 2010)

JRP3 said:


> Maybe take this to another thread since it has nothing to do with the topic?


Lets not mess up Johanness thread. I did get some ideas how to proceed thank you all who contributed. 

A


----------



## jhuebner (Apr 30, 2010)

Just uploaded a new firmware
http://johanneshuebner.com/quickcms/index.html?en_downloads,14.html

It fixes occasional lockups in the terminal.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Just uploaded a new firmware
> http://johanneshuebner.com/quickcms/index.html?en_downloads,14.html
> 
> It fixes occasional lockups in the terminal.


I am now trying the one before firmware and i find the new option for throttle time buffer fantastic! Well done Johannes.
My car now does not shake when switching from braking to throttle anymore. I still have to tune it up a bit to get faster response, but now it is up to me not the car .


----------



## arber333 (Dec 13, 2010)

Hi Johannes


Throttle delay works beautifuly. My poor clutch is grateful . I can finally use 3Hz slip and full power to start and switch to regen immediately. Before it caused serious jolting, now i can feel only decceleration.



I got your WiFi gizmo! I must say you made a fine package with QR code and all...
It works with data you provided. However i cant receive any parameters from my inverter. And i cant get dials to show. Swirling icon is showing like it is searching for signal. Is it something in code? I use one before latest 3.59 code version i belive. 

How do you connect comm cables? I connected RX(gizmo) - TX(olimex) and TX(gizmo) - RX(olimex) like with Arduino. Is that good?


tnx


Arber


----------



## jhuebner (Apr 30, 2010)

Hi Arber,

good you like it 
So it seems either RX/TX swapped or inverter not running. Does it blink?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Hi Arber,
> 
> good you like it
> So it seems either RX/TX swapped or inverter not running. Does it blink?


Green LED on olimex is blinking but red LED on gizmo is steady. Should it be blinking then? I will simply reverse RX TX then. 

A


----------



## arber333 (Dec 13, 2010)

I got some data from Ampera inverter IGBT temp sensors.
They are obviously analog sensors. Each phase has its own sensor. 

Water test showed results:
Approx. 50C .......... 2 kohm
Approx. 20C ............ 5,40 kohm
Approx. 5C ............ 11 kohm
15 min in -18C ........ 16 kohm


I dont have Hitachi MBB650SV6A datasheet so i cant tell exactly, but theese are results.
Johannes could you insert those values in software for additional sensor so we could use sensors directly built in Ampera IGBTs. Also tell me if i would need to make some resistor interface to keep resulting voltage inside 3V window. This would be solely on Ampera interface. Your PCB would still remain generic.



A


----------



## jhuebner (Apr 30, 2010)

Hi Arber,

4 values is a bit crude for a good lookup table, maybe you can find a data sheet.
The pull-down resistor on the generic sensor board is 1k2. Would work with the ampera sensor also, 50C -> 1.875V


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Hi Arber,
> 
> 4 values is a bit crude for a good lookup table, maybe you can find a data sheet.
> The pull-down resistor on the generic sensor board is 1k2. Would work with the ampera sensor also, 50C -> 1.875V


Yes i know, i will get a proper digital thermostat water pump and 3kw inline water heater and i will measure sensor R in steps of 5deg. from 20deg to 60deg. I will also do this for Leaf motor sensor. I think that should cover both sensors.

Now i have installed newest firmware and tried gizmo. It works without problem. I could even update software trough it. You feel BUT comming?

Well when i shutdown car and tried to restart it Olimex locked out. I think it was under impression there was something waiting to update bootloader. But no data arrived and it sat there waiting. I had to press reset button for it to recover. Well i solved this problem before on long serial cable. Just had to add 10K resistor from signal lines to GND and it causes 0 traffic on startup.

A


----------



## jhuebner (Apr 30, 2010)

Oh yes, missing piece of information from my side.
The old bootloader interprets any number from 0-255 as an update request, where number is the number of pages of the update.

The esp8266 outputs some garbage at startup so stm32 gets stuck in bootloader.

So I modified the bootloader to expect some magic byte and then the number of pages.

It is in the zip-file, you have to flash it with some jtag/swd adapter.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Oh yes, missing piece of information from my side.
> The old bootloader interprets any number from 0-255 as an update request, where number is the number of pages of the update.
> 
> The esp8266 outputs some garbage at startup so stm32 gets stuck in bootloader.
> ...


Well that is no longer an issue. I soldered two small 10K resistors to gizmo board. One directly from TX to GND and another from RX to one GND exposed contact. Incidentaly that was one of SOIC chip legs. It now works perfectly. 
Its me you know, i allways prefer hardware solution, its just how MEs are... 

DOH! It is not OK. It only seemed that way. Since i soldered 10Ks no WiFi! I removed them and it is good.
I guess i have to conform to software solution. 

EDIT: I flashed bootloader to Olimex and sure enough it works. I got good signal. My phone misses signal inside car, but outside i got it good. I think firewall is too thick. 
Laptop however has the signal from inside the car, which is good for diagnostics and tuning. I think even tablet dash instruments are not excluded.
Hm... could we program one rasppi with 5in display to start and connect directly to inverter server with some dials preselected. 

A


----------



## jhuebner (Apr 30, 2010)

It's alive


----------



## arber333 (Dec 13, 2010)

Hi Johannes 

I saw new parameter names in web interface. Can you explain how are they applicable?

throtramp - selfevident since i lobied for it 
UDCcharge - is that minimum voltage when charger is still active?
encmode - do we just need to connect ABZ pins or resolver pins or is there anything else to do before we can choose? What do you do with SPI?

tnx


----------



## jhuebner (Apr 30, 2010)

UDCcharge - where did you find that?

Maybe you meant

udcswbuck - Precharge voltage in buck mode - it is higher than in drive mode

encmode:


Single - good ol' .. implies async motor
AB - as before and implies async motor
ABZ - as before and implies sync motor
SPI - Talk to AD2S chip via SPI. deprecated as those chips are no longer needed. implies sync motor
Resolver - new resolver mode. Needs excitation stage on pin PD2 and expects sin/cos signal on PA6/PA7. implies sync motor
Parameter syncmode has been dropped because the feedback of async is unlikely to be a resolver or ABZ type encoder.

So for resolver mode with the current V2 board you need something like this connected to "encoder" pins: http://www.diyelectriccar.com/forums/showthread.php?p=971713#post971713


Next board will have it on board


----------



## arber333 (Dec 13, 2010)

Hi all!

I removed my failed clutch and put in serious insert type coupling. Yes it failed again and i didnt remove it too soon, because one of the springs was ejected out and clutch housing was cracked. All this after 3000km! 
New coupling has plastic insert to dampen vibrations and is assembled fixed. No tought of shifting... Well transmission still works and since there is no flywheel there... it works. I can shift at certain rpm. 
I put one hole in shift lever and put in small button that decouples motor electrically using BMS input pin. It works also with transmission switch for reverse light. Main thing is that regen goes to 0 and throttle is some 30% less than in normal mode. Then motor has less resistance and synchros grab the new gear and shifting is as easy as before. There is some resonant vibration in lower RPM region with low throttle but it subsides when more throttle is applied. I traced this to 25yrs old chewed up motor mounts.

My point is using BMS input pin i can relese motor from torque and effectively shift normal gearbox without clutch. This could also be used to preset motor to some rpm (without a lot of torque) so shifting could be even easier. I also put a switch under the dash to disable regen in case of heavy icing or water in the street.


----------



## tylerwatts (Feb 9, 2012)

Very cool arber. Would be brilliant to have the rev matching gear speed like you said.

But I do wonder, with so much used EV parts available these days, this seems a bit wasted. However I fully appreciate the advantage of multiple gears. My golf GTE was great but that was also through a dsg transmission so all automatic.


----------



## jhuebner (Apr 30, 2010)

Yeah this should hold up. I'm jealous that you cover so high distances with your EV! I've barely reached 25000 total.


Up-shifting without clutch is so easy with regen off that I'm not really motivated to develop speed matching stuff. Still someone can do an external unit that talks to the inverter.


Downshifting 5, 4, 3 needs a little blip on throttle and works quite well also. Just downshifting to 2nd and 1st is impossible with my transmission but theres no need for such low gear besides driving in the forest.


----------



## ALIE (Jan 28, 2015)

Hello Johannes!
I've made 60tkm with your inverter.
All together I go 120tkm.in and continue.
All the best
Aleš


----------



## motorulf (Nov 16, 2016)

Hello 

I have just completed the soldering of one of these.
Now i am trying to flash some code onto a Olimex STM32-H103.
I have tried the files linked from Johannes´s download page.
Both the bin and the hex files.
I have tried to flash only the loader, or only the sineHWCONFIG_REV2.
Also first the loader and then the sineHWCONFIG_REV2, offsetting for the loader...

Whatever i do i can´t connect to it via the frontend.

What am i supposed to flash into the STM32?
In what order?
Does it matter if i choose bin files or hex files?
Is there any magic recipe i can follow?

I am using OpenOCD and OLIMEX ARM-USB-OCD-H for flashing.

I am a total noob with this, so excuse my stupid questions


----------



## jhuebner (Apr 30, 2010)

For flashing via JTAG or SWD you should use the hex files as they have the correct address offsets in them. Flash both, boot loader and ...sine.hex. You should see a blinking led on success.

Combi board is REV1 compatible. 

Subsequent updates can happen via web interface or python script using bin file


----------



## motorulf (Nov 16, 2016)

That worked 
Thank you!


----------



## motorulf (Nov 16, 2016)

One more thing...

This combi-board has CAN on it.
The REV1 does not support this? (according to the readme i does not).
Is REV2 not compatible with this board?
What firmware can i use to get CAN on this board, if any?


----------



## jhuebner (Apr 30, 2010)

CAN works in all revisions.
REV2 just swaps some pins that had to be re-assigned


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> CAN works in all revisions.
> REV2 just swaps some pins that had to be re-assigned


Johannes

Can you tell me how does the Fault signalling apply to the new small board? I have made the interface, but i cant find the pin that would trigger PWM stop in case drivers signal fault. Is it on PWMoutput connector or is it on main connector? You can use this pic and mark which one it is.
I am ready to sent this board for production.


----------



## jhuebner (Apr 30, 2010)

You are using the correct one on the PWM connector.It has pullup to 5V via 10k resistor and is loaded with 1nF filtering cap


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> You are using the correct one on the PWM connector.It has pullup to 5V via 10k resistor and is loaded with 1nF filtering cap


Also you can see from photo i use SN74L chip to invert signals. I connected output signals in a pullup +5V config, each signal its dedicated pullup resistor. However SN74L datasheet shows a different configuration. They recommend using 1k protection resistor and directly connecting +5V to the driver input on other end. I am not sure about this.
Can you comment if i need to change my config or would it be ok?

EDIT: It could also be used without SN74L chip. I could simply connect chip output pads to correct inputs and use existing pullups with inverted signals from olimex chip.


----------



## jhuebner (Apr 30, 2010)

Had to cancel the MOSFET project. So that gives me some more time for the new main board.


I had tested it with 2 6Ohm speakers in series (because the resolver is 12R) and that gave me a really distorted output. Reason being that the DIP version of the LM386 can output 1W while the SOIC version can only output 325mW.

Likewise with the actual resolver. So I attenuated the signal from 11V peak-peak to 5V peak-peak. The output is still somewhat distorted and the SNR suffers from the low amplitude of 1.3 peak-peak on the ADC. So the angular jitter is now 3°.


While I could probably run the motor with that kind of jitter I would much rather upgrade the excitation amplifier to get the good SNR I had before. Unfortunately there are no pin compatible parts so I will have to run another redesign.
EDIT: actually there is: https://www.mouser.de/ProductDetail/NJR/NJM386BM?qs=sGAEpiMZZMtxdzBvM0rKcWwaYVJbKtZqVR1XbUQnGBM=


So, that was one step back, but getting there.


----------



## motorulf (Nov 16, 2016)

Hello again 

I try to bench test my Combi inverter board from Damien.
I communicate with it over USB with the tuning.py script.

I get to this:
"Sanity check passed, continuing
Now start the inverter with the start signal Pin 7"

Which is pin 4 on the combi board.
I connect that to 12V, nothing happens.
I also tried to connect 3V to the PB6-pin on the STM32-H103, still nothing happens.
I thought that i had somehow fried that input pin on the STM32 so i bought an other one, still same result.

What am i missing here? 
Sorry about the noobiness...


----------



## arber333 (Dec 13, 2010)

motorulf said:


> Hello again
> 
> I try to bench test my Combi inverter board from Damien.
> I communicate with it over USB with the tuning.py script.
> ...


Well there are some conditions: http://johanneshuebner.com/quickcms/index.html?en_main-board-version-1,21.html
http://johanneshuebner.com/quickcms/index.html?en_schematics-and-instructions,9.html

1. You have to connect current sensosrs and calibrate them, brain doesnt work if sensors are not connected.
2. You have to connect and calibrate voltage sensor. Also you have to set correct Udcswitch voltage levels, so contactor can close.
3. You have to connect MPROT pin11 to 12V 
4. You have to connect EMGCY pin17 to 12V
5. You have to connect either FWD pin13 or REV pin15 to 12V but not both at the same time. 

I recommend you connect also warning pins 14 and 16 to LEDs so you can see if there is an actual problem
With Damens board i recommend you get his wiring and translate pinouts from Johannes to his interface. Once you have this setup connect propper pins to 12V and GND and only then use START button pin7.


----------



## motorulf (Nov 16, 2016)

Thank you!

This helps a lot.
I am not sure how i could have missed that page on the second link, the whole instructions part, but apparently i did. [facepalm]

Now i am slowly moving forward again.


----------



## tom3141 (Jul 2, 2016)

I've got one of Damien's combi boards running an Enova inverter. I had it up and running from a 30V DC power supply a while back and everything worked great. I recently connected it all up again to try out my new throttle pot and get all the sensors working properly. I've had some issues which I'm hoping you guys can help with.

With the combi board powered up and 30V (limited to 20A) on the DC bus, every time I pressed the start button the power supply would hit the current limit as if there was a short. I double checked everything and retried a few times and eventually it turned on ok. It did drive the motor but there was a strange clicking noise coming from the inverter that I'd not heard before. 

Yesterday, I tried again with a different power supply just to rule out the possibility of dodgy power supply. It did the same thing again but this time I couldn't get it to start at all even after multiple attempts. Every time I pressed the start button it just hit the current limit of the power supply. I had a read on here and noticed mention of the new firmware to make sure all the PWM pins are low. I have now flashed the new firmware and this has fixed it so that I can start the inverter up with no issues. However, it now hits the current limit of the power supply whenever I press forward or reverse (with the throttle pot at 0). This problem disappears if I unplug one of the IGBTs from the combi board. The other two appear to be fine.

It seems that I've been having the problem where the PWM pins are high on start up which has shorted one of the IGBTs. I'm guessing this may have now caused permanent damage to something. Any ideas what the most likely culprit is? Will it be the IGBT module itself? Is there any way I can test this?

Thanks,

Tom


----------



## arber333 (Dec 13, 2010)

tom3141 said:


> I've got one of Damien's combi boards running an Enova inverter. I had it up and running from a 30V DC power supply a while back and everything worked great. I recently connected it all up again to try out my new throttle pot and get all the sensors working properly. I've had some issues which I'm hoping you guys can help with.
> 
> With the combi board powered up and 30V (limited to 20A) on the DC bus, every time I pressed the start button the power supply would hit the current limit as if there was a short. I double checked everything and retried a few times and eventually it turned on ok. It did drive the motor but there was a strange clicking noise coming from the inverter that I'd not heard before.
> 
> ...


Hm... different ways to skin a cat here.
Did you check Driver integrity? Maybe one of the drivers has a faulty solder? Also check DCDC power supplies. If you used Murata DCDCs they should be good, but you never know...
What is your 337 desat RC setting? Did you calculate it? Stock RC combination works up to some 100A.
What is your deadtime setting in software? You may be getting a shootrough on one IGBT. I use quite large value, but for most cases 85 deadtime value should work. Check deadtime on scope WITH IGBTs connected and no power on DC link! both signals turn-on and turn-off curves should not overlap.

I had more or less the same problem with IGBTs a year ago. 
This is why i selected Skyper 32 pro drivers to run my IGBTs. They are industrial quality and have all the protections built in. I just made an interface board that provides 15V power supply and separates driving circuits from sensors. 
You can find it here, designed in DS: 
https://github.com/arber333/Skyper-32-interface
Rev 2 board is in design, but Rev 1 works good in my car for more than a year now....

As for inspecting integrity of IGBTs i built one driver PCB that Damien constructed. It has ACPL 337 chip that can sense desat condition. I added one LED from Fault pin to 5V to signal if chip reports fault. Normaly i would connect it to suspect IGBT on G, E and C connector and provide 5V power. Then i would remove C line as a proof test if ACPL 337 works. 

With this setup i got Fault reports on IGBTs that passed my light bulb test and i considered them good. That really opened my eyes.

Crude light bulb test of IGBT is here, but it doesnt always show degradation of gate substrat.
http://inverterhome.blogspot.com/p/how-to-test-igbt-module.html

Warning! Do not touch GE terminals with your fingers, you may cause static discharge that kills IGBTs. Always use ESD wristband with ground point when handling power electronics.


----------



## jhuebner (Apr 30, 2010)

tom3141 said:


> With the combi board powered up and 30V (limited to 20A) on the DC bus, every time I pressed the start button the power supply would hit the current limit as if there was a short. I double checked everything and retried a few times and eventually it turned on ok. It did drive the motor but there was a strange clicking noise coming from the inverter that I'd not heard before.


Strange clicking usually means that one igbt is permanently closed and the other switches “into“ it. If you've only been using a lab power supply I don't suspect a broken IGBT (unless it was broken to start with). It also sounds like an intermittent fault so check signal integrity from mcu to gate driver. Check that all drivers output -8V in stop mode.


----------



## tom3141 (Jul 2, 2016)

Thanks for the help guys. 

I'm away for a couple of weeks from tomorrow but will do the tests you suggest when I get back.

Tom


----------



## tom3141 (Jul 2, 2016)

I can't believe an entire year's worth of this thread has gone missing!

You may remember that I had an issue with Damien's combi board running my Enova inverter. One of the IGBTs seems to be shorting when I turn it on (powered with a 30V PSU).

Any chance that those of you who replied a month ago could remind me of the tests that you suggested I should do? I didn't expect the last year of the forum to have gone missing when I returned from holiday!


----------



## arber333 (Dec 13, 2010)

Hi Johannes

I am back home. There are some other stuff i will be doing this week, but i would also like to solve the problem with inverter.

Yesterday i had a new development. I had made new small interface boards that can connect rev. 2 and rev 1 main boards. They include signal inverting and current sensor connectors. But there is also inverter temp output. It is compact and suits well to single inverter use.
However i still got OC limit error on trying to connect with inverter. When trying to find error i pulled driver cable and OClimit stopped. When i investigated i found out that pin i thought as driver Fault pin is automaticaly connected to GND. There is like 47R difference from Fault pin to sensor GND. I would like to use Fault pin. 
Do you have an idea how to use your scheme with that signal connection? Probably this pin goes high when Fault condition, but i am not sure how to test it. Do i just join two phases? Or phase and - Batt?


----------



## tom3141 (Jul 2, 2016)

So, I've had another go testing the inverter. Yesterday, I hooked it back up to a 30V power supply and it ran ok but would intermittently make the strange clicking noise. I figured out the noise is actually coming from the PSU not the inverter. I think that the PSU is cutting in and out really quickly (due to a short?) causing the clicking noise. Then after a brief break for some food I came back to it and it worked perfectly with no clicking at all.

I gave it another go today to see if it was fixed for good but sure enough it's not working again. This time it's back to shorting as soon as I click forward or reverse (throttle at 0). Again if I unplug the third IGBT it fixes it so I suspect there is a problem with the control electronics for this IGBT. 

I'm mechanically biased so could do with some guidance on what exactly I should be checking. So far I have checked for obvious things like dodgy connections and also tried increasing the deadtime in software (it was set at 63). This made no difference.


> It also sounds like an intermittent fault so check signal integrity from mcu to gate driver. Check that all drivers output -8V in stop mode.


Could you expand on the best way to do this? Which pin do I need to be checking for -8V? Sorry if it's obvious but I'm a novice in this kind of thing and I'm wary of sticking a scope/voltmeter in the wrong place and causing more problems!


----------



## arber333 (Dec 13, 2010)

arber333 said:


> Hi Johannes
> 
> I am back home. There are some other stuff i will be doing this week, but i would also like to solve the problem with inverter.
> 
> ...


It seems the pin no. 4 of the Volt inverter driver cable is not actually a Fault pin, but a signal pin of some kind. I guess it signals a change of operation to brain... 
It changes state 
- open collector to GND in normal operation 
- floating pin when signaling something

Signal always goes to float when i start PWM so in the beginning it was quite frustrating to figure out where the problem was. 
Now i dont think it will impede my use of Volt inverter, i just would like to have a Fault signal to supplement current sensors OClimit and be universal to different control boards. Anyone knows what signal is for?


----------



## arber333 (Dec 13, 2010)

tom3141 said:


> Could you expand on the best way to do this? Which pin do I need to be checking for -8V? Sorry if it's obvious but I'm a novice in this kind of thing and I'm wary of sticking a scope/voltmeter in the wrong place and causing more problems!


You measure isolated voltage between pins G and E of each transistor. Best to use a scope. You put black probe on E and red on G. Since to keep IGBT closed you need a bit of negative voltage you measure and confirm your signals. Usually they are -8V or -5V depends on driver isolated supply. 

I marked photo of my driver board, it is basicaly the same as Damiens Enova board except for connectors. I also marked photo of Damiens enova board from post here.

Measure Gx and Ex signals only. Dont measure different channels at once Gx and Ey etc... since you can create short even using different scope channels. Cheap scope channels use common GND so your signal under power can quickly rise above 36V difference driver chip can survive. 

I usually measure dead time and signals with dual channel scope but i dont connect any rail voltage for this! 

A


----------



## arber333 (Dec 13, 2010)

arber333 said:


> It seems the pin no. 4 of the Volt inverter driver cable is not actually a Fault pin, but a signal pin of some kind. I guess it signals a change of operation to brain...
> It changes state
> - open collector to GND in normal operation
> - floating pin when signaling something
> ...


No that is not the case! I managed to connect my scope to inverter while driving the car. FAULT signal stays low during operation. Problem is there is a 50us signal from power stage that jumps up and i guess it triggers transistor base. Also OClimit is thrown from current sensors since hash builds up 2x over the signal. It doesnt help to raise OClimit to 2000A since hash in signal raises over 4V quickly.
I put 4K7 pulldown resistors to signal lines and it helps some, but i really think i will have to use cable shield for sensor cables.


----------



## tom3141 (Jul 2, 2016)

Thanks for the help, that's exactly what I needed to know. I will give it a go and post the results.


----------



## jhuebner (Apr 30, 2010)

Just wanted to say I'm back from the biking adventure and want to get back to work asap.


----------



## zippy500 (Apr 3, 2017)

Welcome back


----------



## ECOENERGI1 (Oct 19, 2017)

Good to have you back Johannes, some beautiful scenery on the bike tour....


----------



## arber333 (Dec 13, 2010)

Welcome back Johannes.
I hope your batteries are recharged .

I have been looking your new SMD board and tried to start, but it keeps tripping OClimit. I have all relevant pins connected. I have current sensors connected. I have voltage and temp sensor connected and showing voltage. I use rev. 3 sensor board however. 

Something occured to me yesterday. You stated you use reverse polarity protection. I suspect this is one power diode D2 on the 12V input yes? 
Well i dont have that populated on SMD board since i use my own dedicated 5V power supply. Could lack of 12V supply aft of the main cap cause positive comparator logic on main chip not getting the ON signal?

I will join those tracks and try to run again.

A


----------



## jhuebner (Apr 30, 2010)

Hi Arber,


yes I'm in good shape and ready to sit on my bud 
The diode is the only component on the 12V net and optionally the flyback diodes of the uln2003. The board is fully functional with only 5V supply. So that wouldn't be the culprit.


----------



## arber333 (Dec 13, 2010)

Very good! 
We will have to "shoot this trouble" point to point then...

Before i forget, here is the datasheet for Ampera/Volt IGBT module. In there is the temp sensors curve. Can you add that sensor to your rev. 1 and rev. 2 software so i can use it for test inverter? 

Drivers i still dont know, i do know they use high impedance logic to signal Fault state. They signal normal operation with signal low! So i used one small NPN transistor with high base threshold and use pullup resistor to translate signal to our logic.

tnx

A


----------



## jhuebner (Apr 30, 2010)

Worked on CAN control this morning.


This is the current state:


Throttle / Regen must be explicitly set to CAN mode
pot and pot2 must be mapped to a CAN message (web interface supports this now)
Digital IO can be mixed CAN and gpio
canio must be mapped to a CAN message
canio has a fixed mapping: 1=Cruise, 2=Start, 4=Brake, 8=Fwd, 16=Rev, 32=Bms
It is ORed with the gpio inputs, so e.g. cruise_final = cruise_gpio | cruise_can
Both pot and digio time out after 500ms
On timeout throttle is set to 0 and ios to false
To be done:


Timeout means "no message has been seen on the CAN bus at all for 500ms". Of course thats misleading, we should only care about messages mapped to the inverter
Therefor I need to set up the hardware filtering

Any other suggestions?
EDIT: haven't updated the official firmware yet as I want to do more testing prior to that


----------



## jhuebner (Apr 30, 2010)

Did the basic Polo driving test and all seems well.
So the software is now released as version 3.75
The updated web interface is now also contained in the zip file. You basically need to upload index.js via the "Update" section to get the new functionality. All other files of the web interface remained unchanged


----------



## jhuebner (Apr 30, 2010)

And docs updated:
http://johanneshuebner.com/quickcms/index.html?en_can-communication,31.html


----------



## arber333 (Dec 13, 2010)

Hi Johannes

Ampera inverter still causes EMI trouble. I am doing tests with 50V now and i can still see hard switching spikes. I tried to vary dead time and it shows significant improvement at 88pt which is 1.6us. However this is lower than datasheet declares for safe timing and i still dont know driver time. Accorcing to datasheet I expected it to be at least 3.1us since i dont know driver type. However i can anticipate 800ns since it uses PNP/NPN amplifier. 
I did copy your current sensor design, at least resistor divider and RC. Benefit is now i can use positive values for OClimit and ILx_gain. 

I have noticed you changed/added new parameters that show state in bottom section of interface site.
One is din_desat and one is din_ocur which was there before. However they now show state "1" and system works. It used to mean that state 1 tripped action. Can you explain change in polarity? Is the new SMD board able to run this? Can i update SMD board to rev. 3.75 over wifi?

tnx


----------



## arber333 (Dec 13, 2010)

Johannes could you input Ampera thermistor data in your code? I believe i sent you datasheet for response graph.

Also Leaf thermistor test results i posted here? I could better integrate everything that way.

tnx


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Did the basic Polo driving test and all seems well.
> So the software is now released as version 3.75
> The updated web interface is now also contained in the zip file. You basically need to upload index.js via the "Update" section to get the new functionality. All other files of the web interface remained unchanged


Hm.. could i run inverter in charger mode and vary amps using CAN commands? Also could i start/stop inverter/charger by CAN command?

BMS using CAN is not that rare...

tnx


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> I have noticed you changed/added new parameters that show state in bottom section of interface site.
> One is din_desat and one is din_ocur which was there before. However they now show state "1" and system works. It used to mean that state 1 tripped action. Can you explain change in polarity? Is the new SMD board able to run this? Can i update SMD board to rev. 3.75 over wifi?


A yes I have unintentionally swapped polarity. Basically din_ocur and din_desat are now physical pins and I show their state. din_ocur is high when all is good, I know I used to invert this. The software will run on the SMD board. 




arber333 said:


> Johannes could you input Ampera thermistor data in your code? I believe i sent you datasheet for response graph.
> 
> Also Leaf thermistor test results i posted here? I could better integrate everything that way.


I'm currently working on a more universal method using the B-value of NTC termistors instead of lookup tables.




arber333 said:


> Hm.. could i run inverter in charger mode and vary amps using CAN commands? Also could i start/stop inverter/charger by CAN command?
> 
> BMS using CAN is not that rare...


Yes, check docs linked above. You could either use SDO to change chargecur or map chargecur to some arbitrary message and change it that way. With CAN mapped IO you can trigger BMS pin or forward/reverse pair.
http://johanneshuebner.com/quickcms/index.html%3Fen_can-communication,31.html


----------



## jackbauer (Jan 12, 2008)

For centuries humanity has struggled with the age old question : Just how do I run one of these crappy Enova inverters? Behold yet another logic board!
https://github.com/damienmaguire/Enova-Inverter


I have added Johannes's resolver interface to allow for PM motor experiments. Prototype will be tested in my BMW E65 build. Enjoy


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> I'm currently working on a more universal method using the B-value of NTC termistors instead of lookup tables.
> l


Nice! So idea is to just input beta for our thermistor and we are good.
I suppose it could be made for motor sensor as well. It is NTC also.
EDIT: My bad, KTY84 is PTC .


----------



## jhuebner (Apr 30, 2010)

jackbauer said:


> For centuries humanity has struggled with the age old question : Just how do I run one of these crappy Enova inverters? Behold yet another logic board!
> https://github.com/damienmaguire/Enova-Inverter
> 
> 
> I have added Johannes's resolver interface to allow for PM motor experiments. Prototype will be tested in my BMW E65 build. Enjoy


Are you using the DIP8 version of the lm386? Only that can push 1W. And then theres the NJM386 which has the wider "DMP-8" body and supposedly 0.5W output. Last but not least the mysterious LM386 SOP with maybe some higher power. Will be trying the latter next. The LM386M (8-SOIC) with only 325mW couldn't drive the Leaf resolver with sufficient amplitude to get a good SNR on the return lines.




arber333 said:


> Nice! So idea is to just input beta for our thermistor and we are good.
> I suppose it could be made for motor sensor as well. It is NTC also.
> EDIT: My bad, KTY84 is PTC .


Yes thats the idea. But KTY being PTC is bad news then... Maybe there some fancy math to accomodate these as well? Negative beta maybe?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Yes thats the idea. But KTY being PTC is bad news then... Maybe there some fancy math to accomodate these as well? Negative beta maybe?


Hm, KTY84 is so widespread sensor that almost every modern motor uses. It would be best to leave it in as an option besides general NTC thermistor.
But hey i see it also has a typical koefficient of 0.61 %/K from 60°C up to 130°C. That should cover our application up to 140°C wont it? I mean if i see 140°C motor temperature i am getting anxious to stop and let it cool down.

A


----------



## jhuebner (Apr 30, 2010)

Just had another look at the existing sensors and only one is NTC. So I think implementing a generic method might not be worth the effort. I'll just keep maintaining lookup tables.


----------



## arber333 (Dec 13, 2010)

Hurah! I drove my car on the driveway with Ampera inverter!
I used rev. 2 mainboard and a small interface PCB to collect driver and current sensor signals together. i tried to keep cables at minimum. 

I have made a quick surgery on my car, transplanting inverter and splicing signal cables to keep the same logic connector on the car. I used only essential wires and a single mode encoder, but i could drove uphill with handbrake on and no OClimit is tripped! I have OC set to 600A. I use deadtime 185pt which is 3.6us.

Ampera inverter is more noisy in comparison with my existing inverter, but that was expected since it is not optimised yet. 

Johannes can you code in Ampera thermistor and Leaf motor thermistor so i can start experimenting with PM code?

tnx


----------



## jhuebner (Apr 30, 2010)

Very good!
Can you post the Leaf data here again, I can't find it.
Just dialed in the MBB600/Ampera NTC.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Very good!
> Can you post the Leaf data here again, I can't find it.
> Just dialed in the MBB600/Ampera NTC.


Sorry i forgot i put my post at ampera inverter thread. 
https://www.diyelectriccar.com/forums/showpost.php?p=1011649&postcount=78

Would you also need values up to 100°C or can you extrapolate to there? I think PM magnets can live up to maximum 100°C and then became a pile of metal without magnetic properties, so having more than 100°C is overkill.

tnx


----------



## jhuebner (Apr 30, 2010)

ok. What troubles me a bit is this: 25°C ---- 4,3K. It should be 5k according to the datasheet.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> ok. What troubles me a bit is this: 25°C ---- 4,3K. It should be 5k according to the datasheet.


Yes... i measured resistance with multimeter and switched on/off heater when i got the correct temperature of water. Ampera inverter reaction to temperature change is very fast. That is why i am happy i got datasheet from prof. Kelly. I must have put some error in process while working. Anyways it is ambient temperature, hardly worth alarming over. 

Leaf motor is not so fast. Its mass is greater and i had to wait for quite some time for temperature and measurement to stabilise. In the end i decided to heat motor up to maximum and keep the water running. Then i would switch heater off and wait for temperature to stabilise. I measured the water directly as well as the side of the motor.
And of course Leaf thermistor is not so linear. Do you think i try to measure again this time up to 90°C?
I got a procedure for leaf motor thermistor testing, but it is up to 40°C only...


----------



## jhuebner (Apr 30, 2010)

Ok, temperature/resistance from their table matches my beta-curve pretty good. Basically I calculated beta with the online tool and calculated the table from that.


Firmware coming your way, please test.


Did you ever find the heatsink temp signal on the Leaf inverter?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Ok, temperature/resistance from their table matches my beta-curve pretty good. Basically I calculated beta with the online tool and calculated the table from that.
> 
> 
> Firmware coming your way, please test.
> ...


Tnx I will test code later today.

I would like to tell here that Ampera/Volt current sensors gain ILx_gain value is 3. I calibrated yesterday and sensors work up to 700A. 
I only use two of them, but we could design a comparator that would trigger NAND gate directly if 700A would happen. That would give us additional protection on all three phases.
I must say i had to cut current sensor traces and solder resistor divider between connectors, but everything works. Benifit of that was direct current sensor connection without op amp and OClimit and sensor input is not inverted in code anymore. I secured everything with silicon sealant.


----------



## arber333 (Dec 13, 2010)

So i want to write another observation.
Yesterday before i ran Ampera inverter in torque mode i tried to turn motor on 360Vdc in manual mode by just providing it V/Hz. 
I couldnt start it! 
1. I started inverter on 12V, and turned the start key. 
2. Connected WIFI module
3. Put inverter in manual mode
4. fweak was set at 150Hz
5. give fslipspnt 10Hz and ampnom 50
Motor would start to buckle and rumble, but not rotate. 

Well at 50V and small ACIM pump motor i got normal rotation! 
I tried every trick, but in the evening i lost interest and connected encoder (single mode), reset controller in start 1. Motor rotated instantly when i applied throttle. 
Did i do something wrong or is software logic changed now? 

A


----------



## jhuebner (Apr 30, 2010)

Maybe starting with 10Hz is too much?


I played a bit more with the resolver excitation last night.
Turns out it really helps to increase the capacity of the bypass cap of the audio amplifier to 100µ (instead of 10µ). Now I can go up to 8V peak-peak.


Strange thing is: I measured the old prototype again and it comfortably outputs 10V peak-peak while consuming only 0.5W. The SMD version takes in 0.7W for 8V. Maybe because the amplifier is saturating or something?


Also the output amplitude rises when the value of the decoupling cap is *decreased*. Some analog things going on that I don't understand.


Will try to get some meaningful scope captures done.


----------



## jhuebner (Apr 30, 2010)

Ok, I supplied the amplifier with 12V directly and now it can produce 10V peak-peak with no problems. Except it runs rather hot around 50°C.

So it's that boost converter or one of it's surrounding components thats causing the misery.


----------



## Tony Bogs (Apr 12, 2014)

Might be interesting, especially the way the primary coil is driven:


Application note SLYT568.pdf, can be found on ti.com.


----------



## kennybobby (Aug 10, 2012)

jhuebner said:


> ...
> 
> 
> Also the output amplitude rises when the value of the decoupling cap is *decreased*. Some analog things going on that I don't understand.


In an AC circuit, a capacitor acts like a resistor that decreases in value as the frequency goes up.

For a given frequency, a larger value cap has a lower reactance or impedance value than a smaller cap, so more current is flowing thru the large cap and loading the circuit which is pulling down the voltage.


----------



## jhuebner (Apr 30, 2010)

It seems I was chasing a phantom. I was worried about the increase of 0.9W in power consumption (rise from 1.1W to 2W) as soon as the excitation started.

The reason was the poor efficiency of the cascaded buck and boost converter at low power. Incoming 7-24V is buck converted to 5V and then boost converted to 12V for the excitation amplifier.

When I powered the amp from 12V directly it would only draw 50mA or 0.6W. So the losses in the conversion are another 0.3W which is absolutely fine at low power.

Put the thing back in the Leaf inverter and I'm now getting a +/-0.5° angular jitter. Thats completely sufficient for running the motor.

Conclusion


12V boost stage works fine
LM386 325mW amplifier is sufficient
Bypass cap had to be increased from 10µ to 100µ
Amplitude of input signal into the amplifier had to be lowered (3k3 instead of 1k2 series resistor)
The latter could use some tuning, putting 8k in parallel to the 3k3 resistor gets the 10V amplitude, so 2k2 would be ideal. But maybe not so important after all.


----------



## Tony Bogs (Apr 12, 2014)

Nice, the gold old analog LM386.
That piece of nostalgia is from the 70s, I guess. 

Bit of a surprise, not PWM as TI advises and not what I am used to in this thread, 

but totally OK for me as it brings such sweet memories of the time when I was young.


----------



## jhuebner (Apr 30, 2010)

Tony Bogs said:


> Nice, the gold old analog LM386.
> That piece of nostalgia is from the 70s, I guess.
> 
> Bit of a surprise, not PWM as TI advises and not what I am used to in this thread,
> ...


It seems to be the only amp that operates above 5V and as you point out: its really generic.

So TI advise to synthesize a sine wave using PWM? The text was a bit handwaving so I'm not too sure what they mean. At such low power I don't really see the point of PWM.

Also their sigma-delta magic seems a bit over the top, the SAR ADC in the STM32 does the job just fine.

So what are you used to in this thread?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> So what are you used to in this thread?


We allways do whatever it takes !


----------



## Coulomb (Apr 22, 2009)

jhuebner said:


> LM386 325mW amplifier is sufficient


Surely that should be an LM286, the wider temperature (industrial) version, for automotive work. Even the Chinese made TC Chargers use an LM258 (dual version of the LM386 I think).


----------



## Tony Bogs (Apr 12, 2014)

Exactly what I was thinking and I pointed out the temp issue with a LM339 (overcurrent protection) earlier.


Usually minimal analog here, maybe that's what causing it.


P.S. Just checked the original 1980 National Semiconductor databook. 0 to 70 degree C operating temp.
There's no version with an extended temp range in the book, but I'm pretty sure TI has added a LM286 or LM186.
Or maybe not. The LM386 is great for a headphone amplifier (section audio, radio and TV of the databook).


----------



## jhuebner (Apr 30, 2010)

Good point, overlooked it again.
So the NJM386 has extended temp range down to -40°C and up to 85°C


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Ok, temperature/resistance from their table matches my beta-curve pretty good. Basically I calculated beta with the online tool and calculated the table from that.
> 
> 
> Firmware coming your way, please test.
> ...


Johannes this Ampera thermistor... Do i use the same setup you use in sensor board? What are the edge conditions.
If i want to measure it i would probably need a pullup resistor eg. 4K7 and sense voltage difference when temperature changes. That would get me 3.2V at 9K resistance of 5°C. And probably would not apply lower than that.
But at 80°C i would get 0.7V for 0.8K displayed. I dont think i would need to go higher since electronics usually release smoke higher than 75°C. 
Now you use 1K2 resistor, doesnt this narrows down my measurement scope. Does it?

Do you have any other idea?

Sorry Johannes for challenging your code again.


----------



## jhuebner (Apr 30, 2010)

The code assumes 1k2 pull *down* and thermister connected to 5V. Takes you up to 90°C.
I really wouldn't want any variety in that


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> The code assumes 1k2 pull *down* and thermister connected to 5V. Takes you up to 90°C.
> I really wouldn't want any variety in that


Yes thank you. I was calculating voltage divider and it seemed it wouldnt go that high. Ok no problem then .

EDIT: I forgot to mention, but Ampera inverter thermistor is already connected to GND. Positive side changes value and negative side stays connected to reference gnd. Doesnt that change your schematic values? That is why i was thinking of using 4K7 pullup resistor so voltage value changes in our frame. How would you deal with it so whole system wouldnt change?

Or maybe better to invert reading so i could connect one 4K7 pullup and read voltage from junction.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> EDIT: I forgot to mention, but Ampera inverter thermistor is already connected to GND. Positive side changes value and negative side stays connected to reference gnd



Oh, now I see the problem. So it must be a pull-up resistor. Can you also use 10k? Would result in -5°C to 100°C range (actually the upper range theoretically is unlimited)


----------



## jhuebner (Apr 30, 2010)

Browsed around for some more audio amplifiers and found the TDA2822. Will see how it behaves. I'm hoping for better efficiency as the LM386 soic runs rather hot.Might have to tune the supply voltage a bit


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Oh, now I see the problem. So it must be a pull-up resistor. Can you also use 10k? Would result in -5°C to 100°C range (actually the upper range theoretically is unlimited)


Heh even better. So i will just put one 10K resistor from 5V to signal connector? Will do. 
So i dont need any other reference line connected, just the line from thermistor pin to mainboard?

That was easier than i expected...

tnx


----------



## arber333 (Dec 13, 2010)

Hi Johannes 

On new SMD board, how much do you recommend to use for R45 and R46 on current sensor divider?
I opted for 6K8 so to have 1/2 of voltage. Is it viable or should i use 5K7?

I also use 4K7 pulldowns on each sensor pin to fight EMI like TomDB suggested.

tnx


----------



## arber333 (Dec 13, 2010)

Hah!

SMD board works without OClimit now! What i did was adding 4K7 pulldown resistors to current sensor lines and one 10K pullup resistor to temp pin. 
I will just add 6K8 resistors and i hope to try to run my motor.

EDIT: I prepared everything and conneceted inverter last night. It seems it would only show 92°C. Probably table is now inverted . 

EDIT2: I just got your new table tnx!

Also Johannes i would need your opinion if 6K8 are good resistors for pulldowns on current sensor lines? Where is the 0A set to?


----------



## jhuebner (Apr 30, 2010)

6k8 sounds perfect, converts 2.5V to 1.68V. Offset is self calibrated in stop mode (thats why you don't get current display in stop).


----------



## arber333 (Dec 13, 2010)

Last night i had discussion with Aleš about how we have encoder trouble with every new inverter we connect to motor. Circuit is still the same so what is the problem here!

Well it got me thinking. While it is good to use encoder for those fast accelerations and regen and bumps on the road etc.. when we get illogical signal from encoder inverter brain tries to compensate immediatly and of course we get OClimit thrown. 

How about if we used a form of limiter for the *rate of change* in encoder? That way inverter would see RoC too large to compensate and would just shutdown PWM without triggering actual OClimit. Or better yet it could just ignore throttle change and wait for further input. There could be a simple parameter to move this threshold about some. Units could be ppr/s or deg/s so this would be applicable to different encoders or resolvers etc... 
EDIT: Also if set to 0 that could shutoff RoC limiter from the loop.

Could that be done in code Johannes? Or did you implement it already?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> 6k8 sounds perfect, converts 2.5V to 1.68V. Offset is self calibrated in stop mode (thats why you don't get current display in stop).


Nice! Didnt know that.


----------



## jhuebner (Apr 30, 2010)

Basic RoC limiting is implemented, if you manage to trip even that you should look into your encoder wiring/shielding.


Better still is using A/B channels when available.


Current RoC limiting works like that:
1. Find minimum and maximum time between the last 5 pulses
2. When minimum is 8 times smaller than maximum assume interference and do not update motor speed. Instead, use the last known good value. Consequently the voltage isn't taken to inappropriate levels. This case displays the encoder error.
3. When minimum is 3 times smaller than maximum, use maximum and update motor speed.


----------



## jhuebner (Apr 30, 2010)

Just worked on the Leaf drive again, it now runs beautifully with the new main board 


I did discover a terrible bug though, that results from an earlier fix.


Remember the current software (and boot loader) pulls low all 6 PWM outputs. Now what if your PWM polarity is active low (as is the case in the Leaf inverter)? Yes... Fortunately it has desat.


So I will be fixing it in the firmware and the boot loader, but a lot of boards out there have the flawed boot loader. It won't cause damage in a typical installation where DC power is cut by a switch. But if your on a test bench with permanently connected DC, theres your problem.


Again, this is only relevant for ACTIVE LOW gate drivers. The ones that come with the kit are active high and thus not affected.


----------



## ozwolf (Apr 1, 2018)

G'day Johannes, I'm in the process of collecting bits and pieces to convert my Suzuki Jimny to EV. I've acquired the inverter/converter of a Prius Gen II. My plan is to remove the Toyota control board and replace with one of your kits. This allows me to use the remaining power stage complete with water cooling. I plan to use a 7.5KW ACIM motor, similar (I think) to your car.

Do you have any initial thoughts on this plan?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Again, this is only relevant for ACTIVE LOW gate drivers. The ones that come with the kit are active high and thus not affected.


Tnx for the info. Ampera inverter now works with signal inverter chip so i use positive signals that get inverted on the way. It works very good. 

I will test Leaf motor with new board and ABZ encoder hopefully this weekend.

A


----------



## jhuebner (Apr 30, 2010)

ozwolf said:


> G'day Johannes, I'm in the process of collecting bits and pieces to convert my Suzuki Jimny to EV. I've acquired the inverter/converter of a Prius Gen II. My plan is to remove the Toyota control board and replace with one of your kits. This allows me to use the remaining power stage complete with water cooling. I plan to use a 7.5KW ACIM motor, similar (I think) to your car.
> 
> Do you have any initial thoughts on this plan?


 Using a factory power stage is a very sane idea. I think someone did it before.
What [email protected] rating is your ACIM?


Now, apart from that I just completed a rather large software update:


 Added fast baud rate mode
 Added software buffer for sending more than 3 CAN messages
 Fixed dangling IO pins again. Hopefully
 Fixed bug when switching back to single encoder mode
 Added Leaf and Ampera thermistors
 Added tripmodes: legacy, keep DC switch on or close precharge
 Corrected direction change code
 Basically with the command "fastuart" you can temporarily switch to 921600. When resetting you go back to 115200 again.
I have updated the esp8266 firmware to take advantage of this. You will need to set up arduino for esp8266, connect to your module via uart and toggle the solder jumper GPIO0 if you want to update. Next upgrade can then happen via Wifi.
You also need to upload index.* and style.css via the Update form. It now contains an auto update mode that keep updating the tables until you stop it.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Basic RoC limiting is implemented, if you manage to trip even that you should look into your encoder wiring/shielding.
> 
> 
> Better still is using A/B channels when available.
> ...


Yeah... about that.  I now think i must use the wrong encoder pulse value. It seems that motor came with different toothed wheel option. I will have to verify this, but i am pretty sure now. 

TNX


----------



## jackbauer (Jan 12, 2008)

Oh you mean this one


....on it....


----------



## ozwolf (Apr 1, 2018)

jhuebner said:


> Using a factory power stage is a very sane idea. I think someone did it before.
> What [email protected] rating is your ACIM?


Thank you for the encouragement. I haven't selected a motor yet, but likely to be 240v 50Hz from http://ecatalog.weg.net/TEC_CAT/tech_motor_dat_web.asp

The data sheet is attached. I was hoping to match the one you used, but I am unable to locate it's data sheet. Perhaps you have a data sheet you're willing to share?


----------



## ozwolf (Apr 1, 2018)

jackbauer said:


> Oh you mean this one
> 
> 
> ....on it....


Yes, that's it exactly. I was the guy that asked on your recent live stream. Unfortunately you revealed your plans for your wife's car.

I got the idea from your recent videos of using the Innova power stages. I had been watching Professor John Kelly on the Prius Invertor/Convertor https://www.youtube.com/watch?v=Y7Vm-C4MsW8&t=3622s

It suddenly occurred to me, that using the power stage of the Prius inverter would be useful as housing, cooling, IGBTs all came in a ready made package.


----------



## jhuebner (Apr 30, 2010)

ozwolf said:


> Thank you for the encouragement. I haven't selected a motor yet, but likely to be 240v 50Hz from http://ecatalog.weg.net/TEC_CAT/tech_motor_dat_web.asp
> 
> The data sheet is attached. I was hoping to match the one you used, but I am unable to locate it's data sheet. Perhaps you have a data sheet you're willing to share?


 Look here: https://www.lenze.com/fileadmin/lenze/documents/en/catalogue/CAT_MT_MDHF_15593806_en_GB.pdf


page 27. *MF☐☐☐☐☐132-22 - *it is rated [email protected] At that frequency yours would be rated 240/50*120=576V!


You'll either need to have a play with the windings (connecting them in parallel instead of serial), have the motor rewound (often more expensive than the motor itself) or pick a different one.


----------



## joromy (Feb 27, 2018)

jhuebner said:


> Just worked on the Leaf drive again, it now runs beautifully with the new main board
> 
> 
> I did discover a terrible bug though, that results from an earlier fix.
> ...


Hi, I'm using active LOW setup.
How can I upgrade firmware and bootloader, is it available in the inverter.zip d/l today?

Have not had any burned IGBT's!!??

But there is a lot of safety circuits on the original driver board (siemens/ford ranger) maybe that saved me?

I'm not using volt, current or IGBT driver boards from you

Johannes (not Hübner)


----------



## jhuebner (Apr 30, 2010)

Been having a play with the TDA2822D amp. Check out the scope shot: I'm getting 13V peak-to-peak on the output and 2V on the feedback (with pliers instead of the rotor wheel). Luckily the chip is almost pin compatible, just need 2 botch wires.



Power loss in the chip works out to 270mW with the Leaf resolver which is well within spec of 500mW. Still gets 50°C our 25°C above ambient but I'm not worried there.


Still need the 100µ bypass cap even though they specify just 10µ in their application example. For the other caps I'm using much lower values. 10µ instead of 470µ for the output filtering is fine because I don't care about low frequency response, just 4kHz response.


----------



## joromy (Feb 27, 2018)

Hi Johannes
Can you implement support for the Temperature sensor: KTY 84 – 130.
This is used in siemens motors and Ford Ranger EV.


----------



## jhuebner (Apr 30, 2010)

KTY84 is already supported.


----------



## joromy (Feb 27, 2018)

jhuebner said:


> KTY84 is already supported.


Sorry, my brain needs reboot....


----------



## arber333 (Dec 13, 2010)

I have a persistant problem and i dont know anymore what else to try. 

Ampera inverter works with Rev. 2 mainboard and my car. I tried to run it up and down the driveway and it went good. While i try this on my friends car with similar ACIM motor inverter with 200Vdc it just trips OClimit error. Sometimes i get report "encoder error" also "throttle" and sometimes i just get "overcurrent". 
I replaced rev. 3 sensor board with my own interface board that grabs current sensor signals from phase C and B. I use a 3K3/10K divider to make 1.67V at 0A. 
To detect DC voltage I use isolated opamp again the same as your circuit. 

Things i tried: 
1. I added 4K7 pulldown resistors to hopefully reduce EMI in current signals same as factory board uses
2. I tried to run without encoder connected and still OClimit trips when i apply any current
3. I put his mainboard in my car and ran with it no problem single channel with my motor. I have ACIM with AB encoder and run at 380Vdc.
4. I tried to move the throttle limit up or down if there would be any difference....
5. I connected scope to encoder signal and GND and turned the motor, signal is 5V square tooth with some switching hash
6. I disabled Fault pin reporting so i wouldnt have false reporting...
7. I tried different boost and deadtime settings in case that would cause some EMI. But oclimit trips regardless.

Anyone has any suggestion what to try?

I couldnt just put Damiens logic line RC filter in since it would mean major mainboard redesign, cutting thin traces etc... and obviously it ran good on my car with even higher voltage.


----------



## jackbauer (Jan 12, 2008)

EMI is the devil. I sympathise. In my last job I did a LOT of emc testing with an old guy who had been designing electronics over 50 years. He gave me one piece of golden advice : use 4 layer pcbs for everything. So i do. For the extra money you get can away with murder in terms of layout, component choices, testing etc.


You may well be seeing the results of something called ground bounce. VERY hard to detect let alone solve without a re layout. In these inverters we are dealing with tiny signals, huge power and fast switching. I seriously doubt any of my tesla boards would work two layer.


----------



## jhuebner (Apr 30, 2010)

While your college does have a point, why does it work in his car with the same inverter? The culprit must lie within the other car.
Are the motor leads correctly shielded? In my experience they are a terrible source of EMI. Maybe, but very unlikely the DC cables could be radiating.

Also grounded shield metal around the electronics works wonders. But again, only if it were happening in your car as well.
Can you post a picture of your setup, makes judgment a lot easier.


EDIT: apparently Dave Jones form eevblog is preparing a 4 layer vs. 2 layer test. I'm really waiting for it.


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> EMI is the devil. I sympathise. In my last job I did a LOT of emc testing with an old guy who had been designing electronics over 50 years. He gave me one piece of golden advice : use 4 layer pcbs for everything. So i do. For the extra money you get can away with murder in terms of layout, component choices, testing etc.
> 
> 
> You may well be seeing the results of something called ground bounce. VERY hard to detect let alone solve without a re layout. In these inverters we are dealing with tiny signals, huge power and fast switching. I seriously doubt any of my tesla boards would work two layer.


I am not really sure what this is, but next i will use my inverter inside my car and run 3 cables to RX8 and try to spin it. That will eliminate encoder as a suspect. Motor is very difficult to dissassemble. I rather would not if i can get away with.

I think something is very wrong with my interface board. 
I also tried to run my car with his Ampera inverter set under my hood and everything. I couldnt run fast but it worked under torque!!! Damien i am not sure if its EMI from inverter. Maybe they are just plain RX8 EMI!

I have not shielded phase wires. We interlaced them. I thought it is just as good. Should i wrap them in Alu foil and ground them? Wrap them all together or cable by cable?
Also i have encoder cable grounded at the motor and inverter as well.
DC cables are shielded and connected to chassis.
I have signal cables run in seperate direction from phase or DC cables. Not shielded. Should i wrap them also?
Ampera inverter has a flat alu plate between driver and brain section. It the shielding not enough? 

A


----------



## Tony Bogs (Apr 12, 2014)

Might be interesting. 

Don't think this one is handwaving: TI szza009.pdf EMI and PCB design.

Ground issues (referencing Jackbauers remark about ground bounce):

Even in 12V car systems engineers have to take several Volts of potential difference in the ground lines (body) into account. 

Source: Infineons "handbook" for automotive engineers (if I remember correctly, can't find the d*** pdf and the link).


----------



## piotrsko (Dec 9, 2007)

General useage is to only ground the shield at the one end which has a more positive ground, otherwise it acts like a loop antenna.


----------



## gunnarhs (Apr 24, 2012)

arber333 said:


> .
> ...
> 3. I put his mainboard in my car and ran with it no problem single channel with my motor. I have ACIM with AB encoder and run at 380Vdc.
> ...


Sorry I am not in the discussion but just some basics before we start dealing with EMI...
Have you run this (slip control-algorithm) in your car with 200V like in your friends car.?
Normally if you use different voltage you need to adjust your slip(-ramp) according to your voltage range. This is important to decrease the startup current (which usually is the one that triggers over-current limit). Also you might have to increase the over-current-limit.

Are the cars both of similar torque-need (seen from the motor)?


----------



## arber333 (Dec 13, 2010)

gunnarhs said:


> Sorry I am not in the discussion but just some basics before we start dealing with EMI...
> Have you run this (slip control-algorithm) in your car with 200V like in your friends car.?
> Normally if you use different voltage you need to adjust your slip(-ramp) according to your voltage range. This is important to decrease the startup current (which usually is the one that triggers over-current limit). Also you might have to increase the over-current-limit.
> 
> Are the cars both of similar torque-need (seen from the motor)?


I am not sure it is relevant since with Johannes PWM scheme i can lower effective voltage and thus supply 125Vrms wound motor from 380Vdc power. My motor is wound 185Vrms and it works silksmooth now from 380Vdc whereas before it was jumpy. 
Basicaly i just copied my control scheme to his Olimex chip and replaced my control board for his. And it worked instantly. 

Now i just have to run 3 cables from my inverter to his motor and run his motor from my car . That should prove his motor/encoder is good or not. 

Also i will grab his inverter and put it in my car. Havent done this yet. I have to adapt his connectors... Should prove nothing is wrong with power stage hopefully.


----------



## jhuebner (Apr 30, 2010)

Hi gunnar,


I added a parameter "udcnom" a while ago. The inverter now adjusts boost and fweak automatically depending on how far the actual voltage differs from udcnom.


----------



## arber333 (Dec 13, 2010)

Johannes...

Could i replace 10K pullup resistors in your 7430N schematic with something sharper like 6K8? If GND bounce is happening those ADC inputs are loosing reference and would saw positive voltage drop in value. How do you think i could fight that with existing mainboard?

A


----------



## jhuebner (Apr 30, 2010)

Yes you can use lower values for pull up. Actually you fault line sets the requirement here, not the main board. Fault line needs to be able to pull down whatever is coming.


No worries about the ADC I would say, it is so heavily software filtered that little spikes don't make it through. Basically 12 samples are compressed into one by using a median filter on groups of 3 values and an average filter on the output of the medians.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Yes you can use lower values for pull up. Actually you fault line sets the requirement here, not the main board. Fault line needs to be able to pull down whatever is coming.
> 
> 
> No worries about the ADC I would say, it is so heavily software filtered that little spikes don't make it through. Basically 12 samples are compressed into one by using a median filter on groups of 3 values and an average filter on the output of the medians.


Hah! Crap... i found out a detail... I have a fault pin pulled up at 10K and UVLO pin is connected to Fault pin at PWM connector ON THE DRIVER SIDE of my Skyper 32 driver interface board! DOH! I seem to have built it in PCB because my drivers only use single Fault pin to signal everything. 
Well guess what, the same is with Ampera drivers, only a single Fault pin for every kind of fault.
On my friends board i just have UVLO pin floating. Just now i traced its line and i find it is nowhere connected to pullup. Care to comment? 

I will connect UVLO pin to fault pin on driver interface board ASAP and make a mark in my build log.
It was floating and throwing all sorts of hash into 7430N chip. 
Hope that is it!


----------



## jhuebner (Apr 30, 2010)

Well UVLO is the same pin as the push button on the Olimex header. So it's pulled up to 3V3 by 10k and filtered with 100n


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Well UVLO is the same pin as the push button on the Olimex header. So it's pulled up to 3V3 by 10k and filtered with 100n


So if i just joined the Fault and UVLO pins wouldnt i have 4K7 pullup to Vcc then? That would be even stronger pullup.
I use connection like that in my Mazda and it works good. Or so it seems.


----------



## gunnarhs (Apr 24, 2012)

arber333 said:


> I am not sure it is relevant since with Johannes PWM scheme i can lower effective voltage and thus supply 125Vrms wound motor from 380Vdc power. My motor is wound 185Vrms and it works silksmooth now from 380Vdc whereas before it was jumpy.





jhuebner said:


> Hi gunnar,
> I added a parameter "udcnom" a while ago. The inverter now adjusts boost and fweak automatically depending on how far the actual voltage differs from udcnom.


OK guys, sorry for my ignorance not following the thread for some time, this should do it
Only thing I do not think this is EMI related, just configuration / pin /connection


----------



## joromy (Feb 27, 2018)

*can bus*

Hi. I'm having some problems with the canbus parameters.

This is what I receive on the LCD controller: (Sent from the BMS)

ID: 0x200
0	0	F3	6	3	5	17	15	

Byte 1/0: 0x0 Amp:0
Byte 3/2: 0x6F3 VOLT:177
Byte 5/4: 0x503 A/h:128
Byte 6: 0x17 TMAX:23
Byte 7: 0x15 TMIN:21

If I map "pot" can ID:256, Position:0, Bits:16 and gain:1 on the inverter, I get:

ID: 0x100
D0	2	0	0	0	0	0	0

Byte 1/0: 0x2D0 Pot:720

This is ok. But can't find out how to map other values to the same ID.

Has anyone the correct parameters for this. (and some explanation would be nice, I'm no good at this)


----------



## arber333 (Dec 13, 2010)

Hi Johannes

I tried new software 3.94 on my car. I can drive without any problems. 
It is time to try Leaf motor. I have some questions however. Can you explain new parameters?

dirchrpm?
Why is 0 value causing nverter in "neutral" despite forward pin active?

tripmode?
I have it set at 0, what do other options do?

Can i use new software to run Leaf motor with ABZ encoder directly? What do i have to do first after i connect ABZ and start inverter? Do i set every slip setting to 0 or not?

I will try to find offset then. Where do i start? How will i know that is the best setting? 

Then what? Do i just push throttle? 

tnx


----------



## jackbauer (Jan 12, 2008)

dirchrpm = minimum rpm for direction change. If you set it to zero the inverter will never change direction. set it to say 100 and the inverter will allow a direction change below 100rpm. 



tripmode = how to handle an overcurrent event. 



- Option 1: open DC contactor - Option 2: Keep DC contactor closed - Option 3: Open DC contactor, close precharge contactor

Applying a start pulse will then restart the inverter.


----------



## jackbauer (Jan 12, 2008)

Yet another logic board. This one is for the Enova inverter used in Smith edison vans and other vehicles. Allows use of the original igbt driver board and current sensors. Just waiting on a few parts and headers to complete. also incorporates the latest resolver interface so should work with pm motors.
This one will be going in my E65 7 series build. 



All files on github for those interested : https://github.com/damienmaguire/Enova-Inverter


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> dirchrpm = minimum rpm for direction change. If you set it to zero the inverter will never change direction. set it to say 100 and the inverter will allow a direction change below 100rpm.
> 
> 
> 
> ...


TNX i was thinking tripmode is smething like that. Now if we dont trip DC contactor, does it only kill pwm? Hm...


----------



## arber333 (Dec 13, 2010)

Johannes now i have some more data about my Ampera inverter problems. After i setup again i used this system:

1. 200Vdc
2. 3ph ACIM motor 4pole 125Vrms 
3. Single optical encoder with (supposed 60ppr) unspecified pulse count.
4. optimal parameters for that motor which works in another car already (different encoder though)
5. OClimit set to 800A
6. Mazda RX8 rear drive


I tried to run motor and turn rear diff with varying throttle in very fine ratio. I tried different encoder count, 60ppr, 64ppr, 90ppr and 120ppr.
Results i got were strange. Every time overcurrent would trip. It is just that evidently 60ppr is way better regarding control and trips OC only after some value. 
Even if i set OC to 900A limit is tripped approximately at the same point of throttle. I tied to capture Ix values on graph. I was so surprised what i saw that i didnt save pic. At start both sensors are progressing steadily with I2 always some 15A above I1. After 150A however I2 signal is raised rapidly and it quickly overshots I1 by a 100A! I1 is 250A and I2 is 350A! Then OClimit is tripped. Event can be repeated. Here is where the third sensor reading could be used...

Johannes can you comment this? It is clearly not EMI related since in my car that inverter runs my motor up and down the driveway. I have made the same connectors to more easily switch between cars. 

tnx


----------



## jackbauer (Jan 12, 2008)

Yeah. That slip control stuff is no good for making power


----------



## arber333 (Dec 13, 2010)

Well i went ahead and put Ampera inverter in my mazda with 380Vdc and 3ph 4pole ACIM motor. I connected B channel of AB encoder only, but there were no limitations.
Results were surprising. Using the same settings as my DIY inverter Motor with Ampera inverter had noticably more power from start. It was more direct. Response was instantenous and rough. I had to lower ampmin parameter for the thing to be more comfortable to drive. Encoder was working no problems on just four wires, no shielded cable. Granted it would benifit from shield a lot...
I used deadtime 116pt setting, 1,6us like TomDB suggested. I tried 185pt, 3,3us like in my DIY inverter and motor was jittery and weak. 
I calibrated amp sensors gain to 3.0.

Now the down side... 
1. I couldnt connect DC contactor directly to ULN chip. It kept chattering. Probably some dV at reverse diode? Mabe EV200 economiser does not like ULN chip? I had to put 12V Arduino relay module to interface DC contactor and precharge.

2. Whenever i touched throttle pedal many lights lit on my dash! Even the BMS warning light! In the end light for battery error was lit no matter what happened. I think ULN chip was damaged maybe? 

*3. This is problematic! When i touched BMS button (as in BMS input) my throttle went from 980pt to 1050 and moved there about +/-30pt. That was just above the 0% throttle so my car wanted to move!!!! But i just pressed a totally unrelated button. Huh?
Regen pin is not connected and stays at 28pt.
What input could cause this to throttle? *

I dont have anything like this happenning on my DIY inverter. 
I did use the same wiring loom as in my car. I connect GND at 12V power connector, at throttle gnd and at encoder. 
Anyone has similar event?


----------



## arber333 (Dec 13, 2010)

Well saga continues with a twist. We took the motor down today and tested encoder. It works when turning shaft by hand... Then we decided to dissassemble the motor core since we had it there. 
Lo and behold! Motor insides were toast! The smell was incredible and it was evident that one phase wire loom has melted on itself. 
We will now rewire motor and put two (!) KTY84 sensors on wires. 
Also we see that encoder sensor is a bit old and will replace it with AB magnetic sensor.

Inverter was working perfectly normal the whole time. It was the motor that was damaged. Now its going to the shop for overhaul. 

To be continued...


----------



## joromy (Feb 27, 2018)

Does anybody have previous firmware, or link to d/l?

I just u/l the newest (3.94 if I remember right)
This does not work on my setup. 


Thanks


----------



## MattsAwesomeStuff (Aug 10, 2017)

I am looking at picking up a (free) AC induction motor from a forklift for use in an EV.

The forklift controller is only a 48v, 700a controller, and, presumably isn't going to be very fast (designed for forklift speeds, not sure about gearing). So right now that's my biggest obstacle.

Without reading and trying to understand all 54 pages of this thread, can anyone tell me where this 8-year project is and whether it would be suitable?

...

Depending on where this community goes and if we regain control of it, I would like to see a highlighted/curated project section to simplify adoption of these kinds of things. I think this is the 4th or 5th DIY controller thread on the forums, but, there's never any overview, summary, explanation, landing page, etc for any project. Which is normal for a discussion forum, it's a great place to discuss things, but it's a terrible place to use the knowledge.

Ideally, a novice could walk in, read up on what the project's goal is/was, what kinds of things it's suitable for, and documentation on how to build it.

All of these threads are missing that kind of information and in my opinion it's among the most valuable parts of the website (just hidden away in 2200 posts to take this thread for example).

I'd like to be able to help document projects like this but I'd need help bridging the technical gap.


----------



## arber333 (Dec 13, 2010)

MattsAwesomeStuff said:


> I am looking at picking up a (free) AC induction motor from a forklift for use in an EV.


Arent we all?



MattsAwesomeStuff said:


> The forklift controller is only a 48v, 700a controller, and, presumably isn't going to be very fast (designed for forklift speeds, not sure about gearing). So right now that's my biggest obstacle.


I have a Zapi 120V 800A inverter at home, that is 90kW approx. 
My Mazda with 28kW ACIM motor wound for 75Vrms went 180km/h max! It was no slouch either with 8s from 0 to 100km/h. You can get new for 2.5K€. I can sell mine for 800€ together with wiring loom. 



MattsAwesomeStuff said:


> Without reading and trying to understand all 54 pages of this thread, can anyone tell me where this 8-year project is and whether it would be suitable?


We are moving at 130km/h every day from home to work and back. Hows that for DIY!



MattsAwesomeStuff said:


> Depending on where this community goes and if we regain control of it, I would like to see a highlighted/curated project section to simplify adoption of these kinds of things. I think this is the 4th or 5th DIY controller thread on the forums, but, there's never any overview, summary, explanation, landing page, etc for any project. Which is normal for a discussion forum, it's a great place to discuss things, but it's a terrible place to use the knowledge.


You can start a thread and call it "redacted info of Johannes inverter".



MattsAwesomeStuff said:


> Ideally, a novice could walk in, read up on what the project's goal is/was, what kinds of things it's suitable for, and documentation on how to build it.


You just walked in a store or what?



MattsAwesomeStuff said:


> All of these threads are missing that kind of information and in my opinion it's among the most valuable parts of the website (just hidden away in 2200 posts to take this thread for example).


Its only missing because you didnt read it all. Its not about the end goal, its the journey man!



MattsAwesomeStuff said:


> I'd like to be able to help document projects like this but I'd need help bridging the technical gap.


You are welcomed to give and you shall also recieve...


----------



## MattsAwesomeStuff (Aug 10, 2017)

arber333 said:


> Arent we all?


Let me rephrase.

I have been offered said motor and controller for free. As I finish up my motorbike conversion, I'd like to get started on a small car project for the winter.



> My Mazda with 28kW ACIM motor wound for 75Vrms went 180km/h max! It was no slouch either with 8s from 0 to 100km/h. You can get new for 2.5K€. I can sell mine for 800€ together with wiring loom.


I'm confused. I'm not asking to purchase a motor. I'm asking if this controller project is suitable for EV use.



> You can start a thread and call it "redacted info of Johannes inverter". You just walked in a store or what? Its only missing because you didnt read it all. Its not about the end goal, its the journey man!


I'm not sure if this is you talking down to me or whatnot, seems like it. I'm not complaining, and I'm not saying I'm entitled to it. I'm saying, I've come across the thread, and I might like to use the knowledge here. But I can't tell what the project is and what it's suitable for, where the project is status-wise, what the latest revisions are, see how to build it, at what point the thread became tech support, what the most common questions are, etc... without reading 2200 posts of highly technical information spread over 8 years that is probably mostly obsolete but I don't know at which point.

My point is this...

If this was my project and my thread (it's not), I would get the most joy from it if the most number of people could benefit from it.

The best way to make that happen, is not "Go read a 2200-post 8-year conversation and figure it out for yourselves."

If 30 people have a meeting that goes on for days and days, until about 2200 comments have been said, is the best way to organize that information a gigantic 100 page rambling transcription of it? Or to have someone write out concise meeting minutes, summary, FAQ, etc?

And then if someone asks those questions would you just snap at them and tell them to go read the whole conversation and figure it out themselves?

I think the community would really benefit if we could take some of these projects and create more central pages on them (I would like to see it organized and linked on the front page more like an article, not a forum thread). There's huge amounts of value in some of these projects, but they're poorly documented and the knowledge is poorly organized (by function of it being in a discussion thread, a place optimized to discuss, not host/document/teach).

And I'd offered to help with the documenting, though I'm not sure teaching me is the fastest road to getting there.

Just my two cents. Seems I've ruffled some feathers. Carry on.


----------



## PStechPaul (May 1, 2012)

You can get up-to-date info on the AC controller from Johannes' website, and even order the kit for 240 Euros:

http://johanneshuebner.com/quickcms/index.html?en_motor-inverter,8.html

I've followed some of this thread, but it iscertainly not necessary or even particularly useful to go back through all the posts during the inception and development of the design.


----------



## arber333 (Dec 13, 2010)

Like PStechPaul said Johannes has his own website with instructions and even video on howto. 

Link: http://johanneshuebner.com/quickcms/index.html?de_electric-car-conversion-site,14.html

Here in this thread we share problems and solve some of them. Forum keeps record of that so next guy that sees the same problem doesnt need to go through the same. 
Well at least our comments stay on record. Imagine if all knowledge made here would have to be reinvented each time. 

Forums are for discussion. Even Roman Forum was used in the same way, people shared news, bartered goods and generaly meet. 
Also it is an oppurtunity to record new things and keep community informed. 

So you have some options:
1. You can get inverter kit (several versions actually) from Johannes and start to built your DIY inverter. If you hit a problem you can check here and if it is not listed post your problem. We can help with knowledge to some degree.

2. You can also buy a used car inverter and replace its brain with Johannes kit so you dont have to make power section from schratch. 

3. You can check classifieds if someone is selling partially built inverter...

Or you can use what you have. 
At 48V 700A you can get 30kW to wheels. You are not limited to some rews since AC motor is turned by slip/torque. If you can run inverter at higher voltage say 72V it would be even better. 
Last week i helped a guy with Smart car. 10kW Goldenmotors and 72V 400A Kelly controller is enough to drive it at 90km/h. It is a good little car.

Like i said i have a perfectly good inverter that is sitting on my shelf doing nothing. For low voltage to 140Vdc it is the best there is. 
Since i made my DIY inverter here i am never going back to LV.


----------



## kennybobby (Aug 10, 2012)

*possible addition of an index post*

One very useful thread tool that i have learned from Ripperton and coulomb, is the creation and use of an INDEX post, either in the first or second post of a thread. Now whenever i create a technical subject thread, i also make a reply post to myself to reserve a placeholder for the INDEX.

Obviously it is not possible now to go back and insert a second post after the initial one from years ago, but a link to an INDEX post could be put at the beginning of the first post.

The INDEX post could contain the bare bone facts and technical knowledge that Matt is looking for in a consolidated location. In the case of this thread it appears that a link to the inventor's website would be a good addition to the first line of the first post. If Matt or someone wants to review this thread and extract the pertinent post links, then an INDEX with these links could be created. 

See for example coulomb's link index of the TCCH charrger thread, 

or Ripperton's page index of his electric trackbike thread


Just my 2¢,


----------



## MattsAwesomeStuff (Aug 10, 2017)

*Re: possible addition of an index post*



kennybobby said:


> the creation and use of an INDEX post


Bingo.

For example, I had no idea Johannes had a website with this stuff on it. It's not linked on the first couple posts, I'm sure it's linked somewhere, probably many times in the following 2200 posts. It's one thing to go looking for something you know exists, but in this case you're looking for something that might not be there to be found, which is extra frustrating.

An index would be personally beneficial to me, but even as an observer, who is curious about these kinds of things, I've looked at some of these giant project threads before and, the lack context makes me tune out. Which is contrary to most people's goals I presume.

Better still, I think some projects like these should be featured prominently on the front page. For all the effort put into them, and the value they bring people, there should be some curated content.


----------



## arber333 (Dec 13, 2010)

I can see the benefit of this since there are some traps built in the old inverter build. I agree if people would be informed they might steer away from those. 

I still think this is a mighty tale nontheless and every DIY inverter builder should read the whole thread. At any time i felt overconfident, like "now i finally got it" disaster would strike from seemingly unconnected angle. Better be informed! This project is continuously developing for the better, it is still DIY however.
I have experience that my inverter needs regular overhaul... bolts tightening, contact cleaning, maybe Olimex chip replacement etc... If i respect that it will rune fine.

Lets give it a rest for now. 
Johannes is on vacation so maybe when he reports back we can get him to insert index to some of the milestones.


----------



## jhuebner (Apr 30, 2010)

Hi all, editing the first post to reflect the project state us a great idea. I will set out to do it when back home. If I do it here I'll get angry looks from my wife 
Great to see the thread growing while I'm away.
Could any one help joromy with an old firmware? Some 2017 version. My archive's back home


----------



## jackbauer (Jan 12, 2008)

In case anyone missed it here is the Panzer running on the dyno. Not bad for open source 
https://www.youtube.com/watch?v=2bLPXOGVxLI


----------



## ECOENERGI1 (Oct 19, 2017)

joromy said:


> Does anybody have previous firmware, or link to d/l?
> 
> I just u/l the newest (3.94 if I remember right)
> This does not work on my setup.
> ...


----------



## jackbauer (Jan 12, 2008)

BMW i3 traction motor running from the inverter using the LM386 based resolver interface. Doesn't seem to want to speed up beyond a few hundred rpm but that may be due to the low dc bus voltage (40v) that I was using. Also the exciter is only managing around 5.5v pk-pk so I think a louder audio amp is needed 


Generates enough torque to bend a 10mm spanner from a dead stop. Next up : crank the rex engine with this thing


----------



## ChazFisher (Sep 30, 2017)

jackbauer said:


> BMW i3 traction motor running from the inverter using the LM386 based resolver interface. Doesn't seem to want to speed up beyond a few hundred rpm but that may be due to the low dc bus voltage (40v) that I was using. Also the exciter is only managing around 5.5v pk-pk so I think a louder audio amp is needed
> 
> 
> Generates enough torque to bend a 10mm spanner from a dead stop. Next up : crank the rex engine with this thing


Very nice! There was a mention back in the March time frame in this thread about the resolver interface, but I didn't see a lot of details on it. Can you point me in the right direction for that?


----------



## arber333 (Dec 13, 2010)

ECOENERGI1 said:


> joromy said:
> 
> 
> > Does anybody have previous firmware, or link to d/l?
> ...


----------



## joromy (Feb 27, 2018)

arber333 said:


> I think you are using old bootloader. Johannes instructed me to first erase chip and load new version of boot loader. That way new firmware works from the start. I think problem was with bootloader locking up or something.
> 
> See some of firmware versions attached. Up to 2017 code was for rev. 1 board with single channel only. For 2018 i only found two versions one before safety correction and one after. From october 2017 i use Rev 2 master board.
> 
> A


Thanks, I use rev 2 board and two channel encoder.
Don't have a JTAG programmer.
I have the USBASP V2.0 but I guess that won't work?

Something like this will work?

https://www.ebay.com/itm/ST-Link-V2...TM32F103C8T6-STM8-STM32-w-Cable-/191995253946


----------



## arber333 (Dec 13, 2010)

joromy said:


> Thanks, I use rev 2 board and two channel encoder.
> Don't have a JTAG programmer.
> I have the USBASP V2.0 but I guess that won't work?
> 
> ...



Exactly! I have instructions in slovenian language and picture. Also how to wire it. You can observe there: https://mazdamx3ev.files.wordpress.com/2017/12/programiranje-olimex-stm32h103-c48dip.pdf



I will translate to english when i have more time .


EDIT: I just put something together really fast .


----------



## joromy (Feb 27, 2018)

Thanks arber333.
Now my motor is running again with ver 3.34

3.75 and 3.93 doesn't work on my setup.

I will dig into the bootloader and JTAG.

Is there any place in EU/UK I can buy the ST-Link V2 programmer?
Have ordered from ebay (China) but shipping is slow.


----------



## ChazFisher (Sep 30, 2017)

ChazFisher said:


> Very nice! There was a mention back in the March time frame in this thread about the resolver interface, but I didn't see a lot of details on it. Can you point me in the right direction for that?


Ah, found it. Post #1920: https://www.diyelectriccar.com/forums/showpost.php?p=971713&postcount=1920


----------



## arber333 (Dec 13, 2010)

joromy said:


> Thanks arber333.
> Now my motor is running again with ver 3.34
> 
> 3.75 and 3.93 doesn't work on my setup.
> ...


Yes that is because you have to load new bootloader to use new code.

Check here: 
https://www.mouser.co.uk/ProductDetail/Adafruit/2548?qs=sGAEpiMZZMtzPgOfznR9QUw7dIL4bsHL0T2LUQuW350=

Should have it in stock.
Then make a harness to connect it to JTAG allways the same way.


----------



## jhuebner (Apr 30, 2010)

Thanks for providing the firmware.



Actually all boot loaders are compatible with all firmwares as there is no interaction between them. Only the boot loader shipped since the “fix“ also pulls low the 6 PWM pins which turned out a questionable measure.

That means if your software runs fine now there is no need to mess with the boot loader.


----------



## joromy (Feb 27, 2018)

jhuebner said:


> Thanks for providing the firmware.
> 
> Actually all boot loaders are compatible with all firmwares as there is no interaction between them. Only the boot loader shipped since the “fix“ also pulls low the 6 PWM pins which turned out a questionable measure.
> 
> That means if your software runs fine now there is no need to mess with the boot loader.


Sorry I'm a little confused, should I upgrade bootloader or not.
What version doesn't pull the PWM low.

Worked before I upgraded to newest firmware, and also when I downgraded to ver 3.34

I use SN74LVC4245A (Octal Bus Transceiver 3.3-V to 5-V Shifter) on the PWM output.
If I change to an inverting transceiver, will that solve the problem?
I would like to have the newest bootloader/firmware.


----------



## jhuebner (Apr 30, 2010)

Ok, small version history:


V1 - initial, shipped till late 2017
V2 - mandatory for using esp8266. Improved flow control and prevention of false update trigger
V3 - pulls low all 6 PWM outputs. Shipped since mid 2018
So the only difference between V3 and V2 is pulling low the outputs. Is that still causing issues in your setup? If so, you need to downgrade to V2, otherwise leave V3 on there.
I will work on the firmware next week


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Thanks for providing the firmware.
> 
> 
> 
> ...


Huh J when did you implement the actual change in bootloader? Because i think i dont use the newest bootloader. 
I still get the occasional OClimit trip at start when i apply throttle. I just got one today in the morning. 


Now that i have desat it just stops inverter and no harm done. Before however... it was like i would pop a spring.
Maybe it is time to replace Olimex chip...

A


----------



## joromy (Feb 27, 2018)

jhuebner said:


> Ok, small version history:
> 
> 
> V1 - initial, shipped till late 2017
> ...


The problem I have with firmware 3.93 is "fault 150 precharge"
And full short on IGBT's. So precharge is not possible.

The program should read NEG/POS settings, before precharge?

NB! I use NEG PWM.


----------



## arber333 (Dec 13, 2010)

joromy said:


> The problem I have with firmware 3.93 is "fault 150 precharge"
> And full short on IGBT's. So precharge is not possible.
> 
> The program should read NEG/POS settings, before precharge?
> ...



That is exactly what happens because of new bootloader. So you use gates active low. Bootloader pulls all gates low initially so your IGBTs short everything what poor precharge resistor manages to put into caps. Lucky you i bugged Johannes (i did fry a number of relays) to also put precharge fault into code if after some time preset voltage is not reached! 

If you want to use new code with active low gates try using SN74LS06N buffer chip. It reverses signals so your master board can still use positive 3V3 signals and SN74 reverses them while makes them 5V also. Do you use all 8 inputs or can you live with 6?



It works with my Ampera interface.


----------



## joromy (Feb 27, 2018)

arber333 said:


> If you want to use new code with active low gates try using SN74LS06N buffer chip. It reverses signals so your master board can still use positive 3V3 signals and SN74 reverses them while makes them 5V also. Do you use all 8 inputs or can you live with 6?
> 
> It works with my Ampera interface.


Thanks for clarifying. I had my setup on 400V 38A PSU. And always turn up the volume slowly. 

I use the original Siemens/Ballard controller IGBT drivers, and the fault line from this controls the enable pin on the 3.3-5v transceiver.

I can live with the old ver 3.34.
I guess Johannes H. will fix this in the next firmware!?
If not I just go back one version bootloader.
BTW thanks for excellent bootloader install instruction.


----------



## joromy (Feb 27, 2018)

jhuebner said:


> Ok, small version history:
> 
> 
> V1 - initial, shipped till late 2017
> ...


Got the jtag programmer. Tested to erased the chip, u/l bootloader V3 and firmware V3.93. So the programmer works.

But where can I find bootloader ver2?


----------



## arber333 (Dec 13, 2010)

joromy said:


> Got the jtag programmer. Tested to erased the chip, u/l bootloader V3 and firmware V3.93. So the programmer works.
> 
> But where can I find bootloader ver2?


Check my earlier post. There should be code dated 20.12.2016. 

This is V2 as you describe it but only for rev. 1 board. Bootloader is the same for both however.

A


----------



## joromy (Feb 27, 2018)

arber333 said:


> Check my earlier post. There should be code dated 20.12.2016.
> 
> This is V2 as you describe it but only for rev. 1 board. Bootloader is the same for both however.
> 
> A


Tried the "20.12.2016" bootloader and 3.93 firmware, but same fault. I also notice that there is no "blink" at power ON. But have to press reset...?
Is there any way to confirm the bootloader version, in the ST tool?

I think the V3 is dated:
Tuesday, ‎April ‎10, ‎2018, ‏‎18:54:32

The one you suggested is dated:
Tuesday, ‎December ‎22, ‎2015, ‏‎22:10:42

Have also tried:
Sunday, ‎June ‎11, ‎2017, ‏‎04:22:34

I think both ones I tried is to old, according to Johannes H. version history

Going back to 3.34 and everything works normal.

If you don't fail, you don't learn!


----------



## arber333 (Dec 13, 2010)

Johannes when you swim up to the shore can you tell me if i have to use different divider for Ampera temp sensor? 

On desk i get 33.2deg whereas calibrated sensor in my workshop says 23.3deg.
Voltage on divider is 1.348V measured with my trusted multimeter.
Sensor to GND measurement says 5.93kohm. That is consistent with datasheet graph. 

But inverter brain obviously sees somewhere around 4kohm. If i measure unpowered divider i get 3.77kohm to GND directly on the pin that goes towards brain. If i measure towards Vcc i get 3.88kohm
I used 10Kpullup on the line directly from temp sensor which is connected to gnd. No other resistors there. Would i have to add any other pullup/pulldown resistor? You said your software assumes 1K2 pulldown? 

Do i heat it inverter up to 70deg to check if divider works up there? I have a heater with thermoswitch...

EDIT: I used 9K2 pullup resistor and i get 29.3deg when in my workshop thermometer says 22deg. This is better, but is it also better at 60deg or 70deg?
EDIT2: I used 6K8 resistor and now i get exactly ambient temperature 22deg. Later i will try to heat up inverter to 70deg.


----------



## dima (Dec 1, 2015)

So where is this mysterious bootloader version #3?


Johannes can you upload it to GitHub? https://github.com/tumanako/tumanako-inverter-fw-bootloader


Thanks much.


----------



## joromy (Feb 27, 2018)

dima said:


> So where is this mysterious bootloader version #3?


Not so mysterious, that's the newest one its part of inverter.zip together with firmware 3.93. (on Johannes software page)

More mysterious is the bootloader V2...…..


----------



## jhuebner (Apr 30, 2010)

I think I will revoke V3 boot loader. Messing with PWM pins without knowing their physical use is a bad idea. Like said, initializing the PWM pins to low is the only difference between V3 and V2.



I just saw I never pushed it to github.


----------



## ChazFisher (Sep 30, 2017)

jhuebner said:


> I think I will revoke V3 boot loader. Messing with PWM pins without knowing their physical use is a bad idea. Like said, initializing the PWM pins to low is the only difference between V3 and V2.


Do you have control of the DC Link contactor and Precharge contactor in the bootloader? That might be a low-risk way to make sure the state of the PWM pins doesn't matter on initial startup.


----------



## ALIE (Jan 28, 2015)

something interesting

IGBT
https://www.arrow.com/en/research-a...ucing-infineons-new-gen-1200-trenchstop-igbt6

Battery
https://www.youtube.com/watch?v=kJXRyWQgOY4&feature=youtu.be


----------



## arber333 (Dec 13, 2010)

ALIE said:


> something interesting
> 
> IGBT
> https://www.arrow.com/en/research-a...ucing-infineons-new-gen-1200-trenchstop-igbt6
> ...



I can see application in my compact 3phase charger  up to 15kW.


----------



## jhuebner (Apr 30, 2010)

ChazFisher said:


> Do you have control of the DC Link contactor and Precharge contactor in the bootloader? That might be a low-risk way to make sure the state of the PWM pins doesn't matter on initial startup.


Yes they actually default to off in reset state. Of course that only cures the problem if the inverter is not sitting on a bench permanently connected to a battery.




ALIE said:


> something interesting
> 
> IGBT
> https://www.arrow.com/en/research-a...ucing-infineons-new-gen-1200-trenchstop-igbt6
> ...


Nice IGBTs! And not too expensive either. Would make a nice high voltage, low current inverter.


----------



## jhuebner (Apr 30, 2010)

I have built a new firmware, version 4.03. It mainly solves the PWM bug:


In Active High mode use the pull down code
In Active Low mode explicitly float the pins
So if you happen to have a V3 boot loader the firmware will take care of floating the pins again. If you leave your battery connected at all times (no DC switch) AND are using active low mode you should downgrade to bootloader V2 using JTAG adapter (now in the zip file)


I have also updated the very first post of this thread, tell me what you think.


----------



## jackbauer (Jan 12, 2008)

BMW i3 motor running in torque mode with the low cost resolver interface 
https://youtu.be/psLzhUgoTok


----------



## arber333 (Dec 13, 2010)

jackbauer said:


> BMW i3 motor running in torque mode with the low cost resolver interface
> https://youtu.be/psLzhUgoTok


Nice work, very smooth. Did you have to setup a lot of parameters to get I3 to start smooth? 

A


----------



## jackbauer (Jan 12, 2008)

Very simple. Resolver position sensor, 3 pole pairs,sync offset 11000.


----------



## ChazFisher (Sep 30, 2017)

jhuebner said:


> ChazFisher said:
> 
> 
> > Do you have control of the DC Link contactor and Precharge contactor in the bootloader? That might be a low-risk way to make sure the state of the PWM pins doesn't matter on initial startup.
> ...


Thanks. You're quite right, of course. I just figure when I'm working with a bench setup that doesn't use everything, it's up to me to make sure it's safe.


----------



## jhuebner (Apr 30, 2010)

Yay, lab update 
https://youtu.be/Odz41F5BRrY


----------



## joromy (Feb 27, 2018)

I think it would be a good idea to add inverter fault codes to the can bus.
Do you have that on your list, jhuebner?

How many fault codes are there? Are they described somewhere?


----------



## jhuebner (Apr 30, 2010)

Oh, in fact no list yet. Will do. Putting it on CAN sounds like a good idea.


I reverse engineered the Leaf inverter a bit more:
https://youtu.be/JQ4UmW7OSc8


Turns out there are two heat sink temperatures. They are PWM, not analog. Also found the same goes for the bus voltage. All 361Hz PWM. Temperature is 0.32%/°C hitting 50% at around 30°C. Bus voltage 0.16%/V with an offset of 7%, i.e. 0V=7% duty cycle.


There are two fault signals sitting at 5V when all is fine and dropping to GND on fault.


----------



## jhuebner (Apr 30, 2010)

And it turns out the main connector to the outside world is not available to us https://www.te.com/deu-de/product-1939561-3.html?q=1939561&source=header#pdp-docs-features
So will have to be salvaged from the original control board.


----------



## Keplus4 (Oct 1, 2018)

I am new to this forum and your project but I wanted to add something critical. Variable Frequency Drives or Variable Speed Drives depending on who you are asking accomplish the same exact thing. The problem is that you must make sure you have low voltage sense and a normally open bus contactor. If you lose pull down while the DC Bus is connected the controller board will meltdown. Vfd like Siemens, GE, Robicon with power cell topology offer a complete motor controller solution up to 1250vdc and 2000A. surplus is readily available I was field service reps for years that's how I know about the cells and the meltdown if control logic board power fails. 



jhuebner said:


> Oh, in fact no list yet. Will do. Putting it on CAN sounds like a good idea.
> 
> 
> I reverse engineered the Leaf inverter a bit more:
> ...


----------



## jhuebner (Apr 30, 2010)

Keplus4 said:


> I am new to this forum and your project but I wanted to add something critical. Variable Frequency Drives or Variable Speed Drives depending on who you are asking accomplish the same exact thing. The problem is that you must make sure you have low voltage sense and a normally open bus contactor. If you lose pull down while the DC Bus is connected the controller board will meltdown. Vfd like Siemens, GE, Robicon with power cell topology offer a complete motor controller solution up to 1250vdc and 2000A. surplus is readily available I was field service reps for years that's how I know about the cells and the meltdown if control logic board power fails.


What do you mean by "lose pull down"? Are you talking about a braking resistor? Most conversions will have a normally open DC switch between battery pack and DC bus, is that what you mean?




joromy said:


> How many fault codes are there? Are they described somewhere?


Check it out: http://johanneshuebner.com/quickcms/index.html?en_errors,36.html


----------



## Keplus4 (Oct 1, 2018)

Yes, on the bus and for the gate on the igbts 


jhuebner said:


> Keplus4 said:
> 
> 
> > I am new to this forum and your project but I wanted to add something critical. Variable Frequency Drives or Variable Speed Drives depending on who you are asking accomplish the same exact thing. The problem is that you must make sure you have low voltage sense and a normally open bus contactor. If you lose pull down while the DC Bus is connected the controller board will meltdown. Vfd like Siemens, GE, Robicon with power cell topology offer a complete motor controller solution up to 1250vdc and 2000A. surplus is readily available I was field service reps for years that's how I know about the cells and the meltdown if control logic board power fails.
> ...


----------



## jhuebner (Apr 30, 2010)

Keplus4 said:


> Yes, on the bus and for the gate on the igbts


Ok, the drivers have active pull down on under voltage and also a 10k discharge resistor, you mean that?


----------



## jhuebner (Apr 30, 2010)

Currently I'm working on the boot loader.


Two folks have had issues with lockups after an update. I now activate the STMs watchdog in the boot loader and if the firmware fails to reset it (because it's corrupted) the cpu is reset and keeps cycling through the boot loader allowing for another go.


I'm also working on a procedure to field-update the boot loader without a JTAG programmer.


Of course I tried the latter while traveling and because I screwed up I now have the first 4 pages of the firmware sitting where the boot loader is supposed to be  Programmer is coming my way...


Also thought it would be nice to know the rough CPU load, so working on that also. It doesn't include the load caused by UART communication but maybe thats a good thing. UART communication is an "idle task" i.e. it is done when there's nothing else to do.


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Currently I'm working on the boot loader.
> Two folks have had issues with lockups after an update. I now activate the STMs watchdog in the boot loader and if the firmware fails to reset it (because it's corrupted) the cpu is reset and keeps cycling through the boot loader allowing for another go.


I have had the same problem also. Olimex would get stuck and only way to unstuck it would be to load new bootloader and firmware directly. 



jhuebner said:


> I'm also working on a procedure to field-update the boot loader without a JTAG programmer.



I just remove Olimex from board and programm it through JTAG connector using only 4 pins with ST link dongle. Its great because it works in Windows and because it is more portable. Granted i need a PC for this too. Here is procedure that works with .hex files.
https://mazdamx3ev.files.wordpress....ramming-of-olimex-chip-with-johannes-code.pdf

Also found this app to update with Android device OTG! I will try this today....
https://play.google.com/store/apps/details?id=ru.zdevs.zflasherstm32&hl=en_US


Also i am testing new code for three days now and i like the new PID interface. No more vibrations at slow speed on level road. Regen is a bit sensitive and touchy though, i had to reduce its effect to brake comfortably at slow speed.


Edit: What is with the large spaces after i post msg?


----------



## arber333 (Dec 13, 2010)

arber333 said:


> Also found this app to update with Android device OTG! I will try this today....
> https://play.google.com/store/apps/details?id=ru.zdevs.zflasherstm32&hl=en_US


Sucess! 
I have sucessfuly updated Olimex board using ZFlasher STM32, my Android phone and ST link V2 dongle with USB OTG cable. 
1. I erased flash - OK
2. I downloaded firmware to the phone - OK
3. I used bootloader code and flashed Olimex - OK
4. I flashed again with Firmware code - OK
I got flashing green light as serial began to work. 

For flashing with Android i use .hex file.


----------



## jhuebner (Apr 30, 2010)

Sweet, over are the times when you needed 300€ worth of equipment for this 
Anyway, for the folks who don't want to do that I now have a process for updating the bootloader without any special equipment - provided you have a working (blinking) board.
Once I have the accompanying firmware tested, I'll release that stuff.
Currently working on hardware variant detection to get rid of the multiple image files. Just one image for all.
Extra blank lines are another problem that our great admins are reluctant to fix.


----------



## ECOENERGI1 (Oct 19, 2017)

arber333 said:


> I just remove Olimex from board and programm it through JTAG connector using only 4 pins with ST link dongle. Its great because it works in Windows and because it is more portable. Granted i need a PC for this too. Here is procedure that works with .hex files.
> https://mazdamx3ev.files.wordpress....ramming-of-olimex-chip-with-johannes-code.pdf
> 
> 
> Very well explained, thanks Arber333


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Sweet, over are the times when you needed 300€ worth of equipment for this
> Anyway, for the folks who don't want to do that I now have a process for updating the bootloader without any special equipment - provided you have a working (blinking) board.
> Once I have the accompanying firmware tested, I'll release that stuff.
> Currently working on hardware variant detection to get rid of the multiple image files. Just one image for all.
> Extra blank lines are another problem that our great admins are reluctant to fix.


Heh!

Actually my phone is 298$ new and STLink is some 15$ + OTG cable is another 10$. So all in all we do use 300$ worth of equipment, we just use our phones to multitask for us. 

A


----------



## jhuebner (Apr 30, 2010)

I decided to leave the cluttered tumanako repository behind and set up my own. Check it out: https://github.com/jsphuebner


----------



## jackbauer (Jan 12, 2008)

Excellent


----------



## jackbauer (Jan 12, 2008)

Looks like the main repo is missing stm32_sine.h


----------



## jhuebner (Apr 30, 2010)

Oh sorry, that was an empty file. Removed the #include


----------



## Kevin Sharpe (Jul 4, 2011)

jhuebner said:


> I decided to leave the cluttered tumanako repository behind and set up my own.


That's fabulous 

Would it be possible to have formal software version/release control going forward? Lots people are planning to use the inverter in production projects and it would be helpful to have known good software versions that we can test


----------



## jackbauer (Jan 12, 2008)

Getting the following compiler error :



-------------- Build: STM32F103 in sinus (compiler: GNU GCC Compiler for ARM)---------------

Checking if target is up-to-date: make -q
Running command: make
CC stm32_sine.o
CC hwinit.o
CC stm32scheduler.o
CC params.o
CC terminal.o
CC terminal_prj.o
CC my_string.o
CC digio.o
CC sine_core.o
CC my_fp.o
CC fu.o
CC inc_encoder.o
CC printf.o
CC anain.o
CC temp_meas.o
CC param_save.o
CC foc.o
CC throttle.o
CC errormessage.o
src/project/stm32_can.cpp: In function 'void Can::usb_lp_can_rx0_isr()':
src/project/stm32_can.cpp:318:98: error: invalid operands of types 'void' and 'int' to binary 'operator>'
while (can_receive(CAN1, fifo, true, &id, &ext, &rtr, &fmi, &length, (uint8_t*)data, NULL) > 0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
make: *** [stm32_can.o] Error 1
CC stm32_can.o
Makefile:73: recipe for target 'stm32_can.o' failed
Process terminated with status 2 (0 minute(s), 1 second(s))
2 error(s), 0 warning(s) (0 minute(s), 1 second(s))


----------



## jhuebner (Apr 30, 2010)

Right now you have to use libopencm3 from my repo until they merged my changes


----------



## jhuebner (Apr 30, 2010)

Kevin Sharpe said:


> That's fabulous
> 
> Would it be possible to have formal software version/release control going forward? Lots people are planning to use the inverter in production projects and it would be helpful to have known good software versions that we can test


 Yes, thats a very good idea. github has facilities for that including binary distribution. Brilliant 
Currently I release software when it works well in the Polo. 

If anyone wants to volunteer in release and test management, speak up.


----------



## pm_dawn (Sep 14, 2009)

Maybe it would work to set up some kind of build server, like GitLab or something like that. GitLab have free build agents for public projects.
I think GitHub might also have that feature.


Regards
/Per


----------



## jackbauer (Jan 12, 2008)

Toyota Prius Gen 2 transaxle now working with the inverter and Johannes's resolver interface


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Yes, thats a very good idea. github has facilities for that including binary distribution. Brilliant
> Currently I release software when it works well in the Polo.
> 
> If anyone wants to volunteer in release and test management, speak up.


As allways i can do it! 
I run my car every day at speeds above 100km/h and i can perform some tests during that . 
But first we would have to have a checklist for testing. So we are able to record parameters. But that is not very safe. This should be automated.
Hey Johannes, could you write a software to make a txt file and dump selected parameters to it in some period? I would be great to have a record of events. Could that work through wifi on a phone?

A


----------



## jhuebner (Apr 30, 2010)

Regarding build server libopencm3 uses travis-ci.com. It's free for OS projects.


There is a limited number of unit tests, these should be expanded to also test some high level functionality. These tests can be run by travis.


Then we need some sort of in-car test procedure. Like "set parameter=value and check if power is limited to 50%"


----------



## jackbauer (Jan 12, 2008)

Prius gearboxes running : https://youtu.be/Xm8LXupyk7E


----------



## jhuebner (Apr 30, 2010)

Brilliant! 200€ motor cost is a good start for a budget conversion. Do they come with inverters?
Set up travis-ci today and yesterday. Basically on every commit the firmware is built and tested (as far as testing code goes).


----------



## jackbauer (Jan 12, 2008)

Nissan Leaf motor running : https://youtu.be/FaQ8kBUDM3Q


----------



## jhuebner (Apr 30, 2010)

And Nissan Leaf Logic board: https://youtu.be/SKUvxE0xcec


----------



## jackbauer (Jan 12, 2008)

Torque testing a Toyota PM motor. With smoke 
https://youtu.be/hYxxCOxyWM0


----------



## Tomdb (Jan 28, 2013)

Who said she got no starting torque 

Johannes when do you think an updated 'base' inverter brain will be for sale?


----------



## jhuebner (Apr 30, 2010)

I inquired at the local assembly house on Monday and waiting for them to get back to me. Once they do I have a price tag and 16 populated boards soon after.


----------



## zippy500 (Apr 3, 2017)

jhuebner said:


> I inquired at the local assembly house on Monday and waiting for them to get back to me. Once they do I have a price tag and 16 populated boards soon after.


Will the leaf drop in boards be available at the same time ?


----------



## jhuebner (Apr 30, 2010)

I have 4 boards here so can offer a few.


----------



## zippy500 (Apr 3, 2017)

jhuebner said:


> I have 4 boards here so can offer a few.


how do we order one ?

Will they be on your website ?

Thanks


----------



## mleebert (Aug 6, 2018)

I would like to reserve/purchase one of the Leaf adapter boards.


----------



## jhuebner (Apr 30, 2010)

Maybe I can finally be bothered to set up a proper webshop 


Once I know the cost I will take pre-orders as well.


----------



## jhuebner (Apr 30, 2010)

Finally it all came together and the new board is in the Leaf inverter. Doesn't look different from the outside.


Small bug: 12V and GND input are a bit twisted, no I'm using 2 instead of 4 power pins.


Will make a video tomorrow, it was too dark today.


I used the real time plot of angle and sine/cosine signal. It uses the stream command and a 1 MBit/s uart link.


Used CAN for controlling all IO since the wire harness doesn't connect to my extra pins


----------



## jhuebner (Apr 30, 2010)

Taking pre-orders for the new brain board and the Leaf drop-in board now:
https://openinverter.ddnss.de/shop


Please let me know your opinion on the shop.
The ddnss address is preliminary until I get the proper domain pointing there.


----------



## ra_XOr (Aug 7, 2018)

jhuebner said:


> Taking pre-orders for the new brain board and the Leaf drop-in board now:
> https://openinverter.ddnss.de/shop
> 
> 
> ...


I can't checkout as it says..

"Products marked with *** are not available in the desired quantity or not in stock!"

Cheers,
Mostafa


----------



## PStechPaul (May 1, 2012)

Do I understand correctly that the kit is 300 Euros and an additional tax of 250 Euros? And I'd have to add my own IGBTs, heat sink, bus capacitors, and enclosure? I had considered getting one, but that's too much for my needs.


----------



## kiwifiat (Feb 3, 2009)

PStechPaul said:


> Do I understand correctly that the kit is 300 Euros and an additional tax of 250 Euros? And I'd have to add my own IGBTs, heat sink, bus capacitors, and enclosure? I had considered getting one, but that's too much for my needs.



I think you will find "Ex Tax" means excluding the 19% VAT.


----------



## zippy500 (Apr 3, 2017)

PStechPaul said:


> Do I understand correctly that the kit is 300 Euros and an additional tax of 250 Euros?.


Yes kiwifiat is right. thats the european tax, if outside EU you will pay the EX tax price.

Then DHL ( or other carrier )will charge their fee and add your country import Tax too.


----------



## jhuebner (Apr 30, 2010)

ra_XOr said:


> I can't checkout as it says..
> 
> "Products marked with *** are not available in the desired quantity or not in stock!"
> 
> ...


Oh, thats not what I expected by setting it to pre-order. Will see how I can improve that. Thing is the populated boards will only be available next week or so.


Yes, if you're inside the EU the price is 297.50€, outside the EU it is 250€. 19% VAT.


----------



## bigpie (Dec 14, 2017)

Can Inverter Kit Rev 2 be used with a resolver?


----------



## jhuebner (Apr 30, 2010)

Yes, but you'll need to build an external exciter for the resolver. See here: http://www.diyelectriccar.com/forums/showthread.php?p=971713#post971713


----------



## zippy500 (Apr 3, 2017)

Can I ask is the B.O.M for the Leaf bare PCB adapter Board ?


----------



## jhuebner (Apr 30, 2010)

Ah yes, that will be on github. No sales yet so I'm not in a hurry there


----------



## [email protected] (Jul 2, 2018)

jhuebner said:


> And heres a quick video on my resolver efforts.
> https://youtu.be/0V_kb0N5ONg



hi johannes , could you confirm that r6 value is 1ohm ?


----------



## dima (Dec 1, 2015)

I think it is 10ohm https://github.com/jsphuebner/inverter-hardware/blob/master/mainboardv1.1.pdf


----------



## [email protected] (Jul 2, 2018)

i don't know because it's not the same shematics.


----------



## jhuebner (Apr 30, 2010)

Yes, 10 Ohm is correct


----------



## [email protected] (Jul 2, 2018)

ok thanks ! i will try with it


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> Yes, 10 Ohm is correct


Can you comment on connecting R2 to GND? This means Cruise mode is disabled no? Is there a reason why?

I havent been paying attention much to resolver mode since i use ABZ encoder for Leaf motor...

tnx


----------



## [email protected] (Jul 2, 2018)

i'm working on the adaptation on my old kangoo. I will make the test with the schematic to connect the resolver.


But i have a question on the main borad (v1), is there some free i/o that we could use it to drive with pwm another power stage with a current feed back ?
the motor is a leroy somer with a powered rotor.


To start the car i will be able to make the power stage for the rotor, but when the car will be on the road, i think it will be better to have an asservissement on rotor power by accel and rpm.
What do you think about this ?


----------



## damian.lo (Apr 22, 2018)

arber333 said:


> Can you comment on connecting R2 to GND? This means Cruise mode is disabled no? Is there a reason why?
> 
> I havent been paying attention much to resolver mode since i use ABZ encoder for Leaf motor...
> 
> tnx


Yes, I have already resolver to encoder board done and I put also R6=10 Ohms. Arber, why you put encoder ABZ instead original resolver? Was only faster to put encoder than make board?


----------



## arber333 (Dec 13, 2010)

Last year when it wasnt apparent Johannes inverter could be run with BLDC motor i was experimenting with Pauls controller. It works nicely with ABZ encoder up to some 100Vdc. Then chaos and mayhem... EMI becomes unbarable and nothing really works with any effect. I couldnt even get ACIM motor work with FOC at 300Vdc. 
In process of building ABZ encoder adapter i damaged my resolver core. I dont know if i could get it to work again...


----------



## Zaks90v8 (Jun 27, 2018)

As of now is their anything that your drop in controller and adapter board cant do for the leaf? All is present? Regen, Precharge, cruise ... 

Your thread is 200+ pages it will take a while to read. lol


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Last year when it wasnt apparent Johannes inverter could be run with BLDC motor i was experimenting with Pauls controller. It works nicely with ABZ encoder up to some 100Vdc. Then chaos and mayhem... EMI becomes unbarable and nothing really works with any effect. I couldnt even get ACIM motor work with FOC at 300Vdc.
> In process of building ABZ encoder adapter i damaged my resolver core. I dont know if i could get it to work again...


I lately added support for sin/cos encoders such as MLX90380. Works like your ABZ version with a small magnet on the back of the axis.




Zaks90v8 said:


> As of now is their anything that your drop in controller and adapter board cant do for the leaf? All is present? Regen, Precharge, cruise ...
> 
> Your thread is 200+ pages it will take a while to read. lol


It can do all the high level functions. What it does not do right now is field weakening, so you will not be able to exceed base speed (e.g. [email protected] for Leaf motor). But as soon as I have my Touran conversion up and running I'll work on that.


----------



## Zaks90v8 (Jun 27, 2018)

jhuebner said:


> I lately added support for sin/cos encoders such as MLX90380. Works like your ABZ version with a small magnet on the back of the axis.
> 
> 
> 
> It can do all the high level functions. What it does not do right now is field weakening, so you will not be able to exceed base speed (e.g. [email protected] for Leaf motor). But as soon as I have my Touran conversion up and running I'll work on that.


So the switch over is trouble?


----------



## arber333 (Dec 13, 2010)

jhuebner said:


> I lately added support for sin/cos encoders such as MLX90380. Works like your ABZ version with a small magnet on the back of the axis.


I still have to find the time to try the ABZ encoder with your rev. 3 brain. 
It will be interesting to try resolver core since for ABZ you have to determine the offset first. Is there an offset required for resolver?
At RLS they say it is essentially the same chip with different I/Os connected. 



> It can do all the high level functions. What it does not do right now is field weakening, so you will not be able to exceed base speed (e.g. [email protected] for Leaf motor). But as soon as I have my Touran conversion up and running I'll work on that.


That is a shame . I am counting on reving it to 10k RPM with original gearbox. Do you think you could give it enough field shift for the field to rotate that fast with just V/Hz control? Also dont forget the regen. It becomes very different function when there is no slip there... or can there be little slip hidden in V/Hz to shift the field back? 

EDIT: Well i have my Ampera pack just sitting in my workshop at 390Vdc and it volunteers to power Ampera inverter with your rev. 3 board and Leaf motor just lying about . I have one RPM counter and ABZ encoder. Want to give it a try at some long distance experimenting? 

A


----------



## zippy500 (Apr 3, 2017)

arber333 said:


> That is a shame . I am counting on reving it to 10k RPM with original gearbox.


What is the leaf motor capable of RPM ? Would a standard gearbox be able withstand that high a RPM. I doubt my 1973 gearbox would


----------



## arber333 (Dec 13, 2010)

zippy500 said:


> What is the leaf motor capable of RPM ? Would a standard gearbox be able withstand that high a RPM. I doubt my 1973 gearbox would


Well Leaf motor is normally run at 10Krpm to car speed of 150km/h with final drive ration of 8:1. Motor and gearbox are designed as a whole unit. If you install motor on another cars transmission you should conform to that transmission speeds! Transmission speeds are usually written in that cars user manual.

Arlo ran the exact same motor at 12Krpm and to max 300HP with a voltage of 480Vdc. He used Lebowski inverter core.


----------



## jhuebner (Apr 30, 2010)

Zaks90v8 said:


> So the switch over is trouble?


Well field weakening boils down to a different phase angle (syncofs). The higher the speed, the less the angle offset between rotor and stator, I believe.
What I have to think through is the fault logic. Basically, if you rev the motor to 10krpm and then for some reason the inverter stalls, the motor will generate roughly 1kV of BEMF voltage as the field is no longer weakened. 1kV will destroy just about everything from IGBTs to caps or it will generate an enormous braking force if the current path to the battery is not interrupted.
So it seems in field weakening mode I must never ever turn off the PWM. Any comments?




arber333 said:


> That is a shame . I am counting on reving it to 10k RPM with original gearbox. Do you think you could give it enough field shift for the field to rotate that fast with just V/Hz control? Also dont forget the regen. It becomes very different function when there is no slip there... or can there be little slip hidden in V/Hz to shift the field back?
> 
> EDIT: Well i have my Ampera pack just sitting in my workshop at 390Vdc and it volunteers to power Ampera inverter with your rev. 3 board and Leaf motor just lying about . I have one RPM counter and ABZ encoder. Want to give it a try at some long distance experimenting?
> 
> A


 Regen seems pretty simple. Just set the AC output voltage below BEMF voltage.
Thanks for the offer, but I don't know which new info I could get from another idling motor right now. But maybe I can think of something tomorrow


----------



## [email protected] (Jul 2, 2018)

hello 

anyone could help me to found the fweak ?
it is a 4 poles motor but not conventionnal data on it, only rpm max and nominal voltage:


----------



## arber333 (Dec 13, 2010)

[email protected] said:


> hello
> 
> anyone could help me to found the fweak ?
> it is a 4 poles motor but not conventionnal data on it, only rpm max and nominal voltage:


Well i found this on your motor.
It seems the original fweak was at 1850rpm = 62Hz
At 132Vdc motor can produce 30kW there with 165Nm torque.
Beyond that motor can sustain 15kW for longer period. Torque there is proportionaly lower. 

Rotor is quite short but thick so starting torque is high but high rpm torque suffers. 

I would suggest you try with more than 200Vdc and set fweak at 80Hz. That way you would have still enough torque to start and more at higher RPM.
Johannes inverter can set udcnom parameter to the 140Vdc. That way inverter will conform RMS voltage to motor regardless of DC rail voltage.
I am not sure how to set minimal slip. You will have to try this yourself. And boost as well. I would suggest you try to set boost somewhere at 30Vdc

EDIT: Usually you can overload motor 130% by voltage and 130% by current and get away without too much heat dissipation. So you could get 22kW *1.3 *1.3 = 38kW. That would be electric power into motor. Pout i dont know.... 

A


----------



## jhuebner (Apr 30, 2010)

It is a synchronous motor, so no slip.
Strange torque curve. They say it runs at full torque till 1850rpm but the curve actually tapers off at 1000rpm.


----------



## jhuebner (Apr 30, 2010)

Lab update: https://youtu.be/NWCGlZcbGE8


----------



## [email protected] (Jul 2, 2018)

arber333 said:


> Well i found this on your motor.
> It seems the original fweak was at 1850rpm = 62Hz
> At 132Vdc motor can produce 30kW there with 165Nm torque.
> Beyond that motor can sustain 15kW for longer period. Torque there is proportionaly lower.
> ...



thanks arber for the information.
and yes as johannes say it is a syncronous motor, as the rotor need dc supply ( need arround 2kw )


----------



## jhuebner (Apr 30, 2010)

and combined lab/driveway update: https://www.youtube.com/watch?v=T_6hw6vGzfM


----------



## arber333 (Dec 13, 2010)

[email protected] said:


> thanks arber for the information.
> and yes as johannes say it is a syncronous motor, as the rotor need dc supply ( need arround 2kw )


Well you know then. It is a sepex motor. You should use appropriate controler.
I am not sure Johannes controler would power that.


----------



## jhuebner (Apr 30, 2010)

arber333 said:


> Well you know then. It is a sepex motor. You should use appropriate controler.
> I am not sure Johannes controler would power that.


Sepex is a form of brushed DC motor.
His motor is like a car alternator. The field is generated with rotor windings instead of permanent magnets.


----------



## [email protected] (Jul 2, 2018)

yes that wright, i think renault make somthing like that in the zoe too.


so i just finish soldering operation, and test the web server page.


i will work soon on an arduino systeme with a can input to manage the dc power for the rotor.


----------



## jhuebner (Apr 30, 2010)

So, I think it may be time to put an end to this thread. I have created a forum especially for the openinverter ecosystem: https://openinverter.org/forum


----------



## onegreenev (May 18, 2012)

jhuebner said:


> So, I think it may be time to put an end to this thread. I have created a forum especially for the openinverter ecosystem: https://openinverter.org/forum



Is there a way to archive all the posts of this thread for future review?


----------



## onegreenev (May 18, 2012)

jhuebner said:


> So, I think it may be time to put an end to this thread. I have created a forum especially for the openinverter ecosystem: https://openinverter.org/forum


Just registered on the new site. Thanks


----------



## jhuebner (Apr 30, 2010)

onegreenev said:


> Is there a way to archive all the posts of this thread for future review?


I guess we can not count on VS for that matter but maybe the content can be grabbed with some web tool. (Or VS expose mysql with root and no password to the outside world, I wouldn't be at all surprised )


----------



## nailgg (Dec 12, 2014)

Here is a 40 MB PDF file with all 228 pages: https://www.dropbox.com/s/q8xamg5hcy6dxyj/Huebner_Inverter.rar?dl=0

I used a tool named "wkhtmltopdf" to create it. The document isn't in the perfect shape, but at least it allows text search, also shows the images in posts.


----------



## jhuebner (Apr 30, 2010)

Cool, thanks very much! Would you mind if I upload it to openinverter.org?


----------



## nailgg (Dec 12, 2014)

Of course you can


----------

