Hello,
This is not so much board specific I think. For instance, right now I am building a driver for a motor driver via some older source I found years back that were dedicated to the BBB.
Right now, I am using the BBB to test this source with /sys/class/gpio/*
for handling only two GPIO pins to handle one motor driver and a stepper motor. So, is it done via source to move the motor faster or is it done via Device-Tree?
Am I only allowed to move my motor quickly in RPM when the source is written correctly or is this a limitation with using the GPIO peripheral on the BBB?
For instance, I can write a few lines of code to handle the building, understanding, and small script to test the driver in question. It was called BeagleCPP years ago and has since been deleted for some reason…
If done correctly, is there a limitation on using this source to build faster motors with my commands or is it again the BBB and Linux being bloated and in the way of processing the source?
I am not well versed with PRU just yet. I keep learning slowly as one would presume (just not fast enough for now).
So, these two GPIO pins are mixed up in some C++ source. They are pushing a vector and rotation direction to the driver via both of the pins because of a motor driver (for now).
I have one line. This line states:
# https://github.com/silver2row/BeagleCPP
DelayMicroseconds(static_cast<int>(50000/speed));
Supposedly, that line controls many aspects to what it entails and the mathematics are simple:
It would seem the lower the 50000
integer and the higher the speed
integer would create quicker movements. My vector is like this for the driver:
const std::vector <std::vector<STATE>> driverVector
{
{HIGH, HIGH},
{LOW, LOW},
};
Is the HIGH
and LOW
correct for two GPIO pins or is it more complicated to the entirety of the build? I am solely typing about the vector for now. At one point, I had it turning quickly and with different RPM movement of different rotations. So, CW and CCW just like the source states:
enum DIRECTION
{
CW = 1,
CCW = 2,
};
Anyway, if you are understanding enough to look over the source to see my folly here, I am using the library in my own fashion for usage of the BBB. Please remember, this is before libgpiod-dev
and gpiod
took over my coding skills.
Seth
P.S. If I find enough time, I am going to build the library into some existent source with a gpiod.h
preprocessor directive alongside a few motor movements for current boards and the specification (hopefully).