Shop OBEX P1 Docs P2 Docs Learn Events
6-axis arm as test tool - also pca9685 16 channel pwm board — Parallax Forums

6-axis arm as test tool - also pca9685 16 channel pwm board

Stephen MoracoStephen Moraco Posts: 316
edited 2021-08-14 23:26 in Propeller 2

More of my P2 explorations/wandering...

You may or may not have noticed a P2 pca9685 object appear in our P2 Obex. This is only one of a small number of objects that will likely appear as I'm playing with a multi-axis arm for test use in positioning sensors.

You can track my progress (and always get my latest and best code) by reviewing my top-level repository page at Github Repo P2-PCA9685-Servo-Driver

I'm using objects dedicated to the FlySky transmitter, 6-axis arm, servo(s) wired to pca9685, the pca9685, etc. I'm also playing with serial and I2c as singleton objects (one shared copy used by all client objects.)
I use one or the other shapes (singleton or not) depending upon the needs of my project.

My Arm:
My Test Environment

the pca9685 PWM board as servo driver:
pca9685 PWM board

Comments

  • Thats a neat setup, look forward to hearing more about it Stephen

  • Cluso99Cluso99 Posts: 18,069

    Nice work Stephen.
    Those jaws look nice, and the interesting use of the turntable (lazy Susan).

  • Very nice Stephen! Did you make the base yourself?

  • Stephen MoracoStephen Moraco Posts: 316
    edited 2021-08-15 23:12

    @Tubular thank you! More soon, I hope...

    @Cluso99 yes, i changed to a 360 degr servo for the base because I needed a bit more range in my prior application. ATM it is disconnected as when it runs away due to miscoding/failed test the arm just disconnects all the servo cables. This was only lightly amusing to witness once... ;-)

    @Publison no, I didn't make it. It came with the kit I purchased at Amazon (No longer avail.) My repo page has some Amazon links for current kits. But, all the holes and mounting of the pca9685 board are my doing. Inevitably, when I need to mount something I hadn't before, any existing holes I might have made don't work.

    Also, the cube in the gripper... is a low-cost thing (colored popsicle sticks, cube of styrofoam, and hotglue) I made so that I can easily track which of 6 different colored sides is currently facing up as I determine the arm motions/positions I need.

    Once I've determined the arm positions I want and I have reasonable movement between them then I can position the MPU 9DOF sensor where the cube is and start my repeatable testing. I'm soooooo close...

  • SteffeD1SteffeD1 Posts: 22
    edited 2024-01-02 20:02

    I want to try this. jm_sbus_rx_debug_graphical is working. In arm6axis_demo Parallax serial terminal shows:
    pLpca- setupPins(1,2,0) Cg0

    ** quietController()
    and if I press enter the the terminal window clears and nothing more happen.
    What am I supposed to do next?

  • @SteffeD1 said:
    What am I supposed to do next?

    Read through the demo code. It demonstrates how to control your arm using code.

    The demo itself (see demo()) just moves the arm a bit.

            'arm.gripOpen()
            term.fstr0(string("-- [ startup ] --\r\n"))
            waitms(1000)
            'repeat' hold here
            term.fstr0(string("-- [ close grip ] --\r\n"))
            arm.gripClosed()
            waitms(2000)
    
            term.fstr0(string("-- [ Demo arm moves ] --\r\n"))
            'arm.doServoSteps()
            arm.demoPositions(2)
    

    If you have a FlySky controller then you can uncomment the remote control part of the demo and use the controller to move individual servos of the arm.

    When you are familiar with how to make the arm move in code... then you are ready to write your own arm movement algorithms!

    Does this help?

  • SteffeD1SteffeD1 Posts: 22
    edited 2024-01-05 11:25

    I have installed flexprop and when I run the program the terminal window showed a lot more, but the arm don't respond and it
    says "slewToPosision() ERROR Channel[] NOT configured".
    If I try uncomment the part remmoteCtl.manualCalibrate, program don't stops at 'flip swA down' but at 'push right stick full right', and nothing more happen.
    I will take a break from P2 and I maybe be back at this in summer again.

Sign In or Register to comment.