Old BMS Hardware Thread
Moderators: GregsGarage, retepsnikrep
Re: Old BMS Hardware Thread
Peter , on the pin diagram at the start of the master code RA6 and RA7 are reversed. Pin 9 is RA7 and Pin 10 is RA6.
-
- Posts: 870
- Joined: Tue Apr 01, 2008 5:27 pm
- Location: Galashiels, Scottish Borders
- Contact:
Re: Old BMS Hardware Thread
retepsnikrep wrote:Looking at the 16F886 chip pinouts I discovered that Pin RA6 & RA7 are not logically placed and are reversed!!
Never had that problem with the picaxe
Glad you found it, lets hope it works.
Greg Fordyce
Daewoo Matiz
http://www.evalbum.com/4191
Daewoo Matiz
http://www.evalbum.com/4191
Re: Old BMS Hardware Thread
Right now its running on the bench with 4 cells. The "M" in mph flashes when not charging and i have a counter incrementing at 1 sec intervals in the top right of the screen. My i2c temp sensors dont seem to want to work anymore even with the correct id! One potential problem is if the 1 sec pulse stops pulsing the program waits forever in a loop.
Re: Old BMS Hardware Thread
Ok temp sensors up and running. I was a muppet
One thing that has never work for me is the odometer. The trip counter works fine
One thing that has never work for me is the odometer. The trip counter works fine
- retepsnikrep
- Posts: 1387
- Joined: Sat May 26, 2007 4:50 pm
- Location: North Yorkshire England
- Contact:
Re: Old BMS Hardware Thread
jackbauer wrote:Peter , on the pin diagram at the start of the master code RA6 and RA7 are reversed. Pin 9 is RA7 and Pin 10 is RA6.
That's where i went wrong.
I'll post my updated code once i have tested it this morning.
Re the odometer remember the pulses on this pin have to appear within the time allowed by the pulsin command and the define at the begining of the code.
Code: Select all
DEFINE PULSEIN_MAX 20000 'Set PULSIN maximum count to 20,000 (100ms) (Range 0-65535 x 5us units)
If you don't get two edges within the time then it will miss the pulse.
The max pulse length can be lengthened but remember this eats into the main loop.
It works on my setup which gives approx 4000 pulses per minute at 60mph or aboput 67hz
Regards Peter
Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.
Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.
- retepsnikrep
- Posts: 1387
- Joined: Sat May 26, 2007 4:50 pm
- Location: North Yorkshire England
- Contact:
Re: Old BMS Hardware Thread
jackbauer wrote:Right now its running on the bench with 4 cells. The "M" in mph flashes when not charging and i have a counter incrementing at 1 sec intervals in the top right of the screen. My i2c temp sensors dont seem to want to work anymore even with the correct id! One potential problem is if the 1 sec pulse stops pulsing the program waits forever in a loop.
The flashing M is caused by an extra space i put in by mistake. (Corrected in this mornings version)
I added a display of the passing seconds on the top line so i could ensure something was happening during this testing. This can be removed in the final version if we want. Or we could have a flashing character like a (*) or Something else from the extended ascii tables.
As you will see the charge active indicator (1 or 0) has also been moved from the bottom line to be on the same display line as the SOC. I moved this because when in charge mode the master does not service the CheckSpeed part of the program so although the charge bit was changing in the background it's status on the screen was not updated.
The new code also has an escape in the master and does not wait forever for the watchdog pulse. It triggers it's own alarm if no pulse for a few seconds.
Code: Select all
If Alarms = 9 Then '(Watchdog chip 1S pulse missing)
DEBUG "Watchdog Pulse" 'Video Display
endif
I have also improved the current calculation routine with some help from the picbasic pro forum. It's now a much simpler and more accurate calculation. Certainly for my own 100A sensor any way.
Old
Code: Select all
' if BatCurrent < Offset then 'If BatCurrent is < Offset means system is Discharging
' BatCurrent = ((Offset - BatCurrent) * 2) / 10 'Subtract offset to get a positive number (0-512 = 0-100A+) Max 99
' AmpSign = 45 'Set ascii Character 45 (-) to be displayed if Discharging
' goto ExitCurrent
' endif
' if BatCurrent > Offset then 'If BatCurrent is > Offset means system is Charging
' BatCurrent = ((BatCurrent - Offset) * 2) / 10 'Subtract offset to get a positive number (0-512 = 0-100A-) Max 99
' AmpSign = 43 'Set ascii Character 43 (+) to be displayed if charging
' goto ExitCurrent
' endif
New
Code: Select all
BatCurrent = (BatCurrent * 64) / 326 'New current (Amps) calculation for 100A sensor 090211
If BatCurrent < 100 then 'Means system is Discharging
AmpSign = 45 'Set ascii Character 45 (-) to be displayed if Discharging
BatCurrent = 100 - BatCurrent
else 'Means system is Charging
AmpSign = 43 'Set ascii Character 43 (+) to be displayed if charging
BatCurrent = BatCurrent - 100
endif
I'm sure that can also be tweaked for different current sensors, just ensure any values in the calculation do not exceed 65535 at any time. Potentially this means I should be able to get to within 200ma or so
Regards Peter
Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.
Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.
- retepsnikrep
- Posts: 1387
- Joined: Sat May 26, 2007 4:50 pm
- Location: North Yorkshire England
- Contact:
Re: Old BMS Hardware Thread
See software thread for new working master code!
Regards Peter
Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.
Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.
-
- Posts: 870
- Joined: Tue Apr 01, 2008 5:27 pm
- Location: Galashiels, Scottish Borders
- Contact:
Re: Old BMS Hardware Thread
One step closer today. Got the controller connected to the battery pack and the wheels go round as they should.
Next step is to get all the bms boards mounted and wired together. I am using almost the same Allegro sensor Peter is using (mine is the 50 amp version) and was going to knock up a pcb to mount it, with some nice anderson pcb connectors for the power leads. Note, I am going to only measure charger and DC-DC current with this sensor as the controller already measures motor current. This place will supply 10 off, max 5cm square, pcbs for $12! So unless I am reinventing the wheel here, I will fire up Kicad and give them a go.
Next step is to get all the bms boards mounted and wired together. I am using almost the same Allegro sensor Peter is using (mine is the 50 amp version) and was going to knock up a pcb to mount it, with some nice anderson pcb connectors for the power leads. Note, I am going to only measure charger and DC-DC current with this sensor as the controller already measures motor current. This place will supply 10 off, max 5cm square, pcbs for $12! So unless I am reinventing the wheel here, I will fire up Kicad and give them a go.
Greg Fordyce
Daewoo Matiz
http://www.evalbum.com/4191
Daewoo Matiz
http://www.evalbum.com/4191
- hohisilver
- Posts: 114
- Joined: Mon Jan 24, 2011 10:17 pm
- Location: Wells, Somerset
Re: Old BMS Hardware Thread
I'm planning to use the same current sensor as Peter, so I'll definitely be interested in a PCB if you're looking for takers!
The only thing that confuses me is where in the circuit I connect it - I've always understood you need to go in series to measure current, but those contacts look a bit flimsy for the currents we're dealing with?
The only thing that confuses me is where in the circuit I connect it - I've always understood you need to go in series to measure current, but those contacts look a bit flimsy for the currents we're dealing with?
Ian.
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
-
- Posts: 870
- Joined: Tue Apr 01, 2008 5:27 pm
- Location: Galashiels, Scottish Borders
- Contact:
Re: Old BMS Hardware Thread
The allegro current sensors are only good for a max current of 200 amps. This suits Peter's Insight projects and for me I will connect it so that no motor current passes through it, just the small loads on the pack.
Greg Fordyce
Daewoo Matiz
http://www.evalbum.com/4191
Daewoo Matiz
http://www.evalbum.com/4191
Who is online
Users browsing this forum: No registered users and 10 guests