Another homebrew AC-controller - Page 51 - DIY Electric Car Forums
Go Back  

DIY Electric Car Forums > EV Conversions and Builds > Controllers

Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #501  
Old 10-11-2014, 12:12 AM
jhuebner's Avatar
jhuebner jhuebner is offline
Senior Member
 
Join Date: Apr 2010
Location: Germany
Posts: 669
jhuebner is on a distinguished road
Default Re: Another homebrew AC-controller

I have done an experimental speed controller. I'm away from my lab right now so I couldn't test it.

Here is what I changed:

param_prj.h:
Code:
    PARAM_ENTRY(idlespeed,   "rpm",     -100,   1000,   -100,   52  ) \
    PARAM_ENTRY(idlekp,      "",        0,      100,    1,      53  ) \
stm32_sine.c CalcAmpAndSlip:
Code:
   int idlespeed = parm_GetInt(PARAM_idlespeed);
   int speed = Encoder::GetSpeed();
   int speederr = idlespeed - speed;
   s32fp idlekp = parm_Get(PARAM_idlekp);
   s32fp potreg = MIN(FP_FROMINT(50), idlekp * speederr);
   s32fp potnom = MAX(potreg, parm_Get(VALUE_potnom));
So its a simple P-controller. It can assert a maximum of 50% throttle. As soon as the speed drops below idlespeed the controller will output a value that is larger than the current pot value and thus take over. The default value will always output a very negative pot value and therefor essentially disable the controller. potnom is no longer modified globally so the start inhibit logic will work.
The controller is configured by idlekp. Set it to a value that does not oscillate.

I left the newline unchanged for now.
You can download the binary here: http://johanneshuebner.com/stuff/stm32_sine_2.71.bin

Last edited by jhuebner; 10-11-2014 at 12:19 AM.
Reply With Quote
Sponsored Links
Advertisement
 
  #502  
Old 10-11-2014, 04:23 AM
jackbauer's Avatar
jackbauer jackbauer is offline
Senior Member
 
Join Date: Jan 2008
Location: Ireland
Posts: 1,571
jackbauer is on a distinguished road
Default Re: Another homebrew AC-controller

It works
__________________
Now, Cole, when you shift the gear and that little needle on the ammeter goes into the red and reads 1000 Amps, that's bad.
www.evbmw.com
www.e39ev.com
Reply With Quote
  #503  
Old 10-11-2014, 08:55 AM
dcb dcb is offline
Senior Member
 
Join Date: Dec 2009
Posts: 1,869
dcb is on a distinguished road
Default Re: Another homebrew AC-controller

yah but he cheated If he ever starts FOCing around then idle will have to be re-implemented. But working is good too!

I don't know, but I'm not sure it is technically a P-controller if it doesn't remember some more information about previous errors/adjustments, I think idlekp goes under the heading of fudge factor

P Proportional Band = 100/gain
I Integral = 1/reset
D Derivative = rate = pre-ac


Disregard, you did say P-controller (not PID), never knew all my fudge factors had a fancy name
http://www.controlguru.com/wp/p62.html

Last edited by dcb; 10-11-2014 at 12:40 PM.
Reply With Quote
 
  #504  
Old 10-11-2014, 01:08 PM
jhuebner's Avatar
jhuebner jhuebner is offline
Senior Member
 
Join Date: Apr 2010
Location: Germany
Posts: 669
jhuebner is on a distinguished road
Default Re: Another homebrew AC-controller

Yep, don't do PID if P does the job

Good to hear it works without prior testing
Reply With Quote
  #505  
Old 10-12-2014, 03:14 AM
jackbauer's Avatar
jackbauer jackbauer is offline
Senior Member
 
Join Date: Jan 2008
Location: Ireland
Posts: 1,571
jackbauer is on a distinguished road
Default Re: Another homebrew AC-controller

Not sure if it saved the idle speed value. did a quick test yesterday evening and it didnt idle when powered up. Will check today and report back. Have some video on the way also.
__________________
Now, Cole, when you shift the gear and that little needle on the ammeter goes into the red and reads 1000 Amps, that's bad.
www.evbmw.com
www.e39ev.com
Reply With Quote
  #506  
