AnswerBun.com

How to use PI4J with a brushless motor?

Raspberry Pi Asked by cy8berpunk on November 27, 2020

I have a Raspberry Pi 2 model B. I would like to be able to control a motor with a regulator and PI4J.

I put the black cable to a ground pin and the PWM pin to pin 26. I’ve worked with servos before, so I tried to start the motors like a servo. It didn’t work.

The ESCs: Kontronik CYBEC 40-6-12

The motors are Brushless: I’m sorry but I don’t know what make.

public static void move(int power) throws InterruptedException
{ 
    System.out.println("MOVE_ENG"); 
    Gpio.wiringPiSetup(); 
    SoftPwm.softPwmCreate(26, 0, 50); 
    SoftPwm.softPwmWrite(26, power); 
}

One Answer

If I understand correctly you want to control a brushless motor which is being driven by an ESC (Kontronik CYBEC 40-6-12).

ESCs are controlled in a very similar way to servos. However they often require a particular start sequence for safety reasons (you don't want your model plane to fly off when the ESC is energised).

I suggest you try something like

one second at 1000 µs pulse width

followed by

one second at 2000 µs pulse width

That may initialise the ESC. You can then send pulse widths in the range 1000 (stop) to 2000 (full throttle) to control the speed.

If you are planning to do this seriously you'll need to use something like my pigpio or servoblaster to send the pulses, or buy external PWM hardware,

Answered by joan on November 27, 2020

Add your own answers!

Related Questions

Fade screen on sleep and brighten on wake

1  Asked on February 8, 2021 by itamar-kerbel

     

reading a dutch ‘slimme meter’ has USB troubles

1  Asked on February 6, 2021 by cantdutchthis

 

Screenly install process

1  Asked on February 6, 2021 by dirxtope

   

Block script excecution when fbi is displaying image

4  Asked on February 5, 2021 by jpx

     

Access ports with specific address

0  Asked on February 4, 2021 by dan-chaltiel

   

Adafruit Speaker Bonnet for Raspberry Pi – No sound

0  Asked on February 2, 2021 by emad-mokhtar

   

voltage issues with GPIO raspberry pi 2

1  Asked on February 1, 2021 by andrew-m

   

Pi loses local network connectivity

0  Asked on January 30, 2021 by boogie-man

     

Raspbian 8 on Raspberry Pi 3 B+

4  Asked on January 30, 2021 by medismail

   

Raspberry Pi Networking

2  Asked on January 19, 2021 by danny-herbert

   

Make ifplugd available with systemd

1  Asked on January 17, 2021 by ingo

   

Trying to connect pi zero over USB

1  Asked on January 16, 2021 by wabbitt

     

Compile a dts file (dt overlay)

1  Asked on January 13, 2021 by feroxcannibal

 

RPi 3 B+ set Wi-Fi country on localisation tab

1  Asked on January 12, 2021 by stilllearning

   

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir