Close

Component choices and learning a new toolchain

A project log for DIY Electric Vehicle from Recycled Parts

Converting a car to electric drive using recycled and salvaged EV and hybrid components.

mauswerkzmauswerkz 06/12/2015 at 03:570 Comments

I got started with microcontrollers, like many, with Arduino. This set me on the path to use Atmel parts in my personal projects. First I started embedding Arduino-compatible AVR devices in projects, using the Arduino IDE to code for them, and an AVR-ISP clone to program them. Once I started doing more complex projects, I looked at other Atmel devices beyond those supported by the Arduino IDE. I moved to Atmel Studio and played with the xmega series of devices. Still 8-bit, but with more "grown up" peripherals and a higher clock speed. It was an xmega device that ran my first 3-phase inverter.

With this new project I wanted to take another step up. I looked at Atmel's ARM offerings but couldn't find the right combination of peripherals, performance, and motor-control libraries so I decided to branch out. In my searches, I came across the Freescale V-series ARM devices. These are aimed towards motor control and power conversion, have the right collection of peripherals, and a motor control library is offered for use on them which will greatly simplify the coding portion of the project. These seem to be a good fit.

My inverter control board has three microcontrollers and two resolver-to-digital (R2D) converters. There is one microcontroller and R2D pair per motor and a main "supervisory" microcontroller.

My specific choices of device are:

2x Freescale MKV10Z32VLF7 32-bit ARM Cortex M0+ @72MHz (Freescale product page)

1x Teensy 3.1 (Freescale MK20DX256VLH7) 32-bit ARM Cortex M4 @ 72MHz (Teensy product page)

The MKV10's will do the PWM generation, read the R2D's and phase currents, and perform the vector control calculations for the motors. The current controller setpoints will be fed to these via SPI from the Teensy. The speed control loops, transmission control, CAN link, and supervisory functions will be performed in the Teensy. It'll have more on its plate, but the calculations it needs to do aren't as numerically intense, so it should be a good balance.

I'm getting used to the Freescale toolchain (Kinetis Design Studio). It's a different environment than I'm familiar with (Eclipse for KDS vs Visual Studio for AS), but there are some very handy tools included. I'm using a Freedom KL25Z dev board as my programmer until I can pick up a proper one.

Meanwhile, I've made some progress assembling my board. Ordered a few of the wrong parts, which has delayed me a bit, but I got the power supply components installed and working. I've populated the bottom side of the board (the stick vise sure came in handy for that!) and will do the top side this weekend. If only I could get some 22k ohm SMD resistor arrays locally! Hardly worth placing a digikey order just for those.

Anyway, keep an eye out for more updates over the next few days.

Discussions