AC drive programming and pedal mapping

AC, DC, amps, volts and kilowatt. It's all discussed in here
User avatar
weber
Site Admin
Posts: 2626
Joined: Fri, 23 Jan 2009, 17:27
Real Name: Dave Keenan
Location: Brisbane
Contact:

AC drive programming and pedal mapping

Post by weber » Fri, 19 Mar 2010, 19:38

Back in May 2009 in
viewtopic.php?keywords=pink&t=585&p=13386#p13386
I mentioned that Ross Pink (Brisbane) had sucessfully programmed a variable frequency drive (Industrial AC induction-motor controller) to do automatic star-delta switching on the fly.

This is beneficial when your starting and low-speed torque is limited by the drive's current capability, particularly in a direct-drive (i.e. no gearbox) conversion. In this drive-current-limited situation, it's like having a two speed automatic gearbox with a sqrt(3) ratio.

Not only did he solve that problem, he also implemented a natural-feeling accellerator response. It was so natural that when I drove it I completely failed to appreciate the trouble he'd gone to to achieve it. But other Industrial AC gurus like acmotor and a4x4kiwi would appreciate what this means, compared to plain torque control or plain speed control.

It was because of this that Coulomb and I decided to use the same brand of VFD, a Control Techniques Unidrive SP with its optional Applications programming module that lets you write your own control loops.
http://www.controltechniques.com/CTcom/ ... loads.aspx

Ross sent me documentation and source-code for his method back then, and gave me permission to post it, so I must apologise for taking so long to get around to it. However the work I had to do to satify this forum's limitations on what you can upload (file types and sizes) makes me think I must have known something back then. Why one can't upload .txt files I don't know.

The source-code is of course specific to the Control Techniques drives, but the principles Ross has given in his description and schematic would be applicable to any drive that lets you write your own control loops. I note that the schematic contains what looks like electronic circuits, but these represent the way the software functions rather than any actual hardware.

Description
Source-code (tabs = 5)
Schematic

Image

Now Ross is working with us to (hopefully) add the ability to use the drive as a battery charger off single phase mains (without having to spin the motor).

[Edit: Changed thread title from "Industrial AC drive programming" to "AC drive programming and pedal mapping".]
Last edited by weber on Sun, 02 Jan 2011, 06:48, edited 1 time in total.
One of the fathers of MeXy the electric MX-5, along with Coulomb and Newton (Jeff Owen).

Tritium_James
Senior Member
Posts: 683
Joined: Wed, 04 Mar 2009, 17:15
Real Name: James Kennedy
Contact:

AC drive programming and pedal mapping

Post by Tritium_James » Fri, 19 Mar 2010, 19:56

Wow, that looks really complicated - too much so! Why not just control torque directly? The accelerator pedal position in a normal car is very, very close to that already.

We have a direct map between pedal position and motor current (ie torque) in both the Porsche (Induction motor) and the Civic (BLDC) and they both feel entirely 'normal'.

User avatar
Johny
Senior Member
Posts: 3729
Joined: Mon, 23 Jun 2008, 16:26
Real Name: John Wright
Location: Melbourne
Contact:

AC drive programming and pedal mapping

Post by Johny » Fri, 19 Mar 2010, 19:58

Curiously, being a embedded system's software developer, I am implemeting my throttle interpreter in hardware.
My VFD has speed and torque inputs. The accelerator is from an Audi or VW Golf and provides 0.7 to 4.7 VCD output. The circuit gives me 0-8V on both speed and torque outputs so I can not exceed the magic 10 VDC that the VFD can handle. (I will make each I/P have again of 1.25.)

This graph show what I want. I can fiddle the "coast" area the be smaller (the dip in the purple line) when it's going.
Image

And the circuit mainly using a quad op-amp. I'm building it on a 50x75mm veroboard. I have actually put trim pots in series with some components to trim brake and acceleration onset.
Image

So if your VFD can't do fancy stuff let me know.
BTW Once I get a handle on mine I think I can do this with function blocks but I wanted something initially that was absolutely a sure thing and could be verified outside the scope of the VFD.

