This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pypilot Motor speed Control
#1
Hello,

I am working on the below Proof of concept for Pypilot motor Control.

Raspberry pi 4 (Having Pypilot, Open Plotter) connected with Arduino UNO that connects with Motor controller.

I have procured the BLDC Motor controller and BLDC motor from Aliexpress and the details given below. I am unclear to how customize the motor.ino file for this configuration. Also, I could not understand the correct pwm style from the given Motor Controller specification.

However, when i connected Arduino UNO (Standlone - without Pypilot) with Motor Controller, i am able to control the Motor using Analog Pot (Arduino UNO pin 9 - Motor Controller signal Pin, Arduino UNO ADC pin A0 - Analog POT) with the following sketch.

Please give some input to customize the motor.ino to control the motor per this configuration.

Arduino sketch (Standlone Arduino- without Pypilot):
===============

int motorPin = 9;      // Motor connected to digital pin 9
//int val = 0;         // variable to store the read value

void setup() {
  pinMode(motorPin, OUTPUT);  // sets the pin as output
}

void loop() {
  val = analogRead(A0);  // read the input pin
  analogWrite(motorPin, (val/4)); // (val/4)analogRead values go from 0 to 1023, analogWrite values from 0 to 255
  Serial.println(val);
  Serial.println("WELCOME");
}



Motor Controller:
================
https://www.aliexpress.com/item/1005002862957009.html

Motor Details
==============

https://www.aliexpress.com/item/1005002002733450.html?spm=a2g0s.9042311.0.0.7d6c4c4d23RhXI
[Image: 12v24v1200w-brushless-propeller.jpg]
12v24v1200w brushless propeller|DC Motor| - AliExpress
Cheap DC Motor, Buy Quality Home Improvement Directly from China Suppliers:12v24v1200w brushless propeller Enjoy Free Shipping Worldwide! Limited Time Sale Easy Return.
www.aliexpress.com


Reply
#2
The motor controller can output a PWM in rc servo style to control a brushless controller such as drone type esc. I think the type you are using is for a scooter so it instead takes an analog input. This is not supported but.. in theory you could modify motor.ino to output a pwm from 0-100% duty, then put a lowpass filter on this to make it analog to feed to that controller.

But, first, pypilot generally controls the rudder not motor speed, so is that motor moving the rudder?


I do plan to support vector thrust and many possible custom configurations in the future but it's not implemented yet.
Reply
#3
(2021-12-24, 02:17 AM)Thanks Sean,The motor is the main motor used for propulsion of the prototype boat.RegardsKarthik seandepagnier Wrote: The motor controller can output a PWM in rc servo style to control a brushless controller such as drone type esc.   I think the type you are using is for a scooter so it instead takes an analog input.    This is not supported but.. in theory you could modify motor.ino to output a pwm from 0-100% duty, then put a lowpass filter on this to make it analog to feed to that controller.  

But, first, pypilot generally controls the rudder not motor speed, so is that motor moving the rudder?


I do plan to support vector thrust and many possible custom configurations in the future but it's not implemented yet.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)