Old BMS Software Thread

Threads relating to the BMS system begun by Peter Perkins

Moderators: GregsGarage, retepsnikrep

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Re: Old BMS Software Thread

Postby retepsnikrep » Mon Mar 21, 2011 8:02 pm

martinwinlow wrote:Next question... can i use 20+ IC2 temp sensors? If there arn't enough variables avaialble could I use the same variable and just read and 'owout' each reading in turn?

Possibly :wink: The owin out commands use a fair bit of memory so you may run out. I would think half a dozen is a practical limit. Why do you want 20?

When I connect the current sensor the display tends to be quite signiificantly affected - it goes like an old TV with heavy distortion and rotating etc. Any ideas?


Have you checked it on the bench powered from a seperate 5v supply does the output vary as you expect? What does the output voltage read when zero current is flowing.

To use my -400 - 0 - +400 amp currant sensor can I ask, at line 789 in the CalulateSOC: subroutine, do I need to divide by 2.5 rather than 10 (I gather I have to multiply by 10 first and then divide by 25)?


The maths code has changed in the latest versions, your on your own with this one. :shock: maths is not my strong suit.
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.

martinwinlow
Posts: 79
Joined: Mon Jun 11, 2007 9:35 am
Location: Herts, UK

Re: Old BMS Software Thread

Postby martinwinlow » Sun Mar 27, 2011 5:11 pm

...(IC2 temp sensors) Why do you want 20?
I was hoping to arrange an array of them within the battery box to monitor the temps in a '3D' kinda way... but not really important. If I wanted to add just another 2 sensors, can I just reproduce the 8 lines of sensor code between 'if TempInc =' and 'endif' another 2 times using a Temp3Before/Temp3After & Temp4Before/Temp4After, set TempSensors = 4 and adjust the PClogger o/p accordingly?

Have you checked it on the bench powered from a seperate 5v supply does the output vary as you expect? What does the output voltage read when zero current is flowing.
No. But I have found that the Master V2 board 5V is actually only 4.5V for some reason... that's probably the problem.

I'm trying to get my Netgain tach sensor ( http://www.ngcontrols.com/PDFs/WarP_Mot ... Sensor.pdf ) to work but I see the Master code is looking to measure the width of a low ie Vss pulse to represent speed. The Warp sensor does sort of the reverse, providing roughly 5ms 'low' pulses in 55ms of high for around 1100 rpm (with one magnet) - the high pulse width indicating the speed becasue the length of the high pulse represents the time the sensor magnet is not switching/passing the sensor. Is this something I can adapt to within the software or am I going to have to invert the signal? Incidentally, this sensor - although designed for 12V appears to work fine at 5V giving a 4.5V high pulse voltage. Whether it will still under heavy RFI conditions is another matter. MW
Last edited by martinwinlow on Sat Apr 02, 2011 4:00 pm, edited 5 times in total.
Regards, Martin Winlow
Herts, UK
http://www.evalbum.com/2092
www.winlow.co.uk

martinwinlow
Posts: 79
Joined: Mon Jun 11, 2007 9:35 am
Location: Herts, UK

Re: Old BMS Software Thread

Postby martinwinlow » Sun Mar 27, 2011 5:32 pm

OK... found the answer to part of my last post.. I gather if the 'state' argument in the PulseIn command is changed from '1' to '0' then it will look for a 'low' pulse rather than a high... easy peasy... maybe... MW
Regards, Martin Winlow
Herts, UK
http://www.evalbum.com/2092
www.winlow.co.uk

steiner
Posts: 89
Joined: Mon Sep 08, 2008 1:50 am
Location: Florida

Re: Old BMS Software Thread

Postby steiner » Mon Mar 28, 2011 7:36 pm

Peter,

Just wanted to point out a small issue on the latest version of the master. Line 5 of your header says to use the internal PM compiler not MPASM. On page 5 where you set you configuration bits it says "below used with MPASM Assembler". You had previously mentioned that you are only using MPASM with the code so I am assuming line 5 is left over from a previous version.

Rick

martinwinlow
Posts: 79
Joined: Mon Jun 11, 2007 9:35 am
Location: Herts, UK

Re: Old BMS Software Thread

Postby martinwinlow » Sat Apr 02, 2011 4:00 pm

Peter et al,

Am still having probs with current sensing and speed sensing.

