12 August 2013

EtekChopper: Using the Sevcon Gen4 Motor Controller

The Sevcon Gen4 is both a truly great and reliable controller and a royal pain of finicky finickage. But it can do this: 



On one hand, it's well built, infinitely customizable, has lots of safety features, and is truly a 21st century controller that's years ahead of Kelly Controls in terms of features. I'm really not worried about dropping it a couple feet, the thing is built solid. It has internal pre-charge monitoring, and when you give it logic power it precharges automatically until it's ready to activate main battery power, and then trips a contactor relay, and then has internal economization for keeping that relay held efficiently. 
Getting down to the nitty-gritty, I can change EVERYTHING. Perceived motor inductance, max stator current, max RPM, PID gains on speed or torque controllers for both drive and regen braking. I can have 10 of them on a CAN network and drive them each individually. I can use a single throttle to drive two separate motors for two-wheel independent torque-vector drive. Or I can put one on my motorcycle and make it go VROOM VROOM (Okay, more like whirrrrrrr). 

But on the other hand, if you mess up any of the hundreds of variables, it will have many faults on it and won't work until they are dealt with. Once they are dealt with, there's still a strong possibility it will just dump current into the motor but not do anything. Or it'll dump current into a different motor lead and spin uncontrollably, threaten to fly off the clamps that are holding it down, at the slightest touch of the throttle, leading me to have to disconnect the main power. Not sure if that's awesome or scary. But I've gotten it right. I got my motor spinning properly and controllably. This is my journey, documented as best I can for reference to the EV community, because many are ready tame the Sevcon, and this may just help them get a handle of it. Because it's supposed to be more a reference to other than to me, I will be rehashing some of the stuff I've written in previous posts into this one. 


Let's begin our journey, then!

First things first is selecting the proper Sevcon Gen4 for you. I didn't have much choice, seeing as I was just gifted the $925.00 Sevcon Gen 4 Size 4, the 80 volt 350 Amp peak version. (I know this because it has a 355 Amp fuse on it, and the manual states the 350A peak version needs it on page 33. And the general brochure states the 350A version is meant ofr a 80 Volt system.)

As for picking a good motor for you controller setup, I guess it's a matter of the max motor current and voltage, and continuous current. My Brushless Etek motor can deal with 300+ Amps peak, 150 Amps continuous, at 5000 RPM (probably a bearing rating, and I can probably push it quite bit harder if necessary). As I recently found out (will detail this in a later post), my special snowflake special edition Etek motor has a Kv of 60 RPM/Volt. Nominally, this means 3.3 Volts per series cell * 24 cells in series * 60 RPM/Volt = 4752 RPM. So it's almost perfect for this controller. 


Now to figure out the wiring. Above is my setup. Note that my motor is clamped down to the table in multiple spaces, so it doesn't go flying across the room from the 50-some NewtonMeters of torque, dragging the controller and batteries with it. 

For a good reference, look at the diagram on page 56 and the table on page 35 of the manual.  The Sevcon Gen4 needs the following to function bare-minimum: 

  • A Brushless Motor of some sort, with its main U, V, and W terminals tied to M1, M2, and M3 on the controller. 
    • Use thick gauge wire for this to prevent melting. I used 2AWG. 
  • A big line contactor with the coil (switch) leads plugged into pins 2 and 3 and the contactor leads between the battery + and the + side of the controller. 
  • A Battery whose voltage range lies within the voltage range of your controller. Tie the battery ground to B- and the battery high voltage to one end of the contactor. 
    • BE CAREFUL! USE GLOVES! ELECTRIC SHOCK WITH VOLTAGES ABOVE 50V CAN EASILY KILL YOU. Even if it's less than 50V, it'll hurt. 
    • I have a 79.2V nominal battery pack on an 80V nominal controller. 
    • Again, use thick wire for these connections. I used 2AWG. 
  • Logic Power Switch at Battery Voltage into pin 1, 6, or 10. 
    • This is the main "On" switch for the controller, and allows internal capacitor precharging to occur.
  • Throttle, with the high side plugged into pin 34, the wiper plugged into pin 22, and the ground tied to battery ground. (I find it very annoying that there are no battery ground lines anywhere in the 35-pin connector)
    • I use a 0-5k potentiometer Magura twist throttle from EV Drives
  • An encoder of some sort. I use Hall Sensors that uses pins 5, 15, 17, 26, and 29. 
  • Enable switches: Foot Switch (FS1), Forward, and Seat Switch are the bare minimum needed to enable drive, and I had them tied to pins 18, 30, and 31. 
    • You can configure these to be at any of the reserved digital switch pins. 
    • They are considered "On" when tied to battery ground. 
  • CAN bus leads for programming, with CAN high tied to pin 13, CAN low tied to pin 24, and pin 2 (CAN Termination) tied to pin 24 if this is only controller in your set, which it is for me.
    • May also need a separate wire to system ground.  
