Author Topic: Cutoff Voltage  (Read 101144 times)

Offline OneEye

  • Confirmed
  • Master of Magic
  • *****
  • Posts: 261
Re: Cutoff Voltage
« Reply #15 on: July 31, 2007, 07:29:07 PM »
I am keenly aware the microcontroller uses software to makes decisions based on what it senses.  There are occasionally ways to change what the microcontroller is actually sensing, which could have the effect of perhaps lowering or raising a cutoff voltage.

For instance: 

1.  If the microcontroller is using an external chip for its voltage reference signal (ie it gets a TTL high or low from an external chip based on when the voltage moves out of 'spec')  you can change or replace the voltage reference chip to change the thresholds where it signals a bad voltage condition.

2.  If the microcontroller uses an internal voltage reference (the specs on the specific microcontroller can help in this regard), it is sometimes done through a serial resistor that scales the actual voltage to the sensed voltage.  Changing the resistor can adjusts the scale so the desired cutoff voltage is now sensed as though it were the stock cutoff voltage.

This has been done on other controllers.  A schematic is (obviously) extremely helpful.

It is obviously a warranty voiding experiment, and chances of success are limited.  It would be neat if the controller had a software setting to change the cutoff voltage to different values, but that is obviously asking a lot.  If all else fails you can always buy a 3rd party controller that has the right voltage cutoff (or a programmable cutoff) as a feature.


Oh well, wishful thinking.

Offline myelectricbike

  • PhD. Magic
  • ******
  • Posts: 644
    • How to Build an Electric Bike
Re: Cutoff Voltage
« Reply #16 on: July 31, 2007, 08:34:51 PM »
Let me back up here a minute... Atmel makes a dandy 3 phase microcontroller that you can power with an external voltage regulator from most any supply level above TTL. It may even offer sin wave output!

You merely need to write a program to set the operating range (top and bottom cut-off) based on input from a supply voltage sensor. The two operating range criteria are then, 1.) preventing deep discharge, and 2.) not exceeding the mosfets maximum power rating.

With large enough mosfets, top cutoff might not even be an issue, which leaves only deep discharge a concern. It probably would not be to difficult to construct a cutoff circuit for each battery in the pack so that this problem is solved.






Offline OneEye

  • Confirmed
  • Master of Magic
  • *****
  • Posts: 261
Re: Cutoff Voltage
« Reply #17 on: July 31, 2007, 09:11:46 PM »
True, that would be a good approach.  Essentially you always feed the microcontroller pin responsible for voltage sensing with the "right" signal and then offload the low-voltage cutoff elsewhere. 

In effect you remove the controller from the voltage cutoff part of the equation and use a different method to protect the battery system.  Some of the lithium chemistry battery packs already have low-voltage protection in their BMS (to prevent voltage reversal in a cell = dead cell, and possible thermal runaway)

Offline myelectricbike

  • PhD. Magic
  • ******
  • Posts: 644
    • How to Build an Electric Bike
Re: Cutoff Voltage
« Reply #18 on: August 01, 2007, 07:17:26 AM »

Offline pdonahue

  • Confirmed
  • Magic Undergrad
  • ***
  • Posts: 68
Re: Cutoff Voltage
« Reply #19 on: August 01, 2007, 02:15:25 PM »

The 36V controller uses a PIC16F72.

The pins are (as far as I can tell):

1: not MCLR (drag low to reset the processor)
2: ???
3:  Measure input voltage for low voltage cutout
4:  ???
5:  Throttle input
6:  Brake input
7:  ???
8:  GND
9:  Oscillator
10:  Oscillator
11: ???
12: ???
13: ???
14: ???

15, 16, 17:  Hall sensor inputs
18: Green LED
19: GND
20: +5V
21: ???
22:  ??? (connected to the LM356 op-amp chip)
23, 24, 25, 26, 27, 28:  Outputs to the FET gate drivers. 

If anyone has more info please share.

Offline myelectricbike

  • PhD. Magic
  • ******
  • Posts: 644
    • How to Build an Electric Bike
Re: Cutoff Voltage
« Reply #20 on: August 01, 2007, 03:09:40 PM »
Did you scan or take a photo of the circuit board while it was out of the extrusion case? (both sides)

Offline OneEye

  • Confirmed
  • Master of Magic
  • *****
  • Posts: 261
Re: Cutoff Voltage
« Reply #21 on: August 01, 2007, 03:45:25 PM »
Here's the datasheet for the microcontroller: http://ww1.microchip.com/downloads/en/devicedoc/39597b.pdf

Pin 3 can serve either as a TTL I/O port, or as an analog/digital converter.  That still leaves it somewhat ambiguous what is triggering the low voltage cutoff.

More information is needed:

1.  Follow the trace from pin 3 to see what other components are feeding the signal to it.
2.  Put a voltmeter on it in operation as the battery voltage drops below 31.5V. 

If the voltage on that trace goes from ~5V to ~0V, this would indicate a TTL I/O port, so a separate component is providing the voltage sensing logic.

