Thanks for all the input! Please pardon the slowness of my response -- I get the piclist in the digest form and it takes me a while to absorb all this. Answers to questions and more information. PIC CIRCUIT > What are you doing with /mclr ? I'm using a 16F88 with internal MCLR. I also understand the current issues for the PIC circuit as far as connecting to +24V. Since I have two 12V batteries, I can connect to 12V for the PIC power supply and for the FET gate driver if the (as yet unknown) current requirements make it worthwhile. MOTOR This is the motor http://www.cn-dcmotor.com/productShow.asp?ArticleID=232 M1020 Model 45 500W 24V Torque 1.91nm MOSFET DRIVER >> I plan to use a logic level FET > Bad idea. You need a true totem pole MOSFET driver. > The reason why people are telling you that you need a proper FET driver > is that you actually need significant peak current to drive the FET gate. I understand that. I'm trying to understand the math and FET specs that go along with this. Very slow going and probably completely unnecessary -- I should just build a good strong driver. Why is 'a true totem pole MOSFET driver' necessary? Could not a small logic level FET driven directly from a PIC pin drive the power FET? MOSFET CHOICE >> I did a search on Digikey and found this one: >> DIGIKEY IPP0165N03L G 30V 50A Rdson=.0065 $1.03 > Bear in mind that you cannot get very close to the FET max Vds voltage. > If you are working with a 24V bus voltage, I'd go for at least 50V FETs. Will do. The FET I picked was sort of a straw man, the first thing I saw at Digikey that looked in the ballpark. Digikey has 19475 MOSFETs. Including this one: IRFP4368PB 75V 195A TO-247AC 1.85 mOhm @ 195A, 10V 19230pF @ 50V 520W $7.78 I hope I can use something a little smaller, but we will see. > 0.0065 is about 8 times too high for a good motor controller. > It'll generate a ton of heat that you'll have to dissapate at load. I don't understand this. 0.0065/8 ~= .0008. That just looks like a magic number to me. What is the context? My context is (hopefully) less than 20A for continuous operation. (Otherwise I don't need to worry about the controller, the motor is going to melt.) I'm building a go-cart, not an electric car. I^2 * R loses for 20A at Rdson of .0065 < 400 * .0065 = 2.6W. Is that too high? The FET(s) will have big heatsink and probably a fan too. > If you have some time and patience, there is a long standing thread for an > open system EV motor controller running on EcoModder.com here: > http://ecomodder.com/forum/showthread.php/paul-sabrinas-cheap-144v-motor-controller-6404.html > If you read all 215 pages of the thread, you can become a electric motor controller guru. This is very interesting and a fun read. But slow going. There is, however, no chance of my become a electric motor controller guru! (I am a programmer, not an engineer.) But I have already found several excellent ideas for the PWM logic that I will be implementing. Such as gentle PWM ramp up and limiting the PWM duty / motor current combination. MOTOR LOADING > How about an alternator with a load resistor I like this idea and think maybe I could actually do it. But for now I'm going to skip this bit. See 'CURRENT SENSING' below. > Stall test > Beware that, in some motors, stalling, even for a split second, > can begin to demagnetize the magnets (if it is a permanent magnet motor). My motor is permanent magnet, so I'm going to skip the stall test. (Thanks, Sean!) > There's no need to actually stall the motor to determine the stall current. > You can simply measure the winding resistance and divide that into the battery voltage. I measure something like .2R, probably plus or minus 100%. My meter is not that accurate at low values. Is there some trick to get a more accurate reading for low resistance values? CURRENT SENSING > As has been pointed out, there NEEDS to be a fast current limiting scheme. > Probably the easiest way would be to use a low-value (perhaps 0.01 ohm) > resistor in the source-lead of the FET, with a comparator > and a way of cutting off gate drive when the voltage drop across the resistor exceeds a certain value. > time = (L*I)/V > Time is short. I have everything but L (inductance). Is there a way to measure that with a VOM? Current sensing is my new highest priority. I want to add current sensing, and program the PIC to never allow current anywhere near the maximum (stall) current. I don't want to put a resistor in the high current path. I'd like to use a current sensor like Allegro ACS706 that i've heard discussed on the piclist. Checking for ACS706. Ok, it's discontinued. Replacement ACS712. Checking Digikey. Max is 30A. Searching for current sensors at Digikey - 402 items. Heven't found anything above 30A, except some expensive modules (~ $100). Any ideas for current sensor? 100A capability would be really nice. Doesn't have to be very accurate. Here is my idea. Once I can sense and control current, I can safely experiment. I'll put a fuse holder in the power supply line and pick a number, say 20A. I'll set this as the maximum current allowed by my PWM code. And put a 30A fuse in, just to be safe. Play with the cart. Can it climb a hill? Good acceleration? YES - done NO - bump up the programmed current limit and the fuse value. Repeat until cart performs adequately or fuse pops. (Hopefully I'll reach 'YES-done' before something else besides the fuse blows.) This reminds of the torque-wrench-less method I read about many years ago for putting the big gland nuts -- "Crank it down until it breaks, then back off a quarter turn." How bad of an idea is this? No -- my idea, not the wrench one. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist