# low cost DIY (Tesla) ACIM all hardware controller, no uC, DSP, programming



## piotrsko (Dec 9, 2007)

So pretty much anything 4 pole that uses 3 phase with a decent encoder?


----------



## Tony Bogs (Apr 12, 2014)

Two pole is fine too. I didn't want to use the word "universal".  

Focus is on Tesla ACIM drive units. 

But as a demonstration of the versatility I'm going to start with a two phase (commonly referred to as single phase) induction motor. 

It will have three half bridge PWM legs though. The two windings will be connected between the legs. Phase shifts of AC at the legs: 0, 60 (-60 for reverse) and 180 degrees. 

Description can be found in the Microchip application note AN967. Implementation will be in HW, not in SW with a PIC16F72.


----------



## Tony Bogs (Apr 12, 2014)

The backbone is the basic control method from the early years of inverter design.
Unfortunately, there's no "programming free" solution yet for 3 phase ACIM with a low parts count.

So what does it take to build an inexpensive DIY Tesla FDU controller with a low parts count?

I think this comes close. Start with a basic control method. Nothing fancy.
Like the original Tesla controller board it is a CANBUS based solution, but with a basic control method.

And a duino compatible motor controller. Lots of free software and modules out there really help to reduce the programming effort.

The CANBUS ensures that more advanced control methods can be implemented by adding controllers to the bus.


I'm going to use this approach in my SiC inverter design. High power 100 kW+ SiC inverter


So this thread ends here.


----------



## MattsAwesomeStuff (Aug 10, 2017)

Tony - Since you've last updated development, there has been significant interest in cheap AC inverters (also, me included!).

An affordable DIY inverter option still seems to be the missing connection.

I don't know enough to do anything other than get in the way, but just wanted to let you know that you completing this and sharing your design is helping others. I'm likely to be one of the first people that jump aboard to build one when it's ready-ish. Glad to see you've picked it back up again.


----------



## Tony Bogs (Apr 12, 2014)

Thanks, Matt. I'd like to remind you: my projects are for my personal use only and for evaluation of (basic) DIY methods and new technology. 

Don't expect results anytime soon. 

Report from Ireland: Tesla model III hardware can't be used for testing.


----------



## MattsAwesomeStuff (Aug 10, 2017)

Tony Bogs said:


> I'd like to remind you: my projects are for my personal use only and for evaluation of (basic) DIY methods and new technology.


I remember. But as a side effect, seems they'll help a lot of other DIYers too.


----------



## Tony Bogs (Apr 12, 2014)

Well, they're on their own if they copy or steal it. 

You don't think Tony Bogs is my real name, do you? It's my "alter ego" on the web. Don't want some part of one of my designs ending up in a dodgy product with my real name attached to it.

Back in 2007 I had a first stab at a basic controller design after reading something about a titanate li-ion battery from Toshiba. That proved to be quite tricky back then.

It took twelve years to get to this first design that is going to the foundry. It's a programmers proto board for the model S FDU. 

I'm going to use it with a low power SiC (10kW) stage during the programming phase.


The control method can be retrieved from the all hardware design.


Programming and CANBUS communication: Raspberry Pi + PICAN2 + low impedance ICSP interface.


Here it is.


----------



## Tony Bogs (Apr 12, 2014)

Since the "no programming" Fairchildsemi AC controller chip has been discontinued, the only other option is minimal "uC and programming".
I've found a MCU that fits the bill.

Most of the bit banging (getting the right bits and bytes in the MCU registers) has been done.
I've thrown out all of the silly stuff in the very popular AR-tistic DINO for U IDE. The wire strings are gone.
What is left is basically an empty CORE file folder as part of a definition of a custom board.
The basic header framework (register definition etc.) of the MCU manufacturer is still there.

In order to create a solid reference starting point, the controller has been designed to serve as a replacement board
in a small (front) drive unit of a very popular "S" sedan.

