Cheap FOCer! (VESC compatible 4.12 redesign) (Tested and Functional)

have i somehow overlooked that location where I am able to locate the wiring diagrams?

2 Likes

Let’s get you over here. Cheap FOCer 2 is the latest. Everything is in the GitHub. Links in the first post!

1 Like

thank you very much! will likely be incorporating these into my DIY onewheel! will update if it comes to fruition.

3 Likes

Good day guys ! I got some problems, faults. About FOC Brakes.

BLDC its ok, working very well, no problems.
I solved a problem with the GND cable, probably touching the positive and the BLDC motor starts to accelerate. I redid the solder, no more problems.

So, I changed the BLDC to FOC ( before and after the problems with GND cable).

FOC without Sensor Hall:
Brakes fail with 0 RPM or low speed when I Brake 100% or close of it.

I choose other Vesc FOCer, and change it to FOC and got the same problems with brakes.

I received,
Fault : FAULT_CODE_DRV
Current : -207.5
Current filtered : -22.1
Voltage : 30.29
Duty : 0.000
RPM : 255.6
Tacho : 7992
Cycles running : 903
TIM duty : 0
TIM val samp : 2
TIM current samp : 4200
TIM top : 8400
Comm step : 2
Temperature : 31.00

Fault : FAULT_CODE_DRV
Current : -50.2
Current filtered : -4.1
Voltage : 30.29
Duty : 0.000
RPM : 193.6
Tacho : 8010
Cycles running : 1152
TIM duty : 0
TIM val samp : 2
TIM current samp : 4200
TIM top : 8400
Comm step : 2
Temperature : 30.97

Fault : FAULT_CODE_DRV
Current : 324.1
Current filtered : 32.7
Voltage : 30.29
Duty : 0.000
RPM : 559.4
Tacho : 8042
Cycles running : 5
TIM duty : 0
TIM val samp : 2
TIM current samp : 4200
TIM top : 8400
Comm step : 2
Temperature : 30.97

Fault : FAULT_CODE_DRV
Current : -212.7
Current filtered : -22.6
Voltage : 30.29
Duty : 0.000
RPM : 325.7
Tacho : 8058
Cycles running : 907
TIM duty : 0
TIM val samp : 2
TIM current samp : 4200
TIM top : 8400
Comm step : 2
Temperature : 31.00

Fault : FAULT_CODE_DRV
Current : -190.8
Current filtered : -20.1
Voltage : 30.29
Duty : 0.000
RPM : 147.3
Tacho : 8076
Cycles running : 1822
TIM duty : 0
TIM val samp : 2
TIM current samp : 4200
TIM top : 8400
Comm step : 2
Temperature : 31.00

Fault : FAULT_CODE_DRV
Current : 206.8
Current filtered : 20.2
Voltage : 30.29
Duty : 0.000
RPM : 122.9
Tacho : 8089
Cycles running : 368
TIM duty : 0
TIM val samp : 2
TIM current samp : 4200
TIM top : 8400
Comm step : 2
Temperature : 31.00

Fault : FAULT_CODE_DRV
Current : 133.1
Current filtered : 13.6
Voltage : 30.29
Duty : 0.000
RPM : 64.7
Tacho : 8113
Cycles running : 11019
TIM duty : 0
TIM val samp : 2
TIM current samp : 4200
TIM top : 8400
Comm step : 2
Temperature : 31.00

I changed the motor, a motor with Sensor Hall.

FOC with Sensor Hall
Same problems with brakes. But not the same numbers, look to Current.
Fault : FAULT_CODE_DRV
Current : 0.6
Current filtered : 0.7
Voltage : 30.27
Duty : 0.000
RPM : 309.0
Tacho : 7412
Cycles running : 983
TIM duty : 0
TIM val samp : 2
TIM current samp : 4200
TIM top : 8400
Comm step : 4
Temperature : 31.64

Fault : FAULT_CODE_DRV
Current : -1.1
Current filtered : -1.3
Voltage : 30.26
Duty : 0.000
RPM : 241.4
Tacho : 7485
Cycles running : 17994
TIM duty : 0
TIM val samp : 2
TIM current samp : 4200
TIM top : 8400
Comm step : 4
Temperature : 31.69

Fault : FAULT_CODE_DRV
Current : -1.4
Current filtered : -1.2
Voltage : 30.27
Duty : 0.000
RPM : 0.0
Tacho : 7521
Cycles running : 6100
TIM duty : 0
TIM val samp : 2
TIM current samp : 4200
TIM top : 8400
Comm step : 4
Temperature : 31.69

Fault : FAULT_CODE_DRV
Current : -1.3
Current filtered : -1.4
Voltage : 30.26
Duty : 0.000
RPM : 141.3
Tacho : 7617
Cycles running : 24164
TIM duty : 0
TIM val samp : 2
TIM current samp : 4200
TIM top : 8400
Comm step : 4
Temperature : 31.69

