VESC-controller: Firmware released!

Electric Motors and Controllers
bigdaveakers   1 mW

1 mW
Posts: 19
Joined: Jan 29 2019 3:21pm

Re: VESC-controller: Firmware released!

Post by bigdaveakers » Jan 30 2019 6:32am

I have done a quick teardown and some research as I have renewed hope that I can get this thing working!

The unit is a rear motor controller from a Mitsubishi Outlander PHEV that has a ~60kW capability as I understand

Here it is with the lid off, nicely engineered and modular. There are 2 external connectors, on that is basically a 6 pin resolver connection to the motor, and the other a CAN connection to the EV CAN network in the car along with power.
Overview.jpg
Overview.jpg (469.86 KiB) Viewed 495 times
This is the control board that looks like a prime candidate for replacement with a VESC.
CN0 and CN1 are the external connections.
CN6 is some sort of comms to the driver board - I suspect this is carrying temperature and fault data for each IGBT.
CN7 is connected to the Capacitor and a power resistor. I believe that this is used to drain the capacitor after shutdown or upon request (there is a dedicated hardwired input on one of the external pins).
CN2 is connected to the current sensors, for some reason there are only 2 phases that are sensed.
CN4 and CN5 are both 6 wire connectors - one will be the PWM outputs for the drivers, the other??
Control Board.jpg
Control Board.jpg (321.34 KiB) Viewed 495 times
The capacitor is rated at 450V 700uF
Capacitor.jpg
Capacitor.jpg (211.9 KiB) Viewed 495 times
Underneath the capacitor, not a lot to see other than it is purpose made for the job!
Capacitor Underside.jpg
Capacitor Underside.jpg (263.33 KiB) Viewed 495 times
I believe that the sole purpose of the resistor is to discharge the capacitor at shutdown.
Resistor.jpg
Resistor.jpg (325.55 KiB) Viewed 495 times
The current sensors are sat in here monitoring 2 phases. 4 wire connection to the controller board
Current Sensor.jpg
Current Sensor.jpg (140.28 KiB) Viewed 495 times
The driver board is laid out in 6 neat sections with what I believe to be a sensor section on the right. You can clearly see t1, t2, and t3 connections on the board which I suspect to be temperature sensors.
Driver Board.jpg
Driver Board.jpg (246.27 KiB) Viewed 495 times
This is a closeup of the optocoupler, it was covered in 'stuff' which I assume was used to conceal the part number. However, gentle persuasion removed the stuff and they are seen to be 34JT devices.
IGBT Driver.jpg
IGBT Driver.jpg (361.96 KiB) Viewed 495 times
And here is the pinout taken from the spec sheet.
34JT.jpg
34JT.jpg (71.96 KiB) Viewed 495 times
As mentioned these controllers can be picked up really cheaply as they dont fail so no one needs them. They are well designed, have had millions spent on R&D and have components that are specifically chosen to do the job. The IGBTs are water cooled and everything is laid out logically. It could be a really cheap way to create a motor/controller combo for conversion projects.

https://www.ebay.co.uk/itm/Mitsubishi-O ... ctupt=true
https://www.ebay.co.uk/itm/Mitsubishi-O ... ctupt=true

User avatar
marcos   100 W

100 W
Posts: 252
Joined: Nov 19 2016 11:38pm

Re: VESC-controller: Firmware released!

Post by marcos » Jan 30 2019 7:18pm

I'm glad you know your gear.

First thing to do is identify in the wiring PWM_A_TOP, PWM_A_BOTTOM,
PWM_B_TOP, PWM_B_BOTTOM,
PWM_C_TOP, PWM_C_BOTTOM

Its normal that those automotive drives only use 2 current sensors, in theory it is sufficient but for high performance you really want 3. I would install 3 new current sensors so you know their Amp/Volt transfer function.
Its also possible that they dont measure phase voltage because they already have a resolver to sense rotor position, but we need those voltage signals.

That big resistor discharges the DC link, RevD has that resistor built-in so no need to wire ot externally.

