# Using DRV8316 makes the motor vibrating

**URL:** <https://community.simplefoc.com/t/using-drv8316-makes-the-motor-vibrating/6835>\
**Category:** developement\
**Created:** [March 1, 2025, 5:45pm UTC](https://community.simplefoc.com/t/using-drv8316-makes-the-motor-vibrating/6835 "2025-03-01T17:45:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricardo\_Calle](https://community.simplefoc.com/user_avatar/community.simplefoc.com/ricardo_calle/32/8283_2.png) [@Ricardo\_Calle](https://community.simplefoc.com/u/Ricardo_Calle)\
**Post date:** [March 1, 2025, 5:45pm UTC](https://community.simplefoc.com/t/using-drv8316-makes-the-motor-vibrating/6835/1 "2025-03-01T17:45:35Z")

</div>

Hello, community!

I implemented the DRV8316 driver to test the open loop example with this motor: [Amazon.com: DC 3.7V-11.1V 7.4V 4300KV Mini 1104 3-phase Brushless Motor Micro Outer Rotor BLDC for Quadcopter Fixed Wing : Toys & Games](https://www.amazon.com/3-7V-11-1V-4300KV-3-phase-Brushless-Quadcopter/dp/B0C2TKB715). The code is shared below, I am using the 6PWM example, but the motor starts to vibrate. I powered with 5V and 3V3 comming out from an arduino.

 ![image](https://community.simplefoc.com/uploads/default/original/2X/a/a2ed196a58e715d9ab2417153f6c2761eeccd3b1.png)

```auto
#include "Arduino.h"
#include <Wire.h>
#include <SimpleFOC.h>
#include <Math.h>
#include "drivers/drv8316/drv8316.h"

#define PWM13 13
#define PWM12 12
#define PWM11 11
#define PWM10 10
#define PWM09 9
#define PWM07 7
#define PWM06 6

BLDCMotor motor = BLDCMotor(11);
DRV8316Driver6PWM driver = DRV8316Driver6PWM(PWM13, PWM12,PWM11,PWM10,PWM09,PWM07,PWM06,false); // MKR1010 6-PWM
//DRV8316Driver3PWM driver = DRV8316Driver3PWM(2,1,0,11,false); // MKR1010 3-PWM

void printDRV8316Status() {
	DRV8316Status status = driver.getStatus();
	if (status.isFault())
		driver.clearFault();
	delayMicroseconds(1); // ensure 400ns delay
	DRV8316_PWMMode val = driver.getPWMMode();
	Serial.print("PWM Mode: ");
	Serial.println(val);
	delayMicroseconds(1); // ensure 400ns delay
	bool lock = driver.isRegistersLocked();
	Serial.print("Lock: ");
	Serial.println(lock);
}

void setup() {

	Serial.begin(115200);
	while (!Serial);
	delay(1);
	Serial.println("Initializing...");
	driver.voltage_power_supply = 5;
	driver.init();
	motor.linkDriver(&driver);
	motor.controller = MotionControlType::velocity_openloop;
	motor.voltage_limit = 3;
	motor.velocity_limit = 20;
	motor.init();
	Serial.println("Init complete...");

	delay(100);
	printDRV8316Status();
}

// velocity set point variable
float target_velocity = 7.0;

void loop() {
	//delay(100);
	//driver.setPwm(7.4/4, 7.4/2, 7.4/4*3);
	motor.move(target_velocity);
}

```