I changed and tested the Bat Reg. The problem keeps.

60A
-60A
130A
60A
-12A

I saw some guys with the same problem solving add a Capacitor or changing it.

Dont run FOC on 4.12 HW, it will break.

Also, I think the trial run of cheap FOCer 1 resulted in that a redesign was needed.
V2 I think shaman got the kinks out tho.

This isn’t really completely true

It runs perfectly on original focboxes as well as the makerx gofoc retro

And unity/xenith

1 Like

Tell that to stack of broken unity/focboxes I have, they might be bit more reliable even great in conservative setups. But compared to a 3shunt design they’re still shite

2 Likes

Sure I mean compared to 3 shunt for FOC

You obviously have not had a good experience haha I will say I haven’t blown anything running FOC on 4.12 12s yet for over 3 years

I used alot vedders own 4.12 HW. Lets just say if any of them where to blow one more time they’d be beyond repair :man_shrugging:

Hi, I’m building some cheap FOCers, and have a couple of questions: Hope I’ve posted correctly!

1: Is it safe to use a 0-5v analogue throttle connected to SERVO as the STM32 is 3.3v?

2: I’m testing using Ackmaniac on a Mac, using the arrow keys I can only get my hub motor to spin fairly slowly, how could I increase the speed please?

Many thanks

from what I understand the ADC1/2 pin is only 3.3v tolerant however someone looked up the pinout and technical sheet of the STM32 and some pins are 5V tolerant but to be on the safeside, just use 3.3v.

The problem with the arrow keys is probably only visible on the bench with no load. But I would double check ERPM limits and control mode ie: current/hyst/duty cycle %.

Thank you, I’ll use a voltage divider to step my thumb throttle down to max 3.3v.

1 Like

Power the throttle with 3.3V. Then the signal with be compliant. Yes ADC1 or ADC2 are what you need to use for analog throttles

1 Like

I started building Cheap FOCer, and got it powered on and connecting to VESC tool fine using 12v. After i tried powering it with 36v, it started having issues connecting, and i noticed that something beetween pins 63 and 64 was glowing red hot. Now 3.3v is shorted to ground, and it wasn’t when i measured before. Any idea what could have caused this?

Now the first board i tested i managed to get it work by desoldering, cleaning and soldering stm32 chip, but after i tested and got it working, after connecting to 36v battery 3.3v got shorted again, and now that stm32 chip is dead with 3.3v shorted to ground. I tested another board and that also got 3.3v shorted after plugging to 36v battery. On that one looks like it was caused by broken capacitor, but its looking like that stm32 chip might be dead too.

Soldered new stm32 onto the first board, now it powers on and connects to vesc tool fine, but im worried it might burn something again if i connect to 36v battery.

You would be better of building the cheap focer 2, i have run 3 of my boards on cfocer 1 and even with cap updates and tweaks they burned trough many drv chips. I replaced them all with cfocer 2. If you still want to try to get it working, first check the 5v from the drv is good without mcu and other things on the rails. Could be you got a bad batch of drv chips

Well now im thinking maybe i should have went that way. Chose this because it seems more simple and would fit better in cheap chinese controller casing, i just wanted better replacement for them, and the amps people say this can give would be enough for me. Can’t really afford buying board with jlcpcb assembly now. I want this working now, if they keep burning something i might consider that later.

Do these burn DRV chips even if running only 36v?

Before the shorting happens, voltages on both 5v and 3.3v look fine, my multimeter is showing 5.15 and 3.29v now. But resistance of 3.3v seems weird, it seems to change randomly sometimes. It has showed anything beetween 50 ohms and 1k with these tests on 12v now. When STM32 chip was desoldered it was more like 4k. Anyways it now powers on and connects to vesc tool fine with 12v, but haven’t been able to spin motor.

So do you think its possible that bad drv chip can cause stm32 to burn even if it seems to be outputting 5v and 3.3v normally? Or is it then more likely other bad components, like stm32 or capacitors? DRV and STM32 chips are both from aliexpress, and i noticed that the STM32 chips don’t all look the same, casing is little different on some even tho all 5 are from same order.

Well i decided to just try connecting to 36v through amp meter, now it seems to work fine without burning and its pulling 0.03 amps. I tried to run motor detection, it is pulling no more amps from battery and motor does nothing. Motor current reading on vesc tool seems wrong too. Im guessing something with DRV chip.

1 Like

Well the buck regulator for the input voltage is integrated in the drv chip, so when anythibg is wrong with it its possible that the other regulators burn trough because they recieve a too high voltage. Thats why slowly raising voltage with a lab power supply while measuring can save components from a bad drv. I had a bad batch of drv chips on a order of 50 cfocer 2 from jlcpcb. Had to replace them all.