Edit: Much later edit 23/11/2011. I never did implement this in hardware. By the time I was ready for it I knew the VFD well enough to do it internally. All setpoints are programmable plus it has some BMS tie-ins to remove regen braking if a battery packs spits a high-voltage error.
Last edited by Johny on Wed, 23 Nov 2011, 11:01, edited 1 time in total.

User avatar
weber
Site Admin
Posts: 2626
Joined: Fri, 23 Jan 2009, 17:27
Real Name: Dave Keenan
Location: Brisbane
Contact:

AC drive programming and pedal mapping

Post by weber » Fri, 19 Mar 2010, 20:15

Tritium_James wrote: Wow, that looks really complicated - too much so! Why not just control torque directly? The accelerator pedal position in a normal car is very, very close to that already.

We have a direct map between pedal position and motor current (ie torque) in both the Porsche (Induction motor) and the Civic (BLDC) and they both feel entirely 'normal'.

I don't understand that. How could you have regen that corresponds to engine braking, without having the zero-torque point of the accellerator pedal change with motor speed?

At zero speed you want zero torque to correspond to foot-off. At some middle speed you want zero torque to correspond to some middle accellerator position, with lower gain for reverse torques than for forward torques.
[Edit: Added clarification]
Last edited by weber on Fri, 19 Mar 2010, 09:34, edited 1 time in total.
One of the fathers of MeXy the electric MX-5, along with Coulomb and Newton (Jeff Owen).

User avatar
weber
Site Admin
Posts: 2626
Joined: Fri, 23 Jan 2009, 17:27
Real Name: Dave Keenan
Location: Brisbane
Contact:

AC drive programming and pedal mapping

Post by weber » Fri, 19 Mar 2010, 20:45

Johny wrote: Curiously, being a embedded system's software developer, I am implemeting my throttle interpreter in hardware.

Cool. Yeah, no reason why something like Ross's schematic coudn't be implemented in actual analog hardware.

I notice you are trying to do it without any feedback of the motor's actual speed or torque (or active current), so I don't understand how it can give the "moving zero" of torque that an ICE has, as described above.
One of the fathers of MeXy the electric MX-5, along with Coulomb and Newton (Jeff Owen).

User avatar
woody
Senior Member
Posts: 1715
Joined: Sat, 21 Jun 2008, 02:03
Real Name: Anthony Wood
Location: Mt Colah

AC drive programming and pedal mapping

Post by woody » Fri, 19 Mar 2010, 20:49

weber wrote: I don't understand that. How could you have regen that corresponds to engine braking, without having the zero-torque point of the accellerator pedal change with motor speed?

At zero speed you want zero torque to correspond to foot-off. At some middle speed you want zero torque to correspond to some middle accellerator position, with lower gain for reverse torques than for forward torques.
Mostly you don't want to be applying reverse torque when the car is stopped, unless reverse is selected :-)

Perhaps James has a "don't go backwards" rule in his logic too?
Planned EV: '63 Cortina using AC and LiFePO4 Battery Pack

User avatar
weber
Site Admin
Posts: 2626
Joined: Fri, 23 Jan 2009, 17:27
Real Name: Dave Keenan
Location: Brisbane
Contact:

AC drive programming and pedal mapping

Post by weber » Fri, 19 Mar 2010, 21:21

woody wrote:Mostly you don't want to be applying reverse torque when the car is stopped, unless reverse is selected :-)

Perhaps James has a "don't go backwards" rule in his logic too?
Ah. Thanks Woody. Now I understand that's exactly what Johny is doing with his circuit.

Or maybe James doesn't have any accelerator-backoff regen, and finds that to be natural.

I guess I shouldn't have used the word "natural". Almost anything can come to feel natural after you've been using it for long enough. What I mean is "familiar to most drivers", in other words "ICE-like".

I don't think anything with a fixed zero-torque position is going to feel familiar to someone who has just stepped out of an ICE vehicle. To me, this is a safety issue.
One of the fathers of MeXy the electric MX-5, along with Coulomb and Newton (Jeff Owen).

Tritium_James
Senior Member
Posts: 683
Joined: Wed, 04 Mar 2009, 17:15
Real Name: James Kennedy
Contact:

AC drive programming and pedal mapping

Post by Tritium_James » Fri, 19 Mar 2010, 21:26

Weber:
In the civic regen is activated on the brake pedal.

