# SEPEX/Open Revolt Hacking and REGEN



## Coulomb (Apr 22, 2009)

I don't get your design. Are you separately driving the field with PWM, and adding the same number of MOSFETs from M- to B+ as you have from M- to B-? If so, that might work, at the expense of more than twice the original number of MOSFETs, and making the field somewhat difficult to control. The other problem is that either the field or the armature, I think the armature, has very low inductance; the inductance may be too low to control the current effectively under all circumstances. The lower the inductance, the faster the current rises with time. You have to drive the upper armature MOSFETs with PWM (opposite in phase to the drive MOSFETs, and with appropriate dead time when neither conducts); just shorting out the armature (by turning on the regen MOSFETs with DC) is unlikely to work (too much regen, or too hard to control with the field).

If however you still have the armature and field in series, then it's not going to work (without some other tricks), since when the armature current reverses for regen, the field current will also reverse, and that will reverse the armature current again back to motor direction. You just can't reverse power flow in a standard series DC motor.

My understanding is that MOSFETs don't have reverse diodes, at least not explicit ones. However, MOSFETs seem to be quite capable of conducting with their source-drain voltage "round the wrong way" (as long as the gate-source voltage is still round the right way). So it's "as if" there was a diode across them, if you like, except I think the "diode" won't be there if the gate is turned off. Others more experienced with MOSFETs may care to correct me here, if needed.


----------



## green caveman (Oct 2, 2009)

Coulomb,

The ultimate target is one of the big GE motors. It's a SEPEX, not a series, motor, so the field and armature are always driven separately.

You're right in that I don't really have an innate feel for the relationship between those two currents. From a control system standpoint, you're kinda short an input. There are two controllable parameters (field and armature currents) and only one input (throttle) and the input is largely unrelated to the two parameters that need to be controlled, the acceleration and the speed.

In a gas, or Series Electric, the throttle translates to "power" (more or less). With Sepex, it doesn't seem quite so simple and a speed input would seem to be useful, but it seems a lot of sepex controllers run without that.

As I get deeper into this it's actually quite an interesting control problem. I can't test it all with the baby compound motor, but would hate to build a power board and then find it doesn't do regen.


----------



## toddshotrods (Feb 10, 2009)

Hey green, I'm in here, but very much a lightweight on input right now. FWIW, I have been thinking about trying to build a SepEx controller for Schism, based on Open Revolt architecture. I was thinking about a small Alltrax for the field, and maybe an Arduino board to integrate the two? Basically just something to control the 0-5v throttle input signal of the field controller, based on input from what's going on with the armature controller, vehicle speed, etc.

I have been loosely paying attention to the discussions on using a PWM DC motor controller as a fast charger, and thinking that it goes hand-in-hand with SepEx regen.

I don't really know what I'm doing/talking about, and have no time to learn it right now (as much as I would love to), so I have been waiting to get some reliable electronic/electrical interns to pursue the idea - every single one of them flaked out. My ME interns, however, are almost all kickazz, and one of the best of them switched to EE this (school) year, so there may be hope. He's coming back to the shop for Xmas break, I'll see if he wants to play with this idea.


----------



## green caveman (Oct 2, 2009)

Todd,

I started off with the idea of a couple of different controllers, but it's not a trivial path.

I don't have the electronics background to do much hardware hacking (hence dumb questions like this). Assuming that the answer to the "are these the right MOSFETs for regen" question is yes, then we can continue.

I'm hoping for copy/paste from the Open Revolt schematic. The control/driver board should work as is for the armature. 

I _think_ the Field controller is a replica of the Power board circuit and the MOSFET driver on the control board. You only need one (or two?) MOSFETs for 50A max, so it's buildable. I'm not sure if you need the flyback and the capacitor, but I hope that they won't do any harm if included.

The regen MOSFET control is a replica of the MOSFET drivers. I'm hoping that the diodes on the power board can be replaced with the MOSFETs directly with the gate no soldered to the board and wired separately.

Two suitable lines (one with PWM, one without) are available on the ISP connector, so are easy to pull off the board. Current sensor for the field needs an analog in and I'm toying with the idea of a counter for a tach. There are lines available on the chip, but it means soldering to the chip rather than a quick-attach to an existing connector.

Where this may all fall apart is noise, interference, capacitance, etc. etc. etc. associated with mixing low voltage and high voltage/current parts in close proximity. This is so far out of my area of expertise that I couldn't hope to even know the correct terminology or any steps I should be taking to minimize any future problems.

