EcoModder.com

EcoModder.com (https://ecomodder.com/forum/)
-   Open ReVolt: open source DC motor controller (https://ecomodder.com/forum/open-revolt-open-source-dc-motor-controller.html)
-   -   LCD Instrumentation for Cougar Controller (https://ecomodder.com/forum/showthread.php/lcd-instrumentation-cougar-controller-16132.html)

Freyguy 02-16-2011 01:29 PM

LCD Instrumentation for Cougar Controller
 
1 Attachment(s)
For those Cougar controller owners (or owners to be) interested in a simple LCD instrumentation interface for the Cougar, I’d like to give you an option.
Originally this was designed for my own EV conversion, but I made it flexible enough to support options I didn’t need but foresaw other might (metric units for instance).
My intent is to get all the information on operation, BOM, fab files, source code, etc onto the OpenRevolt Wiki page so others can use as they wish (with Paul & company’s approval of course!)

Design Overview:
The display is 2 line x 16 character backlit LCD with oversized characters, controlled by a PIC18F2480 microcontroller. It displays both readings taken with local A/D and information transmitted serially from the Cougar. Displayed info includes:
- pack voltage (isolated circuitry) 0-204V range
- battery amps (Tamura hall sensor input or Cougar’s output) 0-511A range
- motor amps (Cougar output)
- accessory battery voltage
- motor temp in C or F (via thermistor)
- controller temp in C or F (Cougar output)
- pack temp in C or F (via thermistor)
Other features:
- calculation & display of SOC based on battery amp usage (peukert is factored in). Battery amp draw is subtracted from battery capacity every second with remaining capacity written to EEPROM every minute.
- calculation & display of MTE (Miles to empty) based on %SOC per mile/km
- momentary switch to toggle between 2 profiles transmitted to controller
- “Mode” LED to indicate when controller runs with alternate profile
- “Overtemp” LED based on independent thresholds for the 3 measured temps
- Alarm output (NPN sinking)
- PWM output of SOC to interface to existing analog fuel gauge
- Canbus and RS232 interfaces (E-Can controller is integrated in the PIC)

Below are links to demonstration videos (part 1&2) of the system breadboarded running preliminary code.

http://www.youtube.com/watch?v=I38IgceDbhA

http://www.youtube.com/watch?v=QsPNvt54Ioc

The schematic is also attached.

As of this writing, I have the final fab’ed PCB populated and mostly tested in my car.
I’ll post a few pics of the completed unit later tonight.
I may revise the board since I found minor issues (header pin hole size, part clearance) but I don’t plan on turning this into a development thread. 13 hour work days and family commitments make it hard enough just getting to my conversion (after 2 years I really need to wrap it up & get it on the road!)

bennelson 02-16-2011 01:55 PM

OOh! Very cool!

Yet one more project for me to make......

mrbigh 02-16-2011 02:08 PM

I love it, I want to be able to use it real soon.
I like the idea of different "driving profilez" parameters, maybe 3 or 4?
Is the display legible and bright at a 3' average driver's distance?
Could RTD explorer be used in parallel connection?
Count me in..............

E Vdubya 02-16-2011 04:46 PM

This is a good project. I will have analog gauges for battery volts and motor current and aux battery volts but there is definitely a need for this. Thanks for the good presentation and I can't wait to hear more.

wakinyantanka 02-16-2011 05:17 PM

Quote:

Originally Posted by Freyguy (Post 220681)
For those Cougar controller owners (or owners to be) interested in a simple LCD instrumentation interface for the Cougar, I’d like to give you an option.
Originally this was designed for my own EV conversion, but I made it flexible enough to support options I didn’t need but foresaw other might (metric units for instance).
My intent is to get all the information on operation, BOM, fab files, source code, etc onto the OpenRevolt Wiki page so others can use as they wish (with Paul & company’s approval of course!)

Design Overview:
The display is 2 line x 16 character backlit LCD with oversized characters, controlled by a PIC18F2480 microcontroller. It displays both readings taken with local A/D and information transmitted serially from the Cougar. Displayed info includes:
- pack voltage (isolated circuitry) 0-204V range
- battery amps (Tamura hall sensor input or Cougar’s output) 0-511A range
- motor amps (Cougar output)
- accessory battery voltage
- motor temp in C or F (via thermistor)
- controller temp in C or F (Cougar output)
- pack temp in C or F (via thermistor)
Other features:
- calculation & display of SOC based on battery amp usage (peukert is factored in). Battery amp draw is subtracted from battery capacity every second with remaining capacity written to EEPROM every minute.
- calculation & display of MTE (Miles to empty) based on %SOC per mile/km
- momentary switch to toggle between 2 profiles transmitted to controller
- “Mode” LED to indicate when controller runs with alternate profile
- “Overtemp” LED based on independent thresholds for the 3 measured temps
- Alarm output (NPN sinking)
- PWM output of SOC to interface to existing analog fuel gauge
- Canbus and RS232 interfaces (E-Can controller is integrated in the PIC)

Below are links to demonstration videos (part 1&2) of the system breadboarded running preliminary code.

http://www.youtube.com/watch?v=I38IgceDbhA

http://www.youtube.com/watch?v=QsPNvt54Ioc

The schematic is also attached.

As of this writing, I have the final fab’ed PCB populated and mostly tested in my car.
I’ll post a few pics of the completed unit later tonight.
I may revise the board since I found minor issues (header pin hole size, part clearance) but I don’t plan on turning this into a development thread. 13 hour work days and family commitments make it hard enough just getting to my conversion (after 2 years I really need to wrap it up & get it on the road!)

OK To cool!! Can it be modified for use with the new high amp controller?:thumbup:

harlequin2 02-16-2011 05:51 PM

Very nice, I want one! Looking forward to a circuit board and the s/w asap.

dcb 02-16-2011 06:40 PM

sweet! it would be terribly useful for efficiency tracking if you can squeeze in a speed signal from a vehicles existing speed sensor or an add-on. To track distance/speed and display realtime and trip watts/mile or whatever.

All the pins are used up on that cpu, but maybe you can combine mode and overtemp, or use an internal oscillator or something, wow that thing is loaded up :)

here is a thread with a couple examples of vehicle speed sensors.
http://ecomodder.com/forum/showthrea...vss-10236.html

Freyguy 02-16-2011 09:30 PM

Hey Thanks guys!
Mr Bigh- the display is easily readable at 3'. Reason I chose the oversized character version. It could work in parallel with RTD Explorer only if RTD is used to receive data from the Cougar. Both RTD and the LCD can't transmit unless you incorporate some kind of A/B distribution switch. More than 2 profiles gets complicated and now you need an indicator showing which one you're running with.

Wakinyantanka- As long as the status message sent from the high amp version is formatted the same it should be compatible. If the configuration parameters are different, it shouldn't matter since the user programs in the serial data he wants transmitted as his "profile".
DCB- Yes, every pin is used up. You could drop in a PIC18F2420 which is the same part without the CANbus. The two I/O lines for CAN then become standard I/O.

Freyguy 02-16-2011 09:42 PM

Here are some pictures in various stages of assembly

http://farm5.static.flickr.com/4093/...5f29ac604c.jpg

http://farm6.static.flickr.com/5060/...b6a79a2867.jpg

http://farm6.static.flickr.com/5055/...e74623f80e.jpg

http://farm5.static.flickr.com/4102/...189cf160ef.jpg

http://farm6.static.flickr.com/5016/...aa4233fa07.jpg

Last picture in the car is with electric heat running (12A batt draw)
Bezel is just 1/8" thk clear acrylic which I masked off and spraypainted black
on the backside.

jackbauer 02-17-2011 03:55 AM

Fantastic piece of work. Well done indeed. Interested to see the code and pcb.

Freyguy 02-17-2011 09:48 AM

Thanks Jackbauer! As is the work I've seen you post.:thumbup:
Got the image link thing working with Paul's help, so you can see the pcb in my previous post.
As for the code- Well, I'm a guy that does things the hard way, that is... ALL of this is done in PIC assembler. I'm not a glutton for punishment, I just never learned C. I worked in new product development for 14 years and as a hardware designer, I only had to design the schematic & pcb, then write a specifications document for the software engineer. Sure, I'd write little assembly routines to verify functions on all I/O in my designs, but they did all the heavy lifting.
This probably represents the most code I've written since school (think Intel8088). That being said, making this have a serial command interface to change parameters would be a significant undertaking for me.
A $35 investment in a PIC programmer along with downloading the free MPLAB IDE is the only option. You open up the project, go to the declared variables section and change parameters. I have this well commented in the code and I plan on doing a step by step writeup showing how to change, recompile and reprogram the part.
However, anyone with a background in programming PICs in C and who is interested in this project is welcome to add the serial command interface. While they'd need to purchase all the hardware themselves I would donate my spare PCB (I had 2 done by BatchPCB).

wakinyantanka 02-17-2011 10:06 AM

Quote:

Originally Posted by Freyguy (Post 220727)
Hey Thanks guys!
Mr Bigh- the display is easily readable at 3'. Reason I chose the oversized character version. It could work in parallel with RTD Explorer only if RTD is used to receive data from the Cougar. Both RTD and the LCD can't transmit unless you incorporate some kind of A/B distribution switch. More than 2 profiles gets complicated and now you need an indicator showing which one you're running with.

Wakinyantanka- As long as the status message sent from the high amp version is formatted the same it should be compatible. If the configuration parameters are different, it shouldn't matter since the user programs in the serial data he wants transmitted as his "profile".
DCB- Yes, every pin is used up. You could drop in a PIC18F2420 which is the same part without the CANbus. The two I/O lines for CAN then become standard I/O.

So the crazy people like me that are shooting for 2000 amps with our controllers could set it up to read the amperage draw? That would be awesome!!!

dcb 02-17-2011 10:25 AM

For the budget minded, there is a $17.50 pickit 2 clone here that I have used successfully:
Build A PIC Programmer Based On PIC18A Prototyping Board

Nevyn 02-17-2011 01:24 PM

Macungie, PA? A LOCAL! Well, sort of. I work in Allentown, but live northward. I'm working towards an EV conversion of my own - this will be a great addition!

jackbauer 02-17-2011 01:40 PM

Started out with the 6809 myself back in the day. Did a lot of pic assembler starting on the 16C54. I'm not much good with c but find mikrobasic very easy to use. i am so building me one of these :)

Freyguy 02-17-2011 08:39 PM

Wakinyantanka,
Currently the range for CF and BA are 511.Most likely due to the 2.5~5V range of the LEM which corresponds to 511 steps of the 10-bit(1024) range of the Atmega A/D. This voltage range shouldn't change with Paul's Melexis part for high amp controller. So 1000A will still be conveyed over the same 511 steps. In my firmware there is a "scaler"parameter associated with motor amps. It was added because my custom Cougar firmware's full throttle range is 600A versus standard 500A, so I needed to scale CF's 511 range to 600. I see no problem with this being able to scale to 1000A.

Freyguy 02-17-2011 08:49 PM

Quote:

Originally Posted by Nevyn (Post 220808)
Macungie, PA? A LOCAL! Well, sort of. I work in Allentown, but live northward. I'm working towards an EV conversion of my own - this will be a great addition!

Ya, Macungie is home of the car shows.....Wheels of Time, Das Awkscht Fescht, and don't forget the Macungie EV show. That one is April 30th this year. I hope to see you there Nevyn! I'll be there even if my car isn't ready:D

Freyguy 02-17-2011 08:58 PM

Quote:

Originally Posted by jackbauer (Post 220811)
Started out with the 6809 myself back in the day. Did a lot of pic assembler starting on the 16C54. I'm not much good with c but find mikrobasic very easy to use. i am so building me one of these :)

16C series huh? I've worked with them and can tell you the 18F's are SO much better. Larger instruction set which includes compares, and 8x8 hardware multiplier which I use FREQUENTLY in my code. I'll have to look into mikrobasic.

wakinyantanka 02-18-2011 09:18 AM

Quote:

Originally Posted by Freyguy (Post 220855)
Wakinyantanka,
Currently the range for CF and BA are 511.Most likely due to the 2.5~5V range of the LEM which corresponds to 511 steps of the 10-bit(1024) range of the Atmega A/D. This voltage range shouldn't change with Paul's Melexis part for high amp controller. So 1000A will still be conveyed over the same 511 steps. In my firmware there is a "scaler"parameter associated with motor amps. It was added because my custom Cougar firmware's full throttle range is 600A versus standard 500A, so I needed to scale CF's 511 range to 600. I see no problem with this being able to scale to 1000A.

Paul's quote of readable amperage was very funny. Could the scale be adjusted to 2000A?

Nevyn 02-18-2011 11:47 AM

Didn't know about the EV show - I'll have to put it on my calendar!

Freyguy 02-18-2011 05:16 PM

Quote:

Originally Posted by wakinyantanka (Post 220906)
Paul's quote of readable amperage was very funny. Could the scale be adjusted to 2000A?

Yes, Paul's posts usually require that you not be eating or drinking for fear of choking!
As the firmware exists today, a user adjustable "scaler" for motor amps allows displaying up to 999A. Anything more and code would need modification to display a thousands digit. Simple change really since there is space on the display for it.

wakinyantanka 02-19-2011 12:49 PM

Quote:

Originally Posted by Freyguy (Post 220961)
Yes, Paul's posts usually require that you not be eating or drinking for fear of choking!
As the firmware exists today, a user adjustable "scaler" for motor amps allows displaying up to 999A. Anything more and code would need modification to display a thousands digit. Simple change really since there is space on the display for it.

Nice!!! I want one!

MPaulHolmes 02-19-2011 03:14 PM

Man, I want one too. I love the miles to empty. that's way too cool for school.

Freyguy 02-19-2011 09:26 PM

Thought I'd show it in operation in my car. Used the flip video rather than my camcorder so video quality isn't the best. I'm in the process of doing a writeup for operation and another for setting parameters using MPLAB.
Still making minor tweaks to firmware. Hope to have all info up on the Wiki within a week.

http://www.youtube.com/watch?v=Sq5bbojhXzQ

adamj12b 02-20-2011 11:05 AM

Quote:

Originally Posted by Freyguy (Post 220856)
Ya, Macungie is home of the car shows.....Wheels of Time, Das Awkscht Fescht, and don't forget the Macungie EV show. That one is April 30th this year. I hope to see you there Nevyn! I'll be there even if my car isn't ready:D

Hey,

Were you guys there last yet? I was. I brought my version of the motor controller and showed it off all day under the huge tree(oak if I remember correctly)

I will be there again this year. Looking forward to it. Even with it being a almost a 5 hour ride, its totally worth it.

-Adam

Freyguy 02-20-2011 01:19 PM

Hi Adam,
I was there last year though I got there a little late. I remember your display-it was the one surrounded by the large crowd:)
What goodies are you showing this year? The preliminary 6kW charger perhaps??

Freyguy 02-26-2011 12:52 PM

For those interested, I have support documents, bom, PCB fab files cleaned up and ready to go. I hear the wiki is down, so for now you’ll need to pm me so I can email them to you. I made some final changes to the code, most notably motor amp display up to 9,999, optional temperature compensation of traction battery capacity and leading zero suppression (creates better visual for amp magnitude changes).

Excluding the bare PCB & shipping costs, the material costs for LCD display and all components will be in the $43~50 range. More towards $43 if you want to forgo canbus. I have no code written to support it at this point anyway.

Keep in mind that this is designed around the very common Hitachi 44780 LCD controller. With minor code changes, this would support up to a 40char x 2 line LCD. Steal an I/O line (possible if you eliminate CAN) and you can expand this to a 40char x 4 line LCD.

-Chris

mrbigh 02-26-2011 01:17 PM

Quote:

Originally Posted by Freyguy (Post 222350)
For those interested, I have support documents, bom, PCB fab files cleaned up and ready to go. I hear the wiki is down, so for now you’ll need to pm me so I can email them to you. I made some final changes to the code, most notably motor amp display up to 9,999, optional temperature compensation of traction battery capacity and leading zero suppression (creates better visual for amp magnitude changes).

Excluding the bare PCB & shipping costs, the material costs for LCD display and all components will be in the $43~50 range. More towards $43 if you want to forgo canbus. I have no code written to support it at this point anyway.

Keep in mind that this is designed around the very common Hitachi 44780 LCD controller. With minor code changes, this would support up to a 40char x 2 line LCD. Steal an I/O line (possible if you eliminate CAN) and you can expand this to a 40char x 4 line LCD.

-Chris

Hi are you planning to supply the PC board or a parts kit?
Thank you

MPaulHolmes 02-26-2011 02:06 PM

Not to put words in his mouth, but I can tell you that he just wants to make the information available, and not supply kits, and shipping, and all that stuff. Way too time consuming!

Freyguy 02-26-2011 05:29 PM

Quote:

Originally Posted by MPaulHolmes (Post 222365)
Not to put words in his mouth, but I can tell you that he just wants to make the information available, and not supply kits, and shipping, and all that stuff. Way too time consuming!

Mr Bigh,
Very sorry, but Paul's right. My schedule really doesn't leave room to involve myself in something like that. I tried to be as thorough with the support documentation as possible to make this a fairly easy project to tackle.
A group buy of PCB's might be economical since you can amortize the setup fee over the qty of boards. BatchPCB also has a marketplace option where others can purchase my design which would be shown on their website. I would add zero markup, but they might (not sure).
Let me look into that.

-Chris

harlequin2 02-26-2011 08:39 PM

Quote:

Originally Posted by Freyguy (Post 222390)
Mr Bigh,
Very sorry, but Paul's right. My schedule really doesn't leave room to involve myself in something like that. I tried to be as thorough with the support documentation as possible to make this a fairly easy project to tackle.
A group buy of PCB's might be economical since you can amortize the setup fee over the qty of boards. BatchPCB also has a marketplace option where others can purchase my design which would be shown on their website. I would add zero markup, but they might (not sure).
Let me look into that.

-Chris

I have asked PCBCART for a quote for 10 pcs - result is $104 not including postage. I'm thinking of ordering 10 - might be a better job than me making my own (no plated thru holes) so if anyone wants one, let me know. If we can get up to 10 or more, its a go. You would need to send me about $11 plus postage per board.

wakinyantanka 02-26-2011 08:59 PM

Quote:

Originally Posted by harlequin2 (Post 222410)
I have asked PCBCART for a quote for 10 pcs - result is $104 not including postage. I'm thinking of ordering 10 - might be a better job than me making my own (no plated thru holes) so if anyone wants one, let me know. If we can get up to 10 or more, its a go. You would need to send me about $11 plus postage per board.

Count me in. Where do you want us to send the cash?:thumbup:

pnikolaj 02-26-2011 09:55 PM

Me too please. I am about done with my controller (Thanks to Paul for the boards and help finding parts). Just got my motor connected to the transaxle so it may take a while before I get to this, but it looks awesome. Great work!

harlequin2 02-26-2011 10:08 PM

Quote:

Originally Posted by pnikolaj (Post 222424)
Me too please. I am about done with my controller (Thanks to Paul for the boards and help finding parts). Just got my motor connected to the transaxle so it may take a while before I get to this, but it looks awesome. Great work!

Well, that's 4 so far, including me. Sounds like enough interest to place an order. I have a PayPal account somewhere, probably you can pay that, but I'll wait until they give me an exact price (from the Gerber files) and also the postage then let you know.
Also waiting to hear back from Chris to see if the pcb outfit he used will sell us boards and at what price - I won't place the order until we hear.

Freyguy 02-27-2011 09:02 AM

Hey guys,
Even if I apply no markup on the board selling thru BatchPCB marketplace, your looking at no cheaper than what I paid. $10 setup plus $2.50/sq inch.
That came to $22 excluding shipping. That was another $15. Order qty is 1 so you can't amortize the $10 setup over multiple boards. You'd need to place multiple orders! Worse is the 5 week leadtime.

PCBCART is also overseas, but I don't know their quoted leadtime.
Their pricing, however looks like the best I've seen.

Harlequin2, thanks for organizing this:thumbup:

jackbauer 02-27-2011 09:18 AM

I'm in for 2 or 3 pieces.

Weisheimer 02-27-2011 09:56 AM

LCD instrumentation
 
I would also be in for 3.

We should also look at building a public BOM at Digikey or etc for the parts
and then posting that link.
I'll look into that if I can put aside a bit of time one evening.

Thank You Chris for sharing this project!

MPaulHolmes 02-27-2011 11:54 AM

PCBCart leadtime is either 8 days or 12 days (12 is cheaper). And they are never late (except during the chinese new year). Also, their shipping is SUPER fast, around 2-3 days to the U.S.

E Vdubya 02-27-2011 11:58 AM

PCB order
 
I'm in for one. My car is still a bit from completion so 5 or 6 weeks for the board is not an issue. My only concern is cable length. I have an old beetle so the controller will be in the rear and the display on the dash would require an extra log RS232 cable. Would there be any other way for the two to communicate? Any ideas?
John

Freyguy 02-27-2011 04:03 PM

John,
RS232 @ 19.2k baud, should be good up to 25ft. Use good shielded cable and you'll be fine. Use a low capacitance shielded cable and you could extend that to several 100ft.
-Chris


All times are GMT -4. The time now is 03:40 PM.

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