What remains of "programming" is copying the control method from the "all hardware" design.
For instance:
PLL >> MCU TIMER CAPTURE
PWM COMPARATORS >> MCU POWER STAGE
SINE WAVE GENERATION >> TABLE (MADE WITH PHP7 CLI)
PHASE SHIFT AND SLIP CONTROL >> 3 ADDITIONS in "C"
THROTTLE CONTROL >> 1 EXPRESSION
OVERLOAD (HYSTERETIC) CONTROL >> 1 CONDITIONAL EXPRESSION
FAULT SHUTDOWN >> HARDWIRED IN POWER STAGE + ISR

Later on CANBUS communication can be added. Again: very little programming needed, most is done in the MCU CAN hardware.


I'll release a binary file and gerber files as soon as possible.


Image of the ECONOMYFDU board. ECONOMY as in:
- basic


inexpensive (US$200)
high efficiency control method


----------



## jackbauer (Jan 12, 2008)

Sweet work Tony


----------



## Tony Bogs (Apr 12, 2014)

There is some serious breadboarding going on in the background. Really.  But progress is slow: 24/7 stuff. This board design has been in the shopping basket at the foundry.


----------



## Tony Bogs (Apr 12, 2014)

@jackbauer :

Maybe this will answer your question what I am thinking about Melexis amp sensors.

I think this circuit for a single external amp sensor will solve any (melexis) amp sensor de- and re-soldering issues.


----------



## MattsAwesomeStuff (Aug 10, 2017)

I don't understand anything you're doing, but I'm glad you're doing it. 

Hopefully there's some way I can mash parts together and give it a test drive some day.


----------



## jackbauer (Jan 12, 2008)

This is a thing of beauty On one very early attempt at removing the melexis sensors I wrecked one of them and did manage to get two htfs800p to fit with some trimming.


----------



## Tony Bogs (Apr 12, 2014)

Darn, I missed my goal. I am not aiming for beauty. And there's no rush to get to version 1 . And then maybe 2 , 3, 4, .... 
For instance the latest modification. All active parts on the board are now automotive grade and all parts have an extended temp range of at least -40 to 125C.

The LEM has an industrial temp range. It has to be placed externally on the DC-BUS in the -40 to 85C zone. 

You managed to save one Melexis in one of the early versions of your board? That will do.This controller only needs one.

Version 1 is getting close.


----------



## Tony Bogs (Apr 12, 2014)

The external amp senosor board has some beauty to it because it has only 10 parts.
That is a huge reduction in cost when compared to the KIWI project I considered earlier.
It is possible to recycle a FDU MELEXIS amp sensor.


----------



## Tomdb (Jan 28, 2013)

You can also just buy the current sensors.

Unfortunate it might be hard to get them out of the US due to export restrictions.


----------



## Tony Bogs (Apr 12, 2014)

Do you mean the Melexis? It is basically a bare sensor without the toroid. And it has to be programmed with special equipment. Not a great choice for a DIY project. 

It does have the temp range and reliability grade for application in a -40 to 125C automotive environment. I.e. inside the drive unit. 



O BTW, @Jackbauer: how is your ESP WIFI holding up on version 6(?) of your board in Romania with the winter coming? Looks like a commercial grade product.


----------



## Tony Bogs (Apr 12, 2014)

@Tomdb: thanks for the feedback.
There are replacement parts for the MELEXIS that do not need programming.
Inexpensive parts (US$1 .. 3) with no export restrictions. Specifications meet the requirements for this controller.


----------



## Tony Bogs (Apr 12, 2014)

This a keepalive post. 

*GOAL: A SET OF CANBUS BOARDS FOR A BASIC, INEXPENSIVE (EASY TO APPLY, NO "FULL FEATURES") ACIM CONVERSION.*

HARDWARE

Parts count has been brought down by 4. 
There are about half a dozen diagnostic parts (test pins/headers/leds) in the current board design.
One uC handles the generation of PWM AC (critical timing, high CPU utilization),
The other does the slow bits (temperature sensors, throttle conversion, ....) 

SOFTWARE
There is serious breadboarding going on in the background. 
Programming isn't time consuming, because there are no extra features and the uC internal hardware bits match the tasks. 
Testing it on real hardware is. uCs are soldered on off-the-shelf $3 PCBs in the breadboarding stage. 

