I'm working on my own ROV project, but I find OpenROV have a ready to use image for my BB so want to use that instead of making my own program, and I already deployed the image, but I can't find which three pins find that send PWM signal for ESC's? Please help.
1 Answer
OpenROV Cape
If I understand things correctly, the OpenROV motors are connected to ESCs that are connected to Arduino Digital pins 9, 10, and 11. According to the "ATmega168/328-Arduino Pin Mapping", that corresponds to physical pins 15, 16, and 17 respectively on the 28-pin ATmega328 DIP.
A nice diagram on the OpenROV wiki showing a photo of the OpenROV Cape and where to connect the Port, Vertical, and Starboard ESCs to the cape
(diagram from https://forum.openrov.com/t/wiki-buildout/1585 ).
The Arduino IDE is used to program the ATmega328 in a 28-pin DIP package on the other side of the OpenROV Cape, shown here.
(photo from
"Bluebird Marine Systems: OpenROV underwater robots for educational exploration")
Why are there 2 not-quite-the-same Arduino firmware folders, https://github.com/OpenROV/openrov-software/tree/v2.5.0/arduino/OpenROV and https://github.com/OpenROV/openrov-software-arduino/tree/master/OpenROV ? I'm guessing that the "openrov-software-arduino" version is the latest version.
The OpenROV Cape.h file defines those pins:
#define PORT_PIN 9
#define VERTICAL_PIN 10
#define STARBOARD_PIN 11
Those definitions are used in the OpenROV Thrusters2X1.cpp file
Motor port_motor(PORT_PIN);
Motor vertical_motor(VERTICAL_PIN);
Motor starboard_motor(STARBOARD_PIN);
The above lines pass the pin numbers to the Motor constructor declared in Motor.h. Later the OpenROV Motor.cpp file stores those pin numbers and passes them to functions in the openrov_servo.cpp file to control the ESCs.
BeagleBone PWM
Some of the pins on the BeagleBone are internally connected to a hardware PWM driver. Some people have several ESCs or other things controlled by a standard RC control signal, each one driven by one such pin on a BeagleBone.
(FIXME: this would be a good place for a link to the part of the OpenROV code that runs on the BeagleBone and sends a message to the Arduino with the desired PWM; can that bit of code can be tweaked to directly drive that desired PWM out the BeagleBone pins?)
- Simon Monk. Adafruit. "Controlling a Servo with a BeagleBone Black"
- Ben Martin. "How to Control a Servo Motor from a BeagleBone Black on Linux".
- "BoneScript: analogWrite"
- Meng Cao. "How to use all the GPIO on Beaglebone Black in Python"
- Akkana. "GPIO tutorial for the BeagleBone Black" implies that the BeagleBone Black hardware PWM can drive up to 8 pins (?).
- Justin Cooper. Adafruit. "Setting up IO Python Library on BeagleBone Black: Using GPIO, PWM and more with Python"
- Babak Parvizi. "BeagleBone Black ... Controlling a Servo Using HTML5, JavaScript, and Node.js."
- "Working with PWM on a BeagleBone Black".
- Saad Ahmad. "beaglebone-black-cpp-PWM".
- eLinux. BeagleBoardPWM
- Hipstercircuits. "Enable PWM on BeagleBone with Device Tree overlays".
- "Using the BeagleBone: Using PWM outputs" describes how to drive 6 servos from a white BeagleBone.
-
$\begingroup$ So the ESC isn't connected directly with BBB? I don't have an Arduino and I don't see the need of it, can I change the control of OpenROV image to drive using BBB pin instead? Where is the image you're talking about? $\endgroup$– NurMay 4, 2015 at 5:55
-
$\begingroup$ The OpenROV cape is Arduino-compatible. After you have that, I agree that you don't need another Arduino board to build a OpenROV. $\endgroup$ May 4, 2015 at 14:33
-
$\begingroup$ Well I'm looking to make a ROV project with a BBB only without additional component that OpenROV using, I just want to borrow the OS.. $\endgroup$– NurMay 5, 2015 at 8:34