casainho
10 GW
- Joined
- Feb 14, 2011
- Messages
- 6,047
A good way can be to try reuse your FOC code as this hardware should be similar to the controller you used. Even the microcontroller is also a Cortex M0.stancecoke said:casainho said:Anyway, we should be able to port the firmware of controller V1 to controller V2 and ignore at start that 3 phase currents
I strongly recomment to analyse the circuit deeply, to understand which ADC_x setup, ADC timing, Timer_x config etc. is needed for doing real FOC. Otherwise you will throw away all your work afterwards.
I don't see any battery current shunt, so you have to read the phase current anyway.
casainho said:as the sum of the phase currents is equal to the total phase currents that we calculate already on the controller V1 firmware
?! the sum of the phase currents is zero at any time....
regards
stancecoke
Yes, my mistake. But I am sure I saw a way on a document to extract the value of battery current from the phase currents... Maybe the sum of ABS of each current, divided by PWM duty-cycle?? Anyway, I will look at it later.