Go Back   EcoModder Forum > EcoModding > Fossil Fuel Free > Open ReVolt: open source DC motor controller
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 05-25-2009, 10:46 PM   #1421 (permalink)
EcoModding Lurker
 
Join Date: Apr 2009
Location: Maine
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
That sounds right to me, if after "after" the comparator, then it should be isolated by the comparator and not be able to affect the signal at your current transducer.

I am no expert on this though; I am going to have plenty of questions of my own as I attempt my own controller. I am hoping that maybe you can stop by and help me with a few questions once I start a thread for it.

__________________
"Experience is something you get right after you need it !"

http://www.diyelectriccar.com/garage/cars/143

http://www.diyelectriccar.com/forums...tor-32083.html
  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 05-25-2009, 10:50 PM   #1422 (permalink)
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,831

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,367
Thanked 1,115 Times in 730 Posts
Oh heck ya! I'd love to help in any way I can!
__________________
kits and boards
  Reply With Quote
Old 05-25-2009, 10:52 PM   #1423 (permalink)
EcoModding Lurker
 
Join Date: Apr 2009
Location: Maine
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
open source ROCKS!
__________________
"Experience is something you get right after you need it !"

http://www.diyelectriccar.com/garage/cars/143

http://www.diyelectriccar.com/forums...tor-32083.html
  Reply With Quote
Old 05-25-2009, 10:54 PM   #1424 (permalink)
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,831

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,367
Thanked 1,115 Times in 730 Posts
Heck yes it does...

I got the edit! Thanks, DCB!!!!
__________________
kits and boards
  Reply With Quote
Old 05-25-2009, 10:56 PM   #1425 (permalink)
dcb
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location:
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 158
Thanked 267 Times in 210 Posts
oops, you have to set the right channel in the timer ISR, not the adcComplete isr. Made tweaks to timer and adc isr in the outline above.

EDIT: and I should have said reti, not iret, though I'm not %100 on how you get there from C, so just skip the block I recon.
__________________
WINDMILLS DO NOT WORK THAT WAY!!!

Last edited by dcb; 05-25-2009 at 11:18 PM..
  Reply With Quote
Old 05-25-2009, 11:27 PM   #1426 (permalink)
dcb
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location:
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 158
Thanked 267 Times in 210 Posts
ok, that timer1 function takes 49 cycles (3.062us @ 16mhz)
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
  Reply With Quote
Old 05-25-2009, 11:29 PM   #1427 (permalink)
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,831

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,367
Thanked 1,115 Times in 730 Posts
Holy hanna montana that's fast! Almost as fast as my 45 microseconds... Wait... nevermind.

Hey, I finished entering the directions for etching the power section just now. It's in Open Office Spreadsheet. I got to get me some emails to send it to! Note: I haven't done the drilling coordinates yet. This file only has the etching directions for one of the versions. I wanted to try 2 versions, just to see which one blows up faster. hahaha! Just kidding you guys (about the blowing up, not the 2 versions).
__________________
kits and boards

Last edited by MPaulHolmes; 05-25-2009 at 11:35 PM..
  Reply With Quote
Old 05-25-2009, 11:46 PM   #1428 (permalink)
dcb
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location:
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 158
Thanked 267 Times in 210 Posts
Quote:
Originally Posted by MPaulHolmes View Post
Holy hanna montana that's fast!
Well, it is just scheduling the adc conversions and returning. The adc conversions happen in the hardware and the main loop will march forward till the adc complete interrupt says ("OK, I read that last channel").

The top of the main loop halts interrupts briefly, makes its own copies of the interesting variables, then re-enables interrupts. It can't use the global versions directly because they could get updated in the middle of a computation.

Max ADC rate is about 10khz, and there is only one channel at a time, so a lot of the timer1 calls will auto-return, but it is what it is and the bulk of the processing (32 bit math?) can happen in the main loop outside of interrupts.
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
  Reply With Quote
Old 05-26-2009, 12:38 AM   #1429 (permalink)
EcoModding Lurker
 
Join Date: Aug 2008
Location: Calgary, AB
Posts: 21

Corolla bandit - '05 Toyota Corolla CE
Thanks: 1
Thanked 0 Times in 0 Posts
dcb,
I really like your code for the ISR's.
It looks like Paul has the ADC clock at 1MHz (which means he should only use 8 bits of the result). Other than the first result the ADC takes 13 ADC cycles, or about 13us. So we can read the current for every ISR with plenty of time for everything else.
  Reply With Quote
Old 05-26-2009, 05:37 AM   #1430 (permalink)
EcoModding Lurker
 
Join Date: May 2009
Location: Bucharest,RO and Copenhagen,DK
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by dcb View Post
...

Max ADC rate is about 10khz, and there is only one channel at a time, so a lot of the timer1 calls will auto-return, but it is what it is and the bulk of the processing (32 bit math?) can happen in the main loop outside of interrupts.
...
The is smth. I do not understand here ... ADC will take 13 ADC clocks, we have a 1MHz clock for adc (we loose some precision, 2.5lsb out of 10bit if i'm not mistaken) that means 77kHz max. ADC rate! There will never be be an "auto-return" of the timer1 ISR at 16khz on the grounds of unfinished conversion if we only convert 1 channel at a time...

What am I missing?

L.E.: Doh! Next time i will scroll down before replying ...dlaing had the same observation 5 hours before me


Last edited by charlie_fd; 05-26-2009 at 05:41 AM.. Reason: have seen the last reply :)
  Reply With Quote
Reply  Post New Thread


Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paul and Sabrina's Cheap 3 Phase Inverter (AC Controller) with Field Oriented Control MPaulHolmes Fossil Fuel Free 3471 06-01-2020 10:53 PM
Paul & Sabrina's Cheap EV Conversion MPaulHolmes Fossil Fuel Free 542 11-12-2016 09:09 PM
Three Dirt Cheap DIY Electric Cars - Part 5 SVOboy EcoModder Blog Discussion 0 12-12-2008 04:10 PM



Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com