05-20-2009, 05:44 PM
|
#1331 (permalink)
|
Master EcoModder
Join Date: Jun 2008
Location: London, Ontario
Posts: 1,096
Thanks: 0
Thanked 17 Times in 14 Posts
|
I actually haven't seen the source code in a while. I'm not sure if he is still doing the "one per cycle" increment/decrement. That wouldn't really be PI. State space, i think, is what we should really be using, but that's new tech and a little tricky. probably not worth the minor benefits.
|
|
|
Today
|
|
|
Other popular topics in this forum...
|
|
|
05-20-2009, 06:24 PM
|
#1332 (permalink)
|
PaulH
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
|
I changed the pwm so it's effectively 14 bit, although it really is only 10 bit. I use an auxiliary variable to store the "fine" PWM duty, and each time it is updated, I shift that value down 4 bits, putting it in the range 0-1023. It makes for very smooth driving at near 0 rpm. I would definitely describe the throttle as a bit squishy as JayC was saying. I might try a PI loop again. It was an abysmal failure last time. The greater PWM resolution I bet will fix that problem. Or I'll just do something like "squishy if change in throttle is small", "fast and snappy if change in throttle is large". That would still allow for smooth takeoffs, and I don't think would require a PI loop. Right now, it feels perfectly smooth, and stopping is pretty quick (4 times faster to slow down than to speed up), but not instantaneous, because it made for jerky driving each time I would take my foot off the gas, I mean throttle haha.
I'm going to get that PI loop working. It will be nice to have when RPM feedback is implemented. I have a little hall effect rpm thing that that was $6 that I haven't tried out yet.
Last edited by MPaulHolmes; 05-20-2009 at 06:36 PM..
|
|
|
05-21-2009, 01:11 AM
|
#1333 (permalink)
|
EcoModding Lurker
Join Date: Apr 2009
Location: Maine
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
|
Paul, can you measure the rate of change in the throttle position input and then feed that value in to a sensitivity multiplier? sort of like what Microsoft does for their mouse pointer acceleration. that would allow the driver to control whether it reacts smoothly or aggressively and passenger
|
|
|
05-21-2009, 01:26 AM
|
#1334 (permalink)
|
PaulH
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
|
Hey BlackPanther! That's exactly what I was trying to do a few minutes ago, until I realized that I just put the last diaper on our poopy son, so we just got back from Walmart. Now I'll go back to trying out that idea. Thank you! It's too dark to go drive and test it out, so I might do that tomorrow.
Well, I tried it tonight. I couldn't wait. Much more responsive, like a regular car, but a hair wiggly at near 0 rpm (lholding still up a steep hill). With incrementing the fine duty by one, it's VERY smooth, but a bit mushy. I like the term mushy! I'll lower the sensitivity some more to see what happens TOMORROW! HAHAHA!
Last edited by MPaulHolmes; 05-21-2009 at 02:23 AM..
|
|
|
05-21-2009, 03:32 AM
|
#1335 (permalink)
|
EcoModding Lurker
Join Date: May 2009
Location: Lake Tapps WA.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
Hi Paul this is really great stuff you are doing, this has renewed my interest in EV again.
I'm a good fabricator if I can help some how let me know, I'm local to you, Lake Tapps near Auburn.
Torry
|
|
|
05-21-2009, 09:12 AM
|
#1336 (permalink)
|
Master EcoModder
Join Date: Jun 2008
Location: London, Ontario
Posts: 1,096
Thanks: 0
Thanked 17 Times in 14 Posts
|
Paul, something is fundamentally wrong if you can't get a smooth acceleration out of a PI loop. Can you detail your current and throttle sample rates and filtering methods as well as your PI loop frequency and P and I values and how you came to them?
|
|
|
05-21-2009, 10:56 AM
|
#1337 (permalink)
|
PaulH
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
|
Thank you I B RACIN! I used to go swimming at Lake Tapps, since I grew up in Auburn. That's weird. Thank you for your offer!
Matt:
I have no doubt that there is something fundamentally wrong with my crappy PI loop. It's a piece of junk right now, but I'll try to make it a bit more clear, and then attach it here for you to look over, maybe tonight. I choose my P and I values by starting with I = 0, and P small (but not that small, only 1/64 I think), then gradually incrementing P until "I noticed overshoot", which was a joke because at the time everything was so noisy that it was a mess. Then I was supposed to back off a bit, and then gradually increase I until more overshoot or oscillations. I haven't tried it with the filtered current that I have now. I really need to try it, then I'll ask you guys what I'm doing wrong. IT was a long time ago since I tried it last, and a lot has changed softwarewise.
|
|
|
05-21-2009, 11:02 AM
|
#1338 (permalink)
|
Master EcoModder
Join Date: Jun 2008
Location: London, Ontario
Posts: 1,096
Thanks: 0
Thanked 17 Times in 14 Posts
|
Okay, i'll just leave you alone you've got more important issue to worry about than the fine details of the foot-to-road dynamics. If there's one major lesson I've learned in engineering - perfect is a dream, comprimise puts products on the market.
|
|
|
05-21-2009, 11:56 AM
|
#1339 (permalink)
|
EcoModding Lurker
Join Date: Aug 2008
Location: Calgary, AB
Posts: 21
Thanks: 1
Thanked 1 Time in 1 Post
|
This project is looking really good. I was hoping I could help out with the code. Paul , could you put it on the wiki or - even better - in charlie_fd's svn repository ( /trunk - Open ReVolt - Trac). It sounds like you've been getting a lot of help with the hardware side, let's get the same number of eyes looking at the software.
|
|
|
05-21-2009, 01:11 PM
|
#1340 (permalink)
|
PaulH
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
|
I'll attach the stuff to the thing from Adrian once I figure out how to send files there. I logged in, but I don't know how to send files. I'm going to try to fix that stupid PI loop now.
|
|
|
|