I think I see temperature sensors, we can measure uo to 4 NTC temp sensors.

If you can figure out the pwms I would say its a go!

User avatar
marcos   100 W

100 W
Posts: 252
Joined: Nov 19 2016 11:38pm

Re: VESC-controller: Firmware released!

Post by marcos » Jan 30 2019 11:23pm

lizardmech wrote:
Jan 29 2019 6:20am
Did you decouple the ADC ISR from the PWM freq so PWM can be set to multiples of the ADC ISR?
Here you go:
https://github.com/paltatech/bldc/commi ... 491c348cca

In your hw_xxx.h you can

Code: Select all

#define FOC_CONTROL_LOOP_FREQ_DIVIDER    3
That will make FOC loop run 1/3 of the PWM frequency. If you don't define it, it will be defined by default to '1'.


I also pushed an improvement in the deadtime calculation. You had to manually calculate a PWM register to set the deadtime, and use that register value in the code. It was hard work.
DTG.png
Now you just define the deadtime in nanoseconds and the code will figure out the register value for you.

https://github.com/paltatech/bldc/commi ... b01f13ae5f


I figured out a way to attempt a full code coverage test, but I need a way to simulate a simple BLDC motor with C code. The plan is that when a coverage test is invoked, an extra thread in the RTOS will be created and will inject phase voltage, current, and batt voltage signals into the control loop.
Its a software-in-the-loop test, and the reason I like it is because I can halt the code as much as I need and the result will be the same (semihosting interface is super slow and will halt the code very often). Can't do this with a real motor spinning.
I can start by injecting 3 phase voltages and see how it works, I should see in the gui a motor spinning and be able to try cover the non-driven motor scenario. If this actually works I'll need help from someone with motor modelling skills.

bigdaveakers   1 mW

1 mW
Posts: 19
Joined: Jan 29 2019 3:21pm

Re: VESC-controller: Firmware released!

Post by bigdaveakers » Jan 31 2019 6:21am

marcos wrote:
Jan 30 2019 7:18pm
I'm glad you know your gear.

First thing to do is identify in the wiring PWM_A_TOP, PWM_A_BOTTOM,
PWM_B_TOP, PWM_B_BOTTOM,
PWM_C_TOP, PWM_C_BOTTOM
I guess these are the anode and cathode connections on the 34JTs? I am hoping to probe the board later and find where everything is. I am concerned now that the 20pin connector has all the 'good' stuff on it leaving me stumped with the 2 six pin connectors.

bigdaveakers   1 mW

1 mW
Posts: 19
Joined: Jan 29 2019 3:21pm

Re: VESC-controller: Firmware released!

Post by bigdaveakers » Jan 31 2019 6:22am

Incidentally, you mentioned availability of boards soon.....how much?

User avatar
tecnologic   100 mW

100 mW
Posts: 47
Joined: Mar 24 2015 12:41pm
Contact:

Re: VESC-controller: Firmware released!

Post by tecnologic » Jan 31 2019 6:42am

marcos wrote:
Jan 30 2019 11:23pm
If this actually works I'll need help from someone with motor modelling skills.
When u are there give me a ping I can supply u with the equations in c/c++ code.
regards

Tec

bigdaveakers   1 mW

1 mW
Posts: 19
Joined: Jan 29 2019 3:21pm

Re: VESC-controller: Firmware released!

Post by bigdaveakers » Jan 31 2019 6:44am

Got to love Google......
34JTcircuit.jpg
34JTcircuit.jpg (42.28 KiB) Viewed 441 times

User avatar
marcos   100 W

100 W
Posts: 252
Joined: Nov 19 2016 11:38pm

Re: VESC-controller: Firmware released!

Post by marcos » Jan 31 2019 9:02am

bigdaveakers wrote:
Jan 31 2019 6:44am
Got to love Google......

