# Inexpensive ASIC DC Series controller, no uC, DSP or programming



## jackbauer (Jan 12, 2008)

That is very, very interesting. I am (was) planning to use Paul Holmes old 500A controller logic board as the basis for controller build. I love the simplicity of this however. I might add an overcurrent shutdown option. LM393 should do the job. Thanks Tony


----------



## jackbauer (Jan 12, 2008)

You already have overcurrent protection in there! I need to read before I type


----------



## jackbauer (Jan 12, 2008)

Done. Now to see if it works


----------



## steveob (Nov 10, 2017)

has anyone ever used the comparator on a microcontroller for hysteresis control (while keeping things like throttle lock out and serial data, and precharge/etc)? I appreciate that programming can be a bit of a hurdle, just curious.


----------



## kennybobby (Aug 10, 2012)

i've used a similar circuit for current monitoring but added a low-value capacitor in parallel to R1. 

This adds filtering against noise (PWM) and can be tuned to soften the hysteresis transistion (change slope and round over the edges).

i think you are using R2 and R3 to set the threshold voltage. If so then R3 should be tied directly to ground and the C3 cap should be on the node between R2 and R3.

One other consideration might be a light pull-up resistor to 5V on the output of the comparator.


----------



## sdev (May 3, 2015)

Jack


How did you manage to get that card made up so fast.?


Stephen


----------



## jackbauer (Jan 12, 2008)

Not that many components on it 


Design files on github :
https://github.com/damienmaguire/DC-Motor-Controller


Can't wait to get testing in the car


----------



## zippy500 (Apr 3, 2017)

Nice work.

Damien could you please upload "your brain" to github I would love to be able to do what you can.

I know what +ve and -ve is i could do with your knowledge to fill in the rest to be a EE


----------



## Peterboat#1 (Mar 1, 2018)

jackbauer said:


> Not that many components on it
> 
> 
> Design files on github :
> ...


Are you going to be making them to order?  I am putting two Saitta/Lynch motors in my boat running at 60volts DC. Trouble is two controllers are the same price as one motor so I looking at cheaper but good controllers


----------



## jackbauer (Jan 12, 2008)

I won't be offering built units. However, bare pcbs are available on my webshop :
http://www.evbmw.com/index.php/evbmw-webshop/miscellaneous-bare-pcbs/dc-log-v1


Do note this is untested in a car as yet.


----------



## Tony Bogs (Apr 12, 2014)

You've beaten me to it once again, Jack. Man, you're fast.


I think I'm going to steal your PCB design for the test runs.

But I see you haven't put in a car yet. 

Well, I've got a similar piece of ICE sh*t you've bought for your €1000 build. 

Nah, I think it's actually a bit better. No smell.



Battery pack is on its way.


----------



## jackbauer (Jan 12, 2008)

Running very well in the car now 
https://www.youtube.com/watch?v=ro0dsv_btlg


----------



## Tony Bogs (Apr 12, 2014)

Smooth ride! Great!


----------



## Tony Bogs (Apr 12, 2014)

A car with this controller isn't going anywhere without a power stage.

I'm not a big fan of a lot of mosfets in parallel, so I've picked the IXYS IXTN550N055: 550A, 55V, Tjmax 175C, max dutycycle @48V,400A : 50% (200A terminal amp limit). 

Repetitive avalanch current 200A

Gate resistor turn-off starting point: 5R. Turn-on: 1R
Driver: the usual IXDN609

Freewheel schottky DSS2x160-01A

Effectively 8kW+ per power stage isn't bad at all. Lots of torque at low RPM.

@Damien: brake input is a very good addition, but please drive slowly in the vicinity of petting zoos.


----------



## Tony Bogs (Apr 12, 2014)

The design for the idle control is done. 

Now the nexr circuit: The "HOLD" circuit for the the battery fault input from the BMS.

It holds (captures) a fault from the battery that indicates a too large static (internal voltage) or dynamic (impedance) difference between sections of the battery pack.
It is part of the controller because this fault condition has to lower the output amps to the motor and the wiring to the hysteretic controller has to be as short as possible.

A total shutdown is unwanted. A sort of "limp home" is better.

i'm going to use a thyristor. Similar to commutating thyristors in early 3phase motor inverters, the "hold" status can be reset by bypassing the current through the thyristor.
No flipflops needed for this. Very simple circuit. Design is ready.


----------



## jackbauer (Jan 12, 2008)

I've been looking at some super simple ideas for a precharge controller. Might be worth incorporating?


----------



## Tony Bogs (Apr 12, 2014)

@ jackbauer: Definitely. Can't do without precharge. Seen anything you like?

Next: the very simple gate driver for the 55V,550A (1375A peak) IXYS mosfet.
It is very clear that desat has no benefits in this low voltage, single mosfet design.
The TRACO 12 to 15V isolated power supply does not need a high dV/dt rating, since the source of the mosfet is at ground level. 
But a step-up of the 12V is needed, because the UVLO of the optocoupler has a 13.5 V upper threshold.

With the insulated mosfet at ground level, the cathode of the freewheel diode and its cooler are at battery+ voltage.
This way the coolers cannot act as high power antennas. 

The turn-off gate resistor has a high value (10 Ohm). 
For a major part the stored energy in the parasitic inductances has to be dissipated in the mosfet 
during turn-off to prevent a very high Vds voltage spike and an avalanch current that is above the spec limit of 200A.


----------



## Tony Bogs (Apr 12, 2014)

Precharge:



I've entered a PTC in series with a 11W (and 5x overload spec for 5 seconds) wire wound resistor in the schematics for precharge. 

Only used when the power stage is connected to the baterry pack via a fuse: it's a low voltage system, no need for additional safety devices or relays.


And: I'm maintaining the AT, so it's impossible to start the controller in a drive position.


----------



## Tony Bogs (Apr 12, 2014)

FAN CONTROL 

With a big wink, this fan controller complies with all applicable key words of the thread name except ASIC .

I'm going to use an automotive tangential fan to produce linear flow along the fins of the coolers. 

In series I'll connect a NTC thermistor, mounted on the cooler of the mosfet: inexpensive fan control.


Really works well. Applied it to a number of low cost designs.


----------



## Tony Bogs (Apr 12, 2014)

OK, it's an early rise and shine today, because it has been terribly hot here.

Nobody has posted a reaction yet, but the simple gate driver has a flaw.

Without desat, the circuit relies on UVLO, time constants in the power circuit and a response time of the control circuit in the microsecond range. 

For UVLO to work properly the zener in the turn-on path of the gate has to be removed. 

With the zener removed, the gate will be driven with at least 0 to 9.5 V (full turn-on for the IXYS 55V/550A mosfet) at the low threshold of UVLO.


----------



## kennybobby (Aug 10, 2012)

What is the gate driver chip, can't read or find that part number?

i didn't understand all the diodes for the gate drive, plus the in-line zener, what was the point of all that?


----------



## Tony Bogs (Apr 12, 2014)

The usual transient suppressor zener at the gate. 

Driver; the very frequently applied IXDN609.
UVLO: optocoupler HCPL3120 SMD, also provides ground isolation.


The mosfet is Vgs=10V on type, the zener lowers the output voltage from 15V to 10V under operation conditions. 
Here's the flaw: doesn't work that way at low UVLO threshold.


