EcoModder Forum Paul & Sabrina's cheap DIY 144v motor controller

Register Now
 Remember

 Submit Tools LinkBack Thread Tools
 07-23-2009, 11:25 PM #2081 (permalink) EcoModding Lurker   Join Date: Jun 2009 Location: Australia Posts: 35 Thanks: 0 Thanked 3 Times in 3 Posts You should be able to measure the speed that the motor is running approximately, by applying a short known pulse length to the motor and then measuring the resultant current. The faster the motor is turning the lower the current will be. The current will also be affected by load but it will definitely give you an approximation.
 Today Popular topics Other popular topics in this forum... View the most popular topics in this subforum by views or by posts
07-23-2009, 11:53 PM   #2082 (permalink)
EcoModding Apprentice

Join Date: May 2009
Location: Australia
Posts: 109
Thanks: 0
Thanked 2 Times in 2 Posts
Quote:
 Originally Posted by MPaulHolmes Hey squiggles! That's a good question! I should try that. Also, on the EVTech list, they suggested the following. I'm trying to understand it right now: What if you lower the motor current limit as the PWM duty cycle raises, but not in such an extreme fashion? currentCommand = throttle*(constant - pwmDuty) or currentCommand = throttle / (pwmDuty + constant) The second method is basically what you're currently doing, except with a constant added to pwmDuty to make the low-rpm behavior act reasonable.
So, let me see, pwmDuty + constant = throttle / currentCommand
therefore pwmDuty = (throttle / currentCommand ) - constant.

Hmm, I think that is the opposite to what I was suggesting.
In my mind the constant would effectively be the minimum limiting factor for PWM. But it would not need to be applied through the whole process.

I would add to whatever your code is...
If PWM <= 5%
PWM = 5%

or whatever % seems appropriate. Worth a try at least.

