Stacked SimpleFOC shield

I apologize if this has already been covered, but I can’t seem to locate any reference(s).

Is there any documentation / example sketch for setting up a second driver? Simple FOC mentions the shields as being “stackable”, but that’s the only reference I’ve seen for a dual driver setup.

I would like to control two brushless motors using a stacked simplefoc shield setup.

e.g.

BLDCDriver3PWM driver = BLDCDriver3PWM(pinA, pinB, pinC, pinD);
BLDCDriver3PWM driver2 = BLDCDriver3PWM(pinA2, pinB2, pinC2, pinD2);

Thanks in advance.

Hey @digitalnomadjoe,
Welcome to the community!

Here is an example project in the docs:
https://docs.simplefoc.com/haptics_examples

Let me know if you still have some questions.

and the page below talks a bit more about how you’d need to solder the pads. The “possible pins” table matches Antun’s haptic example.
https://docs.simplefoc.com/pads_soldering

Thanks,

That’s what i was looking for.

I was able to run two motors in the open loop modes without much effort. :slight_smile:

Is there any documentation on setting up a second i2c encoder? Normally i’ll just program a new address on the second encoder, and setup a second i2c port like so:

//TWO I2C PORTS
TwoWire I2Ctwo = TwoWire(1);
#define SDA2 18 //
#define SCL2 19 //

But MagneticSensorI2C() doesn’t seem to accommodate those arguments.

Btw, I’m using an ESP32.

Thanks in advance.

MagneticSensorI2C has two constructors.

Both constructors can accommodate changing chip address.

What sensor are you using? Most versions of the AS5600 have fixed chip addresses which has lead people to either putting them on second i2c bus or using (slightly worse) MagneticSensorAnalog.cpp

Thanks Owen.

I found the dual the esp32_i2c_dual_bus_example in the full download. Seems to be working well.

I’m using two AS5600’s…

-J

1 Like