Yes, you're right though, in the Porsche there is a component of speed feedback. It's a bit hard to describe in words, but I'll give it a go.

There are three relevant points with speed: 0, 0-10km/h, >10km/h

At 0, the pedal is a direct map for position -> motor current. There is no regen.

At >10km/h, the mapping is:
pedal fully up (foot off) = max regen, ie -ve motor current
pedal about 1/3 of the way down = 0 motor current
pedal floored = max drive

Between 0 and 10km/h, the point where the motor current is 0 gradually moves from pedal up to about 1/3 of the way down the travel.

There is no speed dependent component to 'max drive' or 'max regen'.

Woody:
"Don't go backwards" is already covered in our motor controller / inverter. You send it a CAN packet containing a target motor current and a target velocity. So to drive like a normal car, you'd send velocity = something unobtainable (eg 200km/h) so that the velocity loop doesn't kick in, and current = pedal position. To regen you'd send velocity = 0 and current = some complex function of pedal position :) To do cruise control, you'd send velocity = target speed and motor current = something proportional to how aggressive you want it.

User avatar
Johny
Senior Member
Posts: 3729
Joined: Mon, 23 Jun 2008, 16:26
Real Name: John Wright
Location: Melbourne
Contact:

AC drive programming and pedal mapping

Post by Johny » Fri, 19 Mar 2010, 21:28

At about 20% accel down nothing happens. No torque demand, speed = 0.
Foot down further, speed demand jumps to flat out and torque demand gradually increases with pedal position.
Back to 20% position then foot up slightly, speed demand is 0RPM and torque demand gradually increases causing regen. braking.
Forward/Reverse is CW/CCW on a digital input.

I'll be experimenting with the "dead" or "coast" zone to see how wide it has to be. The final has it narrower than shown.
The Honda Jazz CVT control appears to not have coast zone at all and it's annoying.

Squiggles
Senior Member
Posts: 742
Joined: Wed, 22 Apr 2009, 03:19
Real Name: Neil
Location: Newcastle NSW

AC drive programming and pedal mapping

Post by Squiggles » Fri, 19 Mar 2010, 21:32

Here is a dumb question.
Are you guys talking about simulating engine breaking when the accelerator pedal is released?

Tritium_James
Senior Member
Posts: 683
Joined: Wed, 04 Mar 2009, 17:15
Real Name: James Kennedy
Contact:

AC drive programming and pedal mapping

Post by Tritium_James » Fri, 19 Mar 2010, 21:34

Yes.

User avatar
Johny
Senior Member
Posts: 3729
Joined: Mon, 23 Jun 2008, 16:26
Real Name: John Wright
Location: Melbourne
Contact:

AC drive programming and pedal mapping

Post by Johny » Fri, 19 Mar 2010, 21:34

Yes

Squiggles
Senior Member
Posts: 742
Joined: Wed, 22 Apr 2009, 03:19
Real Name: Neil
Location: Newcastle NSW

AC drive programming and pedal mapping

Post by Squiggles » Fri, 19 Mar 2010, 21:35

Snap!

User avatar
Johny
Senior Member
Posts: 3729
Joined: Mon, 23 Jun 2008, 16:26
Real Name: John Wright
Location: Melbourne
Contact:

AC drive programming and pedal mapping

Post by Johny » Fri, 19 Mar 2010, 21:36

TJ only beat me because he was closer to the person who asked the question. (Speed of light and all that!)

Squiggles
Senior Member
Posts: 742
Joined: Wed, 22 Apr 2009, 03:19
Real Name: Neil
Location: Newcastle NSW

AC drive programming and pedal mapping

Post by Squiggles » Fri, 19 Mar 2010, 21:36

Actually it is interesting, I have wondered if it is necessary at all.
There is a brake pedal after all. What is wrong with coasting?

edit:dyslexia!
Last edited by Squiggles on Fri, 19 Mar 2010, 10:37, edited 1 time in total.

Tritium_James
Senior Member
Posts: 683
Joined: Wed, 04 Mar 2009, 17:15
Real Name: James Kennedy
Contact:

AC drive programming and pedal mapping

Post by Tritium_James » Fri, 19 Mar 2010, 21:40

I even typed a whole extra character too.

