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

I don’t know that much about the code either but I think what you are looking for is in bldc/foc_math.c at master · vedderb/bldc · GitHub function foc_svm
and bldc/mcpwm_foc.c at master · vedderb/bldc · GitHub function control_current
It looks like after the duty cycles are calculated in these functions, the pwm signals for H1, L1, … are set by timers in the #define TIMER_UPDATE_DUTY_M1(duty1, duty2, duty3) and #define TIMER_UPDATE_DUTY_M2(duty1, duty2, duty3) macros.
I could be wrong though :slight_smile: So it might be a good idea to ask in the discord channel. It seems there are a few people there with a lot of knowledge about the code.

1 Like

We are excited waiting for the Cheap focer 3 thread!! We wanna see the new stuff :wink:

2 Likes

I know I’m late to party, but this would seem pretty fitting

2 Likes

Hey Shaman,
I’m a little lost. I know you made other FOCers that are going to be closed source since you need to make a living. Is there still going to be an open source CFOC3 or have your plans changed?
Thanks for all your work!

2 Likes

The plan is still to open source it though I may strategically delay open sourcing it until I have production units ready to go.

2 Likes

f*ckin finally got this out…continuing the CFOC3 convo in the new thread.

15 Likes

I’ve got a CFOC2 hw ver 0.9 that just failed. I’m getting DRV fault: GVDD_UV (which I believe is under-voltage on the GVDD pin of the DRV8301; pin 13). Unfortunately, I’m not sure whether the voltage on that pin comes from within the DRV8301 or externally. Based on the schematic (only a couple of capacitors tying that pin to Gnd), it would seem that the voltage on that pin is internally sourced.

Just to get it out of the way, I erased the flash and reflashed the bootloader and firmware. This didn’t fix it. I just now tested the FETS in-circuit with an ohm-meter. Two FETs (the one with the temperature sensor and the one directly above it) have very low impedance readings (from 0 to 3 ohms) across any combination of pins. When I test these same FETs in-circuit on a good board, I get more typical readings (like 4.68Kohm). So I’m guessing these two FETs really are dead.

So first question… does that make sense to anyone here? Dead FETs could give a GVDD_UV fault?

Second question… does anyone have any of these FETs they’d be willing to sell me, or know of a good source for them in the U.S.?

Thanks!

RC

2 Likes

It could be that you are measuring a short through the DRV and not the FET. I have been fooled like this before. Maybe best to desolder the FET and then measure it to be sure.

2 Likes

Something is causing the voltage regulator that is used to drive the MOSFET gates to go too low. Yes maybe the dead MOSFETs you measured are causing it.

1 Like

Thanks guys. It did occur to me that I might have to remove the FETs to give them a fair test. I’ll do that today. I’ve already ordered new FETs. I’m sure hoping that’s it since FETs are both available and easy to replace. DRV’s - not so much.

Shaman, I had found the except you quoted, but only kind of understood what it was saying.

1 Like

Good news… After removing the FETs, they still show effectively shorts between all leads. I do have a question though…

The bom specifies: NCEP60T20’s
But what I find on the board are: SE60210’s

I’m guessing that’s just the LCSC equivalent. Sound right?

LCSC is just a distributor. It wouldn’t have a brand name equivalent just like Mouser wouldn’t have Mouser-brand MOSFETs.

The SE60210 are just whatever the builder used.

1 Like

Hmmm… I was the builder on that one (I’m pretty sure). I ordered from LCSC whatever was in the BOM.

You think there will be any issue with using these on two of the channels and the NCEP60T20’s on the other?