There's no hurry: still no low cost, intrinsicly safe, high energy density batteries out there.


----------



## MattsAwesomeStuff (Aug 10, 2017)

I've probably missed it somewhere, but, I presume this is only the brains for a controller. The actual power stage is something that'll be done elsewhere or can be reused from some OEM parts?


----------



## Tony Bogs (Apr 12, 2014)

Yep, the title indicates "Tesla", in particular the FDU "S" drivetrain, but it is also intended for use in combination with the all SiC power stage. 

There's no hurry, as is obvious from my late response, but I'll continue to evaluate DIY practices and methods. And design circuits for own projects.

For instance: a precharge sensor circuit that consists of a zener in series with an optocoupler (thyristor output) has a serious temperature range issue and it may become unreliable without a gate resistor to ground at the thyristor output.
No gate resistor is considered to be bad design practice.

But right now I'm kind of 24/7 busy with more important stuff.


And I'm waiting for the first intrinsicly safe high energy (solid state) batteries to hit the market in volume. Those Tesla ones and NMC811 are pretty safe in a mainstream production EVs, but in a DIY build?


----------



## arber333 (Dec 13, 2010)

Hi

Here is one voltage sense circuit, courtesy of Arlo
https://endless-sphere.com/forums/viewtopic.php?f=30&t=36602&start=1775#p1500561

And another from Johannes
https://openinverter.org/wiki/File:Schematic_voltage_sense_board.png

You can even test older AT Tiny chip oscilator design version.
https://openinverter.org/wiki/File:Schematic_sensor_board_r3.png 
I tested them both.


----------



## Tony Bogs (Apr 12, 2014)

Well, I saw one on github, posted in april 2019. What a crappy design, but I must admit it is simple.
Really crappy, so I'm not going to post a link. I like the guy. 

I'm not doing voltage sensing, have you seen my design? 

Apparently, a more basic (read: inexpensive, build on a shoestring) approach might be appreciated. 
So it's coming. Automatic precharge, uC free, basic version. All voltages up to 1000V.


----------



## arber333 (Dec 13, 2010)

Tony Bogs said:


> So it's coming. Automatic precharge, uC free, basic version. All voltages up to 1000V.


What about voltage divider and TL431 diode with opto across barrier?


----------



## Tony Bogs (Apr 12, 2014)

Yeah, what about it? 



I have taken my original 77 thyristor design into this millenium. Smart mos output for instance. At the same time I have integrated automatic discharge. 



No diagram. I hate it when someone else builds my design before I have the chance.


----------



## Tony Bogs (Apr 12, 2014)

The section of the automatic precharge circuit that senses current. Similar to the real deal.
And the small signal equivalent (bode plotter simulation) for AC analysis.


----------



## Tony Bogs (Apr 12, 2014)

Basic, basic, basic .... auto discharge & precharge, suitable for uC (tesla FDU &SiC) and the basic uC free DC (LTC69xx).


OFF TOPIC of course....


----------



## Tony Bogs (Apr 12, 2014)

Hardware implementation of pre- and discharge to minimize coding effort.
It also makes it a lot easier to handle the HV circuits.

I've added a few parts. Description (this is the 1000V version):

1. A high precharge current must have occured. This triggers U3.
2. The precharge current must drop to a low value. If not, Q2 blocks activation of the output.
3. The precharge current may not become zero or very low (indicates a possible open circuit).
U4 disables output stage at very low current levels.
4. The integrated discharge network (R2) garantuees a minimum current at the CAP+ terminal for the detection of open circuit.
5. Thermistor TH1 provides compensation for thermal variation (mainly CTR).
6. Zener D3 creates a threshold for UVLO.

First try: solder it on an experiment board.


----------



## Tony Bogs (Apr 12, 2014)

Of course there's no thermistor to compensate for CTR.


@arber333 asked:



> How about TL431?


 Answer: Not V, but I sensing. 

Here's the DC step analysis of the mosfet bypass input stage (IRF1018E, Infineon model)
at 200V input, 100R precharge.


----------



## Tony Bogs (Apr 12, 2014)

KiCAD eye candy of the 25A precharge, 10A discharge module.


----------