And as usual: diodes provide seperation of the flow of gate current for turn-on and turn-off. 

Serious engineering, but just for the fun of it.


----------



## Rapsodija (Aug 24, 2018)

Very interesting post.


----------



## Tony Bogs (Apr 12, 2014)

The boards are on the way. Idle control is the largest (1.1 x 2.1"). And then the gatedriver, the overtemp protection input and the battey fault (bms) hold. 3D doesn't work perfectly yet in Kicad. 

Yep, it's definitely an inexpensive and quick to build controller. 

I think I'll build a nice laminated busbar for the power section. 2mm thick sheet of copper to be added to the next parts order. I've already have the 0.5mm thick sheet of glass filled epoxy. 

The gatedriver can be screwed directly onto the power mosfet.

Capacitor bank on the busbar will consist of a couple of smaller Kemet 400V that can handle the ripple current and a big one for the farads (voltage drop).


----------



## Tony Bogs (Apr 12, 2014)

The parts of the hysteretic DC series controller "squeezed" onto a 3x3" PCB.


----------



## Tony Bogs (Apr 12, 2014)

Great news. The PCB foundry now offers full small series PCBA service. Parts supply, professional pick and place, online pre-check tools, all in the EU.
Part size down to 0402 and 0,5 mm pin spacing. 
No need to switch to RS and sparkling software. I can stay with Kicad.

Not ready yet for that order, this one will be a low cost "engineering" board. Only two, no silk, no solder mask.

I'm going to run this board with a 50V power stage, but jackbauer (Damien Maguire) has been kind enough to try out the basic version (no pin headers for daughter boards) with a 100V dual HB IGBT power stage.


P.S. The pin headers are NP in the BOM of thsi board, headers are on the daughter boards


----------



## Tony Bogs (Apr 12, 2014)

Precharge controller can be done with only a few discrete parts for a conversion of a ICE car with a key mechanism, i.e. contacts 30, 54 ..., 50 is the supply contact for the relay of the starter motor.


The circuit operates as drivers are used to in an ICE. Turn the key to the start position and wait for the motor to start or in this case for the precharge ready LED to light up.


Protective measures must be implemented externally, i.e. by blocking the 12V from contact 50 to the precharge controller. For instance when the AT is in a drive position.


----------



## jackbauer (Jan 12, 2008)

Very interested in this


----------



## boznz (Aug 22, 2018)

Hi Guys

Been down at 3.3V for the last 15 years and getting back up to speed slowly on power electronics so please bear with me.

I am probably going to use this as the basis of my 1998 BMW 528 Automatic conversion similar to Damien's but keeping the auto box (which also has the higher diff ratio than the manual Damien) I will also be setting it all up on the bench and getting my head around it and testing it before touching the car.

For a beginner like me it would help to include the overall wiring diagram of what you are trying to achieve, I really dont know at this stage what the inputs are? analog, 0-5V, digital, 4-20mA, PWM, plain old pot, whatever, also the outputs which drive the IGBT whether its high side or low side, still got some research to do as most of these were not in my EV curriculum when I learnt.

Once I get it on the bench it will hopefully become obvious but I am still trying to source a motor and build up battery packs and in a thread like this and for a beginner it is difficult to keep track of various low quality jepgs, I got the schematics from Damiens github but Tony has added and changed things since, so Tony do you have a github or can publish the source files please.

As an electronics engineer too I value simplicity of this design, it is likely I will customise the design for my build to include the auto creep function, cruise control (or maybe just 50KMH and 100KMH buttons) and a few other things I may think of.

Keep up the good work


----------



## jackbauer (Jan 12, 2008)

In case anyone missed it here is me driving the E36 with Tony's controller :
https://www.youtube.com/watch?v=NZwDnNj17aw


----------



## MattsAwesomeStuff (Aug 10, 2017)

I wish I understood this stuff well enough to contribute.

I've never dabbled in microcontrollers, but to me, a lot of this stuff is more easily handled in software, at least code I can break down and understand.

I can't look at a circuit and go "Oh, this is what this does, this is what this is for." I understand PWM, but, not what all of this does.

I expected the difficult part for me to understand would have been the power stage, but that's not what this is, yet.

It's great to see that someone else can fill in these gaps, I'd like, at some point, to help maybe document and bridge the gap to the common individual who wants to know a little bit more.


----------



## Tony Bogs (Apr 12, 2014)

Well, the tiny LTC6992 converts a voltage (0,1 to 0,9V) directly into a digital PWM output.
What can be more straightforward than that. 

In a micro, you have to do a lot of bit banging before you get this functionality up and running and it takes much more hardware.
Bit banging means: set bits in a lot registers, load them with values, set up a scheduler, activate a watchdog, set up an interrupt scheme, initialize complex PWM controllers .....
Some develoment systems hide a lot of the bit banging to make it look a little bit easier.
And then there are the bugs. This guy I occasionally meet at a party, has a full schedule bringing down the number of critters as a member of a team of experts.

I've done my share of bit banging. When it was new, it was interesting. Not any more.
I'm being mild here: if it can be done without bit banging, yes please.


----------



## MattsAwesomeStuff (Aug 10, 2017)

> Well, the tiny LTC6992 converts a voltage (0,1 to 0,9V) directly into a digital PWM output.
> What can be more straightforward than that.


I understand that much. Once upon a time I'd have used a 555 to do the same.

But, you can get little PWM circuits for a couple bucks on Ebay, whereas, Damien's selling his blank boards here for $30 (and not saying that's an unfair price) and they seem to be about the size of my palm.

The render you posted above, I count 35 screw terminals and 50 breakout pins.

And that's only on the signal board, not the power board.

Again, not saying you're doing anything wrong, it's me that doesn't understand what's going on or why something that in my head seems very simple is obviously much more complicated. I can't tell what any of it is, what it does, or why it's there. If it's going to have feature creep, to me, I can understand and "edit" those features better in software. In hardware it's a bit more black magic.

At the design stage, meh, keep the lookieloos out of the process, those with the technical understanding can get stuff done faster by not dumbing it down.

But eventually, if you'd like it to be adopted by those that couldn't engineer their own circuit (presumably a goal?), it's gotta be dumbed down. I'm happy to help with documenting stuff when the time is right, if I can understand it well enough.


----------



## Tony Bogs (Apr 12, 2014)

Damien tried out the very basic functionality. As far as I know, that's enough for his car (for now). He did make the suggestion to incorporate a precharge controller for the power stage. 

Well, there you have one of the things one can add. Some don't like it, they can leave it out. It is a seperate piece of hardware.

I'm dressing up the basic functionality with other modules, for example idle speed control.
If idle speed control is unwanted, don't place the module and the connectors for it. It's as simple as that. 
Other modules for example: handling of battery fault, overtemperature of motor and battery. 
Some prefer one or two dash battery meters in the dash in stead of automatic handling of a battery fault. That's OK. It's a free world. 

But you can get started with Damiens PCB for €30 when the basic functionality is enough for you. And that's entirely up to you to decide.


----------



## Tony Bogs (Apr 12, 2014)

In a couple of weeks my donor car for my senior citizen EV wiill be ready to be stripped down. 

And then I can have a look at the existing hardware to see what interfaces I need on my boards.
Tacho input, dash lights, that kind of stuff.


