Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Materials have arrived for a test batch)

Electric Motors and Controllers
shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Materials have arrived for a test batch)

Post by shaman » Nov 27 2019 1:31pm

CFOC2 front.jpg
CFOC2 front.jpg (255.33 KiB) Viewed 3657 times
CFOC2 back.jpg
CFOC2 back.jpg (193.05 KiB) Viewed 3657 times

UPDATED SUMMARY
Prototyped and tested for functionality. Successfully controlled(FOC) a 7uH motor under 50A load. est batch materials have arrived but won’t be assembled for about 2 weeks :( Will continue testing and validation before releasing design files.

Capabilities/Properties
  • At least 35A continuous and 70A peak with good heat sinking. These are real values. Not marketing numbers
  • Up to 12S operating voltage
  • FOC or Trapezoidal control
  • at least 40kHz switching frequency achievable
  • 49mm x 100mm x 14mm without enclosure/heatsink
  • Compatible with the VESC Tool for configuration
  • Designed in KiCAD. Project files and gerbers will be open-sourced after more testing and validation
Advantages over VESC 6
  • Significantly lower build and BOM cost
  • TO-220 FETs allow for big heat sink attachment for better thermal performance
  • 2-layer PCB for cheap boards from JLCPCB
  • Designed with JLCPCB’s SMT assembly service in mind
  • Added optional ON/OFF capability to turn off control circuitry when controller is not in use. A simple mechanical switch will achieve this when connected to the “ON/OFF” 2-pin connector.
  • CAN connector changed to 2-pin to avoid improper connections that can cause damage
  • Hardware design files open sourced (KiCAD) after validation/testing
  • Open source enclosure design to come
  • “Living” LCSC BOM to come. BOM document to be continuously updated with compatible and stocked components from LCSC
Advantages over Cheap FOCer 1
  • VESC 6 based instead of VESC 4.12
  • Significantly improved layout to reduce current loops and facilitate low-noise operation of both the power stage and control circuitry
  • Lower profile
  • Handles lower inductance motors much better
  • All components on the top side except MOSFETs
  • Addition of JST connectors to replace pin headers for Servo, CAN, COMM, ect.
  • Addition of header for unused GPIO pins
  • Micro USB
Disadvantages (that I know of)
  • Larger than original VESC 6. Cheap FOCer 2 is about 49mm x 100mm x 14mm without enclosure/heatsink
  • Additional assembly steps to beef up high-current traces. 2 layers of 1oz copper can’t handle the current flowing through during operation. Assembler will have to apply wire/solder wick/bus bar to the exposed Power, Ground, and Phase areas.
  • Will need custom firmware that’s not currently supported in the VESC project. Will make firmware available on GitHub until Cheap FOCer 2 is added to and supported by the VESC project.
All this wouldn’t be possible without Benjamin Vedder’s hard work to build on. Please consider supporting him for his efforts through the link below.

https://vesc-project.com/donations

Funding for essential materials has been achieved but I’m not stopping anyone from helping out. Anything you toss my way helps with unexpected costs and/or helps get this project to completion

https://www.paypal.me/shamansystems?locale.x=en_US
Last edited by shaman on Dec 06 2019 4:47pm, edited 1 time in total.

shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by shaman » Nov 28 2019 12:59pm

Funding acquired. Will be ordering materials for test units today or tomorrow

guancio   10 mW

10 mW
Posts: 31
Joined: Jun 04 2019 8:10am

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by guancio » Nov 28 2019 4:19pm

May I ask why 12s? Will it work with 13s without regen?

SRFirefox   100 mW

100 mW
Posts: 35
Joined: Apr 24 2019 7:27pm

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped and needs funding)

Post by SRFirefox » Nov 28 2019 8:20pm

You've come a long way since the Cheap FOCer 1! Great work!

