Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (v0.9 Release. Beta testing ongoing)

I think there might be a way to hybrid the two methods. Use resting voltage to determine initial state of charge and make that the reference for the coulomb counter at startup. Go on about your ride and let the coulomb counter do it’s thing.

So basically every time you turn on your rig the coulomb counter re-calibrates to the resting voltage (fuel gauge). Seems doable by an arduino, accurate low-side shunt resistor, and some analog conditioning between the shunt and arduino ADC.

1 Like

I agree that would work as long as you know the cell’s overall capacity. Simply using voltage has the advantage, and disadvantage, that it doesn’t need to know cell capacity since it only tells you the percentage charge remaining.

But this approach doesn’t solve the problem of LifePo4 cells having such a shallow discharge curve since it would still be difficult to tell the state of charge by looking at the resting voltage.

2 Likes

well just like you said, if you know the battery capacity (the user should) then it’s possible. LiFePo4 batteries will just have to take voltage references fresh off the charger and then coulomb count from there. The reference then can’t be reset until nearing depletion or when charged again. It’s possible to keep track of this. I have ambitions to do a cheap open-source BMS capable of all this but that’s just a pipe dream for now. Wish I could get a hold of the schematics for those generic “smart” BMS units from China…

8 Likes

Hmmm…this might be interesting. I’ll save looking into this sort of thing for a different thread…

4 Likes

Up to 20s with UART, metr compatible and very tiny :slight_smile:

1 Like

@shaman Diebiems has selectable SOC methods including coulomb + voltage lookup.
Both Flexi and Diebie are open sourced
Derelict Robot also has new open source BMS in the works:

I think there are enough options, I would rather contribute to the projects that are already in the works so they could be finished more quickly

2 Likes

Yeah seems like the BMS scene is taken car of. The only thing is that they don’t use the BQ769xx chips and use the LTC6803 chips instead. It’s just that the BQ769xx stuff is JLCPCB compatible… Oh well. Back to motor controllers.

7 Likes

i added a third cap, still getting the over voltage issue during braking, which is not that concerning, but after 10-15 mins or so I get the issue where the DRV throws every fault.

Is there any further troubleshooting I can do? replace DRV? more caps? bigger caps? happy to make whatever mods

1 Like

Sorry to ask dumb questions, but where do you see all these faults? Is that from logging with the metr? I log continuously when I ride and I’d definitely like to log faults. Right now I’m just logging specific things I ask for.

1 Like

this might not be the most elegant way, but after a ride I leave the board on, plug it into vesctool and run the “faults” command in the terminal, then it shows every fault since startup

1 Like

Perfect! Thanks for that. I can add a button to my dashboard to do that too.

2 Likes

Did you reduce the regen current (negative battery current)?

Is there some associated event with the major DRV faults or does it just seem like it happens no matter what after 10 to 15 minutes?

1 Like

yes, battery negative is -4.

I haven’t been able to find out what triggers it yet. I guess I could maybe try riding without braking to see if I can still get that fault?

seems I’m able to recreate it very quickly, rode for 2 mins, did some braking (at only -4A) then hit the throttle hard a few times.

And even with 4 caps I’m still getting over voltage on braking.

currents: 60,-30,95,24,-4.

maybe the delta between motor current and battery current is too high?

The following faults were registered since start:

Fault : FAULT_CODE_OVER_VOLTAGE
Motor : 1
Current : -10.3
Current filtered : -9.4
Voltage : 57.94
Duty : 0.223
RPM : 15898.5
Tacho : 80677
Cycles running : 4495
TIM duty : 1875
TIM val samp : 4200
TIM current samp : 4200
TIM top : 8400
Comm step : 0
Temperature : 30.64

Fault : FAULT_CODE_DRV
Motor : 1
Current : -32.1
Current filtered : 7.6
Voltage : 42.77
Duty : 0.595
RPM : 27536.3
Tacho : 186615
Cycles running : 1791
TIM duty : 4999
TIM val samp : 4200
TIM current samp : 4200
TIM top : 8400
Comm step : 0
Temperature : 32.90
DRV8301_FAULTS : | FETLC_OC | FETHC_OC | FETLB_OC | FETHB_OC | FETLA_OC | FETHA_OC | OTW | OTSD | PVDD_UV | GVDD_UV | GVDD_OV |

1 Like

Just went for some hard riding with my longboard (13s, pneumatics, dual keda motors). I’m on 75/-75 motor current 120 abs max, 99 -60 battery. So far the focers are doing really well, had to reboot them when i stopped and accelerated hard.

The battery is not taking it very well. The focers are in a aluminium enclosure, cooling is working really good.

7 Likes

@alwaysmohawk It’s really odd to me that you’re experiencing such high voltage spikes when braking even when your pack voltage is at 42V. This is with your LiFePO4 battery right? Does it display this behavior with a typical lithium ion battery?

@doomy Wow that’s some tough conditions on them FOCers!

Correct me if I’m wrong but it seems like the FOCers never got above 45C! That’s proper thermal management right there.

1 Like

They only get barely warm, the motors a bit more. Its 13s liion, old ebike 13s6p battery. I will up the amps to 85/-85 next. Its running in FOC but i have the impression it has less punch than in BLDC.

2 Likes

i only have the one lifepo4 pack.

i just spent the past 2 hours putting together another board. this one made it about 5m before “fault code DRV” that won’t clear.

it must be either a problem with my battery, motor, or every DRV. I’m no expert, but man, i would put good money down that I soldered it as near to perfect as possible, i really took my time. no bridges, plenty of heat, brushed any flux off with toothbrush and rubbing alcohol etc

1 Like

Hold up you’re running these at 13s? That’s damn impressive.

2 Likes