JohMah / Hoverboard-JC2015.7.31.V2.0-Hack

MIT License
15 stars 6 forks source link

More detailed schemantics please #1

Open phpkadir opened 3 years ago

phpkadir commented 3 years ago

I want to know where is the dc battery voltage sensing circuit connected. where is the single shunt resistor for current sensing connected. i want to know where is the button pin connected. where is the led pins connected. i want to know lm358 opamp protection brk function and current sensor role. hall sensors connected to tim2 motor pwms tim1.

JohMah commented 3 years ago

@phpkadir Rearranged the schematics to make things more clear. Battery voltage sensing: PA5 Current sensing: PA7 Button: PA3 lm358 A is for current measurement. PA7. via R35(10k) connected to PB0. I don't know the function of that PB0. Hall sensors: PA0, PA1, PA2. Using software from https://github.com/flo199213/Hoverboard-Firmware-Hack-Gen2 and converting it to GD32F103 is work in progress.

phpkadir commented 3 years ago

dear johMah i am also working on this hoverboard motor driver card. i made 2 firmwares by using st motor control webench MCSDK 5.4.4 its current reading and protection circuit and pwm style is different from normal ir2101 gate drives. i also want to know low side switches operating mode. what is the state of low side mosfet switches when idle. timer1 brk input level low or high? can we use lm339 style hall sensor to back emf sensorless drive addition to hall sensor inputs? please co-operate with me. we should successfully develop a firmware for this valuable bldc driver and mems gyro accelerometer.

JohMah commented 3 years ago

@phpkadir lm339 "style" hall sensor can be used. The lm339 is not needed. Apparently the hall sensor signals are connected via the 3k3 resistors directly to PA0, PA1 and PA2. Back emf is not possible I think. I did not find a feedback signal from the motor wires to the micro controller. Behavior of the output is described in the schematics based on levels of outputs PA8 (high side) and PB13 (low side) that control power mosfets Q9 and Q13. In case PA8 is high impedance I expect Q9 to be off. In case PB13 is high impedance I expect Q13 to be off.

phpkadir commented 3 years ago

i think we can add sensorless option by using an interface card of lm339. at this situation we can drive the motor. there is an issue about pwms only.

i changed the gd32f103c8t6 mcu with stm32f103c8t6

Candas1 commented 3 years ago

Hi,

I started to look at porting Emanuel's FOC firmware to those boards. Happy to find out someone already started reverse engineering those boards. Did you start from the split board firmware from Florian ?

Regards,

Candas

JohMah commented 3 years ago

@Candas1 I started from the code of Florian. Changed it to run on the gd32f103c8t6. Added I2c code from other repo to read IMU data.

Candas1 commented 3 years ago

Oh so you had to port back from SPL to HAL ?

JohMah commented 3 years ago

@Candas1 I did not use STM32cube's HAL if that is what you mean. Used Keil uVision free version for compile, debug, ...

Candas1 commented 3 years ago

ok great job by the way I referred to your repository here if you don't mind

Can the lm358 be used to read the current on 2 phases ? FOC would work with that.

JohMah commented 3 years ago

@Candas1 The board measures the total current to the motor. The second channel of the lm 358 seems to measure the 5 V (doesn't make sense. Might be missing something in the reverse engineering). Measuring current in 2 phases would require changes in the board. Until now I have no plans to do so. Motion is quite smooth already when I use the Hall sensors and let the stator field phase advance 30 degrees instead of the usual 90 degrees. Speed and/or torque are controlled with pwm.

phpkadir commented 2 years ago

yeah its working awesome job

amremam2004 commented 2 years ago

it would be great if you port it to stm32cubemx, this MCU is a clone of STM32F103C8. before I found this repo, I created sample code to read the gyro, hall, compiled with stm32cubeIde, and flash with stm32cubeProgrammer and it worked just like the original STM32F103C8, Maybe the only difference is that it might lack the ADC2 as mentioned in datasheet.

Ability-dis commented 2 years ago

Thanks all for making the firmware for these boards I also have these boards ,Please let me know is there any working firmware.

phpkadir commented 2 years ago

Thanks all for making the firmware for these boards I also have these boards ,Please let me know is there any working firmware. https://github.com/phpkadir/Hoverboard-JC2015.7.31.V2.0-Hack https://youtu.be/XIqb7e3k_FA