Arm movement

hi, im try to make a program for a arm with MPLAB, is there any guides or references that could help me make one?

How does the arm work? Does it use a motor? Pneumatics? What do you want it to do?

the great thing, and the worst thing at the same time about MPLab is that you have to make everything yourself. Unlike easyC (i dont use it cuz it has the word ‘easy’), MPLAB allwos almost more control (IMHO) because I have created everything, and i know it inside out. the problem is that i also have to figure everything out myself, or, with the other team members…

…enough with the rant…you can control the rm however you want. you could use a Victor and have speed control, or you could use a spike with something likea globe motor or a solenoid and pneumatics

I struggled with mplab and robot programming many years ago, so I know what you’re going thru. But you do have to have some more info for us to work with. Also knowing what level of programming smarts you have helps, so we don’t talk over your head. Reading the material from the FAQs here helps too. We can’t do all your homework!

Programming is the link between driver (or autonomous mode) and robot parts. And it doesn’t matter if it is mplab or easy-c or Robo-COBOL (which does sound like a cool name to program robots): you have to know what you want – *in detail *-- before you can program it.

How is the arm moving? What motors or pneumatics? Do you have limit switches so the arm itself or the motor doesn’t go beyond it’s range? (These are questions I give to the manufacturing crew to answer.) You will eventually need input/output plug numbers, but to start just what is driving the arm is needed.

How is the driver to move the arm? Joystick or one of it’s buttons, or a separate control attached to the controller? Or is it automatic – when the ball sits on the robot a limit switch is pressed and the arm is raised. (Just as an example.) It’s somewhat easy to change which control later, but you need something to start with.

Most controls are written in an if statement. In pseudo-code:

if <joystick button 1 pressed>, then <drive motor b>, else <stop motor b>

Obviously, once you figure out which button and motor, fill in the blanks.

Adding a limit switch to stop automatically only adds another if inside this if:

if <joystick button 1 pressed>, then 
    if <limit switch 2 not pressed>, then 
        <drive motor b>
    else
        <stop motor b>
else
   <stop motor b>

Just go thru the different possibilities to make sure every possible combination is covered. (The above code is incomplete, but it’ll give you a starting point.)

To have something continue after the button is released requires a variable set to say “if equal to 1 the button was already pressed - continue until limit switch pressed and then set variable to zero.” (That last part is important!)

Write back when you get more info.