Do you have an expected BOM cost for the CF2?
guancio wrote:
Nov 28 2019 4:19pm
May I ask why 12s? Will it work with 13s without regen?
The DRV used for the VESC6 and by extension the CF2 is good to 60V. 10V of buffer at 12S is already giving the DRV a small 16% safety factor, pushing to 13S gives basically no room for switching overshoot, which happens on even the best designs. A max of 10 or 11s is safer, but unrealistic to expect anyone to hold to on a 60V absolute max system.

shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by shaman » Nov 28 2019 9:10pm

BOM, PCBs, and hardware are looking to be about $250 for a batch of 15. You'll really get the most bang for your buck making these in batches. The minimum you can make with JLCPCB is 5 along with their SMT assembly service.

Thanks for the donation btw!

shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by shaman » Nov 28 2019 9:18pm

@guancio 12S is the safe number as previously mentioned. Some people have pushed VESC controllers to 13S with success but your margin of error is pretty much nothing. You would have to have conservative current limits and regen brake strength to try and not blow something.

On a related note, I have tweaked the firmware to have the DRV8301 use a lower gate drive strength. The default strength is overkill and would contribute to voltage spikes/ringing. Lowering it like I did helps prevent spikes/ringing.

casainho   10 GW

10 GW
Posts: 4085
Joined: Feb 14 2011 2:43pm

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by casainho » Nov 30 2019 12:46am

Congratulations!!

I think it is really important to have a version specific for ehikes.

I bought and I can buy more VESC boards from China at about 45 Euros (shopping and taxes included). Once the Chinese adopted the VESC hardware and started to sell it, we got a very good opportunity to have accessible hardware, which is very important -- so I think is hard to justify your hardware compared to original VESC costing 45 Euros.

Another thing is the voltage limitation. I and being developing OpenSource firmware for the popular and cheap Chinese motor controllers and displays and they are popular for up to 14S!! Being 13S the most popular.

Seems almost no one is doing VESC based hardware capable of doing higher voltages like 13 or 14S.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by shaman » Dec 01 2019 9:59am

casainho wrote:
Nov 30 2019 12:46am
Seems almost no one is doing VESC based hardware capable of doing higher voltages like 13 or 14S.
I am. Check out my other thread. Controllers designed for up to 20s operation. Beta units being built.

viewtopic.php?f=30&t=99152&start=150
Last edited by shaman on Dec 01 2019 10:29am, edited 1 time in total.

shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by shaman » Dec 01 2019 10:02am

casainho wrote:
Nov 30 2019 12:46am
so I think is hard to justify your hardware compared to original VESC costing 45 Euros
Why again? I missed it. Also what original VESC 6 can be found for 45 euros?

SlowCo   100 kW

100 kW
Posts: 1416
Joined: Jan 05 2015 5:43pm
Location: The Netherlands

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by SlowCo » Dec 01 2019 4:57pm

Great work!
I'll be following this thread.

casainho   10 GW

10 GW
Posts: 4085
Joined: Feb 14 2011 2:43pm

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by casainho » Dec 02 2019 5:23am

shaman wrote:
Dec 01 2019 10:02am
casainho wrote:
Nov 30 2019 12:46am
so I think is hard to justify your hardware compared to original VESC costing 45 Euros
Why again? I missed it. Also what original VESC 6 can be found for 45 euros?
It is the smaller VESC hardware based on 4.12 that I bought and that I think is good enough for ebike application.

So, can anyone provide better value than this ones: price VS functionality of based VESC OpenSource firmware and hardware??

Image