If the voltage on that trace goes from ~0V to ~5V, it would also indicate a TTL I/O port, but the controller is looking for a positive "bad voltage" signal.  In that case, cutting the trace might disable the low voltage cutoff.

If the voltage on the line doesn't show a sharp transition, it would indicate the pin is being used as an A/D converter.  The A/D inputs can use either supply voltage or voltage on pin 5 as a reference.  Pin 5 is noted by pdonahue as being the throttle input, so if it is being used as an A/D converter it must be comparing the voltage on pin 3 to VDD.  In a way that's too bad, if it had been using pin 5 as the voltage reference we could just play with the voltage provided to pin 5 (a diode on the line to drop the voltage?) in order to make the controller think the voltage on pin 3 was a bit higher.

Offline OneEye

  • Confirmed
  • Master of Magic
  • *****
  • Posts: 261
Re: Cutoff Voltage
« Reply #22 on: August 01, 2007, 03:54:10 PM »
myelectricbike said:
Quote
DIY motor controller

There is also the Open Source Motor Controller (OSMC) as an option.  Definitely only for someone who knows a lot about electronics design though.

Offline pdonahue

  • Confirmed
  • Magic Undergrad
  • ***
  • Posts: 68
Re: Cutoff Voltage
« Reply #23 on: August 01, 2007, 03:58:45 PM »

I suspect that the low voltage cutoff is under software control, however I think the high voltage cutoff must be implemented using some sort of latching hardware (that then feeds into a digital I/O pin on the MCU) since doing a processor reboot doesn't reset the high voltage cutout.  The only way I have found to reset the high voltage cutout is to remove power, wait for the caps to discharge, and then reconnect the power.

Pete


Offline OneEye

  • Confirmed
  • Master of Magic
  • *****
  • Posts: 261
Re: Cutoff Voltage
« Reply #24 on: August 01, 2007, 04:21:16 PM »
Thanks for all the info you are putting up, pdonahue.  Does the 11k resistor on the trace from pin3 go directly to the supply voltage?  If so, you're probably right about changing out the resistor to give a higher sensed voltage for the low voltage cutoff.  I should go find a circuit simulator to play around with the numbers and see what would change the low voltage cutoff to ~22V.  You mentioned in that post that you took a picture.  Can you post it for us?

Offline myelectricbike

  • PhD. Magic
  • ******
  • Posts: 644
    • How to Build an Electric Bike
Re: Cutoff Voltage
« Reply #25 on: August 01, 2007, 04:44:52 PM »
Did you read the note on page 2 for the PIC16F72...? The PDF file will not even allow it to be copied...


Offline pdonahue

  • Confirmed
  • Magic Undergrad
  • ***
  • Posts: 68
Re: Cutoff Voltage
« Reply #26 on: August 01, 2007, 05:32:08 PM »

The 11K does in face go directly to the supply voltage, but it is also connected to GND by a 1.2K resistor forming a voltage divider such that the actual voltage at the pin is:
 Vpin = (Vin) * (1200 / (11000+1200))

I think I am recalling the resistor values correctly, but I'll check this evening.  The original cutout is at around 31.5 volts (3.1 volts at the pin).

Changing the 11K to a 7.5K would set the cutout to the correct value, but that would make the pin voltage ~5.8v for a fully charged battery.  I doubt that the PIC will appreciate having any of its pins that high. 

A compromise would be to try a 9K resistor so that 42v input gives close to 5v at the pin and the cutoff is around 26v.

As for the picture, I don't have my flash card here so I'll have to try to remember to post it tonight.

Pete

Offline pdonahue

  • Confirmed
  • Magic Undergrad
  • ***
  • Posts: 68
Re: Cutoff Voltage
« Reply #27 on: August 01, 2007, 05:38:05 PM »
Which "note" are you referring to?

Offline OneEye

  • Confirmed
  • Master of Magic
  • *****
  • Posts: 261
Re: Cutoff Voltage
« Reply #28 on: August 01, 2007, 05:42:12 PM »
Actually, that 7.5K resistor should be just about perfect for using DeWalt batteries.  Right off the charger they are 36V and drop quickly down to 33V and lower.  At 36V, the pin voltage would be just about 5.0V.  The input pins will take VDD+0.3V if they are being used as A/D inputs.  I'm assuming VDD is somewhere near 5.0V.

At low voltage, 22.5V will show as 3.1V on the pin, which would be the same as an SLA setup at 31.5V.

If I remember my physics of electricity and magnetism correctly, paralleling a 24K resistor with the 11K resistor will give you an effective resistance of about 7.5K.

Thanks pdonahue!
« Last Edit: August 01, 2007, 05:56:15 PM by OneEye »

Offline OneEye

  • Confirmed
  • Master of Magic
  • *****
  • Posts: 261
Re: Cutoff Voltage
« Reply #29 on: August 01, 2007, 05:44:34 PM »
right click on the link and "save target as..." if you want to save a local copy.

I'm glad these are bikes and not medical devices.