Hi!
I’ve been working on hacking the cheapest Ebike controller I could find on Ebay.
So far, I’ve taken the controller out of the housing to look at the PCB. The H/L drivers seem to be implemented discreetly instead of a single driver IC, or 3 driver ICs.
I have traced out the connections for what I believe are the 6 H/L connections to the discrete driver inputs, and 5V/GND , and removed the controller IC, soldering flywires in place of it:
I tried using the 6PWM with STM32 bluepill, and the following code:
#include <Arduino.h>
#include <SimpleFOC.h>
// Motor instance
BLDCMotor motor = BLDCMotor(7);
BLDCDriver6PWM driver = BLDCDriver6PWM(PA8, PB13, PA9, PB14, PA10, PB15, NOT_SET);
void setup() {
// driver config
// power supply voltage [V]
driver.voltage_power_supply = 24;
driver.dead_zone = 0.5f;
driver.init();
// link the motor and the driver
motor.linkDriver(&driver);
motor.controller = ControlType::velocity_openloop;
// maximal voltage to be set to the motor
motor.voltage_limit = 2.0f;
// initialize motor
motor.init();
// align sensor and start FOC
//motor.initFOC();
}
void loop() {
// motor.loopFOC();
motor.move(5.0f);
}
When powered from my lab supply w/ a current limit of ~700mA, it hits the current limit instantly. The motor I can feel is very slightly twitching, and the FETs begin to get hot. With the motor disconnected, the current limit is still reached. This indicates to me that I’m not driving the circuit correctly and thus causing the FETs to go into short.
I then thought that the issue may be the logic level being too low (3.3V instead of 5V), and I also thought maybe I’m feeding the supply too low (its a 36V/48V controller), so I switched over to an Arduino Nano w/ 6 PWM mode, and upped supply to 42V. I used the following code:
#include <Arduino.h>
#include <SimpleFOC.h>
// Motor instance
BLDCMotor motor = BLDCMotor(7);
BLDCDriver6PWM driver = BLDCDriver6PWM(5,6, 9,10, 3,11, 8);
void setup() {
// driver config
// power supply voltage [V]
driver.voltage_power_supply = 42;
driver.init();
// link the motor and the driver
motor.linkDriver(&driver);
motor.controller = ControlType::velocity_openloop;
// maximal voltage to be set to the motor
motor.voltage_limit = 1.0f;
// initialize motor
motor.init();
// align sensor and start FOC
//motor.initFOC();
}
void loop() {
// motor.loopFOC();
motor.move(5.0f);
}
unfortunately, the results are identical to first try. The powersupply hits current limit immediately and cannot run the motor.
I have looked closely at the discrete driver and measured things and the implementation appears to be near identical to the somewhat well-known ‘KU63’ ebike controller. This is the schematic for the KU63 https://www.avdweb.nl/Article_files/Solarbike/Motor-controller/China-BLDC-motor-controller-36V-250W.pdf
I bought two of these controllers for if(when) I blew the one I’m modifying, but I’m thinking now I should take unmodified one and take it out of the enclosure and try to run it as-is, and probe around the controller to see if i’m missing something obvious. While I do that I thought I should make a post here seeing if any of you have any ideas about whats up. Thanks!