Pypilot Motor speed Control - Printable Version +- OpenMarine (https://forum.openmarine.net) +-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17) +--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=18) +--- Thread: Pypilot Motor speed Control (/showthread.php?tid=3819) |
Pypilot Motor speed Control - karthikpraveen.ezy@gmail.com - 2021-12-23 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 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 RE: Pypilot Motor speed Control - seandepagnier - 2021-12-24 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. RE: Pypilot Motor speed Control - karthikpraveen.ezy@gmail.com - 2021-12-25 (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. |