The rest is software, which, if I had any knowledge of how to control a sepex motor, would be much firmer ground.



toddshotrods said:


> He's coming back to the shop for Xmas break, I'll see if he wants to play with this idea.


I have a couple of tasks that would be easily manageable by an intern, so if he's up for it, please let me know. The biggest help would be to layout the MOSFET drivers (picture) from the Open Revolt schematic in a form that we can get them made into boards. Two drivers on a board.


----------



## major (Apr 4, 2008)

mechman600 had some success here: http://www.diyelectriccar.com/forums/showthread.php?t=81416

You might benefit from starting with a regen controller for a PM motor. It has constant flux and no need for a field controller. You can start low voltage low power and drive it with another motor to get the generation control working and then switch to a flywheel load to deal with transients. That would get the armature circuit developed.

Then get into the field controller. I suggest you read the manuals for the SepEx controllers from Curtis and Sevcon and see how they go about it. They all use a half bridge for the armature and a H bridge for the field, but use the field for reversing, so a simple chopper would suffice for the field in a non reversing application.


----------



## green caveman (Oct 2, 2009)

major said:


> mechman600 had some success here: http://www.diyelectriccar.com/forums/showthread.php?t=81416
> 
> You might benefit from starting with a regen controller for a PM motor. It has constant flux and no need for a field controller. You can start low voltage low power and drive it with another motor to get the generation control working and then switch to a flywheel load to deal with transients. That would get the armature circuit developed.





major said:


> They all use a half bridge for the armature and a H bridge for the field, but use the field for reversing, so a simple chopper would suffice for the field in a non reversing application.