34JTcircuit.jpg
Yes, thats the reference schematic. You need x6 pwm, gnd, 5v, and the gate driver supply, you need to check if it shares the same gnd of the logic and its voltage, I've seen 12v, 15v and 24v.
Those faults and UnderVoltageLockOut could be joined together in the gate driver pcb or sent individually to the OEM control board. With this vsc board you can receive x6 fault inputs (open drain, low means fault).
tecnologic wrote:
Jan 31 2019 6:42am
marcos wrote:
Jan 30 2019 11:23pm
If this actually works I'll need help from someone with motor modelling skills.
When u are there give me a ping I can supply u with the equations in c/c++ code.
Thanks! I'll give it a try these days, quick test showed that code runs out of RAM if I enable code coverage symbols for the whole firmware, so I have to enable coverage for a few .c files at a time and then merge the coverage results.

lizardmech   10 W

10 W
Posts: 67
Joined: May 19 2017 4:16am

Re: VESC-controller: Firmware released!

Post by lizardmech » Jan 31 2019 12:33pm

bigdaveakers wrote:
Jan 30 2019 6:32am


As mentioned these controllers can be picked up really cheaply as they dont fail so no one needs them. They are well designed, have had millions spent on R&D and have components that are specifically chosen to do the job. The IGBTs are water cooled and everything is laid out logically. It could be a really cheap way to create a motor/controller combo for conversion projects.
What is the motor like? I assume it's an IPM like most other japanese EVs but I can't find pictures or details for this motor.

bigdaveakers   1 mW

1 mW
Posts: 19
Joined: Jan 29 2019 3:21pm

Re: VESC-controller: Firmware released!

Post by bigdaveakers » Jan 31 2019 2:25pm

lizardmech wrote:
Jan 31 2019 12:33pm

What is the motor like? I assume it's an IPM like most other japanese EVs but I can't find pictures or details for this motor.
Take a look here for a basic picture

http://mmc-manuals.ru/manuals/outlander ... B00ENG.pdf

It is basically the same as the one used in the IMIEV

Permanent magnet synchronous motor - see powertrain section

https://en.wikipedia.org/wiki/Mitsubish ... Powertrain

bigdaveakers   1 mW

1 mW
Posts: 19
Joined: Jan 29 2019 3:21pm

Re: VESC-controller: Firmware released!

Post by bigdaveakers » Jan 31 2019 3:29pm

While manually trying to trace the IGBT driver board I think I found an oooopsie by Median/Mitsubishi. I am not an electronics engineer by any stretch but I do have an eye for detail! First of all would it have been beyond the with of man to make the layout the same for each of the six 34JT optos??!

Secondly, and more of an error I believe is that 5 of the 6 devices have a resistor across the anode and cathode, but the 6th.....a capacitor. Can anyone advise whether this is just plain wrong or if I missed something!
Error.jpg
Error.jpg (371.06 KiB) Viewed 411 times

User avatar
marcos   100 W

100 W
Posts: 252
Joined: Nov 19 2016 11:38pm

Re: VESC-controller: Firmware released!

Post by marcos » Jan 31 2019 4:29pm

bigdaveakers wrote:
Jan 31 2019 3:29pm
Secondly, and more of an error I believe is that 5 of the 6 devices have a resistor across the anode and cathode, but the 6th.....a capacitor. Can anyone advise whether this is just plain wrong or if I missed something!

Error.jpg
Looks like "CA" pin is connected to GND on both gate drivers, and "AN" pin has a pulldown resistor (R46 and R47) plus a capacitor to GND (C52 and C53). Its the same schematic, but someone swapped the R and C footprints between the gate drivers.

bigdaveakers   1 mW

1 mW
Posts: 19
Joined: Jan 29 2019 3:21pm

Re: VESC-controller: Firmware released!

Post by bigdaveakers » Jan 31 2019 4:40pm

