# What Controller for a Tesla Motor?



## dcb (Dec 5, 2009)

http://www.roperld.com/science/TeslaModelS.htm

says 375v battery, 380hp (peak assumed motor) = 283kw

283/375v = 756A. if it is 380hp divided by two motors, then you need 2 controllers that can handle ~ 400v and 400a each minimum @ 150kw, plus a lot of patience figuring out how to tune all that. 


Or you detune it and live with less peak performance.

the dmoc645 can do 400v and 400+amps, but lists Peak Power: 118 kW @ 336vdc, Continuous Power: 53kW @336 vdc so it will come up a little short.

Again, just reading crap on the internet, I have no way of validating it.


----------



## Tomdb (Jan 28, 2013)

Only AC controller that is "readily" available would be the Rinehart motor controller or maybe the tritium wavesculpter, that gets near the power and voltage levels.

http://tritium.com.au/products/wavesculptor200-motor-inverter/

Where are you from?


----------



## Boxster-warp (Jun 22, 2014)

Hello
Thank You fore your answer.
Two Motors need two controller, off course.

Hmm, thats not easy.
Can i Build a drivetrain with One motor and One controller?
I dont whant over 230v.

Is the dmoc 645 the only controller that i buy?
Can i dont Build the drivetrain with a curtis 1239 6501 with 144v?

Thats not the Optimum but this is cheaper.

Is this a good idea with the tesla drivetrain for a first ec conversion Builder?

Greetings Boxster-Warp


----------



## Boxster-warp (Jun 22, 2014)

i come from Germany.


----------



## Tomdb (Jan 28, 2013)

I have no clue what kind of encoder the tesla motors use.

This will have to match with the curtis input.

144v and 500amp peak is roughly 72 KW.


----------



## kennybobby (Aug 10, 2012)

There is only one motor on the tesla gearbox--the other thing that looks like a motor is actually the inverter (motor drive electronics). Any 3 phase AC motor drive (e.g. variable frequency inverter) could be used, sized for your battery pack and the power level you want to run. See Baldor for commercially available VFD. i have run a 300 hp Baldor unit with both 480 vac 3-phase and 750 VDC.

The tesla inverter uses a DTC (direct torque control) scheme to control torque and flux, see the Matlab controls for details of how it is done, basically a bang-bang controller using a high-speed processor to do table lookup for switching.{edit}

If you get the motor and gearbox i would be interested to reverse engineer the inverter.


----------



## Boxster-warp (Jun 22, 2014)

Hello
Ok, Thank you fore answer.
The picture Looks like two Motors, but One motor and the other sied the inverter 
I Must Look what is DTC 
Greetings Boxster-Warp


----------



## major (Apr 4, 2008)

kennybobby said:


> The tesla inverter uses a DTC (direct torque control) scheme to control torque and flux, see the Matlab controls for details of how it is done, basically a bang-bang controller using a high-speed processor to do table lookup for switching, no encoder, seems kinda crude but it works.


Where did you get this information? I'm especially interested in the "no encoder".


----------



## Tesseract (Sep 27, 2008)

major said:


> Where did you get this information? I'm especially interested in the "no encoder".


I'm highly skeptical myself as all of the FOC control schemes (of which DTC qualifies, albeit somewhat, uh, tangentially... pardon the obscure pun) need rotor speed feedback for traction applications. In my experience (vastly eclipsed by yours) it is difficult to achieve more than about 75% of full load torque at 0 rpm with "sensorless vector" schemes.


----------



## jhuebner (Apr 30, 2010)

Subscribing... would really like to know about that (lack of) encoder


----------



## dcb (Dec 5, 2009)

http://en.wikipedia.org/wiki/Direct_torque_control
http://www08.abb.com/global/scot/sc...1e728/$file/ABB_Technical_guide_No_1_REVC.pdf

gotta measure some motor values, i.e. stator resistance. makes a hiss instead of a whine.

" Typically the control algorithm has to be performed with 10 - 30 microseconds or shorter intervals."

this seems like the biggest hurdle, a 100khz (or more) switching frequency, at 400hp, unless there is a typo there.

the abb pdf suggests something a bit more achievable:
"For DTC, a typical torque response is 1 to 2 ms below 40 Hz 
compared to between 10-20 ms for both flux vector and DC 
drives fitted with an encoder. With open loop PWM drives (see 
page 11) the response time is typically well over 100 ms."












in a way it reminds me of zcs/zvs, with the random switching frequency. which reminds me of pfc correction.