Recently had to finish couple of more units. Couple of links on my previous post died including 5.2 firmware that is lost to time. Luckily had it in my archives. Here is how to set up old CFOC2 0.9 as 1.0 (this tutorial also works for 1.0 units just ignore resistor and capacitor fix) and program using Jlink on nucleo board without using cube IDE. If there are any things that could be set better in utility, let me know.

  • To convert 0.9 unit to 1.0 unit follow instruction here:
  1. Cheap-FOCer-2/guides/upgrade at Developer-Branch · shamansystems/Cheap-FOCer-2 · GitHub
    In nutshell, desolder resistors R65 and R64 and replace them with 10Kohm resistors. I had 0402 size resistors and those worked just fine aswell.
  2. Solder a ceramic 220N capacitor between On/Off switch leads like this:
    image
    again size doesn’t matter.
  • Programming (It is assumed you did the diode, short circuit and other tests before)
  1. Download ST-link utility here (needs registration): STSW-LINK004 - STM32 ST-LINK utility (replaced by STM32CubeProgrammer) - STMicroelectronics
    I prefer it over cube programmer due to how lightweight it is, if you prefer STM32CubeProgrammer then use that instead, adjust settings accordingly.
  2. Update stlink on your nucleo board by going to ST-LINK > firmware update
  3. Use breadboard wires to connect nucleo to stlink. Stilink has pinout like this:
    image
    However to use it you have to remove couple of jumpers. Make sure your jumper layout is same as here:
  4. Pins you need to connect are:|
    VCC-3.3v
    SWCLK - SWCLK
    GND - GND
    SWDIO - SWDIO
    Do not connect nrst, in this instance chip reset is done with SWD pins.
  5. In stlink utility go to Target > settings and set settings as follows

    You can change programming frequency to higher if you wish like 4Mhz, but 100Khz seems to be more reliable
  6. In stlink utility Open following file:
    VESC_default.bin (384.0 KB)
    This is 5.2 firmware that works on latest 5.2 vesc tool. It should also not throw out ‘‘old esc firmware’’ error on both 5.2 vesc tool and vari-ESC tool
    7.In stlink utility, with open VESC_default.bin windown go to Target > Program & Verify…, set settings as follows:
    image
    Click start and wait, it should take about 1-2 minutes. Once done, wait 10 seconds, then power cycle. Afterwards 3 lights should pop up on vesc, now you can connect VESC to USB and change settings accordingly.
2 Likes

Hello, where I get one of these ?

I’ve just burnt mine :confused:

Peace

“Replace resistors R64 & R65 with 10k ohm resistors. Easy peasy!”

Yes easy, as long as you can source the resistors without have to buy a billion of them. Does anybody on here have a cache of these resistors they’d be willing to sell me some from?
I have 10+ 0.9 focers that need them. (Along with a drv swap lol). I hope to use two of em for my upcoming build so any help would be appreciated to the MAX!

Cheers

1 Like

A bit late to the party, but you can source specific amount from retailers like digikey or farnell in EU. The manufacturer can be anyone as long as resistance is matching. Also if you have smaller resistors you can solders on larger footprint aswell with a few tries. Good luck!

An example: https://www.digikey.com/en/products/filter/chip-resistor-surface-mount/52?s=N4IgTCBcDaIIwAYDWACBA2BBmEBdAvkA
https://www.digikey.com/en/products/detail/vishay-dale/RCA060310K0FKEAHP/6561243

3 Likes

Thanks for the response! Managed to find a decent little kit on Amazon that has everything I need for a good price. Actually gonna be dressing up my .9’s pretty quick. I’ll report back here once finished. :slightly_smiling_face:
I REALLY hope it fixes the cut outs. I wanna trust these focers lol

Sadly it didn’t for me. If i hit the throttle very sharply cutout will happen even with very little current present in the moment. Sometimes it also throws non descriptive “Faul_DRV” message. However from what I understood v1.0 firmware at least doesn’t shut off esc when DRV fault happens, instead it does cutout and continues as normal.

@shaman did you managed to figure out what was the issue with 0.9 and older units having rare but seemingly unexplainable cutouts even under low motor amps and where they fixed on v1.0 pcb?

1 Like