You can buy on their online shop (https://flipsky.net/) or on ebay, aliexpress, etc:

Image

And sure they also sell the VESC based on 6, but is more expensive as expected:

Image
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by shaman » Dec 02 2019 6:57am

@casainho I see. Yes the VESC 4.12 based hw can be found cheap. But to actually assign a cost to creating my CFOC2 hardware...how about $250USD for a batch of 15? No VESC 6 out there is $17USD a pop.

The value here is that one can make their own. Plus my design provides access to the unused GPIO pins of the MCU for further development opportunity. I agree that more work needs to be done on the VESC firmware to be more ebike friendly, but the VESC code is easy enough to modify. I simply don't have the time to do so...yet.

casainho   10 GW

10 GW
Posts: 4085
Joined: Feb 14 2011 2:43pm

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by casainho » Dec 02 2019 8:09am

shaman wrote:
Dec 02 2019 6:57am
@casainho I see. Yes the VESC 4.12 based hw can be found cheap. But to actually assign a cost to creating my CFOC2 hardware...how about $250USD for a batch of 15? No VESC 6 out there is $17USD a pop.
They sell VESC 6 for $99 USD, assembled, tested, with all the metal e cables. I think is simple impossible in DIY mode, out of China.

What I mean is that is very hard for a hardware project adoption, unless boards are provided assembled and tested, at a good price. Chinese are unbeatable on that. We are luck to have access all the technology around us at the Chinese prices, like every product of Apple and so on are assembled there.
For ebikes, they sell motors controllers of $20 USD, at unit, for final user. This motor controllers, other than the board, also has big piece of metal and cables, all for $20.
I think we are luck if they adopt more OpenSource hardware and provide us for this very cheap prices.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of the Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by shaman » Dec 02 2019 8:37am

Of course I won't be able to out China China. But i bet you that those $20 motor controller don't have near the performance of mine. Who knows...maybe some Chinese manufacturer will adopt the CFOC2 design and crank them out extra cheap like for the original VESCs. The CFOC2 could be cranked out really cheap in volume if someone tried.

Until then, those interested in a DIY approach have this as it is now...or at least will be once I release the design files after testing. One can enjoy the flexibility of design and make modifications as seen fit.

zombiess   100 MW

100 MW
Posts: 2911
Joined: Feb 01 2011 2:16am
Location: Ventura

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by zombiess » Dec 02 2019 7:33pm

shaman wrote:
Dec 02 2019 8:37am
Of course I won't be able to out China China.
You can totally out China, China. Just take someones money, send them a defective product, or the wrong product, or even better an incorrect defective product! Then when they ask for a refund, tell them sorry, but you'll provide them credit on their next purchase.
Change the name of your business, but keep selling the same crappy product, maybe slightly alter it.

Remember, the key is to forget about quality and focus on selling mass quantity of possibly functional stuff.

shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by shaman » Dec 02 2019 7:58pm

@zombiess seems like I'd be a lousy at that kind of business with my focus on good quality to cost ratio, advertising real numbers, and being transparent. Guess I'll have to pack it in and just be honest...or something.

nieles   10 kW

10 kW
Posts: 682
Joined: Jul 14 2008 5:39pm
Location: The Netherlands

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by nieles » Dec 03 2019 3:30am

how do you access the TO-220 screws once they are soldered to the PCB? i don't see any holes in the PCB for that

or will it not be possible to remove the FETs from the heat sink once assembled?
zombiess wrote:
Dec 02 2019 7:33pm
shaman wrote:
Dec 02 2019 8:37am
Of course I won't be able to out China China.
You can totally out China, China. Just take someones money, send them a defective product, or the wrong product, or even better an incorrect defective product! Then when they ask for a refund, tell them sorry, but you'll provide them credit on their next purchase.
Change the name of your business, but keep selling the same crappy product, maybe slightly alter it.

Remember, the key is to forget about quality and focus on selling mass quantity of possibly functional stuff.
LOL

shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by shaman » Dec 03 2019 7:30am

@nieles the mounting scheme doesn't actually use the holes in the TO-220 tabs. The 4 holes in the PCB around the FETs allow for screws and standoffs to compress them to the heatsink. I'll be showing a picture of this sometime this week.

shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Ordering materials for a test batch)

Post by shaman » Dec 06 2019 4:45pm

image (1).jpg
image (1).jpg (267.73 KiB) Viewed 2894 times
Good news is that everything has come in!

Bad news is that I have leave on a business trip for 1.5 weeks starting next Monday and I won’t be able put these bad boys together until I’m back…

