Trying to review code , to find max ERPMS ;
#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
Do i understand correctly , that max eRPM is 15625/30 and 20833/30 ?
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
Hi , sorry for late answer.
At last i figured out this case. I think it was my faulty. It was something wrong with firmware compiling. I downloaded source one more time and compiled it. And miracle happened , PWM appeared at both : Low and High side . I attached the motor, some angle...
I studied source to find out , where i can insert this . Its a complicated to me , i dont know this cpu ..
Stancecoke, please help me with this.
Br, Linas
I measured resistance on pins 20-23 and GND - 3.3K . Then i cut the line to pin 20 . To cpu side ~7M , to resistors 3.3K
Tryed to get diagram on cutted pin20 :
Strange signal ..
Can it be something wrong with CPU or pin output not initialized properly ? How to find it out ?
As on...
Yes, its looks to be HalfBridge . On low side pins ~2,5V , if i remember correctly.
PWM on HighSide is always on. Ontroothle i can see , that duty cycle chanching.
Can you in short write motor starting sequence ?
Schematic looks very similar. I can monitor by Bluosec ; voltage is ok , hall sensors is ok , then i rotate manualy its shows hall sensors , speed. Brake signal is ok. On this pcb are 2 low side mosfets in paralel and 1 for high.
I have checked ; Low side at cpu pins 20-21 , high at 26-28 ; looks good. I'm measure with scope directly on cpu pins , no any impulses at low side - 20-21 pins.
Hello , forum
I'm new here. Trying to get work OpenSource controller.
I have this one from ebay :
I flashed it succsefuly . Installed Bluosec at phone , connection is ok.
But motor does not start , no impulses at output. Throotle is ok , it can be monitored by Bluosec.
Tryed to measure...