GitHub - vtpgit/Lepton-BLDC: Lepton SimpleFOC BLDC PCB Board

By popular request, I created a small How-To order repository for the Lepton boards.

The public shares for the Lepton Boards:

2-Layer

or

4-Layer

Instead of cloning the order from OSHWLab, you could also use the Gerber, BOM and centroid files from the GitHub repository directly.

Open loop code to demo / test the board:

#include <SimpleFOC.h>
BLDCMotor motor = BLDCMotor(1);
BLDCDriver6PWM driver = 
BLDCDriver6PWM(PA8, PA7, PB3, 
               PB0, PB6, PB1);
float target_velocity = 1.0;
float target_voltage = 2.0;
void setup() {
  driver.voltage_power_supply = 12;
  driver.pwm_frequency = 15000;
  driver.init();
  motor.linkDriver(&driver);
  motor.voltage_limit = 12;   // [V]
  motor.velocity_limit = 100; // [rad/s]
  motor.controller = 
  MotionControlType::velocity_openloop;
  motor.init();
  _delay(1000); }
void loop() {
  motor.voltage_limit = target_voltage;
  motor.move(target_velocity); }

The same code is printed on the back of the PCB silk screen of the 4-layer board.

Cheers,
Valentine

3 Likes

I will try to follow this asap. Tomorrow at the latest. JLCPCB is making me redo the order. Also I need to make sure the encoder boards have the standard mouting and chip position. It is a 24 mm square, with the chip exactly in the middle of the square.

What software did you use to make the 3 files? I can use them to modify them and produce new downstream files.

oh, this is the lepton. software - easy EDA, looks like cool software. Do you have the design for those encoders? I need that…

EasyEDA. Open the third link.

Let me check.

Cheers,
Valentine

ok, I read the guide at Ordering a Mosquito BLDC Board from JLC step by step - #5 by Valentine and will get started, I will go for the 2 layer board, I think that’s more suitable. I only need like 2 amps max. Hope I don’t need any part substitutions…

If you need any ask. I will find the synonyms. Cheers, Valentine

All went ok! :slight_smile: Looking forward to testing :). I noticed the actual source code isn’t really the gerber or bom or centroid files, it is inside eda. I don’t know how one would get it out. Modifying the design for the encoders would not have really been possible if I had not been able to simply load up a copy of the file from the cloud.

To be fair, the schematic could be recreated in EAGLE or some other editor which is more independent, I guess. Perhaps I could import the schematic or something some other time. At least it is up on github.

I ordered 20 encoders but only 10 leptons, because seems like significant chance I will have to change at least one minor thing, and if not I can order more without too much difficulty. Always a bit of a gamble, tempting to order more hoping to save money later but in my experience that rarely works out. I may try to change the connectors to 2.54 mm pitch screw terminal connectors, I don’t like having to source connectors to access things. I would have tried this time around but it’s not a simple substitution as they are twice the size and I don’t want to mess with something I don’t understand before at least testing. My priority is to get out of the woods and know which way to even go.

BTW, can I ask what’s the CK pin on the plug for the encoder for? There is no corresponding pin on the encoder…

Yeah, to get a 6 pin 1.25 mm pitch picoblade connector with 600 mm leads is $8.8. They want $5.6 each for the 4 pin ones, similar for smaller prices. I’m definitely going to have to switch things over to 2.54 mm pitch, either dupont or screw terminals can then be used. In the meantime I will buy some 6 pin connectors and the cheapest 4 pin, just a couple for prototyping. Shit. Whatever, all part of the process I guess. Amazon has some little adapter kits, I will probably get one of those, they should be useful in the future anyway.

Why is it that components are easier to get on amazon than digikey… both the 1.25mm connectors and the 5 mm screw terminals are a fraction the price on amazon, and there is way more variety… The idea of a supplier that effectively supplies a respectable selection of electronics parts seems to have eluded these people. Same story with voltage regulators, servos, motor driver boards…

That’s the SPI Clock, the pin is SCLK, there wasn’t enough space to put four characters on the silk screen.

1 Like

You can order without the connectors and directly solder wires.

1 Like

Search “4-pin 1.25mm jst” on ebay and you’ll get a bunch to pick from. None with 600mm leads though. You’ll have to solder extension wires yourself. 100 of them for about $15 here, and even includes the male connectors to solder to the boards (if you exclude them on the JLC order to save the hand soldering fee) 100Pcs Micro JST 4Pin Spacing 1.25mm Single End 15cm Wire To Board Connector | eBay
There are some with 30cm leads, so if you don’t have suitable wire on hand, you could buy those, cut the wires off one, and use them to extend another. Leave a couple cm of wire on the donor cable so you can still solder to it in the future rather than throwing it away.

And if you need different pin counts, you can save a bit of money by buying one type of cable with wires from ebay, and empty connector housings from LCSC such as HC-1.25-4Y HCTL | C2962291 - LCSC Electronics
Then harvest wires from the ebay cables and stick them in those housings. I wish I had been smart enough to do that instead of buying 9-pin with wires when I already had a pile of 6-pin :slight_smile:

60cm SPI sensor wire requires twisted pairs and shielding. SPI doesn’t work reliably over such a long distance unless precautions are made, especially with higher data rates. He will need probably a cat-8 cable or a USB cable which already have TP shielded wires for that, and the eyes and patience of a neurosurgeon to solder them on the connectors.

:rofl:

Or a decent microscope…

hm, uh oh, thanks for the heads up. I will have to deal with that somehow. I think I can get wire length down to 20 cm.