Beginner's question(s) on the BGC 3.1 controller

Yeah JLC is awesome!

I think the best alternative is designing your own solution. It may take some time but would be a great learning experience.

If that’s out of the question, I don’t know of any alternatives but lots of people make boards here so just peruse the forum and you may find one.

I am not expert in this but someone is helping me design the board. I was planning to use it as is and just customise its size etc. However, I can get it reviewed for improvement. In your opinion (since you know it inside out), which areas we should revisit, focus or alter? Which points would you consider in v2? It would be awesome if you could please share some pointers.

One more question around @AdinAck controller and @runger one of your previous answers about voltage.

  1. with this controller, can I run 5208 motor at 12v input? of course, the board standoff positions may need to be redesigned, however, is it suitable?

  2. @runger - you had advised to run a 12v motor with 6v specified as motor limit. This made me wonder, can I run 5208 motor which has 20v as specified voltage, with 12v? I basically want to run that motor with 12v, Simple FOC and the above-mentioned controller? Is it a good idea?

Here is the motor link: GM5208-12 Gimbal Motor w/Encoder

Hey,

Have you checked what’s making the PCB expensive? There could be some optimizations you can do to bring the cost down a bit…

Doing a quick quote with mostly default settings I get $65 for 4 layers, 40x40mm “panel by PCBWay “ (panel is required due to round shape), for 20 pieces.

Assembly will still be $30 but of course component cost will go up for 20 pieces.

The trick to getting a halfway reasonable price per board is to max out the quantities they allow for the prototyping service.

Of course it only makes sense if you need 20 and are reasonably confident the design will work.

What can we say? Making PCBs comes with a certain base price…

Yes, it will work just fine :slight_smile: of course the DRV8316 has 5A limit so you’ll have to operate within that, but it’s enough for many purposes…

Hey hey!

Thank you @runger. On being expensive they said these 4 reasons…

  1. "Rasin filling makes it expensive. I have changed the vias process to be tent vias, no resin fulfilling. PCB manufacturing fee would be $155.79.

  2. And surface we used for this project is immersion gold 1u’’ and FR4 TG is 150."

  3. If go with HASL with lead surface, it will make it a bit more cheaper.

  4. Is that possible for you to change the min hole size to be 0.3mm at least? The currently price is added mainly because of the small drill, which is 0.2mm.

Like @AdinAck said, I checked out JLC and their cost is really low. Unfortunately, they do not have parts in stock for the assembly.

I want to first order only up to 5 so that i can actually place it on the back of the motor and see how it fits within the iPower motor’s standard encoder back cover. We may need to move things around to fit it nicely and so that possible change stops me from ordering more. I have tested a few motors using BGC 3.1 and it looks like we will need either 4108 or 5208 motor - smaller ones are struggling a bit. From what I read, it would fit nicely at the back of the 4108 but not sure about 5208.

@AdinAck - does it fit on 4108 without modifying the encoder cover or need a new cover?

@runger - Thank you for confirmign regarding 5208 being operable Is that possible for you to change the min hole size to be 0.3mm at least? The currently price is added mainly because of the small drill, which is 0.2mm.at 12v. Its a relief knowing that I can go for it without changing the whole world around it.
In regards to the 5A limit… the motor page on iFlight page says 1A nominal current, you think it could still go 5x higher than its nominal capacity? Also, if I am setting motor voltage limit to 12v and driver limit to 12v - is there a way to limit amp? Also, my battery is capable of discharging 2amp max. So, should I get a battery that can go upto 5amp to give more power to the motor? Sorry by your standards my questions are likely to be very basic.

Hi, @hs307 ,

Regarding the PCB:

Adin’s design has lots of space. it should be no problem to:

  • move any via-in-pad out of the pads - then you do not need any resin filling. For the thermal vias underneath the driver IC, it is not ideal, but it should work ok if you use tented vias.
  • You can change the surface finish to any you like. ENIG is not required. HASL with our without lead will work fine.
  • You can change all the vias to be 0.3/0.6, which PCBWay will do without extra costs. For thermal vias, it can require modifying the footprint if the thermal vias are too small. Be sure to update your DRC rules to check for the via size, and the spacings between vias and traces, and performa a full DRC check. That way you can be sure changing the via sizes has not caused problems with spacing.

If the parts are not in JLC’s “basic components” then the assembly at JLC will not be cheap…

You can make a template out of card-stock or 3D-print a plastic “PCB”, and use this to check the dimensions with the motor… this will be much cheaper than ordering a PCB… or you could order some PCBs without assembly to check the size and the mounting hole positions.
I would definitely check the mechanical side 100% before ordering assembled PCBs.

The 5A limit of the driver is a upper limit. You don’t have to use 5A, you can run the driver with currents up to 5A. So it will not be a problem using any motor that operates at less than 5A. So for your motor, the motor’s resistance will anyway prevent the currents from rising so high.

So you can use this motor, no problem.

I think it will be enough. You won’t want to use more than 1A anyways (the motor limit), so this battery should work.

Thanks again @runger for all your help.

  • Placed an order with the PCBWay. They helped with the pricing with vias changed to 0.3. Made other changes in the selection as per your suggestions…helped big time.
  1. you are right. JLC got me on the parts cost with their quote, added a bit of procurement time and I had to manually find, add to cart and order each item.

  2. I do print and test enclosures with 3d printer but had no clue that i can do that with the pcb. Its going to be super useful. Thanks! Can we export a 3d printer format from the Altium?

  3. On iFlight, the 4108 is listed as 1amp nominal and i think 1.8amp for max current. However, for 5208 gimbal motor, its 1amp for the nominal and 10amp for max current. Has anyone used this motor and know if its true…the 10amp stall current? If so, won’t it be an overkill for the DRV8316 driver with 8amp stall current limit? Any measures i can put in place to protect both motor and the driver?

