View Single Post
Old 10-09-2015, 10:37 PM   #2171 (permalink)
Permanent Apprentice
Join Date: Jul 2010
Location: norcal oosae
Posts: 523
Thanks: 351
Thanked 314 Times in 215 Posts
Originally Posted by MPaulHolmes View Post
Maybe there could be a separate microcontroller that does all the non time critical stuff that sends the info to the time critical micro? non super-time critical could compute A/D's of throttle, brake A/D pressure switch thing, temperature A/D, DC voltage monitor, UART communication with outside, etc... All stuff that doesn't HAVE to be right this 0.0001 sec. It could even drive an optional 4th half bridge for the boost option. Then the other micro could do current 1, current 2, encoder or resolver, and that's it. boom. FOC with the focus of a ninja. haha. It would have to receive messages but that could be done quickly and reliably.
I am debating (with myself) a system like that to deliver the power to four different wheels. I'm wondering if it would be better to have a microcontroller (something simple like an 18 or 16 series pic) "interpret" the user inputs like throttle, brake, steering angle, etc. The output of this would go as an individual throttle "request" to four independant motor controllers.

Or perhaps a more simple analog solution that also makes these "requests"?

Anyway, I've sort of come to the conclusion that having one computer interpret driver "requests" like throttle is a necessary evil. Two? Hmmm I'm not sure I trust cumpooters that much. I REALLY don't trust the modern systems that use CAN bus for everthing from tire pressure monitoring to infotainment to throttle and ABS brake controls.

Oh, BTW, I'll this previous post
By "frozen" on the startup, I really meant "I don't give a crap what happens there because I never mess with that part. haha (laughing intentionally in quotes)" So, feel free to adjust that to include delays for things that are needed so no extra delays are there.
to mean go ahead with those final "main" mods. I'll put them into a form that can easily be copied into the current code, so your current work won't be affected. I hope this will work out - if not, you'll still have your old code.

regarding the above, for now I'm not going to change anything.
1) I can't see a way to improve the contactor control time, and moving this outside main would not help anything
2) The while(1) loop in main that starts with "ProcessCommand" appears to be only UART stuff, but I'm not sure about the section that looks at the PI values. Since you are debugging PI stuff, I think it's best to leave this alone for now.

I'll just get back to integrating a resolver into the FOC part. I'll see if just the sin or cos can be used so that AN0 doesn't need to be changed.

- Eclipse

Last edited by e*clipse; 10-09-2015 at 11:00 PM.. Reason: reconsider better use of time
  Reply With Quote
The Following 2 Users Say Thank You to e*clipse For This Useful Post:
MPaulHolmes (10-09-2015), thingstodo (10-09-2015)