For those interested, I have mapped out the connectors on the igbt driver board - a couple of unknowns and use at your own risk!
Header.jpg
Header.jpg (290.51 KiB) Viewed 404 times
  1. PWM Cathode OPTO 1
  2. 5VA
  3. PWM Cathode OPTO 3
  4. FAULT (NOTE: all 6 OPTO outputs connected together)
  5. PWM Cathode OPTO 5
  6. UVLO (NOTE: all 6 OPTO outputs connected together)
  7. GND
  8. Not Connected??
  9. GND
  10. Temperature??
  11. PWM Cathode OPTO 2
  12. Temperature??
  13. PWM Cathode OPTO 4
  14. Temperature??
  15. PWM Cathode OPTO 6
  16. 15V
  17. 5V
  18. 15V
  19. 5V
  20. Not Connected??
OPTOs.jpg
OPTOs.jpg (254.46 KiB) Viewed 404 times

bigdaveakers   1 mW

1 mW
Posts: 19
Joined: Jan 29 2019 3:21pm

Re: VESC-controller: Firmware released!

Post by bigdaveakers » Jan 31 2019 4:46pm

marcos wrote:
Jan 31 2019 4:29pm
Looks like "CA" pin is connected to GND on both gate drivers, and "AN" pin has a pulldown resistor (R46 and R47) plus a capacitor to GND (C52 and C53). Its the same schematic, but someone swapped the R and C footprints between the gate drivers.
I am maybe a little obsessive with my desire for consistency! :lol:

User avatar
marcos   100 W

100 W
Posts: 252
Joined: Nov 19 2016 11:38pm

Re: VESC-controller: Firmware released!

Post by marcos » Jan 31 2019 5:00pm

Sounds good,
PWM Cathode OPTO 1
PWM Cathode OPTO 2
Do you you know which one commands the TOP IGBT and which one commands the BOTTOM IGBT?

bigdaveakers   1 mW

1 mW
Posts: 19
Joined: Jan 29 2019 3:21pm

Re: VESC-controller: Firmware released!

Post by bigdaveakers » Jan 31 2019 5:31pm

marcos wrote:
Jan 31 2019 5:00pm
Sounds good,
PWM Cathode OPTO 1
PWM Cathode OPTO 2
Do you you know which one commands the TOP IGBT and which one commands the BOTTOM IGBT?
What is the definition of TOP and BOTTOM?

The emitters of OPTO 2,4,6 are connected to the low DC......I assume that this is BOTTOM?

User avatar
marcos   100 W

100 W
Posts: 252
Joined: Nov 19 2016 11:38pm

Re: VESC-controller: Firmware released!

Post by marcos » Jan 31 2019 5:49pm

bigdaveakers wrote:
Jan 31 2019 5:31pm
What is the definition of TOP and BOTTOM?

I think the emitters of OPTO 2,4,6 are connected to the low DC......
If 2, 4 and 6 are connected to HVDC(-) then they are the driving the "BOTTOM" IGBT's
top and bottom.png
top and bottom.png (27.45 KiB) Viewed 392 times


Abricosvw   10 mW

10 mW
Posts: 26
Joined: May 11 2018 10:40pm

Re: VESC-controller

Post by Abricosvw » Feb 01 2019 6:59pm

maholli wrote:
Nov 25 2018 10:24pm

About that 5v difference, I wouldn't worry too much, if your fullscale is 600V, you have <1% error, and these isolated amplifiers have a rather poor offset spec.
One thing you can try is using AMC1311, they work better for voltage sensing, you need to change the resistor divider because they have gain=1 instead of the original gain=8.2.
Hi ...
i got and installed AMC1311BDWV
I understand that I need to mount (to replace) R9 R10 from 1K to 8.2K resistor ( In four places ) ?
Thanks ...
Новый точечный рисунок (3).jpg

User avatar
marcos   100 W

100 W
Posts: 252
Joined: Nov 19 2016 11:38pm

Re: VESC-controller

Post by marcos » Feb 01 2019 7:19pm

Abricosvw wrote:
Feb 01 2019 6:59pm
maholli wrote:
Nov 25 2018 10:24pm