----------



## Tony Bogs (Apr 12, 2014)

The number of connectors is probably a bit too much. New diagram with idle speed comparator, modified current limit comparator circuit,
smart hi side mos switch for delayed turn on and simplified inputs (no modules anymore). Minimal hardware, but still very versatile.

Power output to gate driver is now 5V. DC/DC converter in gatedriver circuit lists IGBT application in specifications (Recom R05P215S/P), full continuous short circuit protection.


----------



## jackbauer (Jan 12, 2008)

Tony, I'm getting naughty ideas about designing a hardware AC motor controller


----------



## Tony Bogs (Apr 12, 2014)

Thanks, but the Fairchildsemi ASIC for ACIMs is now obsolete. So I'll leave that one for you.


----------



## Tony Bogs (Apr 12, 2014)

Nevertheless, an AC controller can be done without without a single line of code. 

So @Jackbauer, when can we see a glimpse of your ideas and find out what so naughty about them?


----------



## Tony Bogs (Apr 12, 2014)

OK, naughty ideas about a hardware AC controller. Trying to focus and beam in on Ireland. Nope, not getting anything. 

Well, I guess it's up to me then to fill in the huge blanks and gaps in the ideas for a hardware AC controller.

Thank goodness it is not as challenging as it was in the 70s.
We now have low cost switched capacitor filter devices available and in production. They are going to play an important role,
because the frequency and phase response can shift up and down as the output frequency of the controller varies.

Sine wave generation: SQUARE WAVE VCO with divider and high order SWcap low pass filter. 
Phase shift for three phase operation: dual universal SWCAP filter device. Allpass?
Accurate triangle voltage based 3 phase PWM : quad comparator + inverter (SOT23) + integrator. 
Dead time insertion: easy to implement RCD 

V/F control input: LM1815 magnetic pickup, LM2907 F/V and a throttle pot.

Total parts cost of basic controller (excluding PCB, throttle pot, gate drivers and power stage): about €30. 

My telepathic skills didn't get me very far  , I guess I don't have any, 
so is this anywhere close to what you had in mind, Jackbauer (Damien Maguire)? 
I'm not so sure about the naughty element. Perhaps you can shed some light on it?

SORRY, NO OVERCURRENT PROTECTION IN THIS PROPOSAL YET. Too easy.


----------



## jackbauer (Jan 12, 2008)

Sorry Tony my mind is elsewhere these days


I'd came across the device in the picture when working on the Enova inverters. Dismissed it at the time (it is obsolete of course) but recently got me thinking about what would be needed to make a hardware 6 output pwm generator capable of running a power stage.


----------



## Tony Bogs (Apr 12, 2014)

No wonder, I can imagine that Elon keeps you quite busy with frequent revisions of hardware and possibly software. 

And now you've got me thinking. IXYS IXDP630, is that the one?
Pretty small if it is a re-packaged microntroller with some preloaded software.

Yeah, it think it might be the more efficient solution to go with hardware if you take (development) time as a scarse resource into account.

I picked the LTC 1060 as a dual universal tracking filter for the 3 phase sine waveform generation.


Hardware does have its limitations when time is critical. So no overmodulation, saddle wave or advanced vector schemes.


----------



## jackbauer (Jan 12, 2008)

So the LTC1060 creates the sine waves and use them to modulate the pwm duty?


I'm thinking the simplest possible way to drive a 3 phase acim. Take an analog throttle input, two current sensors and pump out some pwm. Feed that into 3 IR2214 drivers for a simple power stage.


