Open to Any Suggestions on IF the Boards Available via Beagleboard.org CAN In Fact Handle Quick Movements in Motors

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).

Hi Seth,

Yes this can be done, but you will need to use the PRU’s on the Am335x based boards, maybe the R5 cores on then BBAI-64/BBY-Ai can also do it, but they also have PRU’s.

You need real time hardware to do any serious motor control.

Here is a G code interpreter for the BBB and can drive up to 8 motors. However this is a pretty old project and will probably need some work to get it going on a more recent kernel. I haven’t investigated it that deeply.

BeagleG

Watch the video to see the code in action.

1 Like

I saw the code repo and it builds.

I will test it more now that I know about it and how I can already use it via commanding on the command line.

Off to test…

Ben,

Hey…um. The source compiles and works. This is nice.

I know what you said about not digging too deep in the source of beagleg. No issue.

I got to the point where it will not accept the command to get online to view whatever…

I am at the point where I might have to write it up or find a written example that someone already produced.

Hey Ben…I got it. It all works. It works!

thats good, never tried it myself. now you just need to hook up some motors

1 Like

Right and now I can stop bothering the community over simple things!

Unless it is warranted, I can make some posts about it…

Time will tell…

What is your suggestion for that, I tried their c2000 launch board and its turned into another waste of time. Only tried it because we need to have precise pwm on the fly. That only happens with advance pwm systems with a shadow register.

@foxsquirrel
I would imagine most 32bit arm micros can do what you need. You should be able to find chips with programmable dead times as well, which can be very important. You will be able to find dev boards for most micros, but you are going to have to write some software. Personally I find ST micros to have the best documentation usually with plenty of examples. Infineon also have a range of very competent processors (their AURIX processors for safety critical stuff and MOTIX for motor control) although in the past I have found their documentation less easy to read.

Probably the biggest thing you need to take into account is the safety aspect, but that depends on what your motor is doing.

1 Like

I finally got the c2000 package with ccs20 working.

Tried the ST suff and out of the box their software would not flash their demo board.

So that one went back and I had to fiddle around and get ccs20 up. Once I got it actually working it is VERY nice to work with for that product line. They do have some extremely good examples so out of the box I was able to do skew testing and it was under 135ps.

Need that same chip with ethernet, it has can and uart so that might have to do for now.

I will look into infineon and see what they offer, thank you for helping me on this.

Hey Ben,

Seth here. I have been trying the source at beagleg so far. No luck thus far…

It may need work. For instance, I think porting it so clpru is in control of the UIO may prove valuable. I will read up and see how far I get.

I think PASM stopped and is old news now. I cannot be sure so far. I have only seen the dated docs. on the PASM to CLPRU data so far.

Seth

P.S. The video on beagleg is neat and it would be better if I could configure things appropriately so far. hard win over here!