In the mean time, check out what JLCPCB’s SMT service can do by itself. They were able to knock out a good deal of the soldering leaving me with just a few of the larger SMT components and then of course all the through-hole stuff. Not bad in my opinion.

SRFirefox   100 mW

100 mW
Posts: 35
Joined: Apr 24 2019 7:27pm

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Materials have arrived for a test batch)

Post by SRFirefox » Dec 07 2019 2:19pm

Good luck on your business trip! I would assemble and test some for you if that meant getting to beta testing faster, but I will settle for drooling over the images of mostly assembled CF2s!

What wattage and size are the 1mOhm current sense resistors?

shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Materials have arrived for a test batch)

Post by shaman » Dec 07 2019 2:31pm

They're 2W 2512 0.001ohm resistors. 2 of them in parallel give you 4W which should more than enough to accommodate the max current for this controller. This is a cheap approach to getting a large enough sense resistor at the sacrifice of a bit of accuracy.

shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Materials have arrived for a test batch)

Post by shaman » Jan 30 2020 10:47pm

image (1).png
image (1).png (497.44 KiB) Viewed 1282 times
50A motor phase current at 50V
50A.JPG
50A.JPG (137.36 KiB) Viewed 1282 times
50A FOC current waveforms

Finally got around to testing under load properly. I now have a neat test rig. Two motors mounted and coupled at the shaft(giggity). Each motor has it’s own controller. One motor provides braking torque(load). The other is run like in normal operation. Behold the the test data!

So I do have an embarrassing story. For the life of me I couldn’t figure out why the controller behaved badly right at 40A. I attacked this issue for weeks. I thought it was the Op Amp I was using as the 3rd phase current sensor. This issue had me nearly crying in the corner before I realized the damn DRV8301 OC mode setting was the culprit. Disabled that and then bam…50A FOC at 50V!

So 50V (12s) is operating the controller pretty close to its absolute max of 60V. Running 42V(10s) is the safer but there are many that operate the VESC 6 at 12s.

SRFirefox   100 mW

100 mW
Posts: 35
Joined: Apr 24 2019 7:27pm

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Materials have arrived for a test batch)

Post by SRFirefox » Jan 31 2020 6:43pm

This is exciting! What's up next in testing for the CF2?

Keep up the good work!

shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Materials have arrived for a test batch)

Post by shaman » Jan 31 2020 6:51pm

I want to finally mount the heatsink and gauge it's thermal performance with the intended heatsink both in still air and with a 5V 50mm fan that fits perfectly to the heatsink. I also want to get scope shots of the switching waveforms to see rise/fall times and the severity of the spikes. I still have room to tune the gate drive resistance/capacitance if I see bad spikes or oscillations. Being that it did 50A @ 50V without blowing anything up I suspect it won't be too bad.

shaman   1 kW

1 kW
Posts: 314
Joined: Dec 10 2018 7:03pm
Location: Fort Worth, TX, USA

Re: Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (Prototyped. Materials have arrived for a test batch)

Post by shaman » Jan 31 2020 8:59pm

turn off.jpg
turn off.jpg (97.43 KiB) Viewed 1222 times
Rising edge (turn off) waveform FOC 50A at 50V
turn on.jpg
turn on.jpg (95.53 KiB) Viewed 1222 times
Falling edge (turn on) waveform FOC 50A at 50V

Ok so those that have been with me since the Cheap FOCer 1 has seen something like this before. These are the scope shots that show the turn on and turn off of the MOSFETs at each PWM pulse. The peak of the turn off waveform is the voltage spike that the controller experiences. You can see the spike is 58.8V when the battery voltage is about 50V(12s). This spike gets worse when current gets higher. This doesn’t leave much room at all to hit the 60V ceiling. Yes I'm using good measurement techniques with a calibrated probe and using the little spring thingy for low-inductance measurement.

Now this isn’t bad in my opinion (only a 8V spike and very little oscillation) but there are some tricks I can do to calm that spike a bit. I’ll post some waveforms after I conduct said tricks to show the difference.

Post Reply