BLDC Brushless DC Motor and Slipring

Code for driving a BLDC motor and adjusting its speed using a pot. This photo shows wires to a slipring in the hollow shaft of a BLDC motor.

Dec 22, 2018

19006 views

8 respects

Components and supplies

3

Rotary potentiometer (generic)

1

L298N Stepper Motor Controller Module

1

LiPO or NiMH battery, 2 cell (7.2V) or 3 cell (11.1V) tested

1

Arduino UNO

1

BLDC Brushless DC motor

1

Switch DPDT

Project description

Code

BLDC Brushless DC motor code V2 + stepper motor code

arduino

This code drives both a BLDC and a stepper motor at the same time. Three potentiometers are used to control the speed of both motors and the position of the stepper. A Protoneer Arduino CNC Shield V3 with Pololu A4988 Stepper Motor Driver Carrier fitted, to drive the stepper motor. An L298N Stepper Motor Controller Module is used to drive BLDC.

BLDC Brushless DC motor code V2 + stepper motor code

arduino

This code drives both a BLDC and a stepper motor at the same time. Three potentiometers are used to control the speed of both motors and the position of the stepper. A Protoneer Arduino CNC Shield V3 with Pololu A4988 Stepper Motor Driver Carrier fitted, to drive the stepper motor. An L298N Stepper Motor Controller Module is used to drive BLDC.

BLDC Brushless DC motor code V2

arduino

This code is simply to drive a BLDC using an L298 driver board and an Arduino. The sketch after this sketch is for driving a stepper motor at the same time as the BLDC. V1 code pulsed once and then waited for interval before sending next pulse, whereas this improved code keeps pulsing the same phase until the interval is past. Also, input from pot connected to A5, now varies BLDC motor speed. Removed 'step' variable by reversing order in which time interval is tested. Serial.print is commented out to improve smoothness of motion.

Downloadable files

BLDC and L293

This layout is approximately right. I used a L298N Stepper Motor Controller Module (Jaycar XC-4492) instead of the genuine Arduino shield (which would have been easier, as it mounts directly on the Uno).

BLDC and L293

BLDC and L293

This layout is approximately right. I used a L298N Stepper Motor Controller Module (Jaycar XC-4492) instead of the genuine Arduino shield (which would have been easier, as it mounts directly on the Uno).

BLDC and L293

Comments

Only logged in users can leave comments

mbarraus

0 Followers

0 Projects

Table of contents

Intro

8

0