Yeah, that's a lot to deal with, and there's more involved in the setup to get regen braking or other features enabled, but you'll soon see why every bit of it is necessary. 

In order to start connecting things to the 35-pin header, we need the proper individual female connectors and the large 35-pin housing. I ordered these female connectors and this AMPSeal housing from Digikey. Something ended up being incorrect, however, because when I tried to insert the connectors into the AMPSeal housing and then insert the entire housing into the socket on the controller, there was no connection made between the female and male connectors. 


And so I ended up just putting extra electrical insulation on the female connectors and plugging them directly into the controller. I'll deal with how I'll properly isolate these from each other and the elements later. 


After plugging the logic power into the connector and switching 72V into the logic power input, THE LED TURNED ON! LOOKIT! IT'S ALIVE! I tried plugging everything else in (Contactor, hall sensors, throttle. No CAN or enable switches yet) to see if it would trigger the contactor.

Then it blinked 11 times, clearly a fault of some sort. Page 110 of the manual specifies it's an encoder fault, which could result from the encoders not being attached to the controller correctly. 

Now, here's my issue. I don't know which of the bajillion of internal configurable variables are set, and at what values they set to. Odds are, either an incremental optical encoder or a sin/cos encoder (or a combination) is set to be the default for the controller to look for, and those require different pins, hence the thrown fault. 

The only way to see what's going on in the software is to purchase a USB to CAN converter. However, according to this forum thread, and this one, not any old USB to CAN converter for under $90.00 will do. The Sevcon Gen4 requires a specific $300.00 adapter made by IXXAT which has the required proprietary software libraries for the Sevcon to be happy. 