ooh, this is interesting, two motors, one dtc controller (and maybe 6 current sensors):
http://www.aicit.org/JDCTA/ppl/JDCTA1828PPL.pdf


----------



## Tesseract (Sep 27, 2008)

dcb said:


> http://en.wikipedia.org/wiki/Direct_torque_control
> http://www08.abb.com/global/scot/sc...1e728/$file/ABB_Technical_guide_No_1_REVC.pdf


From the wiki reference:


> In higher speeds the method is not sensitive to any motor parameters. However, at low speeds the error in stator resistance used in stator flux estimation becomes critical



What that basically means is that torque sucks at low speed without accurate (and dynamically predictable) estimation or knowledge of the motor parameters. Ergo, you need rotor speed feedback for traction applications.


The ABB document says something a little less direct (ahem):




> Also with DTC, for most applications, no tachometer or encoder is needed to feed back a speed or position signal.



The applications that do need speed feedback? Those that need the motor to deliver maximum torque (ideally, breakdown torque) near 0 rpm.


----------



## dcb (Dec 5, 2009)

I've seen some references to it being operational at .5hz, so the workaround is probably to drive it @ 1hz till you get some measurable bemf, or something like that. I've read that accurate voltage/current measurements is critical, can't be using lowpass filters.

but yah, dynamically predictible can be a challenge to say the least.

"Thus it is not possible to control the motor if the output frequency of the variable frequency drive is zero. However, by careful design of the control system it is possible to have the minimum frequency in the range 0.5 Hz to 1 Hz that is enough to make possible to start an induction motor with full torque from a standstill situation. A reversal of the rotation direction is possible too if the speed is passing through the zero range rapidly enough to prevent excessive flux estimate deviation.

If continuous operation at low speeds including zero frequency operation is required, a speed or position sensor can be added to the DTC system. With the sensor, high accuracy of the torque and speed control can be maintained in the whole speed range."


----------



## eldis (Sep 3, 2013)

Getting full torque with FOC is difficult (but not impossible), and indeed require well-tuned parameters. You can do some clever things like high frequency injection to improve the 0Hz behavior. It seems highly unlikely that Tesla is not using a sensor - it costs nothing compared to their motor-inverter combo.

The fact is, that microcontrollers and FOC implementations improved a lot in recent years, and you can indeed get very close to full torque without any mechanical sensor. I have such setup in my car, and it seems it can nicely start in any hill without clogging. I am very interested in how close it can actually get to the breakdown torque - that's why I reversed the Chevy Volt inverter, as my Prius setup cannot even fully load my motor. It would be interesting to gain an access to a motor-generator setup (or to make one) to actually get some numbers.


----------



## dcb (Dec 5, 2009)

you guys are probably right, eliminating the cost of an encoder/resolver is cheap appliance level thinking. It is nothing in the cost of a vehicle.

edit: for that matter, mechanical torque sensing might even be appropriate.


----------



## eldis (Sep 3, 2013)

dcb said:


> you guys are probably right, eliminating the cost of an encoder/resolver is cheap appliance level thinking. It is nothing in the cost of a vehicle.
> 
> edit: for that matter, mechanical torque sensing might even be appropriate.


Well, in the DIY world it makes perfect sense, being able to go without it. Then you can use any motor you like, regardless if it had sensor or not. In the automotive every electric car I took apart had sensor - no optical cheap stuff, but always resolvers.

Mechanical torque sensor you really don't need. Every car is measuring phase currents, which is enough to estimate that. Plus, "every sensor is a failure waiting to happen" (my history with medical equipment development).


----------



## dcb (Dec 5, 2009)

re: torque, mostly was thinking how to get competitive acceleration from an induction motor (i.e. drag racing). And closing the loop on dynamic parameters.

I don't pretend to fully understand the algorithms, but it seems even some trial and error at the strip should allow one to map best slip vs rpm (limited by current capabilities) for max torque. 

As well if you are trying to set best slip for max torque based on current, the efficiency is falling off at the same time, so you can overshoot by a wide margin it seems. Tesla is doing 0-60 in 3.2 seconds in a 4000+ lb car, so they are doing something right.


----------



## Hollie Maea (Dec 9, 2009)

Barring a solid authoritative citation, I would find it very hard to believe that the Tesla inverter is sensorless. There is just no reason to use an inferior control scheme, and the Tesla doesn't appear to lack performance.