I had a soldering issue with my LEM sensor where I had solder-bridged the output and Vref pins and wonder (as I can't get any sense out of it) if I have either damaged the sensor or damaged the speed input to the 886. If I put a trim pot across J15 of the master PCB I should be able to vary the J15/pin3 voltage to simulate the o/p of the currant sensor with 2.5V being '0A' - is this correct?

Next, jackbauer (Damien?) - I gather you have used the LEM type sensor. Can you confirm my wiring as per viewtopic.php?f=53&t=2059&start=380 is correct?

On the speed sensing front, I have included a scope capture showing what I get out of the Warp speed sensor and it gives a 4.5V high and 0V low. In the Master .txt files the pulsIn parameters show a '1' for measuring a high pulse width yet the comment in the .txt file refers to measuring Vss - ie ground ie a low pulse....? Confused of Much Hadham.
Attachments
IMG_0030.jpg
IMG_0030.jpg (15.52 KiB) Viewed 18497 times
Regards, Martin Winlow
Herts, UK
http://www.evalbum.com/2092
www.winlow.co.uk

User avatar
hohisilver
Posts: 114
Joined: Mon Jan 24, 2011 10:17 pm
Location: Wells, Somerset

Re: Old BMS Software Thread

Postby hohisilver » Sat Apr 02, 2011 11:54 pm

My C rewrite gathers more pace, I now have interrupt-driven comms for the display and the slaves, using the on-board UART. It took me a while to realise that the PBP serout and serin commands are mostly using inverted signals (which caused me a few headaches!). Because of this I've had to invert the signal to the Rx pin and to use the UART for video I've swapped the video and dash LED 1 pins:

Image

It's not pretty, but it works!

I've got my "run display" almost formatted (few tweaks still required), as you'll see I've reinstated "big numbers" as there's no way I'll see the standard-sized numbers on my scooter on my tiny 2.5" display! :lol:

Image

Still to do:
All the menus, reading the temp sensors (interrupt-driving those is causing me major grief!), serial eeprom writing, er... I think I've still got some way to go...
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....

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Re: Old BMS Software Thread

Postby retepsnikrep » Sun Apr 03, 2011 4:07 pm

martinwinlow wrote: If I put a trim pot across J15 of the master PCB I should be able to vary the J15/pin3 voltage to simulate the o/p of the currant sensor with 2.5V being '0A' - is this correct?
Yes that should work.

martinwinlow wrote:Next, jackbauer (Damien?) - I gather you have used the LEM type sensor. Can you confirm my wiring as per viewtopic.php?f=53&t=2059&start=380 is correct?
No idea on this.


martinwinlow wrote:On the speed sensing front, I have included a scope capture showing what I get out of the Warp speed sensor and it gives a 4.5V high and 0V low. In the Master .txt files the pulsIn parameters show a '1' for measuring a high pulse width yet the comment in the .txt file refers to measuring Vss - ie ground ie a low pulse....? Confused of Much Hadham.
Does the number of your pulses vary or the width of them? Try both options for pulsin? I haven't used the speed code for months so it may need some work. Are you trying to measure motor rpm or vehicle speed? You might need the count command rather than pulsein.
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.

GregsGarage
Posts: 870
Joined: Tue Apr 01, 2008 5:27 pm
Location: Galashiels, Scottish Borders
Contact:

Re: Old BMS Software Thread

Postby GregsGarage » Sun Apr 03, 2011 9:38 pm

hohisilver wrote:... as you'll see I've reinstated "big numbers" as there's no way I'll see the standard-sized numbers on my scooter on my tiny 2.5" display! :lol:


Glad someone is getting use of the big numbers, 8) let us know how readable they are on the move.
Greg Fordyce

Daewoo Matiz
http://www.evalbum.com/4191

User avatar
dillond666
Posts: 139
Joined: Mon May 26, 2008 7:52 pm
Location: Central Scotland

Re: Old BMS Software Thread

Postby dillond666 » Mon Apr 04, 2011 9:21 am

Martin,
On the speed sensing front, I have included a scope capture showing what I get out of the Warp speed sensor and it gives a 4.5V high and 0V low. In the Master .txt files the pulsIn parameters show a '1' for measuring a high pulse width yet the comment in the .txt file refers to measuring Vss - ie ground ie a low pulse....? Confused of Much Hadham.


My sensor on the warp motor is pulled low 4 times per revolution. (I've got the older model though)
If the pulsin parameter "1" is looking for a low to high transition before measuring then you would be measuring the comparatively long high output.
Changing the program to use a high to low transition before measuring is what you want I think.

Derek

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Re: Old BMS Software Thread

Postby retepsnikrep » Mon Apr 04, 2011 4:52 pm

If you are trying to measure rpm on a warp as mentioned with pulses x4 per rpm then count sounds a better option. You can use say 100ms for the count time and should make the maths pretty easy.

So 1000rpm would equal about 6.5 pulses every 100ms
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.


Return to “BMS thread”

Who is online

Users browsing this forum: No registered users and 29 guests