Page 45 of 61

Re: Old BMS Software Thread

Posted: Mon Mar 21, 2011 8:02 pm
by retepsnikrep
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.

Re: Old BMS Software Thread

Posted: Sun Mar 27, 2011 5:11 pm
by martinwinlow
...(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

Re: Old BMS Software Thread

Posted: Sun Mar 27, 2011 5:32 pm
by martinwinlow
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

Re: Old BMS Software Thread

Posted: Mon Mar 28, 2011 7:36 pm
by steiner
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

Re: Old BMS Software Thread

Posted: Sat Apr 02, 2011 4:00 pm
by martinwinlow
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.

Re: Old BMS Software Thread

Posted: Sat Apr 02, 2011 11:54 pm
by hohisilver
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...

Re: Old BMS Software Thread

Posted: Sun Apr 03, 2011 4:07 pm
by retepsnikrep
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.

Re: Old BMS Software Thread

Posted: Sun Apr 03, 2011 9:38 pm
by GregsGarage
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.

Re: Old BMS Software Thread

Posted: Mon Apr 04, 2011 9:21 am
by dillond666
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

Re: Old BMS Software Thread

Posted: Mon Apr 04, 2011 4:52 pm
by retepsnikrep
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