Some form of current limiting would be required (don't ask me how I know) otherwise it will just push too many amps at low rotor speed, saturate and blow.


----------



## kennybobby (Aug 10, 2012)

In the third version of the schematic the voltage comparator reading the LEM current sensor has been changed to an LM2904 op amp, and it appears to be used as a non-inverting amplifier to provide the hysteresis. 

i'm wondering about the function of the summing junction on the (-) input? Could the desired cutoff voltage from the current sensor just be set with a single voltage reference instead of summing 3 input voltages? Just curious about if you had a special reason that i'm overlooking or missed...

Also which LEM current sensor are you using?


----------



## Tony Bogs (Apr 12, 2014)

@Jackbauer,  you really do need phase shifted AC to get an ACIM to work.
And overcurrent protection, but that is too easy in a discussion about a hardware AC controller. 
Sorry to hear that you've had some bad experiences in a real world setup. 

And that's why the LTC1060 is such a good pick. It is hardware and it is in the LTSPICE library. 
Unlike software solutions, hardware is very easy to simulate when the models are there. Another reason why it is so efficient to go for full hardware. 

As soon as SW is introduced, tests are very often run in a real world setup. And that can lead to very expensive mishaps.
I'm all for the simplest solution and the LTC1060 is very simple, though it is a filter in the discrete time domain.

@kennybobby: I'm using opamps as comparators. Fast enough, low cost. And they're automotive grade. 
"Kind" of important in an overcurrent circuit for increased reliabililty (ask Jack, sorry, Jack ). 
And the hysteresis is now indepedent of the threshold with only a minor change.

I'm not going to change the title of the thread yet to include AC.
I will post a circuit diagram and run a LTSPICE simulation if, and this is a big if, I can find the time for it , 
Only a few parts as models in a computer memory.


----------



## Tony Bogs (Apr 12, 2014)

I've found the time to do the first simulation.  

With a LTC1068. It has 4 filters on chip. Meaning that we probably can do with just one IC for all filtering in the AC generation section.
In the diagram all four filters are configured as 1st order allpass. 
In the final circuit, two will be configured as low pass for the square wave to sine conversion.
The resulting 4th order elliptic should have a steep enough amplitude drop to effectively filter out 3rd and higher harmonics.

As can be seen in the driagram, the AC input frequency is 200 Hz and the clock for the LTC1068 is at 12.8KHz.
That gives a very easy to implement division factor of 64. Great!
Now we only have to do a minor adjustment of R3 and R11 and we've got the 120 degree shifts. Pretty close already though.


----------



## Tony Bogs (Apr 12, 2014)

Resistor value(s) determined by repeated simulation: R3,R11 900 Ohm.
I'm going to use three allpass filters to make sure that there's no difference in characteristics of the signals that are fed to the output comparators.

LT has a - no external components needed - solution for the square wave to sine conversion: the LTC1064-1. 
Why not just use it and save a lot time? Yeah, so it is a bit expensive, but an hour of my life is also very valuable.

Next are the triangle waveform generator, the comparators and the VCO. 
Very straightforward, nothing fancy and almost too easy to simulate.

Although this thread is about keeping it inexpensive, basic and easy to develop and build,
it is possible and not too difficult to make the controller a bit more advanced by adding 3rd harmonics of the square wave to the AC signals (uitilize bus voltage to the max).


----------



## Tony Bogs (Apr 12, 2014)

Triangle generator and 1 output comparator added. We have sine wave modulated PWM.


----------



## jackbauer (Jan 12, 2008)

You'll have this design done by the time I get home


----------



## Tony Bogs (Apr 12, 2014)

Yep,  I was going to add something along the same lines in my previous post, but then applied to a *build* in a couple of weeks. 
But unfortunately, I can't get the parts within that timeframe. And I don't have a scrap model III yet to strip down for a SiC inverter stage.

I'm pretty sure you like this kind of approach, but I'm not going to resort to solutions like hugh milk bottle sized caps as series impedances. 


Oh yeah, back to the design and simulation stage. 



VCO: the good old 74HC4046. I think I'm going to utilize the built-in phase comparator as part of the slip control.
The 8 stage DFF as divider is straightforward. Just pick one from the HC/AC lines.

V/f : simple multivibrator , two opamps and a SPDT analog switch.


And that's the basic HW controller design. Enjoy!


----------



## Tony Bogs (Apr 12, 2014)

Time for some design choices and some background info concerning the HW AC controller.

1. Slip control. With slip control the stator frequency (output from the controller) is a fixed percentage higher (motor mode) or lower (regen mode) than the rotor frequency (at the output shaft of the motor). 
The percentage can be selected. The first is very close to the optimum percentage for high efficiency (ECO mode), but the maximum torque is lower than at the second percentage. 
At the higher second percentage the maximum motor torque can be achieved, but the efficiency is worse. Great selection for overtaking a car, for example. 

The third percentage is for regen mode. The mode selection is done manually by the driver (for safety reasons). 

2. The driver controls the excitation of the stator field via the throttle. 
There's no direct link between throttle position, torque an speed. 
The driver closes the control loop for torque (acceleration) and velocity and generates the necessary error signal with his foot.

3. Operation above the nominal speed of the motor is not supported. 
The controller is designed for conversions of existing ICE cars (with AT). 
Need to go fast? Choose another gear in the transmission.


----------



## Tony Bogs (Apr 12, 2014)

The slip control PLL section.

HITORQUE/ECO and MOTOR/REGEN select the mode of the slip control. 

*Should* also work OK in the region above nominal speed. 

And it looks like a simple SPDT analog switch between two phase outputs of the filter is enough to add support for a fixed gear ratio transmission.


----------



## Tony Bogs (Apr 12, 2014)

OK, the design is ready. 

Really, for some this may come as a surprise, but we've designed most of what is needed for a ACIM-no-uC, all hardware controller.

Sure, it needs an opamp for the throttle and a tacho sync/multivibrator circuit, probably some optocouplers and there are almost certainly going to be revisions, 
but there's no doubt anymore about the basic functionality (confirmed by simulation).

Next: enter the shematic in KiCAD and build a prototype. Can be done in about 4 weeks.
Some parts have a longer lead time than the usual on to three days.


----------



## Tony Bogs (Apr 12, 2014)

Now filling in the details for the number of polepairs, tacho pulses per rev, 50 or 60 Hz machine etc. 

I think that a stator frequency that's about 28% higher than the rotor frequency is about right for most ACIMs in high torque mode. 
*Should* be enough to be able to push the operating point a little bit beyond the peak in the torque/ slip curve. 

Any ideas on this?


----------



## Tony Bogs (Apr 12, 2014)

The result of the LTC1068 simulation and LTC1064 square wave to sine in a KiCAD schematic. 

Bypass caps still have to be added.


----------



## Tony Bogs (Apr 12, 2014)

In this design iteration (revision of the pll circuit pole selection has been added (jumpers), division facttors were reviewed, 
the circuit was simplified and the ugly frequency doubler was dropped.

The PLL locks on to the tacho signal from the motor and division factors (counter circuits) set the slip. 
At startup, when there are no tacho pulses, the PLL output frequency is at a minimum value (can be set by a resistor) for motor spin-up.


----------



## Tony Bogs (Apr 12, 2014)

Basic throttle circuit. Controls the excitaion of the stator field. 

The usual V/Hz characteristic curve sets the maximum at a given speed.


----------



## Tony Bogs (Apr 12, 2014)

And finally, the pwm output stage. That's it, folks, we have a controller design for ACIMs.
Just a few more details to fill, for instance the opamp selection. 

Now let's build it. Starting with the PLL. All parts readily available.


----------



## jackbauer (Jan 12, 2008)

I'll be on it as soon as my feet touch the ground


----------



## Tony Bogs (Apr 12, 2014)

I hope you land soon. Socks still on?


----------



## Tony Bogs (Apr 12, 2014)

I think I can breadboard the PLL. Still have a nice collection of DIP stuff in the attic.
4017, yeah, 4046 also, 4040 definitely, 4053 hmm. The 3208 is new, but I know I've got a lot of DIP gates. 



Let' see what I can bwing together...


----------



## Tony Bogs (Apr 12, 2014)

Only one 4046 and that's a goner. VCO input is dead. And only one 4040. 

But here's the asc file for LTSPICEXVII sine and triangle wave generation. It works!


----------



## MattsAwesomeStuff (Aug 10, 2017)

I have a feeling I'll be building a DC and an AC controller, so, mostly just smiling and nodding and waiting to see how this turns out.

Do you think this will be more or less expensive than a typical uC DIY controller?


----------



## Tony Bogs (Apr 12, 2014)

Definitely less. But the main reason for starting this build is that the DIY development of the software for a uC controller takes almost forever. 
I know what it takes to do it in hardware (since the 70s). And now it is much easier than in the 70s.
So this build is primarily inexpensive in invested time.

Some uC projects are already running for more than 10 years.


----------



## MattsAwesomeStuff (Aug 10, 2017)

Tony Bogs said:


> Definitely less. But the main reason for starting this build is that the DIY development of the software for a uC controller takes almost forever.


That blows my mind. I'll take your word for it but it doesn't make sense to me.

Anything you can do in hardware should be able to be done in software faster than you can solder (and is reproducible for free thereafter), let alone electrically engineer.

I'm not a microcontroller guy, and I only did a couple years worth of a CompSci degree, but I can't imagine how the programming on the main function of a speed controller could take longer than an afternoon. There's just not that much going on. It's just pulse timing, isn't it? And then, auxiliary stuff you want done.

I mean, a PLL is more complicated than just blind PWM but, it's just software!



> Some uC projects are already running for more than 10 years.


Well, in time elapsed, sure. In the way that my motorbike conversion has taken 14 months. But not in the "this is so hard it's taken 14 months" sense, as it could have been completed in a spare weekend. The effort that one dedicates to a project is an issue regardless of method.

Anyway it's interesting but over my head obviously, and I'm glad you're doing it


----------



## Tony Bogs (Apr 12, 2014)

Thanks for the last bit, but I'm doing it solely for me. It DIY, remenber? 



And Matt, no way, sorry, mate, you're mistaken about HW -SW.. 

If a solution is available in hardware (ASIC), in this case for instance switched capacitor filters, hardware is much faster and easier.

Example is a recent project where a programmer (uC guy) didn't want to implement a filter in SW because it was complex and it would take a lot of programming time. 
In hardware the design took in all less than two hours with the aid of an online filter tool. 


And sometimes those uC gadgets (yes, even the STM ones) are just way to slow. FPGA might help and otherwise HW is the only option. Example is available on endless sphere.


----------



## Tony Bogs (Apr 12, 2014)

Next design iteration. Simple resistor isn't enough at low speeds without PLL lock.
Added a clock generator and a lock detector (dual comparator circuit).


BTW: if a complex function is easy to implement in SW, is most often cause there's dedicated HW on the uC chip that makes it easy to implement (reduction to bit banging).


----------



## Tony Bogs (Apr 12, 2014)

OVERLOAD AND FAULT DETECTION.

Jack, I know you're gonna appreciate this bit. Sorry, Jack.

I'll implement *REAL, 3PHASE, ALL HARDWARE *overload protection, that does not rely on Ia+Ib+Ic= 0. Cause that's not always the case, folks!!! 
I've seen what happens when the wire insulation fails in an ACIM after several years of operation (in a factory).

@Matt (sawsomestuff): comparing the BOM cost of a HW controller and a SW controller is a bit like comparring apples with other fruit. 

It is how one appreciates the flavor, the appearance and the inherent good stuff they bring ( f.i. vitamines). 

So with the all hardware, real 3phase overload protection, this AC controller is still really inexpensive with regard to the BOM cost.


----------



## Tony Bogs (Apr 12, 2014)

Now filling in the details for overload and short circuit protection ...
Applying 16pins SO ASIC devices specifically designed for motor protection. €5 per device. One LEM current sensor per device. 

Outputs (overload and error) can directly be connected in parallel, so one can protect as many current paths as one thinks is necessary or adequate. 

I'm putting four in parallel: 1 for the DC bus and the others for the three phases. 



Other components: a few resistors and two linear devices (opamp/comparator).


----------



## Tony Bogs (Apr 12, 2014)

I've ordered the protection ASICs and the missing parts for breadboarding the PLL. 

Picked the opamp for this project: MCP6022. And the low cost comparator MCP6562.
Both SOIC8. 

For breadboarding some parts have to soldered on small SMD to TH conversion PCBs.
No DIP version in stock.


----------



## arber333 (Dec 13, 2010)

Tony Bogs said:


> OVERLOAD AND FAULT DETECTION.
> 
> Jack, I know you're gonna appreciate this bit. Sorry, Jack.
> 
> ...


Finally someone with some sense! 
Like i said we need protection on all three phases. Adding current isnt enough since the story is usually over at the time computer figures out OC happened on the 3rd unprotected phase. I lost several IGBTs that way. 
And coup de grace came last month when i just couldnt get Ampera inverter to reliably run the ACIM motor. It kept throwing OC limit after 150A phase current. I thought it was me or my faulty board design. Finally i put inverter in my Mazda and ran it perfectly fine. We decided to open motor and behold ... one phase was toast. I never thought i will see this. It supposed to be so rare in a robust design... see for yourself.


----------



## Tony Bogs (Apr 12, 2014)

Yeah, I've seen something similar before. Back then the motor had to be rewound, because it had special dimensions.


----------



## Tony Bogs (Apr 12, 2014)

If the analogy to fruit of HW vs SW is a step too far for some, here's a similar comparison between slip and field oriented control in "the great debate": 

http://industrial.embedded-computing.com/articles/the-versus-field-oriented-control/

Each method has its own merits and the AC controller in this thread uses slip control for several reasons. 
An important one is that slip control is much, much easier to implement in an "all hardware" controller.


----------



## Tony Bogs (Apr 12, 2014)

OK, back to overload (overcurrent) and error (short circuit) protection.
As I mentioned earlier, overcurrent and error detection is done with motor protection ASICs. 

They have all the necessary features built-in, but they are in short supply. Luckily, one of my preferred suppliers has enough in stock for my projects. 

OVERLOAD (overcurrent)
In response to an overcurrent the hardware controller does not shut down, but reduces output power in real time in two ways: 
1. by setting a lower field excitation, and 
2. by setting the slip to 0 for a short period of time.
In this way the car is still driveable, but with reduced performance.

ASICs reduce the number of parts significantly and make detection of an overcurrent in multiple current paths as easy as connecting pins on a PCB. 


ERROR (short circuit)

Shutdown is immediate and permanent as soon as the error output of one of the protection ASICs is active, indicating a short circuit (extremely high current level).


----------



## arber333 (Dec 13, 2010)

Tony Bogs said:


> OVERLOAD (overcurrent)
> In response to an overcurrent the hardware controller does not shut down, but reduces output power in real time in two ways:
> 1. by setting a lower field excitation, and
> 2. by setting the slip to 0 for a short period of time.
> ...


Hm... i have seen lots of overload/overcurrent events happenning while driving. Mostly due to encoder read fault or some EMI event. 
Webasto diesel heater is a good source of EMI by the way .
What i found out is that emgcy shutdown at 120km/h is an embarrasing situation on highway. 

Johannes did program continuous encoder synchronisation in the background, so i can just restart inverter on the run and it will work. 

I agree with you single OClimit should not throw out inverter brain. 
However repetitive OClimit event should. What if you have repeating hardware fault? Power stage could burnout because of that. 

Most good drivers today have desat which with good blanking time setting can act as a supplemental OC protection. Also it naturally senses SC event which is of higher magnitude than OC. 
Mind you the OC event feels like a surge while driving and is not so unpleasant. SC event however feels like a spring would flyoff from the car when 1000A is discharged into one phase winding leg. Motor locks and it is better to just remove motor excitation alltogether.

To summarize, single OC event should inhibit PWM for a short time and restart. 
Repetitive event however should open contactor after several PWM inhibit retries since that would indicate SC in the power stage.


----------



## Tony Bogs (Apr 12, 2014)

No, we are not on the same page here.

An overcurrent event does not have immediate catastrophic consequences for motor or inverter. I think we agree on that point.

I leave it up to the driver to decide if he or she wants to take the foot of the pedal in case of an overcurrent event. I assume there's not an idiot in the driver seat.
However, if I'm wrong, he or she will push the motor and inverter to the point where the overtemperature protection trips, resulting in an immediate shutdown.

Desat is part of the power circuit. A fault from the power circuit is handled in the same way as an error from the motor protection ASIC. Immediate shutdown.

Here are the results of the associated OC limit design iterations. Pretty straightforward, easy and fast to implement.


P.S. This is a slip controller. Setting the slip to zero in case of OCresults in loss of excitation (at normal cruising speeds). 

And that's exactly what this controller does (for a short period of time).

Slip control is so easy. Really.


----------



## Tony Bogs (Apr 12, 2014)

Sorry, folks, I pressed enter a bit too soon.
The motor does not lose excitation when slip = 0, it loses drive (torque).
I've written it correctly in the reason for editing in the previous post.


So, the experience of the driver in case of an overcurrent event is the same as in an ICE losing combustion for a very short period of time (at normal cruising speeds).


As soon as the overcurrent event ends, normal operation is resumed automatically.


.


----------



## Tony Bogs (Apr 12, 2014)

REGENERATIVE BRAKING


This is again a subject for a "great debate". 
There has been a discussion here a couple of years ago and my take on it is that putting regen control mechanism(s) at the steering wheel is the way to go in a DIY conversion. 



Again, I'll leave it up to the driver if he or she wants to engage regen and how much. 

Weather and road condition, ABS, up and downhill, the driver calls it. 



So this is on the list of design iterations. 

And again very easy to implement in this HW controller.


----------



## arber333 (Dec 13, 2010)

Tony Bogs said:


> REGENERATIVE BRAKING
> 
> 
> This is again a subject for a "great debate".
> ...



From 5yrs of day to day driving experience i suggest to just put regen enable to brake switch. EDIT: And also from comments from other family members driving my EV.

1/5 of brake pedal movement is wasted anyway so we use driver natural movement to apply regen braking before mechanical brakes are in serious action. Also we have to consider we are braking here. Other drivers might want to know someone is applying brakes, wheather regen or mechanical. Brake lights are activated with brake switch when foot is on the brake pedal which is before driver pushes the actual brake. 

Then there is desire to regulate braking force. In some situations it is best that regen is as small as possible (snow, water on the street...). I successfully use 5K pot under the steering wheel. I have direct access to it and can change regen while driving. Large pot head with indent gives me feel what the force will be when i set it without looking. 

Third is the foot of throttle regen when small regen is simulating compression of piston engine. Just a tad of regen makes it slow at the lights effectively. This actually should be up to the driver decesion. Some prefer it and some just rather glide.


----------



## Tony Bogs (Apr 12, 2014)

The "great debate" has started, I guess.

Are you sure you understand slip control with a motor/regen input from a switch?
Brake switch: see before.

Pot at the steering wheel is one of the options as meant by mechanisms at the steering wheel.

*As implemented in other AC controllers:*

Applying regen braking immediately with for instance throttle torque control as soon as the foot is taken of the pedal can be very dangerous on slippery roads.
Not in a series production vehicle with traction control and ABS all integrated, but this is about DIY solutions. 

Not worth taking that risk when weighing it against the very limited energy gain.


----------



## arber333 (Dec 13, 2010)

Tony Bogs said:


> The "great debate" has started, I guess.
> 
> Are you sure you understand slip control with a motor/regen input from a switch?
> Brake switch: see before.
> ...


Is this a debate for ACIM multiphase motor controllers? Because name implies DC??? I am talking about ACIM motor regen using two separate inputs. Brake switch to apply regen with 5k pot power setting and throttle off regen using last 10% of throttle travel.

It is all very empirical... let me assure you that using throttle pedal off regen is no danger even in wet/snowy roar etc... There has to be common sense of course in regen power applied. I for instance never use more than 3kW throttle off regen since this feels exactly like normal car engine brake. Granted Johannes does program throttle ramp into it so it is not immediate torque application anymore.
As for using brakes and regen on slippery road i close the pot, i.e. cut regen power, trust mechanical brakes (ABS) and drive carefully.

Oh yes! I see the danger with slip control regen. When reducing speed below some 30Hz (rpm) slip to speed ratio becomes so small that brake torque can become dangerous. This effect would have to be reduced somehow.

Of course i dont know why not use ABS, since it is independent system. I cant remember a car worth converting that doesnt have ABS installed.
EDIT: I se the gain with regen as less wear on the brakes and smoother ride. Granted energy addition is small, but it is there nontheless. Mechanical brakes just heat up air. And then, why remove the very advantage ACIM motors have against DC motors, besides lower maintenance?


----------



## Tony Bogs (Apr 12, 2014)

I guess you haven't taken a real look at the diagrams. At low speeds there's a fixed stator frequency. 
But you're very passionate about regen, that's for sure. 

Even ICE motor braking can cause a car to go into a spin on a slippery road. Unless, of course, the driver has had adequate training in "slip control". 

As can be seen in TV shows with dash cam videos from East Europe, Russia etc.


I'll start a seperate thread soon with the title: DIY all hardware universal ACIM controller.


----------



## Tony Bogs (Apr 12, 2014)

I did manage to find the PLL device in DIP16. Scheduled for delivery this week.
So breadboarding can start soon. If it works OK, I'll start the new thread.


----------



## Tony Bogs (Apr 12, 2014)

First breadboard results.


1. The PLL device has about a factor 8 as highest frequency to lowest frequency ratio.
2. Dividers were off by a factor 5. I tried to sync a 10Hz output RPM to a 50 Hz stator frequency. What was I thinking?


Anyway, that's giving a 5 jumper slip selection option for each of now four operational modes, 2 REGEN and 2 MOTOR.


----------



## Tony Bogs (Apr 12, 2014)

It's getting close. Almost ready for a new thread. 

Some major design iterations as a result of the breadboarding in the PLL and the stator frequency synthesizer (slip setting).

1. A clamp has been added on the VCO input voltage
2. This now also sets the minimum VCO (stator) frequency at low speeds.
3. Jumper slip selection for four operational modes HI_TORQUE, ECO, REGEN_LO, REGEN_HI


----------



## jackbauer (Jan 12, 2008)

Think I need to rip this design off and stick it in a Tesla drive unit I already get a kick out of replacing 2 TMS320 DSPs and an Actel fpga with one lowly $2 STM32. Now imagine doing it with pure hardware. Muhahahahaha


----------



## Tony Bogs (Apr 12, 2014)

Did you really do that? DIY? 


Well, now you know it can also be done in HW. But you do really need phase shifted AC to get an ACIM to work.


----------



## Tony Bogs (Apr 12, 2014)

It is very rare to get it right in one go.
Here's the first diagram of the hard wired fault protection and shutdown.


----------



## Tony Bogs (Apr 12, 2014)

Luckily, it is possible to breadboard these circuits. Well, not the filters, of course, simulation worked for that section.

So the clamp works. Stabel operation of the VCO. 
Now, let's see if the PLL can lock on to a tacho signal and hold while we shift the frequency range for operation above nominal speed (often called field weakening range).

And oh yeah, it is terribly easy to add a low cost microcontroller box as go-in-between for monitoring, canbus messaging and set-by-wire. 

Very little effort in it as a seperate "CANBUS SYSTEM I/O expander" project based on open source.


----------



## jackbauer (Jan 12, 2008)

Tony Bogs said:


> Did you really do that? DIY?



Yes and you designed the filter for the sigma delta current sensors in the large drive unit


----------



## Tony Bogs (Apr 12, 2014)

> Yes and you designed the filter for the sigma delta current sensors in the large drive unit


 Did I now? Hmm, well, I did design a filter with a specific transfer function, but not for a specific purpose, as I remember it. Similar to a lot of open source stuff.


Somehow it did seem to fit your application at that time.


----------



## Tony Bogs (Apr 12, 2014)

The PLL does lock on to the tacho signal. 

With a simple 100K/0.33uF phase detector filter there's only a little bit of second order response to a 25% step tacho input. 
Such a step does not occur under normal driving conditions, 
but it necessary for determining the response of the PLL in the frequency domain and its "lock hold" characteristics when the frequency range is changed.


----------



## Tony Bogs (Apr 12, 2014)

After doing some research, it seems that a 100K/10K divider in the filter network reduces the second order response significantly. Measurements do support it.

But we still have to investigate further. This is critical for stable operation of a hardware AC controller.


----------



## Tony Bogs (Apr 12, 2014)

Yep, that's it. Rock solid lock.

The PLL can easily handle the small increments of a 100 step digital potmeter for the extension of the stator frequency range into the field weakening region.

Breadboarding continues as soon as I have the DS1804-100 digital pot.


----------



## Tony Bogs (Apr 12, 2014)

While I am waiting for parts....

Some might ask: why are there AC controller diagrams in this thread?
Answer: it's all hardware, i.e. no uC, DSP, programming.
I started this thread with a diagram for a DC series motor, but as it turns out, 
all hardware is also possible for ACIMs, but not as inexpensive, and it takes (a bit) more hardware.
However, it does come with a rock solid, all hardware base, 
which includes PLL slip control and hard wired overcurrent and fault handling.

An open source anekdote:
I'm using KiCAD as EDA tool. GNU open source license and other open source licenses (libraries). 
When I first tried my breadboard setup, I noticed that the PLL went up to the maximum frequency with no input signal, 
when it was supposed to go to minimum. The cause was quickly found. 
Whoever put the 4046 PLL device in the KiCAD library, got the input pins Refin and Sigin mixed up.

That can happen. I got the polariry of UP/DWN wrong in the last diagram. 
The D input of the UP/DWN HC74 fliflop has to be tied to the output of the other comparator.


----------



## Tony Bogs (Apr 12, 2014)

Let's get this straight. Some are trying to re-ignite the "great debate" SLIP versus VECTOR AND OTHER METHODS. 

And I'm sad to say, not based on arguments. 

I'm not going to reply to what I would call booing and making cow like noises in writing.

Slip control works just fine in an EV.


----------



## Tony Bogs (Apr 12, 2014)

I picked the Onsemi FAN7389MX1 for the 3 phase output stage. It has the overcurrent and auto restart circuits built-in. 

For IGBTs a few extra components for dead time are needed, but I'm planning ahead for the model III SiC powerstage.


----------



## jackbauer (Jan 12, 2008)

Tony Bogs said:


> Let's get this straight. Some are trying to re-ignite the "great debate" SLIP versus VECTOR AND OTHER METHODS.
> 
> And I'm sad to say, not based on arguments.
> 
> ...



If I had a penny for every moron who has told me slip control is no good in an EV ....
Thing is, there are some people who are heavily invested in maintaining the notion that motor control is this super complex subject that only they can master.


----------



## Tony Bogs (Apr 12, 2014)

I'm not playing along in that direction, sorry.

First of all, this is a DIY project. DIY means limited resources. 
To set realistic goals I have to ask myself a few questions.
Q:Am I going to implement traction control? 
A: Of course not, that's way out there from a DIY perspective.
Q:Am I going to implement an integrated regeneration / braking system with ABS functionality that controls both regen braking and the mechanical brakes?
A:Hell no, this is DIY.
Q:Am I going to implement some ludicrous acceleration mode, knowing that there's no traction control or integrated ABS?
A:What???? I'm not insane. I don't want to end up wrapped around some big tree along the road. 
Q:So is it worth implementing VECTOR control? 
A:NO. The only advantage in favor of VECTOR is a better dynamic torque control.
And there are a lot of disadvantages.
So no way, slip control is by far the best choice for DIY. 
(And the only practically achievable option for an all hardware controller).


----------



## Tony Bogs (Apr 12, 2014)

Serious breadboarding ...
All went well until the output of one comparator got stuck at a 5V level when it should have switched to 0V. 

Probably just a breadboarding thing. It is easy to cause a (momentary) short circuit on a breadboard.


----------



## jackbauer (Jan 12, 2008)

That is serious. Thanks for the hard work Tony


----------



## Tony Bogs (Apr 12, 2014)

Well, it's hardware. Takes about one hour to wire it up. And then a couple more for the iterations.
And now we have a working wide range PLL. 
SOLID LOCK when an input sweep from 50 Hz to 6 kHz (tacho signal = RPM) is applied, 1Hz per millisec. Configured for 4 pole (1500RPM nominal).
The comparator issue was a PLL issue. The SFout is indeed a SF.
And of course there were some additional iterations.
HC74 out, HC4017 in. A bit of hysteresis on the comparators. 


To keep the parts count down, I'm replacing my current sensor board (which can be found in the SiC inverter thread) with a single LEM current sensor and a single ASIC.
And about five passives.

So it's *"GO!"* for an all hardware ACIM controller thread.


----------



## kennybobby (Aug 10, 2012)

i've been following with interest and noticed the HC4046 PLL chip with deja-vue. 

Then it came to me--i had repaired an old HP LCR meter and that was the failed part. Fortunately i located the dip version in some old parts bins and was able to get it working again.

And there were two in the bin, so i've got a spare that i can use to breadboard up your clever circuit.


----------



## Tony Bogs (Apr 12, 2014)

NICE! Sounds like a LCR meter from the fabulous 70s. 

But before you have a go at it, maybe there's some good news.

I've just ordered the SMD versions for the first prototype.
It must be the NXP HC4046. Not any old 4046 will do.

And please keep in mind that the diagrams are just snapshots of a project in progress.


----------



## Tony Bogs (Apr 12, 2014)

OK, now I have to do the math to verify the PLL design. 
You really want to skip this bit, unless you're an EE. 

rfic.eecs.berkeley.edu/ee242/pdf/Module_7_3_PLL.pdf
www.delroy.com/PLL_dir/tutorial/PLL_tutorial_slides.pdf
www.ti.com/lit/an/swra029/swra029.pdf
cppsim.com/PLL_Lectures/digital_pll_cicc_tutorial_perrott.pdf


----------



## Tony Bogs (Apr 12, 2014)

Well, too bad. No 4th phase. .
It looks like I'll be needing the 4th filter in the LTC1068 as a 1st order low pass PLL filter.
The damping value (meaning overshoot) varies too much when the filter has a fixed cut-off frequency.


I told you so, please skip this bit, unless you're an EE.


----------



## Tony Bogs (Apr 12, 2014)

I've found a less expensive elliptic filter for the square wave to sine conversion: the LTC1069-6IS8. It also comes in a smaller package. 

The version with a commercial temperature range is even cheaper. But no!, no!, can't do that.
What if someone decides to use this design in a production vehicle?
But for breadboarding it's OK. The LTC1069 is not in the LTSPICE library.
Maybe I can also use it for the PLL filter.
Example (LTC1062). This is great fun, people! 1987. With CD4046. Enjoy!

https://www.analog.com/media/en/technical-documentation/application-notes/an24.pdf


----------



## MattsAwesomeStuff (Aug 10, 2017)

I have so many questions about each update, but I figure, instead of you answering them, your time is better spent getting the controller working. So I'm just following along, nodding my head, waiting for when it's soldering time.


----------



## Tony Bogs (Apr 12, 2014)

For another project I didn't post schematics until most of the design iterations were done. 
The response was then some would like to see detailed diagrams earlier.

I'm still busy with the PLL. It has to keep up with a speed signal from a sensor on the motor shaft. It delivers the clock signal for the circuit that generates the three sine waveforms.

Right now, the PLL has trouble keeping up with very low speeds. It has a strong tendency to overshoot the right speed when the range is adjusted. 

The math backs this up.


I think it can be solved with a tracking, switched capacitor, 5th order, Bessel filter in the control loop of the PLL: the MAXIM MAX7409 in an 8 pin uMax package.
The article in my previous post discusses the effect of a 5th order Butterworth. 

The fast way to confirm this without simulation tools: breadboard. The MAX7409 has a lead time. Indication: three weeks.


So I'm saving a few bucks with the LTC1069 and spend them on a MAX7409.


----------



## jackbauer (Jan 12, 2008)

What pulse count are you assuming from the encoder? Could you work with a higher pulse count to give more resolution at lower rpms?


----------



## Tony Bogs (Apr 12, 2014)

At low speeds the frequency is fixed: slip control. ACIM only.
Pulse count (only speed, no encoder/resolver necessary: slip control) must match RPM. So 1200 Hz input tacho signal at 1200RPM. 

My donor car has a reluctance pickup on the cranckshaft output with that frequency to RPM ratio. 

The designs and builds I post here are for my personal use only. If there is a purpose it is evaluation without any garantuee that it is fit for that purpose. Subject to change in the future. Who knows what lies ahead.

I'm starting with the DC series low speed (senior citizen) conversion and then I'll move on to ACIM.
There has been a horrific accident is the news recently. Some sort of converted bath tub got out of control. Approved for the open road. Very young lives were lost.


----------



## Tony Bogs (Apr 12, 2014)

The updated diagram for the square wave to 3 phase sine circuit, now with the 8 pin €10 LTC1069. It replaces the 16 pin €30 LTC1064.
No decoupling caps etc. in it for clarity. 

I'm posting it because the LTC1069 is in stock. So we can see a square wave to sine conversion in a couple of days. "live" from the breadboard.
The LTC1068 is not in stock and also can't be found in the parts bin. 

So the breadboard remains single phase for at least three weeks.


----------



## Tony Bogs (Apr 12, 2014)

And this is the one for the first prototype. €30 less than the first LTC draft, smaller and better specs.
Now with all the caps for the PCB layout app.


----------



## Tony Bogs (Apr 12, 2014)

And there it is: the first clean sine wave from the LTC1069 elliptic filter. 


Adding the third harmonic for a better utilization of the DC bus is a bit more tricky.
I'm still waiting for those maxim filters, so why not give simulation of the 3rd harmonic filters based on LT parts a try first?


----------



## Tony Bogs (Apr 12, 2014)

Not that tricky after all. 3th isolated in a LTSPICE simulation with a LTC1068. 


Time to move on to the throttle circuit on the breadboard.


----------



## Tony Bogs (Apr 12, 2014)

In a controller with 3rd harmonic DC bus uitilization, the 120 degree phase shifts for the AC outputs have to be implemented digitally.
Bandpass filters based on the MAX7490 will generate the first and third harmonic with matching delays from the three square wave signals,
Matching delays means no phase difference between third and first, so that an opamp can be the final summing device for the PWM stage.
In this topology is also easy to adjust DC offsets if needed.


Only a few lines, but they are the big ones for the first prototype.


----------



## Tony Bogs (Apr 12, 2014)

Very straightforward 120 degree digital phase shifting. It took a bit longer to get the timing (clock signals) right. And I threw in the amplitude modulation for the excitation voltage.

Only four parts. And a few caps.


----------



## kennybobby (Aug 10, 2012)

Tony--you are a top-class Electronics Wizard™, that's an impressive manipulation of the chips to bend to your will...


----------



## Tony Bogs (Apr 12, 2014)

Very flexible, great base: ring counter. No chance of catching a glitch. Ring counters are very popular in programmable logic. 

The simulation of the bandpass filter/opamp circuit shows the addition of the third harmonic.
It works, but not that great. A lot of components. 
And the phase relation is not all that steady, resulting in a waveform that is a bit asymmetrical.

Next option: filter out both 1st and 3rd in one go with a lowpass.
Bessel is the first in line for this kind of phase critical application.
And guess what? We already picked a 5th order one (MAX7409) for the PLL.
And the amplitude of the 3rd harmonic in the simulation is too high. 
Reference: Infineon https://www.infineon.com/dgdl/AP160...M.pdf?fileId=db3a304412b407950112b40a1bf20453 

So -8dB for the 3rd, when the cut-off frequency of the MAX7409 is set at the 2nd, sounds about right.
Pick a MAX7400 (same pinout, supply voltage, ...) and the result is a pure sine controller.


----------



## Tony Bogs (Apr 12, 2014)

Is this the final square wave to sine/ac circuit? Yeah, I think so, this looks really good. 

If anyone thinks five (or are there six by now?) is a lot, take a look at the revision/patch list of a similar project in software.


----------



## Tony Bogs (Apr 12, 2014)

Prototype diagrams after annotation and DRC.


----------



## Tony Bogs (Apr 12, 2014)

Not that many parts, but still trying to get the number down.


And adding mods to make it really easy to hook it up to an Arduino (clone)
for setting the board up, monitoring, CAN bus ....


----------



## Tony Bogs (Apr 12, 2014)

The digital pot to set the PWM frequency is a bit of fun of course while I'm wating for parts. This thread is about an all hardware controller. 

But is possible to hook up an Arduino.

Major change:
The jumpers have been replaced with analog switches. In the end more versatile and less expensive.
Now the driver can select a slip setting from twelve options. Four in each mode of operation: high torque, eco (higher efficiency) and of course regen. 
Again, I'm placing the driver at the controls. 

There will be two throttles. One for driving and one for regen.

Parts selection. I've selected the MCP6242 (dual opamp) and the MAX9032/34 (dual/quad comparator). 
Total less than €60 in parts on the PCB.

The ACIM board uses the same TACHO circuit as the DC series board.

POWER STAGE
Let's assume that the big Tesla S drivetrain will be used. Replacement of the DSP brain.
Current sensing filters: design is ready (updated version with a single switched cap device).
Overload/fault handling: ASICs have been selected.
Temperature sensors: straight forward multiplexer and a single protection ASIC.
Tacho: external pickup (for now) .


----------



## Tony Bogs (Apr 12, 2014)

This is nothing new, I've selected them some time ago: MCP25020/25050 for CANBUS system integration. No link, the Microchip website has issues right now.

With these the brain in the dash can control and monitor the ACIM drivetrain. Bringing it all back the future (or at least this millenium). 

Darn, this almost makes me forget that this thread started as a DC series project. 

Anyone know if advancement of the brush ring is a good idea to get more miles out of the brushes than say 2000?
Ah, no, sorry, now it's coming back to me. Forget I asked: I'm going to use it for a 15mph senior citizen project. 10 miles max per trip.


----------



## Tony Bogs (Apr 12, 2014)

PLL: the VCO part of the 4046 and the digital pot circuits are no longer used. The LTC6990 is linear and it has the full range.
CAN MCP25020 diagram shows that the controller can be used without CAN: 9 pin parallel I/O connector.
PCB: The prototype circuit fits on a 3x3 inch board.


----------



## Tony Bogs (Apr 12, 2014)

Still on breadboard. Scope screenshot showing the PLL based generation of sine and 3rd harmonic injected signals, input frequency step 300 to 400Hz. 

BLUE: VCO input, step is close to the center of the track.
GREEN: square wave from the digital 120 degree phase shifter
RED: sine wave (LTC1069-1 elliptic filter)
YELLOW: sine with 3rd harmonic (LTC1065 Bessel filter)


----------



## Tony Bogs (Apr 12, 2014)

I've been kind of busy with 24/7 stuff, not at all EV related and much more important, so all of my projects are on halt.


But every now and then I have little bit of free time. Of course, I try to keep in touch with developments, visiting EV related sites

And I've spotted an interesting new chip from Toshiba for a project like this one: a fully hard wired, very simple to drive BLDC interface chip. 



https://www.greencarcongress.com/2019/04/20190422-tosh.html


----------

