Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Simple FOC Shield: Examples, Pinouts, and Specs

Image of Simple FOC ShieldDesign with Simple FOC Shield in Cirkit Designer

Introduction

The Simple Field Oriented Control (FOC) Shield is a versatile circuit board designed to drive brushless DC (BLDC) motors with high efficiency and precision. It leverages Field Oriented Control (FOC) algorithms to achieve smooth and accurate motor control, making it ideal for applications requiring precise motion, such as robotics, drones, and industrial automation.

This shield is compatible with popular microcontrollers, such as the Arduino UNO, and provides features like current sensing, PWM control, and communication interfaces for seamless integration. Its compact design and ease of use make it a popular choice for both hobbyists and professionals.

Explore Projects Built with Simple FOC Shield

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Arduino-Based Security System with Fingerprint Authentication and Voice Recognition: A project utilizing Simple FOC Shield in a practical application
Arduino-Based Security System with Fingerprint Authentication and Voice Recognition

This circuit is designed to serve as a multifunctional security and interaction system, featuring biometric authentication through a fingerprint scanner, voice command recognition, visual feedback via an OLED display, and wireless communication capabilities with the ESP8266 WiFi module. The piezo buzzer provides audio feedback, and the Arduino UNO serves as the central controller for the system.

Open Project in Cirkit Designer
Image of Raspberry Pi 4B-Based GPS and GSM Tracking System with Audio Feedback: A project utilizing Simple FOC Shield in a practical application
Raspberry Pi 4B-Based GPS and GSM Tracking System with Audio Feedback

This circuit features a Raspberry Pi 4B as the central processing unit, interfaced with a GPS NEO-6M V2 module for location tracking and an Adafruit FONA 808 Shield for cellular communication. It includes a PAM8406 5V Digital Audio Amplifier connected to an Adafruit STEMMA Speaker for audio output, and a Condenser Microphone connected to the FONA 808 for audio input. Power management is handled by a 12V battery connected to a voltage regulator that steps down the voltage to 5V and 3V required by the various components.

Open Project in Cirkit Designer

Common Applications

Technical Specifications

The Simple FOC Shield is designed to work with a wide range of BLDC motors and microcontrollers. Below are its key technical details:

General Specifications

Parameter Value
Input Voltage Range 6V to 24V
Maximum Current 10A per motor phase
Supported Motors 3-phase BLDC motors
Communication Interfaces I2C, UART, SPI
PWM Frequency Up to 20 kHz
Current Sensing 2-phase inline sensing
Microcontroller Support Arduino UNO, STM32, ESP32

Pin Configuration

The Simple FOC Shield features a standard pinout for easy connection to microcontrollers. Below is the pin configuration:

Pin Name Description
VIN Input voltage (6V to 24V)
GND Ground
PWM1 PWM signal for motor phase 1
PWM2 PWM signal for motor phase 2
PWM3 PWM signal for motor phase 3
CS1 Current sense for motor phase 1
CS2 Current sense for motor phase 2
EN Enable pin to activate the motor driver
SDA I2C data line
SCL I2C clock line
TX UART transmit
RX UART receive

Usage Instructions

How to Use the Simple FOC Shield

  1. Connect the Shield to a Microcontroller:

    • Mount the Simple FOC Shield onto an Arduino UNO or connect it to another compatible microcontroller using jumper wires.
    • Ensure proper alignment of the pins to avoid damage.
  2. Connect the BLDC Motor:

    • Attach the three motor wires to the PWM1, PWM2, and PWM3 terminals on the shield.
    • Secure the connections to prevent loose wiring during operation.
  3. Power the Shield:

    • Provide a DC power supply (6V to 24V) to the VIN and GND pins.
    • Ensure the power supply can handle the current requirements of the motor.
  4. Program the Microcontroller:

    • Use a compatible library, such as the Arduino SimpleFOC library, to control the motor.
    • Upload the code to the microcontroller to initialize and control the motor.
  5. Test the Setup:

    • Enable the motor driver by setting the EN pin high.
    • Run the motor control code and verify smooth operation.

Important Considerations

Example Code for Arduino UNO

Below is an example of how to use the Simple FOC Shield with an Arduino UNO to control a BLDC motor:

#include <SimpleFOC.h> // Include the SimpleFOC library

// Define motor and driver objects
BLDCMotor motor = BLDCMotor(7); // Motor with 7 pole pairs
BLDCDriver3PWM driver = BLDCDriver3PWM(9, 10, 11); // PWM pins for motor phases

void setup() {
  // Initialize the driver
  driver.voltage_power_supply = 12; // Set power supply voltage
  driver.init();
  
  // Link the driver to the motor
  motor.linkDriver(&driver);
  
  // Set motor parameters
  motor.voltage_limit = 6; // Limit motor voltage to 6V
  motor.controller = ControlType::velocity; // Velocity control mode
  
  // Initialize the motor
  motor.init();
  
  // Set initial target velocity
  motor.target = 2; // Target velocity in rad/s
}

void loop() {
  // Run the motor control loop
  motor.loopFOC(); // Field Oriented Control algorithm
  motor.move();    // Move the motor to the target velocity
}

Notes:

Troubleshooting and FAQs

Common Issues and Solutions

  1. Motor Not Spinning:

    • Verify all connections, especially the motor wires and power supply.
    • Check if the EN pin is set high to enable the motor driver.
    • Ensure the motor parameters (e.g., pole pairs) are correctly configured in the code.
  2. Overheating:

    • Use a heatsink or active cooling for the shield if it gets too hot.
    • Reduce the motor's voltage or current limit in the code.
  3. Erratic Motor Behavior:

    • Check for loose connections or damaged wires.
    • Ensure the current sensing resistors are properly calibrated.
    • Verify the motor's specifications match the shield's capabilities.
  4. Communication Issues:

    • Ensure the correct communication protocol (I2C, UART, or SPI) is selected in the code.
    • Check the wiring of the communication lines (SDA, SCL, TX, RX).

FAQs

Q: Can I use the Simple FOC Shield with a stepper motor?
A: No, the Simple FOC Shield is designed specifically for 3-phase BLDC motors. For stepper motors, use a dedicated stepper motor driver.

Q: What is the maximum motor speed supported?
A: The maximum speed depends on the motor's specifications and the PWM frequency. Ensure the motor's voltage and current ratings are not exceeded.

Q: Can I use a 5V power supply with the shield?
A: No, the minimum input voltage for the shield is 6V. Using a lower voltage may result in unstable operation or damage.

Q: Is the shield compatible with Raspberry Pi?
A: Yes, the shield can be used with Raspberry Pi, but additional wiring and configuration may be required to interface the GPIO pins.

By following this documentation, you can effectively use the Simple FOC Shield to control BLDC motors with precision and efficiency.