I'd say the setup in the Porsche is close to perfect, apart from that it has no deadband around 0, which does make it hard to coast. It's all implemented with analog circuitry in the AC Propulsion controller, so a little difficult to adjust :)

Johny, I think there's a bit of an issue with the mapping you've drawn, in that when you're stopped, you'll get 1/4 of a pedal movement with no response from the car. This is going to be really disconcerting to a person who hasn't gotten used to it.

Squiggles
Senior Member
Posts: 742
Joined: Wed, 22 Apr 2009, 03:19
Real Name: Neil
Location: Newcastle NSW

AC drive programming and pedal mapping

Post by Squiggles » Fri, 19 Mar 2010, 21:40

What happens in DC conversions with series wound motors with no regen?

User avatar
Johny
Senior Member
Posts: 3729
Joined: Mon, 23 Jun 2008, 16:26
Real Name: John Wright
Location: Melbourne
Contact:

AC drive programming and pedal mapping

Post by Johny » Fri, 19 Mar 2010, 21:42

You coast with foot off. Hard on the old brakes at high speed but similar to an auto at lower speed.

Tritium_James
Senior Member
Posts: 683
Joined: Wed, 04 Mar 2009, 17:15
Real Name: James Kennedy
Contact:

AC drive programming and pedal mapping

Post by Tritium_James » Fri, 19 Mar 2010, 21:43

Squiggles wrote: What happens in DC conversions with series wound motors with no regen?
They don't get to experience the huge fun of driving a car with lightning-fast response and transition between driving and braking, all on the one pedal. It is seriously cool.

Full regen in the Porsche is quite strong, and I can easily do my commute to work in it without touching the brake pedal. Cornering is great, you get a perfectly smooth transition to braking as you approach, and then another smooth transition back to drive as you exit. It's great.

User avatar
Johny
Senior Member
Posts: 3729
Joined: Mon, 23 Jun 2008, 16:26
Real Name: John Wright
Location: Melbourne
Contact:

AC drive programming and pedal mapping

Post by Johny » Fri, 19 Mar 2010, 21:49