At this point I have PWM control of the armature (that's just the standard Open Revolt) and I have PWM control of the field from the Open Revolt control board. Currently just an opto-isolator to a MOSFET, not the complete driver circuit.

Since the car has reverse, I'm with you that I see no point in the H-Bridge, so the field is just a chopper (straight copy from the Open Revolt power board). 

The change to the Open Revolt power board is to replace the flyback diodes with more MOSFETs to complete the half bridge. These I also currently have control of from the control board in the breadboarded system.

"Control" is a little optimistic. I disabled all the sensors because nothing I have is small enough for the baby compound motor. I can change the field and armature currents (PWM signals) manually, and close/open the MOSFETs on the half-bridge based on whether power is commanded to the Armature. 

All is well, the motor goes forward and changes to either the armature or the field affect the motor behavior.

Plan is to drive the motor with a drill to simulate regen, but at the minute I don't have any small enough current sensors to do anything useful in this regard.



major said:


> Then get into the field controller. I suggest you read the manuals for the SepEx controllers from Curtis and Sevcon and see how they go about it.


Good plan. I'll see what I can figure out from there.

The control is interesting because of the relationship (that I only understand in the broadest terms) between the field and armature currents/motor load as related to the speed and throttle.

Put another way, for a Series motor, the throttle position relates pretty much directly to the power output. However, for Sepex, if I understand correctly, lots of throttle at low speed means lots of field and armature, at high speed, it means less field and so a different armature current, so, it seems to me that the armature current is not directly related to the throttle position - there's a field factor there somewhere.

I have some time to figure this out while we collect parts for the power board.

Do you have any opinion on whether the N-MOSFETs are correct for the half-bridge configuration in the first diagram?


----------



## major (Apr 4, 2008)

green caveman said:


> Do you have any opinion on whether the N-MOSFETs are correct for the half-bridge configuration in the first diagram?


This is how it is typically drawn.










Also, check out: http://homepages.which.net/~paul.hills/SpeedControl/SpeedControllersBody.html


----------



## green caveman (Oct 2, 2009)

major said:


> Then get into the field controller. I suggest you read the manuals for the SepEx controllers from Curtis and Sevcon and see how they go about it.





sevcon manual said:


> The controller software uses the graph by measuring the Armature current, feeding it through the graph to obtain a target Field current.


Curtis manual says a similar thing. 

Is that really the primary control mechanism? Feed the armature based on the throttle, increase the field current as the armature current increases according to a (mostly linear) graph?

And I get to the FieldCurrent/ArmatureCurrent map from the FieldCurrent/ArmatureVoltage graph in accordance with this thread. Plus/minus things I have no easy way to measure. Well, maybe. Do I need a variac, or just an AC source and a pure known resistor (no impedance) to measure the current. A 12V 0.5A AC power supply should be manageable (or 24VAC). 12V DC and enough amps should be available.

Lots of good parameters in the Curtis manual. Downhill, it would be cool to have "constant speed" - adjust the regen (within limits) to maintain the speed.


----------



## toddshotrods (Feb 10, 2009)

green caveman said:


> ...I have a couple of tasks that would be easily manageable by an intern, so if he's up for it, please let me know. The biggest help would be to layout the MOSFET drivers (picture) from the Open Revolt schematic in a form that we can get them made into boards. Two drivers on a board.


I will see. The intern I mentioned is scheduled to come in tomorrow, but I'm not sure where he is in the electrical side of engineering. When he was here before he was a freshman ME, and hadn't really touched any real engineering courses yet. I don't know if the switch delayed the start of electrical engineering related courses, whether or not he has taken any active interest on his own, etc.

I used to have an ad running for EEs, but didn't post it this time because of previous (lack of) results. I will post a new ad for them tomorrow, and see if I can get any bites. I also have an ME that develops her own electrical components, to support her mechanical contraptions, and even writes code for them, but I need her elsewhere right now. It's a numbers games for me. If I can get enough of them on the roster, I can play with more things simultaneously.


----------



## green caveman (Oct 2, 2009)

I ordered some small hall sensors and most of the components to build up the power board (actually 2, I'm thinking of replacing the EV-1 in the Electravan).

The power components won't be here until the New Year. With luck, I'll have a chance to incorporate the hall sensors into the test bed before then. That's assuming that the ones I ordered will actually measure the tiny current associated with that motor. I have no feeling for Gauss to Amps in a copper wire.



toddshotrods said:


> I will see. The intern I mentioned is scheduled to come in tomorrow, but I'm not sure where he is in the electrical side of engineering.


If you have someone who's more into heavy electrical measuring/calculating the field map_:

_


green caveman said:


> And I get to the FieldCurrent/ArmatureCurrent map from the FieldCurrent/ArmatureVoltage graph in accordance with this thread.


 Might be interesting. Basically, you have to measure the inductance of the armature, and Major has a method for it in the linked thread.

So many fun projects (and I'll bet you have others), so little time to work on them!


----------



## toddshotrods (Feb 10, 2009)

green caveman said:


> ...If you have someone who's more into heavy electrical measuring/calculating the field map_..._
> 
> ...So many fun projects (and I'll bet you have others), so little time to work on them!


I didn't really get a chance to discuss this with Evan yet. He was busy with some steel fab we need to get done and I was preoccupied with issues with machining and casting. Now, it's Christmas time so I'll pick up on the idea later in the week...


----------



## green caveman (Oct 2, 2009)

Awakening a sleeping project...

I have an Open Revolt control board built and two MOSFET driver boards (complete with space for an Allegro sensor).

Here is the most comprehensible description of regen that I've seen. Just because it's comprehensible doesn't mean that it's correct, so if someone would like to comment on it, please feel free.

There's good stuff here also. It's possible to get two complementary PWMs with the same frequency from the Atmel in the Open Revolt (to control the high and low together), but it's not easy to bring it out electrically, so my plan is to control the low-side and hope that the diode in the high-side will work for the regen current. Since I won't really know the answer to this until I hook it up to a big motor, any observations as to the likely success of this approach would be appreciated. Mostly it solves the problem of shoot-through since the high-side is never actually open (then again, maybe it doesn't since the reverse recovery time of the IRFP4668 in the controller is 130ns and the turn on/turn off time is about that).

Next step is to bread-board it all with my little compound motor. With a little luck, some of the tiny current sensors will be in the right range to give me some real feedback.


----------



## green caveman (Oct 2, 2009)

New Schematic attached - no boards yet ordered. This daughter board replaces the processor and the U6 opto-isolator on the open-revolt controller board. This makes it easy to add and allows the use of the same PWM timer for the high and low. It's really impractical to add the connections by soldering to the open-revolt control board, although the little boards were useful for some preliminary testing.

I'm still planning to use the existing power board, but I'm concerned that the wiring to the low-side MOSFETs will be too long and don't really see any way to shorten that.

Regen control is bothering me because you have two parameters - PWM frequency and field current - controlling only one output - the regen current.


----------



## green caveman (Oct 2, 2009)

SEPEX daughter board installed. So far untested, except that the orange light blinks, so the processor, which is now on the daughter board, is running.


----------