About that 5v difference, I wouldn't worry too much, if your fullscale is 600V, you have <1% error, and these isolated amplifiers have a rather poor offset spec.
One thing you can try is using AMC1311, they work better for voltage sensing, you need to change the resistor divider because they have gain=1 instead of the original gain=8.2.
Hi ...
i got and installed AMC1311BDWV
I understand that I need to mount (to replace) R9 R10 from 1K to 8.2K resistor ( In four places ) ?
Thanks ...
Новый точечный рисунок (3).jpg
Hi Abricosvw,
I used R9 = 8.2k and R10 = 0 Ohm
AMC1311.png
AMC1311.png (31.24 KiB) Viewed 336 times
And the same for the other 3 iso-amps.

bigdaveakers   1 mW

1 mW
Posts: 19
Joined: Jan 29 2019 3:21pm

Re: VESC-controller: Firmware released!

Post by bigdaveakers » Feb 02 2019 2:30pm

Had a bit more of a probe after picking my motor up :bigthumb:

The resolver output from the Mitsubishi board to the motor is 5V and at 10kHz.

What is achievable with the controller board?

User avatar
marcos   100 W

100 W
Posts: 252
Joined: Nov 19 2016 11:38pm

Re: VESC-controller: Firmware released!

Post by marcos » Feb 02 2019 3:01pm

bigdaveakers wrote:
Feb 02 2019 2:30pm
Had a bit more of a probe after picking my motor up :bigthumb:

The resolver output from the Mitsubishi board to the motor is 5V and at 10kHz.

What is achievable with the controller board?
Resolver interface is programmable (with resistors) to 10, 12, 15 and 20kHz. Excitation amplitude must be configured (also with resistors) such that the IC receives 3.15Vpp +-27%. Should work!

bigdaveakers   1 mW

1 mW
Posts: 19
Joined: Jan 29 2019 3:21pm

Re: VESC-controller: Firmware released!

Post by bigdaveakers » Feb 02 2019 3:12pm

marcos wrote:
Feb 02 2019 3:01pm
Resolver interface is programmable (with resistors) to 10, 12, 15 and 20kHz. Excitation amplitude must be configured (also with resistors) such that the IC receives 3.15Vpp +-27%. Should work!
It is almost like you have thought of everything :lol:

User avatar
marcos   100 W

100 W
Posts: 252
Joined: Nov 19 2016 11:38pm

Re: VESC-controller: Firmware released!

Post by marcos » Feb 02 2019 5:25pm

bigdaveakers wrote:
Feb 02 2019 3:12pm
marcos wrote:
Feb 02 2019 3:01pm
Resolver interface is programmable (with resistors) to 10, 12, 15 and 20kHz. Excitation amplitude must be configured (also with resistors) such that the IC receives 3.15Vpp +-27%. Should work!
It is almost like you have thought of everything :lol:
Ha, I'm sure there is room for improvement after more test rides. This board is made to support that kind of motors.

2 notes about the resolver support:
* I've only tested it with an ancient military resolver with scarce documentation, so if you don't mind I'd follow closely your setup.
* You won't see in the commit history any support to the resolver chip, thats because I emailed the resolver commit to benjamin and he told me he will merge it in his public branch, so to avoid merge conflicts I didn't apply that patch to my branch. So don't worry if you don't see it in the commits, its available.

lizardmech   10 W

10 W
Posts: 67
Joined: May 19 2017 4:16am

Re: VESC-controller: Firmware released!

Post by lizardmech » Feb 02 2019 7:22pm

bigdaveakers wrote:
Jan 31 2019 2:25pm

Take a look here for a basic picture

http://mmc-manuals.ru/manuals/outlander ... B00ENG.pdf

It is basically the same as the one used in the IMIEV

Permanent magnet synchronous motor - see powertrain section

https://en.wikipedia.org/wiki/Mitsubish ... Powertrain
What does the rotor look like though? If it's an IPM motor with reluctance torque, controlling it will be different to a conventional motor with surface mounted magnets.

Post Reply