06-09-2009, 11:14 AM
|
#1651 (permalink)
|
EcoModder Student
Join Date: Nov 2008
Location: Youngsville, NC
Posts: 117
Thanks: 11
Thanked 14 Times in 13 Posts
|
Paul vs SVN
dcb's suggestions would be valid if we kept to a single file. But we will very quickly have multiple files dealing with new features. Also include files for headers. Also compiler settings (kept in the project file).
Better he learn now and keep everything under control. That's what SVN is for.
Eric
__________________
1995 BMW 318i EV in the making
|
|
|
Today
|
|
|
Other popular topics in this forum...
|
|
|
06-09-2009, 11:15 AM
|
#1652 (permalink)
|
EcoModding Lurker
Join Date: Jul 2008
Location: Memphis, TN
Posts: 58
Thanks: 0
Thanked 1 Time in 1 Post
|
Quote:
Originally Posted by MPaulHolmes
How do I pop the stack in C??? It's wonderful that the status register gets pushed onto the stack when I call cli(); (at least I think it does), but how do I retrieve it without assembly? stack.pop()?
|
No, it's all done for you if you use the "Signal" for you ISR. But after looking at your code, and the reason you are clearing the Interrupt bit, disregard my comment. You are protecting that section of code from being interrupted and "tricky" that you are reseting the SREG I bit when you restore it afterwards Whether or not the compiler is doing that with register variables or not is of not concern right now ... don't let me distract you
Jay
|
|
|
06-09-2009, 05:53 PM
|
#1653 (permalink)
|
EcoModding Lurker
Join Date: Jul 2008
Location: Memphis, TN
Posts: 58
Thanks: 0
Thanked 1 Time in 1 Post
|
Quote:
Originally Posted by charlie_fd
Keep up the good work! I'm running your software on a test-board, using a pot for throttle and a LED for motor. I've added a bootloader so I can quickly update the uC directly from Avr Studio using the serial link. I'm testing serial communication from within the HighVoltageController.c ...
|
Did you make your own test board? or are you using a breadboard? if the former, what PCB software did you use? I'm in the process of putting this in Eagle so I can design my own layout and mill it at home.
|
|
|
06-10-2009, 01:39 AM
|
#1654 (permalink)
|
EcoModding Lurker
Join Date: Jun 2009
Location: Burbaank, CA
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
Feature Idea
Hey Paul and Sabrina! I have been reading about the bug and your motor controller. I am the creator of "Deep Cycle", a lithium powered 1973 Yamaha Motorcycle and I also have an electric bug called "Bugtera"...It now has three wheels and is AC powered. I wanted to jump in and suggest a feature for your controller that my bud Marko Fox and I always wished for on our Curtis and Allrax controllers: A simple trim pot for adjusting the current limit (and maybe other functions like ramps). This would make it easy so you need not hook up computers or change the programming, etc. Your Atmel would be able to read those easy enough I would guess.
Also, for others thinking of making their own homemade controllers: How about starting with a cheapo cordless drill controller and simply opto-coupling to the high-voltage section? This would be easy for bikes and such. Maybe not so good with the cars as you would have to add more circuitry for the ramps and current limiting, etc...
Regarding the other guy's water cooled plumbing: How about square copper tubing (does it exist?) so you can mount the Muppets right onto it?
Regards, Jeff K. Burbank, CA
|
|
|
06-10-2009, 05:10 AM
|
#1655 (permalink)
|
EcoModding Apprentice
Join Date: May 2009
Location: Australia
Posts: 109
Thanks: 0
Thanked 2 Times in 2 Posts
|
Hey guys, I just thought of something neat to include in V3.0.
What if we had an input into the controller called "Hand Brake On".
When it was active the controller would not attempt to run the motor when the accelerator (what gas?) pedal is pressed. BUT as soon as you release the handbrake (assuming your foot is on the pedal) the motor ramps up. EASY hill starts!!!
|
|
|
06-10-2009, 11:27 AM
|
#1656 (permalink)
|
EcoModding Lurker
Join Date: Aug 2008
Location: Salt Lake City
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
|
Current Limit Adjustment
Jeffkay,
Which model of the Curtis are you using? My 1231C has a hex-head screw that you remove to gain access to a trim pot that adjusts the max. current limit.
Bill
|
|
|
06-10-2009, 12:37 PM
|
#1657 (permalink)
|
EcoModding Lurker
Join Date: Jun 2009
Location: Burbaank, CA
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
Quote:
Originally Posted by wjdennis
Jeffkay,
Which model of the Curtis are you using? My 1231C has a hex-head screw that you remove to gain access to a trim pot that adjusts the max. current limit.
Bill
|
I now have a Curtis AC controller which is remote adjust only. Yes, some Curtis controllers have the trim--see how handy it is? The Alltrax talks over DB9 serial cable...
|
|
|
06-10-2009, 07:11 PM
|
#1658 (permalink)
|
PaulH
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
|
Hey Jeffkay! We actually did add a trim pot to this controller, adjustable from 495amp to 775 amp, but it's mainly for later versions, because the controller is probably only safe to maybe 550 amps tops I'm guessing with 10 of those 60amp diodes. In fact, I wouldn't move it above 500 amps.
The mosfets got in early to Digikey, and I ordered all the digikey stuff today! ya! One of the control boards is finished being assembled. Now we get to see if I sent a crappy ATMega8 to the engineer or not. I couldn't really test the chips properly before mailing them to him. We'll see what happens.
|
|
|
06-10-2009, 07:21 PM
|
#1659 (permalink)
|
EcoModding Lurker
Join Date: May 2009
Location: Bucharest,RO and Copenhagen,DK
Posts: 42
Thanks: 0
Thanked 1 Time in 1 Post
|
Yuppie!!! My mock-up controller section is now reporting via serial link the throttle, pwm value and current.
The code works! I've used a FIFO queue (ring-buffer) filled with values on timer2 overflow. The actual transmission is done using buffer empty interrupt. The impact on the code is thus minimal.
Next steps: Implement receive part so I can send 1 byte commands to the controller ("inhibit reporting" for instance).
There was a question earlier in the thread about what kind of test board I'm using: I just bought the cheapest avr programmer/test kit I could find and changed the xtal and the uC to 16MHz version. The actual kit is "myAVR board MK1 LPT, assembly kit" 12Eur in Germany. with PCB, a sp12 compatible programmer, connectors, leds, push-buttons ...
|
|
|
06-10-2009, 07:28 PM
|
#1660 (permalink)
|
PaulH
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
|
That's awesome Adrian!!! How complete is your control board? Did you use an HIN202CP?
|
|
|
|