Tritium_James wrote:Johny, I think there's a bit of an issue with the mapping you've drawn, in that when you're stopped, you'll get 1/4 of a pedal movement with no response from the car. This is going to be really disconcerting to a person who hasn't gotten used to it.
Yes, I had thought about that. I have moved it back a bit and I'm hoping it won't be too noticable. When you think about it, that's what is going to happen at 10, 30, 60km/hr as well as from stationary (dead zone in same pedal pos. regardless of speed) so it may well be very easy to get used to. The coast zone with the Jazz varies with speed and, as I've said, it's annoying. Point taken though. Every time I try to rework it for a 0-100% pedal system I come up with something like you have in the Porche and I'm just not sure about wanting that... (also means no op-amp, PIC instead and I'd need speed input).
Here is the one I settled on. Close to about 12% pedal.
Image

Tritium_James
Senior Member
Posts: 683
Joined: Wed, 04 Mar 2009, 17:15
Real Name: James Kennedy
Contact:

AC drive programming and pedal mapping

Post by Tritium_James » Fri, 19 Mar 2010, 22:17

Sorry Weber, I didn't mean to jump all over your topic like I did!

What language is that software written in? What decides when those various routines get called, I can't see anything that ties it all together?

Squiggles
Senior Member
Posts: 742
Joined: Wed, 22 Apr 2009, 03:19
Real Name: Neil
Location: Newcastle NSW

AC drive programming and pedal mapping

Post by Squiggles » Fri, 19 Mar 2010, 23:12

Tritium_James wrote:
Squiggles wrote: What happens in DC conversions with series wound motors with no regen?
They don't get to experience the huge fun of driving a car with lightning-fast response and transition between driving and braking, all on the one pedal. It is seriously cool.

Full regen in the Porsche is quite strong, and I can easily do my commute to work in it without touching the brake pedal. Cornering is great, you get a perfectly smooth transition to braking as you approach, and then another smooth transition back to drive as you exit. It's great.
I read somewhere where a guy in the US had a set up like that, problem was that he was on a freeway, got distracted, lifted his foot off the pedal, instantly into full braking in heavy traffic. He decided it was not so good! From memory he was in a BMW conversion.

User avatar
weber
Site Admin
Posts: 2626
Joined: Fri, 23 Jan 2009, 17:27
Real Name: Dave Keenan
Location: Brisbane
Contact:

AC drive programming and pedal mapping

Post by weber » Fri, 19 Mar 2010, 23:15

Tritium_James wrote: Sorry Weber, I didn't mean to jump all over your topic like I did!
No apology necessary. I thought it was exactly the sort of discussion we needed. I envisage this thread being for discussion of anything relating to setting VF-drive parameters for EV use, whether in real-time control-loops or just once-of manually.

I take it you don't think it is too complicated now. Particularly when you read the description and realise that only the upper 1/3rd of the diagram relates to giving a smoothly familiar accelerator response. The rest relates to the auto star-delta changeover, protecting the batteries from overcurrent, and from overvoltage on regen, and protecting the motor from overtemperature.

I note that this ICE-like engine-braking response can be implemented in two different ways:

1. You can treat the accelerator as a torque input and subtract a constant times the motor speed from it to generate the actual torque setpoint for the drive. This is how we've been talking about it so far in this thread. Or

2. you can treat the accelerator as a speed input and subtract a constant times the motor torque from it to generate the actual speed setpoint for the drive. This is how Ross does it.

This corresponds to the Thevenin/Norton equivalence of real voltage and current sources.

So Johny, you may be able to do it with op-amps even if your drive won't give you an analog output proportional to speed, since current can be used as a proxy for torque and this could be measured with a shunt or Hall-effect sensor at the input to the drive.
What language is that software written in? What decides when those various routines get called, I can't see anything that ties it all together?

Control Techniques call it DPL (for Drive Programming Language). Anything of the form #xx.xx, where the x's are decimal digits, is a drive parameter whose meaning can be found in the "Unidrive SP Size 0 - 6 User Guide". I think the language is described in the "SM-Applications Modules User Guide". Both of these can be downloaded from
http://www.controltechniques.com/CTcom/ ... loads.aspx

It is multitasking. I think basically you write tasks that read and write drive parameters and tell it how often you want each task to run, synchronised to the drive's basic cycle time. Sadly it gives no control over individual half-bridges, as we'd like it to for single-phase charging. The lowest level of control is motor voltage and frequency.
[Edit: Formatting and "tasks" plural]
Last edited by weber on Fri, 19 Mar 2010, 12:22, edited 1 time in total.
One of the fathers of MeXy the electric MX-5, along with Coulomb and Newton (Jeff Owen).

User avatar
weber
Site Admin
Posts: 2626
Joined: Fri, 23 Jan 2009, 17:27
Real Name: Dave Keenan
Location: Brisbane
Contact:

AC drive programming and pedal mapping

Post by weber » Sat, 20 Mar 2010, 00:16

Squiggles wrote:I read somewhere where a guy in the US had a set up like that, problem was that he was on a freeway, got distracted, lifted his foot off the pedal, instantly into full braking in heavy traffic. He decided it was not so good! From memory he was in a BMW conversion.
That guy was probably a total moron.

He says so himself, as you can read here:
http://www.metricmind.com/audi/10-shifter.htm

That is certainly a moronic way to implement accelerator backoff regen. What we are talking about is how to _not_ do it that way! But how to do it properly so it feels like any other car you've ever driven. Zero torque should not be fixed at the middle accelerator position, and max regen torque should be set much lower than max drive torque. But there's an argument for letting drivers crank that up as they get more experience with it.
One of the fathers of MeXy the electric MX-5, along with Coulomb and Newton (Jeff Owen).

Tritium_James
Senior Member
Posts: 683
Joined: Wed, 04 Mar 2009, 17:15
Real Name: James Kennedy
Contact:

AC drive programming and pedal mapping

Post by Tritium_James » Sat, 20 Mar 2010, 00:37

Weber, I still think it's complicated! But yes, it's not as bad as I first thought - when I looked at it and thought "all that to do the pedal control?" then it's fairly nuts. But yes, if it's also got all those other things in there too it's not too bad.

OTOH, apart from the auto star-delta changeover, all those other items (temp limits, battery voltages and currents, etc) our controller does by itself already, so I mentally didn't expect them to be done by the 'driver controls' interface.

Post Reply