Strange, but then the 2.6V have to come from "outside"?! Can you check the resistance from these pins to gnd?shellton said:AT STM8 pins 20-22
shellton said:Look here :
https://github.com/stancecoke/BMSBattery_S_controllers_firmware/wiki/01-Hardware-needed
CPU is STM8S105 ?
Hm, seems that the mikrocontroller is defective. 3.3K is OK.shellton said:I measured resistance on pins 20-23 and GND - 3.3K . ...
Can it be something wrong with CPU or pin output not initialized properly ? How to find it out ?
shellton said:I studied source to find out , where i can insert this.
shellton said:What about reverse ? Is it possible to implement ? On pad X4 may be ?
The Halls are not in 120° positionBlack6spdZ said:I do not understand how the halls are bad when they test good with a meter.. what am I missing?
stancecoke said:The Halls are not in 120° positionBlack6spdZ said:I do not understand how the halls are bad when they test good with a meter.. what am I missing?
If you get only 3 and 4 all three halls are switching at the same time![]()
3 - - > 011
4 - - > 100
![]()
regards
stancecoke
Its the standard 18-fet PCB.. Maybe they used different value resistors on the supporting circuitry, or maybe a problem with the controller, or maybe the halls in my motor are flaky.. Just not sure how to narrow it down further. The fact that the halls test OK not connected to the KT and work with another controller lead me to believe the motor is OK. But i m not sure if I need another controller or replace the motor halls "which will be a major PITA" at this pointshellton said:Look at schematic. Hall sensors must go to PINS 38-40 of CPU.
https://opensourceebikefirmware.bitbucket.io/development/EmbeddedFiles/32-BMSBattery_S06S-Kuteng_EBike_motor_controller_schematic.pdf
If pins are wrong , you can define them in gpio.h
BR , Linas
Do you have an external +5V power supply for the BT-module? The controller internal +5V supply is known to be very weak, it can't handle any additional load. You can try to supply the hallsensors with external +5V, too.Black6spdZ said:I pulled up the phase monitor in bluosec
#define PWM_CYCLES_COUNTER_MAX 3000 // higher values assume motor is at standstill.
#define PWM_CPS_NORMAL_SPEED 15625L
#define PWM_CPS_HIGH_SPEED 20833L
stancecoke said:Do you have an external +5V power supply for the BT-module? The controller internal +5V supply is known to be very weak, it can't handle any additional load. You can try to supply the hallsensors with external +5V, too.Black6spdZ said:I pulled up the phase monitor in bluosec
regards
stancecoke
I will not implement that, but of course everybody is invited to do it :wink: .Vbruun said:Are there any plans to implement field weakening in this firmware?
if ((ui8_foc_enable_flag) && ((ui8_assumed_motor_position) >= (ui8_correction_at_angle + (ui16_motor_speed_erps>>factor))) &&(ui8_assumed_motor_position) < (ui8_correction_at_angle + (ui16_motor_speed_erps>>factor) + 4))) {
// make sure we just execute one time per ERPS, so reset the flag
ui8_foc_enable_flag = 0;
updateCorrection();
}