Let's Make Robots!

Code help for Robot arm - High current motor

My project is a 5 motor robot arm.  I have a megamoto  plus mega2560. I got the test program running (megamoto test code) ramp up/down and modified enough to show that the high amp 9 vdc drill motor motors I am using can be handled by the megamotoplus.  I am currently zeroing in on the 2nd 8 inch arm and one motor for now.  I need help with  code that will run one loop  when a switch or button is pushed.  (and act as a one shot-(switch on or button pushed for short or long time))  I am using a 50/1 worm gear and 3.3/1 belt pulley ratio so about 2.2 motor  revs per degree. I have run with a direct toggle switch to show it will run.   I want the loop to ramp up and travel 180 degrees  then ramp down , delay stop and repeat back to home.  I want to use a pot on the output shaft or an encoder on the motor. ( I have both, but 1st want to see if the accuracy of a pot will be good enough.)
Eventually I will add the other arms etc
I can pay some so am interested if someone could help me.  I have some knowledge with PLCs, but my background is Mechanical.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I can probably help you a bit, but some others here have more experience with the Arduino.

You also might want to check on your choice of controllers. I don't know if the MegaMoto Plus can have more than three shields. I might be wrong, but it sounded like the store I saw them in didn't know. Each can control 1 motor.

I'm using a RoboClaw 30 amps for my bot. It controls 2 motors at up to over 24 volts and 30 amps each, and it reads the quadrature encoders for me. It also communicates four ways: r/c pulses, analog, serial, and USB. This way the Arduino can just handle the interfacing. These are a available at orionrobotics.com, or at Amazon.

As for you arm, I'm curious about the total weight it's expected to be, because that's how much your first motor has to lift in addition to any payload. You might want to experiment with putting the additional weight at the end of your first joint just to see if the motor has the torque. I'm not good at mechanics, but I've built a few robots and arms.

As for coding, there is a lot of documentation at Arduino.cc, as well as a lot of other forums. I'm surprised if you can handle PLCs that you'd have any problem with the Arduino. Not meant as a put down, just surprised is all.

One opinion in the encoder vs pot question: with a five DOF arm, the early motors are going to be important to keep their positioning know. If you're off a degree or two on motor one, and then another two degrees on motor two, by the end of the chain you're talking about having the hand be somewhere in Cincinnati. :)

And maybe you can help me with some problems with a rather large robot arm I'm going to be building at some future point once I get Groucho built up a bit.

I answered his question to the best of my abilities because he had put in the work. Jlhoffa probably has the docs because he knows how to use the sample code. Yes, there are more bits of data i would like were I to accept this contract, but for giving him advice they aren't necessary.

As to why I don't think that rhis was a bad request for help, well, when I was a proffesional working for Penn State, I got worse requests from faculty..

And, to be perfectly frank, I signed up for this site believing that it helped beginners of all stripes. You have given me cause to rethink this assumption. Perhaps I will find someplace else.

BTW: Mocking somebody is always rude. And if this was there first question, maybe they'll never come back.