Last edited by squiggles; 07-23-2009 at 11:54 PM.. Reason: spellunk

 07-24-2009, 12:24 AM #2083 (permalink) PaulH     Join Date: Feb 2008 Location: Maricopa, AZ (sort of. Actually outside of town) Posts: 3,832 Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000 Thanks: 1,362 Thanked 1,202 Times in 765 Posts I didn't get a chance to try it yet. I had to watch one of the foster kids, who was really really naughty. I had an idea about the throttle. At 0 rpm, the torque is maximum and rpm is minimum. At max rpm, torque is minimum and rpm is maximum. So, what if we took a cue from the nature of the motor. pwmDuty is proportional to speed, and current is proportional to torque. So what if we tried this: Try to make: C*current + (1 - C)*pwmDuty equal to throttle. C would be a number from 0 to 1. If throttle was 0, then C would be 0. And if throttle was maximum, then C would be 1. To get this, we could do: attempt = (throttle*current + (MAX_THROTTLE - throttle)*pwmDuty)/MAX_THROTTLE Then, you change pwmDuty based on if attempt is too little or too big, compared to throttle. __________________ kits and boards Last edited by MPaulHolmes; 07-24-2009 at 12:30 AM..
 07-24-2009, 12:33 AM #2084 (permalink) EcoModding Lurker   Join Date: Aug 2008 Location: Calgary, AB Posts: 21 Corolla bandit - '05 Toyota Corolla CE Thanks: 1 Thanked 1 Time in 1 Post How then do we use the current readings? Near max rpm with normal load, the current should be stable. With no load at max rpm the current should still increase, does that differ from normal load when at an average rpm? At low rpm the current will increase a lot, will the same thing at no load average rpm? The first may not be able to stop over-revving the motor, the second may be exactly what Paul wants. What about the current decay, does it always decay at the same rate as it increases, under the same load and speed? Paul if you're going to do some testing, I suggest you do the timing thing, or on a button, and then do what mcudogs suggested. Turn on the pwm full, run several concurrent current readings (4 or 5) (should be safe 13*(4 or 5)*adc clock ~65us). Then turn the pwm to 0 and again run several readings. Then go back to normal control. I'd have my hand near the contactor just in case.
 07-24-2009, 12:39 AM #2085 (permalink) PaulH     Join Date: Feb 2008 Location: Maricopa, AZ (sort of. Actually outside of town) Posts: 3,832 Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000 Thanks: 1,362 Thanked 1,202 Times in 765 Posts Right now I can't do any sort of testing that requires movement. hehe. The serial port is the only way I can hear from the controller right now, and I have 3 old laptops, and none of them have a battery. My extension cord isn't long enough for street testing. I'm saving for one, though. __________________ kits and boards
 07-24-2009, 12:54 AM #2086 (permalink) EcoModding Lurker   Join Date: Aug 2008 Location: Calgary, AB Posts: 21 Corolla bandit - '05 Toyota Corolla CE Thanks: 1 Thanked 1 Time in 1 Post What about a radio shack (The Source by CC) cigarette lighter inverter? Probably cheaper than a battery. I took the liberty of simplifying what you wrote above. pwmDuty = T/(Tmax - T) * (Cmax - C)/Cmax; except for the possible the divide by zero, this looks good.
 07-24-2009, 12:59 AM #2087 (permalink) PaulH     Join Date: Feb 2008 Location: Maricopa, AZ (sort of. Actually outside of town) Posts: 3,832 Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000 Thanks: 1,362 Thanked 1,202 Times in 765 Posts CIGARETTE LIGHTER INVERTER!!!!!!! HAHAHA! DUH! EV59RAG ALSO SUGGESTED THAT TO ME, BUT I FORGOT! i'M GOING TO BUY ONE TOMORROW. tHE STUPID PLACE IS CLOSED TONIGHT. DANG IT! YA! hOLY COW i'M EXCITED. YA! __________________ kits and boards
 07-24-2009, 01:12 AM #2088 (permalink) Master EcoModder   Join Date: Sep 2008 Location: Texas Posts: 632 Thanks: 0 Thanked 26 Times in 24 Posts You can also just wire the power supply for one of your laptops to the main battery pack. (They're universal switching power supplies meaning they can accept either 100-240v AC or 140-370v DC.) __________________ If America manages to eliminate obesity, we would save as much fuel as if every American were to stop driving for three days every year. To be slender like Tiffany Yep is to be a real hypermiler... Allie Moore and I have a combined carbon footprint much smaller than that of one average American...
 07-24-2009, 02:42 AM #2089 (permalink) Joe   Join Date: Feb 2009 Location: phx Posts: 260 Thanks: 0 Thanked 48 Times in 38 Posts I found a throttle code that I mostly like - maybe it's a hair too sensitive, but it's good for my rig. Here's what I was thinking - 500A is needed off the line to get this heavy thing rollin at a reasonable pace, and I don't want to have to floor it to get it. Just feels weird. You could just set it up so that half of the throttle is active - at half throttle and above, I'd get 500 amps. But, that seems like it'd screw with higher speed driving; Only 150 - 200 amps are needed to cruise, so I'd be trying to nail something like 20% throttle. To get the best of both I modified the throttle input based on the PWMduty knowing that a zero rpm I have zero PWMduty. throttlenew=((2*PWMmax - PWMduty)/PWMmax) * throttle PWMmax is the max bitvalue. So, when PWMduty is zero, throttlenew=2*throttle, (I'll get full throttle by only pressing halfway). If PWMduty were it's maximum, that whole mess before 'throttle' would equal 1 and throttlenew = throttle. The other side effect is that your throttlenew (torque) decreases as you speed up and PWMduty increases. I personally find this nice because it becomes easier to hold the battery amps constant (I try to peg it at 200A during acceleration so as to try to 'baby' the pack). Previously, you had to slowly release the pedal as you accelerate to achieve this (which felt weird). Now, the pedal is more constant. If I were to change something, I might have 100% throttle at 3/4 PWMduty instead of at PWMdutymax, but I'll leave it like this for now. I imagine it won't be so easy for other vehicle setups, but I'm interested in what other people think about how it feels. Here's the 3 lines I added (the 1st one is already in there, but I copied it in so it's easy to find where this stuff was added). rawThrottle = throttlePos >> 1; throttlePos = (1022-OCR1A)*throttlePos/512; if(throttlePos > 506) {throttlePos=506;} Oh, I also had to make throttlePos a 32bit variable. Oh, and I changed the ramp to 8 and commented out the ramping if the error was negative, and that fixed the voltage problem I was having and made the throttle more responsive. __________________ ReVolt AZ testing thread: http://ecomodder.com/forum/showthrea...ting-9325.html
 07-24-2009, 08:48 AM #2090 (permalink) PaulH     Join Date: Feb 2008 Location: Maricopa, AZ (sort of. Actually outside of town) Posts: 3,832 Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000 Thanks: 1,362 Thanked 1,202 Times in 765 Posts Joe, you are the man! It fixed the voltage problem you were having? You mean the sudden cutoff of 80 amps? or something else. the 80 amp thing has been keeping me up at night! NiHaoMike! I have a dang 72v pack. boohoo __________________ kits and boards

 Thread Tools

 Similar Threads Thread Thread Starter Forum Replies Last Post MPaulHolmes Fossil Fuel Free 3431 05-04-2022 05:43 PM MPaulHolmes Fossil Fuel Free 542 11-12-2016 09:09 PM SVOboy EcoModder Blog Discussion 0 12-12-2008 04:10 PM

 -- EcoModder Skin -- Mobile / Lightweight skin Contact Us - EcoModder.com - Archive - Recent Posts - Top

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