I am currently testing 3510 and 4108. The 5208 is on the way…will receive soon.

By the way… my motors feels slow and sluggish. Would you recommend changes / try playing with any of these parameters? I am running it with magnetic sensor so thought it will be a lot better but apparently not.

#include <SimpleFOC.h>

// magnetic sensor instance - SPI
MagneticSensorSPI sensor = MagneticSensorSPI(14, 14, 0x3FFF);

// BLDC motor & driver instance
BLDCMotor motor = BLDCMotor(11);
BLDCDriver3PWM driver = BLDCDriver3PWM(3, 5, 6, 8);

// commander interface
Commander command = Commander(Serial);
void onMotor(char* cmd){ command.motor(&motor, cmd); }
void onMotion(char* cmd){ command.motion(&motor,cmd); }

void setup() {

  // initialise magnetic sensor hardware
  sensor.init();
  // link the motor to the sensor
  motor.linkSensor(&sensor);

  // driver config
  // power supply voltage [V]
  driver.voltage_power_supply = 12;
  driver.init();
  // link driver
  motor.linkDriver(&driver);

  // choose FOC modulation
  motor.foc_modulation = FOCModulationType::SpaceVectorPWM;

  // set control loop type to be used
  motor.controller = MotionControlType::angle;

  // contoller configuration based on the control type
  motor.PID_velocity.P = 0.2;
  motor.PID_velocity.I = 12;
  motor.PID_velocity.D = 0;
  // default voltage_power_supply
  motor.voltage_limit = 8;

  // velocity low pass filtering time constant
  motor.LPF_velocity.Tf = 0.01f;

  // angle loop controller
  motor.P_angle.P = 20;
  // angle loop velocity limit
  motor.velocity_limit = 30;

hi everyone, especially @runger and @Rem666 @Anthony_Douglas and @o_lampe

Just to give you an update…with simpleFOC and your help, my setup is finally looking like an automated robot wheel. Big thank you. Now moving to the next steps of implementing advanced automation.

On that note, I want to reach out to the wider Simple FOC community for a paid gig. I am requesting advanced code writing help and want to know if someone here would be interested in helping me write advance monitoring and command codes for SimpleFOC. What I am looking for is mainly in line with

  1. slowing the motor in conjunction with TOF position output and safely move it in the dock.
  2. optimise serial communication between controller and CM4 and ensure automated correct port mapping. Currently the port keeps changing and we have to manage it manually.
  3. identify current position and ensure that the right direction movement is continued from that point. Get motor controller to adjust the own position it remembers, if required.

Please let me know by direct message if you are interested and available.

No one’s active on this library anymore or has my profile been blocked? So many days, there is no reply to any questions.

I’m sorry! I have been on holidays and it seems no one else has had time either… I will try to get back to you later today on your questions.

1 Like

I am not sure, I don’t use Altium but KiCad. In KiCad you export the 3D view of the PCB as a “step” file, which can be opened in many 3D programs. I do it this way. I export STEP from KiCad and import it into Fusion360 - then I have an exact copy of the PCB in Fusion, and can model around it.

In have not tested it.

yes, it would be too much. I think the limit of 8A on DRV8316 is the peak limit, and the continuous limit is 5A. Even for this you will need a heat-sink.

The DRV8316 has current sensing and good protections, so you can set up the driver to protect itself. You can also set the limits in SimpleFOC to prevent over-current in the first place, and you can add some code for stall detection and switch the system off in case of stalls.

This is hard to say without being able to test it. You can try increasing the limits a bit, you can try tuning the PID parameters and LPF time constant to see if you can improve performance.

Is this already on theJLC SAMD based board, or is it on the BGC 3.1?

Thanks @runger . Hope you had a great holiday.

Thanks @runger for your replies.

3d print underway.

  • Regarding 10amp stall current. I reached out to the iFlight live chat on their website again and they are suggesting that the stall current is surely not 10amp, it is 1.5amp. However, on their ali express page it says 10amp. I believe 1.5amp is likely to be true(er).

Has anyone tested the iFlight 4108 or 5208 motors previously at all? What is the currect stall current number in your experience?

Currently it is on GBC 3.1. The SAMD based board is with the PCBWay - hoping to get it in a week or so.

Stall current in general followes Ohm’s law: I = U / R
In case of the 5208 the phase resistance is 15.5 ohm.
At 24V it will draw ~1.5A (per phase?) but there might be other stuff going on: more than one phase active or PWM settings

1 Like

So, if i get it right, in total it would be 4.5A around assuming everything else not changing?

No, you don’t have to add the phases up in this situation.

If you imagine DC current passing through the motor, it means either one or two phases are connected to ground, and one or two phases are connected to supply voltage. So if you think about the current path, now it matters whether the motor is delta or wye type winding, and whether the value given for resistance is the phase to phase value, or that of a single phase, and whether all 3 phases are connected, or one of them is floating.

But if you know all these things, you can draw it out and work out the actual resistance of the motor and therefore the current that will flow in this situation according to ohms law.

Assuming the value is the single phase resistance, all three phases are connected to either GND or power (but not all to the same), and the motor is wye wound, the actual limit would be 24V/23.25Ω=1.03A, for delta it would be 24V/7.75Ω=3.09A.

1 Like