-
Notifications
You must be signed in to change notification settings - Fork 6
2‐3‐2024 ‐ DC Motor Testing
DC Motor was tested today and it proved to work.
We are using the following equipment:
- ESC
- DC Motor Brushless
- Arduino UNO
- DC Voltage Supply
The circuit was the following:
flowchart LR
uno[Arduino UNO]
dc[DC Power Supply]
m[Brushless DC Motor]
esc[ESC]
uno --> |A0 to ESC signal|esc
uno --> |5V to 5V|esc
uno --> |GND to GND|esc
dc --> |18v to ESC Vin|esc
dc--> |GND to esc GND|esc
esc --> m
![](https://private-user-images.githubusercontent.com/89555610/302071452-0cb864af-5166-4db8-b5d8-1fb94439e32f.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEzNDc3NTMsIm5iZiI6MTcyMTM0NzQ1MywicGF0aCI6Ii84OTU1NTYxMC8zMDIwNzE0NTItMGNiODY0YWYtNTE2Ni00ZGI4LWI1ZDgtMWZiOTQ0MzllMzJmLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE5VDAwMDQxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkyMzQyMDY2M2QyMzM0N2UxMzdkNmMwODQ0NWRlNjc2ZjllNTdlNDMyMmE2NGUzZjJmNjg5NDU0ZjNkZGFkMTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.KQqPPIdVxoe5ERe6VbmkQHeRXDWesQEj-KBBr3GBKD8)
![](https://private-user-images.githubusercontent.com/89555610/302071462-609792d3-60c6-4a8c-8d86-45ea03f22430.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEzNDc3NTMsIm5iZiI6MTcyMTM0NzQ1MywicGF0aCI6Ii84OTU1NTYxMC8zMDIwNzE0NjItNjA5NzkyZDMtNjBjNi00YThjLThkODYtNDVlYTAzZjIyNDMwLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE5VDAwMDQxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVjZmFkZDE3MTYxYWFmMjU3N2M3ZGQxNWY5MWFkNmFiZTA3OTJkNGM4OTVhNWNjMzQ4NTI1NzhiMGU4OGJmZmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Ir9CR9ae6omA3TzLoyna1_xu7_yukY4L_VMoc6QzHvw)
![](https://private-user-images.githubusercontent.com/89555610/302071466-2dd53ad0-0d2e-4f89-8844-a68e653ced20.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEzNDc3NTMsIm5iZiI6MTcyMTM0NzQ1MywicGF0aCI6Ii84OTU1NTYxMC8zMDIwNzE0NjYtMmRkNTNhZDAtMGQyZS00Zjg5LTg4NDQtYTY4ZTY1M2NlZDIwLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE5VDAwMDQxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE1YjMxNDcxNTMwZDY5NTU4YTIyZGRlOTEzZjg1YmU4NzRkMTg1NDI0ZThiOGQ5MWU1OTE0OGNlMzIyNDQ5YjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Gfck_n8gz7w5dzMH-9iw8JpuLFkIqdB514RJAMFgSGo)
In order to control the DC motor speed with an Arduino we had to implement our own basic PWM
. Even though an Arduino has PWM functionality already, the delay between pulses is apparently not enough for the motor to detect it as something between 0 and 5V, however with our own implementation we define what's the delay between a HIGH and the delay between a LOW and from there create an artificial PWM:
// Pin for PWM output
const int pwmPin = 9;
const int highDelay = 50;
const int lowDelay = 50;
void setup() {
// Set the PWM pin as an output
Serial.begin(9600);
pinMode(A0, OUTPUT);
}
bool iter = false;
void loop() {
// Output the PWM signal
int val = 255;
int del = highDelay;
if(iter) val = 0;
if(iter) del = lowDelay;
analogWrite(A0, val);
iter = !iter;
// Delay for demonstration purposes
delay(del); // Adjust as needed
}
VID_20240203_185131.1.mp4
From testing we realized the slowest the motor could run without significant vibrations due to our custom PWM
is a delay of 50ms for the HIGH and 50ms for the low. If you were to dramatically increase that ratio of DelayHigh:DelayLow
, like 500ms for delay HIGH and 1ms for delay Low then we could achieve back again max speed.