As far as inverters for the motor go, until someone hacks the Tesla inverter, probably the best option for getting the full performance out of the motor would be the Rinehart PM250dx. In the past, Rinehart has characterized and tuned new motor types for people. It probably isn't super cheap.

Of course even after it is characterized, the inverter still costs over 12 grand. But that's not super expensive for a ~275kW AC option, if you could get motors for next to nothing from the bone yard.

Edit: a PM150dx would also be a cheaper but still respectable solution for someone who got a Tesla motor for cheap. Especially if you got one of the front motors from a P60D (throwing away less of the motor capability...)


----------



## dcb (Dec 5, 2009)

well they are copper rotor bar motors, and they paid lots of attention to cooling, so that hollow shaft is probably aiding cooling as well. So I don't think the tesla is your typical junkyard ACIM, it is built to handle more repeated abuse methinks. But still you should be able to get a lot more out of a standard motor before it heats up/melts something.


----------



## dcb (Dec 5, 2009)

Well the basic question started with what inverter to use with the tesla motor, and wandered off into DTC and etc... (DTC is basically instantaneous slip control) All surrounded by all the vagueries of things tesla. Did you have anything intelligent to add?

This might be promising news (without resorting to a complete build up). It appears that the infamous Mr. Rickard has decided to try and can control the stock inverter: http://www.teslamotorsclub.com/showthread.php/44722-Put-a-Tesla-motor-in-any-car-or-truck-ever-made 

He picked up a motor/inverter/gearbox/shafts for ~$7000 and the charger and some etc for another ~1500. Good luck!

props to carter, and really neat to see "local" hero Damian on the show!

Still I'd have a backup plan if you are procuring a tesla motor.

Edit: jack clarified his business plan a bit, evtv isn't planning on selling just the logic board, but rather bundled with a motor and whatnot, so buying tesla hardware and hoping they will get it running for you isn't a good plan. So, plan B, find a suitable controller or make one.

edit2: I do find it a little ironic, that jack rails against the closed sourcing of the internals, so that nobody can work on them, then close sources the solution. Not that I expect any business to do anything different, there might be lost revenue. It would be good to know that it is indeed hackable, though I certainly wouldn't complain if the info were publicly available, as that is kinda what hacking is all about. Though he does at least offer some clues how to hack stuff.


----------



## eldis (Sep 3, 2013)

This might be a slightly off-topic, but this is how I see that this whole DIY "which motor with which inverter could work" (we are of course talking AC here):

1) If you manage to get the whole drivetrain from an electric car, you could be able to use it "as is", by emulating the CAN bus. This is how Jack is imagining 90% of DIY builds to be done in the upcoming years. He is trying to provide a box that does just that, and if I recall correctly, the firmware is open source. Therefore if you don't like that box, you can still borrow some code (CAN packet format) and use a different MCU for it. So it is possible to get your own components from the scrapyard. 
Right now, there is not a single hacked drivetrain you could pull from an electric car and use. Only available ones are legacy products, from bankrupted companies and discontinued stuff. I'm still waiting to see the first Leaf or Volt drivetrain being used "as is" by anyone. 

2) Buy a fully supported motor-inverter combo from a manufacturer, and just wire it up together.

3) If you want anything non-matched (some motor, some inverter), you should be able to take an inverter from Prius, Leaf, Chevy Volt etc, replace the physical control board inside with a DIY controller (keeping IGBTs, drivers, current sensors) and then tune it to your own motor. Be it your own choice if you want to go sensor/sensorless. Once someone tunes the controller to a certain motor, parameters can be easily shared, so it does not have to be done again.

Summary:
1) No programming (probably) needed, just basics of electronics, reasonably priced. Minimum support, but if you do things right and it worked for other people, it will work for you.
2) Only mechanical skills needed, you pay quite a lot for getting things that works, backed up by a company and warranty.
3) Gives the most freedom, as you can use whatever you find and suits your requirements (power, price, availability, weight). Requires you to open up an existing inverter and do some cable and boards swapping. Requires reasonable skills with electronics, maybe getting your hands dirty a bit with code modifications.


----------



## dcb (Dec 5, 2009)

eldis said:


> ...if I recall correctly, the firmware is open source. Therefore if you don't like that box, you can still borrow some code (CAN packet format) and use a different MCU for it.


If you know where the source is please share. I noticed that EMW seems to have gone closed source on their chademo after lunching off the hacker community. I *think* jack is being upfront about it and probably offering the private hackers some compensation.