Old 10-12-2014, 03:53 AM
Tony Bogs Tony Bogs is offline
Senior Member
 
Join Date: Apr 2014
Posts: 323
Tony Bogs is on a distinguished road
Default Re: Another homebrew AC-controller

Finally, speed control! That's more like it.

I disagree on Arduino. The Arduino Due has an Atmel ARM chip on board with all the major hardware goodies needed for an EV controller: sophisticated DMA, multi phase PWM with H/W protection, timers, it's all there.
The top Arduino software layer, that most engineers despise, is really very thin. Below it is a complete open source C/C++ ARM software framework.

And then there is the UDOO board www.udoo.org. It is a Ubuntu / Android mini PC combined with an Arduino Due on a single PCB.
Isn't it a ideal combination for a development system with a local PHP web interface?

Porting the software may take some effort. It's not that well documented.
But on the other hand, it also provides a great opportunity for speed control review, modification and reorganization.

Speed control. I like it.
Reply With Quote
  #507  
Old 10-12-2014, 07:54 AM
dcb dcb is offline
Senior Member
 
Join Date: Dec 2009
Posts: 1,869
dcb is on a distinguished road
Default Re: Another homebrew AC-controller

I'm glad to see atmel catching up in the ARM department, but there are good reasons why engineering types don't like arduino for serious development.

But as far as doing web-style development on an android that talks to a microcontroller, that might be better served with a simple bluetooth/local port proxy. The php side isn't so interesting that interesting that it would be terribly missed, yet all the javascript functionality (graphing) can be retained.

That udoo is kinda ridiculous. Just need an apk or a jar file that is packaged nicely and a $5 bluetooth adapter (done).

You want to pull it into arduino, other folks want to pull it into mapleleaf, others want PIC, St has their own online arduino (on steroids) ide which plays with their neutrino...

I think you are at the point where you simply don't wanna learn a new toolchain, been there. But force yourself to get through it and make some binaries and you'll feel better, trust me, it is liberating. You won't feel like an arduino hostage come minion anymore, single-system-itis sucks.

http://www.diyelectriccar.com/forums...tes#post478826

Last edited by dcb; 10-12-2014 at 07:57 AM.
Reply With Quote
  #508  
Old 10-12-2014, 08:05 AM
Tony Bogs Tony Bogs is offline
Senior Member
 
Join Date: Apr 2014
Posts: 323
Tony Bogs is on a distinguished road
Default Re: Another homebrew AC-controller

Sure, for me no STM32/ bluetooth for development or torque control for normal driving.

Also, no IGBTs anymore.

Recently Cree presented this SiC mosfet module as a replacement for IGBT:
http://www.cree.com/Power/Landing-pa...lfbridgemodule

It can handle up to 1500A, limited bij the juction temperature.
Translates to up to 200 microsecs at 25 degrees C case.

Specified potential 183 kW at 850Vdc, 3phase, pf=0.98, 15 kHz, air cooled. Check it out.

Only negative point so far:
The gate requires +20/-5V voltage converter. But that's an easy fix.
Reply With Quote
  #509  
Old 10-12-2014, 08:11 AM
Tony Bogs Tony Bogs is offline
Senior Member
 
Join Date: Apr 2014
Posts: 323
Tony Bogs is on a distinguished road
Default Re: Another homebrew AC-controller

O, and by the way, I'm an engineering type.
Reply With Quote
  #510  
Old 10-12-2014, 10:16 AM
dcb dcb is offline
Senior Member
 
Join Date: Dec 2009
Posts: 1,869
dcb is on a distinguished road
Default Re: Another homebrew AC-controller

if you have the budget for brand spanking new cas300m12b2s then go for it. You probably don't need a diy controller in that case.

Not sure what you have against stm except unfamiliarity or some other agenda though, the speculative returns (kumbaya?) on the effort on porting it are hardly convincing though, and it isn't clear who does the porting and who gets the "benefits", or that all the cons of porting are even remotely being considered.
Reply With Quote
Reply

Share or Bookmark this

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

 
Support DIY Electric Car
Sponsors

All times are GMT -6. The time now is 10:22 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Ad Management by RedTyger