According to this Sevcon program setup document, the amount of configuration power gained by getting this thing is well worth the $300.00, so I called IXXAT directly (They're closeby in New Hampshire) and purchased one, and I got a small academic discount for doing this project through a student club (MITERS). Carla, their sales representative, was a great help and was able to send me one quckly. 


And here it is. Even came with a free pen! 


Okay. One side is a USB plug, the other is a D9 connector, which goes to the controller.


The manual it came with specifies these 3 wires from the male D9 connector. 


I found a female D9 connector lying around the shop, and soldered 3 leads to it at the appropriate pins. I also soldered a jumper from CAN Low to CAN Termination, necessary for the last device of a CAN bus. 


Here is the default screen of the Sevcon DVT Software. To acquire the software, I called technical support at Sevcon, and a specialist named Joseph was kind enough to send me access to the software, as well as offer some tips for getting the controller working. I would later contact him again to acquire an updated firmware for the controller and a parameter configuration file for the ME0907 motor. 

I later found out you can acquire the software by following the instructions on this forum post, but I believe the software is older and possibly outdated. And after calling up Sevcon they can send you a special download link for free, so there's no reason not to just call them up and get the latest software. 

So, once you got the software running, just follow these DVT instructions. You can see there's an area to change the baud rate for the CAN communication. 


After I set it to the proper baud rate, IT CAME TO LIFE! GREEN LIGHTS!



The controller started speaking, too!


By pressing the "H" Helper button at the top of the screen, I am able to modify controller parameters that pertain to function. The first thing to do is set the controller to Preoperational mode. That will turn off the contactor (if it isn't off already) and enable you to modify the internal settings. I first set up motor parameters based on the ME0907 datasheet, but there were so many parameters that I just left some as they were. 


By looking at the datasheet for the Kilovac EV200 contactor I am able to set the contactor pull and hold voltages. 


I set my throttle ranges using the specified instructions. 


And I am able to test them in the Status tab, and I can see the current perceived throttle voltage as I move the throttle. Cool! 

In addition, I went to the Input/Output tab (Where switch inputs like Forward and the Foot Switch and throttle configurations are determined) and ensured that the first selection was Left Wheel Drive (Joe from Sevcon let me know that is required for drive, in addition to a Forward, FS1, and Seat switch). 


So after doing ALL THAT and going operational, the following faults come up -_-. I played with some settings, and I'm not quite sure what exactly I did, frankly, but I got it to the following uncontrollable state: 

What's happening here is hardcore integrator windup in the controller's torque control system. I can modifythe P and I gains, but I really don't want to mess with them too much because I don't understand the internal transfer function of the controller. I'd rather just call up my friendly neighborhood Sevcon tech support specialist and see what he suggests. 




Joe, the technician who had originally sent me the DVT software was able to send me an updated firmware for the controller as well as a .DCF configuration file for the ME0907 motor. With this config file, I don't have to go about modifying every parameter, but I can load this default one (which includes proper P and I torque control gains) and modify smaller parameters as needed. Remember, while my motor is a little more powerful than the ME0907, it's roughly equivalent, and this will serve as a proper starting point. I'll tweak max current and other settings as needed, as well as later add regenerative braking. 

After flashing the updated firmware and sending the new .DCF file, the following awesomeness ensued: 



Sure, the motor is spinning in the opposite direction it should be, but that's only a matter of playing the sensor game. I have to either shift the sensor leads

And there you have it! In a nutshell, to use the Sevcon Gen 4, you must: 
  1. Have a Sevcon Gen 4, a brushless motor, a contactor, logic wire (18AWG), power wire (2AWG for 350A peak), and a power supply/battery pack
  2. RTFM
  3. Buy the right pin connectors
  4. Buy/rent an IXXAT USB to CAN Compact
  5. RTF other M
  6. Call Sevcon for the DVT software and motor configuration file
  7. Do some finagling, and win!

38 comments:

  1. Hi there
    Great article, loads of information.
    Any chance of a copy of your dcf to compare with mine?
    It would be useful to compare motor parameters too see any differences.
    Your welcome to a copy of mine also.

    Regards

    Charles

    ReplyDelete
    Replies
    1. No problem, I am going to upload my .DCF file soon as I have a chance to extract it from the Gen4, which is currently embedded in my motorcycle.(I have the stock ME0907 .DCF, but I tweaked it for my particular motor and setup.) I'll update this post once I get it off my Gen4.

      Delete
  2. OK, I give up. Why is the controller wrapped in foil tape?

    ReplyDelete
  3. Great document Daniel! Thank you very much!

    ReplyDelete
  4. Hello to everyone
    I own soon for a Sevcon Gen4 in 180A
    and a hub motor 3kw 72volts 900RPM
    I'd like to know if someone know how and where to find a function that allows for a self caracterization?
    this command will permit to have the characteristics of any engine!
    Any idea?
    thank you
    Laurent

    ReplyDelete
  5. Hi, could you send me the .DCF file I have a ME0907 sevcon gen4 system which is showing the same problem(11blinks, encoder problem). My email ID is gayamrahul@gmail.com

    thanks

    ReplyDelete
  6. Hi, could you send me the update file (dld) and config file (dcf) sevcon was sending to you too?
    I have some Problems with my controller and I hope this could fix it.
    Thanks
    free1985@arcor.de

    ReplyDelete
  7. Called Sevcon, they directed me to the vendor to obtain their software. Bummer. They're charging $900 for the software/adapter combo.

    ReplyDelete
  8. contact someone else at sevcon USA, i just bought the adapter for 350$ from them (in february)

    ReplyDelete
  9. Hello
    Needed: new firmware and. DCF file
    my mail lukyanovys.007 @ gmail.com

    ReplyDelete
  10. Hello.
    I need DVT software. Can you send me that?
    s.alperogan@hotmail.com
    Sevcon didn't response me

    ReplyDelete
  11. Hi, can someone send me a sample DCF file? No matter to what motor.
    Also, can i have the link to the DVT software plz?
    I didn't receive any reply from sevcon.
    Shanylazar@gmail.com
    Thanks

    ReplyDelete
    Replies
    1. https://dl.dropboxusercontent.com/u/69716067/Sevcon%20gen4/sevcon.rar

      Delete
    2. THANK YOU!!! this could mean the difference between walking and driving for me!!!

      Delete
  12. This comment has been removed by the author.

    ReplyDelete
  13. I finally got the IXXAT usb2can compact.
    Its working!
    I did a fimware upgrade, and play with it for a while.
    Now i have the dreaded 5044 error dyn range param error and 4f41 internal error...

    Anyone here solved this? I saw daniel did.

    Please send me some dld and dcf files so i can try
    To: shanylazar@gmail.com
    Thanks

    ReplyDelete
    Replies
    1. solved it buy receiving a new DCF file from my motor manufacturer... my 6kw scooter is the fastest in israel as of now 140kph on a sevcon gen4... thanks for all the help. couldn't do that without you guys..

      Delete
  14. what is the latest DVTsoftware version? Is any body have that?

    ReplyDelete
  15. Hi,

    Nice to see someone have success to connect Sevcon and motor! I have question if someone could help, I have Tyco EV200 and Allbright SW180 contactor 72V, with Tyco I have economizer on, I didnt figure why did you remove economizer, if it is because Sevcon send battery voltage to contactor coil then I can use Allbright instead Tyco?? If someone could help me I would priciate!!!

    ReplyDelete
  16. Good afternoon. Tell me where you can download the program Sevcon DVT Software ?
    E-mail - pazzls.jizn__gmail.com

    ReplyDelete
  17. Found! THANK YOU!
    Please delete my message. Thank you!

    ReplyDelete
  18. Error? http://vfl.ru/fotos/878e426c6614630.html

    [URL=http://vfl.ru/fotos/878e426c6614630.html][IMG]http://images.vfl.ru/ii/1413055190/878e426c/6614630_m.jpg[/IMG][/URL]

    ReplyDelete
  19. I would like to purchase or rent the Sevcon 35-pin AMPSeal connector and program for the Gen4 350A #634A83203
    2donwine@bellsouth.net

    ReplyDelete
  20. hi,
    thanks for your article.
    We was set a sevcon gen4 size 6 motor controller and driving a motor. We are connecting the controller with ixxat usb to can. We are receiving some CAN ID's but they are not meaningful. Are there a list to mean the CAN ID's?

    ReplyDelete
  21. Hi very nice article!
    I also have a Gen4 80V 350A with an me1012! Every time I wanted to switch from preop to op mode I get the same errors as you! Can you maybe send me the new firmware and also the dcf? I would be so lucky if you can help me maybe!

    sascha_dietzel@hotmail.com

    Ty allready!!!

    ReplyDelete
  22. Good day, I am happy to find your article! I have to launch the motor with Sevcon Gen4 80V 350A, and have these problems:
    I cant to make the line contactor to work? that is why I just put the gag though it.
    But I have two errors:5044 error dyn range param error and 4f41 internal error. I read that it is solved by receiving a new DCF file from my motor manufacturer. May you send me your version Sevcon DVT Software, and DVT config file please. My email is i.satskyi@gmail.com

    ReplyDelete
  23. Good day, I am happy to find your article! I have to launch the motor with Sevcon Gen4 80V 350A, and have these problems:
    I cant to make the line contactor to work? that is why I just put the gag though it.
    But I have two errors:5044 error dyn range param error and 4f41 internal error. I read that it is solved by receiving a new DCF file from my motor manufacturer. May you send me your version Sevcon DVT Software, and DVT config file please. My email is i.satskyi@gmail.com

    ReplyDelete
  24. I am working on the ME0907 motor, and have issues to drive it.
    Could you send me the DCF file and the DVT software if it is OK.
    Very appreciate that.
    My Email: Jeff@praesidium.net.au
    Thanks

    ReplyDelete
  25. Hi great article!!
    I have been searching who can I modify my parameters but I can´t find any support.
    I have some Problems with my controller Sevcon Gen4 with the same motor.
    Could you send me the update file (dld) and config file (dcf)?
    I would be very lucky.
    Email: timal.eduardo@gmail.com
    Thanks so much

    ReplyDelete
  26. Anyone have the me1012 and the Sevcon 80/350 that could please help?

    ReplyDelete
  27. I am just wondering if you have the battery +ve connected to the wrong side of the fuse. From the looks of the manual it should connect to the other side, otherwise you are bypassing it.

    ReplyDelete
  28. I need DVT software.Send me.
    quaintq@hotmail.com

    ReplyDelete
  29. Hi,
    great walkthrough! I would've lost faith in that SEVCON (Gen4 size2) Controller (or me) if it was'nt for this article ;). I have the exact same behavior of the motor that you showed in the first Video. Spinning up like crazy and than the SEVCON goes into "DSP Overvoltage" Error (LED blinks 3 times).

    Can you provide the DCF file (the dropbox link does not work anymore) you used for your ME0907 motor? I'm using a Goldenmotor HPM48-5000 though.

    Do you still have that firmware update? I think I might need it too to get this thing operational.

    ReplyDelete
  30. Looking for DVT Software and DCF for ME-0913 or similar motor if anyone thinks they have something.
    https://www.dropbox.com/request/Gz31NEUNHoLbd6VNR4ZY
    loganfellers@hotmail.com

    ReplyDelete
  31. Hi
    Very interesting
    I have same IXXAT but no suc6 with DVT
    Please reply to : Demeth@zeelandnet.nl


    ReplyDelete
  32. Hi,
    Very interesting article, liked it very much! I'm having problems in configurating the Sevcon Gen4 inverter. The only thing I need is the .eds file from the inverter. If anyone has it, could you please reply to the following e-mail: brunomt@id.uff.br

    ReplyDelete