from: http://evtv.me/2015/03/driving-toward-the-lowest-common-denominator/ 
"As noted in the video. Yes, I did score a Tesla Drive Train for $6500. No, we will not sell it to you for that. Yes, you can probably find one as well. No we will not enable you to use it using our efforts for free. But yes, I can see them in stock for less than $10-12K within the year."

Note to hackers, don't let the "money grubber" guy be the source code control guy if it is being presented as an open source effort. I think that was pretty sleasy of vale/EMW. Also something based on hobby grade arduino that is "closed source" is completely nonsensical. Get rid of that $40 POS and put a $5 chip on your board and get a stable compiler, sheesh. Nobody cares if it is arduino if they can't get to any code anyway. I hope I'm wrong and EMW is just making it pretty before publishing it.


[email protected] said:


> and all of our hardware and software is open source and will be kept that way.



Also, most full-on conversions are going to be targeting higher-end vehicles (since you can hardly compete with the cost of a used "commuter" EV after procuring batteries and everything), so lots of performance is probably expected. I think it is wise of EVTV and EMW to target higher power systems from a marketing perspective.

There are a few diy inverters out there, if you cannot find one with the needed capabilities. noteably jheubeners and mpauls. Jheubener has a kit, but mpaul has field oriented control and a bit more details on approaching 200kw. I don't know squat about prefab controllers though (too many secrets to care).


----------



## eldis (Sep 3, 2013)

This looks like the repository for GEVCU:
https://github.com/collin80/GEVCU
So I expect that this will eventually be pulled down (or not updated anymore), otherwise you would indeed have an access to those precious CAN packets  But as I said, they don't have any current drivetrain cracked yet. Maybe I'll be the first one for some parts  

It is true, I'm getting a bit puzzled by the recent videos and blog entries.. It seems that there is a shift away from the community and more into the business model (but sure, who can blame them).


----------



## Hollie Maea (Dec 9, 2009)

eldis said:


> This looks like the repository for GEVCU:
> https://github.com/collin80/GEVCU
> So I expect that this will eventually be pulled down (or not updated anymore), otherwise you would indeed have an access to those precious CAN packets  But as I said, they don't have any current drivetrain cracked yet. Maybe I'll be the first one for some parts
> 
> It is true, I'm getting a bit puzzled by the recent videos and blog entries.. It seems that there is a shift away from the community and more into the business model (but sure, who can blame them).


Collin is on Jack's payroll now, so that should be the end of the open source phase.


----------



## CKidder (Dec 12, 2009)

Yes, my github account is pretty much the place to go for all that stuff. GEVCU is there, there is also code in my repos to produce the security byte that locks the canbus frames for the Nissan Leaf inverter. To my knowledge no one has tried that yet but some the preliminary code exists.

And, yes, I'm working for Jack now. But, I know of no orders from on high that would suggest that we're about to go dark. For one, the genie is out of the bottle. Anyone can go to my github repos and fork their own copy of GEVCU. Several people have. There's no take backs in open source. But, sure, there is the potential that he'll tell me not to update github with details about the Tesla drivetrain. It could happen. But, I don't think that's what he means to say. Will he help you get a salvage drivetrain to work? Not if you didn't buy it from him. Could you maybe see the details in my github repos? Probably. But, that only helps the truly technically savvy. He's not going to offer free tech support to people who bought the stuff from someone else. Nobody should expect him to.

If today Rinehart sent me the source code and schematics for a PM250 controller I could make one myself. Most people building electric cars couldn't. It takes a special skill set to use open source stuff. You need to know a lot about electronics and embedded software to do it yourself even with the information open. Also, look at it a different way. Let's say Chevy sent me the schematics for a big block V8. I could not and would not make my own motor even if the schematics were totally free. It's too hard, I don't have the tools, I don't have the skills. Open is only helpful to the people who could have done it themselves anyway. I could design my own motor controller and write the firmware so I could also take something open and build it. I could not design my own big block V8 so the schematics still do me no good.

I believe that the schematics and code will remain open source. For most people this does not matter and you're going to be buying a pre-made kit anyway because it's complicated and costly to get set up to make something yourself. Some people will build it themselves anyway. Take LINUX for example. How many people compile all of the programs and operating system themselves? Nearly no one. Even the people who use it usually take something prepackaged and use that.

So, I guess that's my take on the situation. I don't know of any specific drive to close down access to the source code but I'm not the official word on that. I believe it's going to stay open because he wants to attract as many technical people to help as possible and you can't easily do that if you hide your work. If the situation changes I'll say so.


----------



## nimblemotors (Oct 1, 2010)

