View Single Post
Old 09-07-2014, 01:38 PM   #1091 (permalink)
Permanent Apprentice
Join Date: Jul 2010
Location: norcal oosae
Posts: 523
Thanks: 351
Thanked 312 Times in 214 Posts
Thumbs up

I'm glad to see your opinion about interrupts is like mine. I've run across code in app notes that completely relies on interrupts for every little thing to work at all. To me that's scary unreliable.

Hmmm the PIC pin seemed like a great way to provide some synchronization between the resolver and the motor control. - I'm actually not sure at this point if it's entirely necessary - I'll look into that today. I was under the impression from a TI app note that it was necessary to synchronize the AtoD conversions with the resolver. If it's not necessary - or it just needs to be synchronized with itself - then an oscillator IC is a great idea.

BTW, that 40KHz interupt could toggle some unused pin at a perfect - 20kHz - frequency. What is its job?
Also could the FOC frequency be increased? Two reasons 1) The angle between updates at high speed 2) audible noise

Thanks a bunch for all this info. I'm really enjoying this project for that reason alone!

***edit***Hmmmm that 50KHz signal might be an excellent choice. If there's no 50KHz signal, then the motor drivers aren't running either! I could cut the frequency 50% easily, but that would still be 25kHz. Do you synchronize that signal with the PIC?

***re-edit*** Is that 50KHz signal going to the transformers that bridge to the drivers?
- E*clipse

Originally Posted by MPaulHolmes View Post
There's an interrupt that is run only when there's a catastrophe of desaturation detection or undervoltage, so it won't cause any problems with jitter. However, the FOC code is run at 10KHz, and is run inside an interrupt. A 2nd timer based interrupt could do its thing at 40KHz (toggle at 40KHz for 20KHz frequency), but that's a lot of interruptions. I'm not sure how long interrupts take with their pausing and returning. Maybe you could include a little attiny ($1) on the board that oscillates at any frequency that sounds good to you? I use an attiny putting out a frequency of 50KHz (updated at 100kHz) for feeding the inputs of all 6 isolated supply inputs. Fran told me that he used hundreds of attinys in his EVs that he designed (a mine blowing up machine, etc...), and has never seen one be less than 100% reliable.

On the other hand, if you are happy with 50KHz, you could use the signal from the ATTINY that's on the board! haha. Also, the jitter may not cause a problem for the FOC code if we had the main dspic30f4011 do it.

Last edited by e*clipse; 09-07-2014 at 02:03 PM.. Reason: thoughts I shoulda had in the first place....
  Reply With Quote