Index

About the project

  1. about this documentation in HTML
  2. License

Controllers

  1. BMSBattery S06x
    1. LCD control panel
      1. LCD protocol
    2. S06S
      1. PWM signals
        1. very low speed - 6 steps
        2. low speed up to max speed - sineware
    3. S06P
      1. various info
        1. 01
        2. 02
  2. BMSBattery S12S
  3. BMSBattery bottle battery controller
  4. GreenEBikeKit
  5. Kunteng 18 mosfets

Datasheets and application notes

  1. STM8S105C6T6
    1. Interrupts
  2. Alternatives

Development tools

  1. STLinkV2 - Flash/program/debug hardware
  2. Flash and debug connector on S Series controller
  3. Debug OpenOCD and Eclipse
    1. stm8-binutils-gdb
  4. Flash programming
  5. C library
  6. Various resources
    1. Printf example

Motor control

  1. Motor control scheme of S06S controller
  2. BLDC 6 steps
  3. PWM schemes
    1. So, Which PWM Technique is Best? (Part 1)
    2. So, Which PWM Technique is Best? (Part 2)
    3. So, Which PWM Technique is Best? (Part 3)
    4. So, Which PWM Technique is Best? (Part 4)
    5. So, Which PWM Technique is Best? (Part 5)
    6. So, Which PWM Technique is Best? (Part 6)
    7. So, Which PWM Technique is Best? (Part 7)
  4. PWM control and Dead Time Insertion
  5. Low inductance motors
  6. Throttle Control Modes

Various

  1. Endless-sphere.com forum messages
    1. 2017.04.25 - Initial forum message
    2. 2017.05.08 - First flash and debug on a dev board
    3. 2017.05.18 - First code flashing and running
    4. 2017.05.20 - more new information
  2. How to unlock proteced read memory
  3. STM8S003 board
  4. LOG
    1. 2017.06.19 - SVM current waveforms

Clipping

  1. 2017.05.22 - Hackaday Links: May 21, 2017

Smart BMS with bluetooth

S06S


Schematic
Components
Pins connections to microcontroller
Battery voltage


Schematic


Linked file: BMSBattery_S06S-Kuteng_EBike_motor_controller_schematic.pdf


Thanks to KingQueenWong that did the schematic!! Get the source files here.

Components


STM8S105C6T6 (LQFP48) ST
◇ microcontroller STM8S-medium density
◇ Access line, 16 MHz STM8S 8-bit MCU, 32 Kbyte Flash, integrated EEPROM, 10-bit ADC, timers, UART, SPI, I²C, 48 pins LQFP
• LM317 (TO-220) ST
◇ voltage regulator: outputs 14.8V for the mosfet drivers
• 78L05 (TO-220) ST
◇ LDO voltage regulator: outputs 5V for the VCC
• LM358 (SO8) ST
◇ dual op-amp
◇ pin7: outputs a value from shunt current (motor total current)
▪ 1.63V when motor is stopped (zero current)
◇ pin1: always at 5V. Seems it is not used and is connected to 5V with a resistor
Linked file: LM358_datasheet.pdf

• ACS711 (QFN) Allegro (possible ACS711KEXLT-15AB-T, +-15.5 amps\)
◇ hall effect current sensor
◇ output pin goes through a resistor (and a capacitor to ground) to pin STM8S105C6T6 pin 17 PB5/AIN5. This measures a motor phase B current (green phase wire)
Linked file: ACS711_datasheet.pdf

▪ 2.5V when motor is stopped (zero current)
◇ fault pin is not used and is connected with a resistor to 5V
• TK150E09NE (TO-220AB) Toshiba
◇ mosfets


Pins connections to microcontroller


• pin 2: resistor 2200R and a capacitor to GND. This pin goes to blue wire of undocumented connector with 2 wires (blue and black(GND))
• pin 3: resistor 2200R and a capacitor to GND. Resistor 10k to VCC. This pin goes to a header pin that is not wired
• pin 10: BRAKE - through one resistor, goes to BRAKE wire
• pin 15: seems to stay always at 5V (Goes to a big diode..)
• pin 16: CURRENT SHUNT - goes to pin 7 LM358 (shunt current)
• pin 17: CURRENT PHASE B - goes to pin output of ACS711 (phase B current)
• pin 18: THROTTLE - low pass filter and goes to XS pin on the board as also to the throttle.
• pin 20: PWM pin phase A Yellow LOW. When motor very low speed, this pin is only on/off
• pin 21: PWM pin phase B Green LOW
• pin 22: PWM pin phase C Blue LOW
• pin 23: BATTERY VOLTAGE
• pin 24: seems to stay always at 2V
• pin 25: goes to a pin on the board that is unconnected (near a cable for throttle)
• pin 26: PWM pin phase C Blue HIGH
• pin 27: PWM pin phase B Green HIGH
• pin 28: PWM pin phase A Yellow HIGH
• pin 29: goes to 2nd pin on the board that is unconnected (DDB header)
• pin 30: SPEED - goes to speed sensor white wire
• pin 31: GND
• pin 32: VCC
• pin 33: NC ??
• pin 34: goes to 1st pin on the board that is unconnected (DDB header)
• pin 35: goes to unconnected pin with label RX2
• pin 36: NC ??
• pin 37: goes to a header pin and seems that is always at 5V
• pin 38: HALL SENSOR signal Blue
• pin 39: HALL SENSOR signal Green
• pin 40: HALL SENSOR signal Yellow
• pin 41: PAS - go to yellow wire of PAS connector
• pin 42: SWIM pin for flash/debug
• pin 43: connect to a pin header on the board with label T22
• pin 44: connect to a pin header on the board with label T23
• pin 45: connect to a pin header on the board with label T24
• pin 46: UART TX pin
• pin 47: UART RX pin
• pin 48: unknown, seems to always have 4.17V

Battery voltage


Battery voltage | AIN8 pin voltage
24V | 1.8v
30V | 2.25v
36V | 2.69v