If you don't mind please stop referring to EVTV as 'jack', there are many 'jacks', I know 4 of them that post here.

So EVTV has failed as a 'magazine' or 'publisher'.. which was their intent,
and did become a 'reseller', and now they will become a 'proprietary products' company? tsk tsk.


----------



## eldis (Sep 3, 2013)

CKidder said:


> I believe that the schematics and code will remain open source. For most people this does not matter and you're going to be buying a pre-made kit anyway because it's complicated and costly to get set up to make something yourself. Some people will build it themselves anyway. Take LINUX for example. How many people compile all of the programs and operating system themselves? Nearly no one. Even the people who use it usually take something prepackaged and use that.
> 
> So, I guess that's my take on the situation. I don't know of any specific drive to close down access to the source code but I'm not the official word on that. I believe it's going to stay open because he wants to attract as many technical people to help as possible and you can't easily do that if you hide your work. If the situation changes I'll say so.


I actually stand behind Colin on this one. EVTV didn't do anything yet that would turn even us, hardcore DIYs, down. There might be a lot of "power talk" in the show, but code is still up (after all, even people not on Jack's payroll are contributing). 

Selling to DIY market is one of the toughest things you could try. Either you make your product dirty cheap, and I mean raw-components cheap (you will never even get your development time payed). Or you put the price tag high, provide the support and take the beating for everything that craps out (either due to a bad design or ignorance of the buyer). Then you will have many people pointing at your price, screaming that they could build it cheaper.

I'm building everything myself, including the inverter, instrumentation, BMS and so on. I could just buy it.
Multiplying my development hours by the salary would make every economist roll his eyes up, labeling me as a complete idiot. But we still do it, and we love it


----------



## Abdool (Dec 5, 2017)

Does anyone know a source for the motor encoder in the Tesla motor?
Or where could I get a used one?


----------



## kennybobby (Aug 10, 2012)

It looks like a Bosch part, but are there any letters or numbers printed or stamped on the device? May be able to trace it with a part number.


----------



## Kevin Sharpe (Jul 4, 2011)

Abdool said:


> Does anyone know a source for the motor encoder in the Tesla motor?
> Or where could I get a used one?


You could try asking Damien ("Jackbauer" here)...


----------



## Abdool (Dec 5, 2017)

kennybobby said:


> It looks like a Bosch part, but are there any letters or numbers printed or stamped on the device? May be able to trace it with a part number.


There are no markings on it at all. This one is off a Tesla motor. I had to put it back!
Some friends and I are trying to build an induction motor from scratch for a truck project. And we will be using the Sevcon drive. The motor has a through shaft with a toothed wheel on one end.
The encoder from a Tesla or yasa would work.
I need to find the supplier, or a used one.


----------



## boekel (Nov 10, 2010)

This might work:

https://www.ebay.com/itm/222045832912


----------



## CKidder (Dec 12, 2009)

boekel said:


> This might work:
> 
> https://www.ebay.com/itm/222045832912


It might but I think I remember something about the encoder on a tesla motor being 64 PPR not 100. Either way it's not very many pules per rev but nobody cares. You're just using it to get a basic idea of how the motor is starting and then you can ignore it once there is plenty of BEMF to measure.


----------



## jackbauer (Jan 12, 2008)

Tesla drive units use a 36ppr encoder.


----------



## Abdool (Dec 5, 2017)

boekel said:


> This might work:
> 
> https://www.ebay.com/itm/222045832912


Hi
Thank you, but I need the type of encoder that reads a toothed wheel, not the end of shaft type.
regards
A K


----------



## Abdool (Dec 5, 2017)

jackbauer said:


> Tesla drive units use a 36ppr encoder.


hi Jackbauer

Would you know where I could buy a couple of these second hand, or where I can source new ones? New would be ideal as I may need about half a dozen eventually. It is for R&D for a heavy vehicle KERS project. (I am doing post-graduate research into Kinetic Energy Recovery in diesel trucks with a view to understanding the potential for reducing road freight emissions)

I emailed Jack Rickard who has them but that conversation did not go too well.


Best holiday wishes


----------



## kennybobby (Aug 10, 2012)

If you are not trying to replace the exact tesla part, then consider a wheel speed sensor such as this

https://www.ebay.com/itm/ABS-Wheel-...d=162597550647&_trksid=p2385738.c100677.m4598

If this is a project of your own design then use whatever you can find for a reasonable price (meaning not a tesla part). The ABS system on most cars uses a toothed gear wheel on a shaft.


----------

