Page 17 of 31 FirstFirst ... 713141516171819202127 ... LastLast
Results 161 to 170 of 302

Thread: PhantomX using a Teensy 3.1

  1. #161

    Re: PhantomX using a Teensy 3.1

    I believe that I originally found it some place like: https://code.google.com/p/digitalwritefast/

    At the time I thought there was a link to it from the contributed libraries page off of the Arduino reference. For the Teensy we really don't need this as they are fast enough. So if there are places I am still using it, should maybe try to remove it.

    Kurt

    P.S - I enjoyed your new/old Apod video
    Last edited by KurtEck; 04-29-2014 at 04:42 PM.

  2. #162

    Re: PhantomX using a Teensy 3.1

    Note that digitalWriteFast uses AVR8-specific registers to do its "fast" magic, and this won't work at all an an ARM-based Teensy3.
    I agree it's probably not needed anyway on that MCU :-) Sounds like you could not include it and swap back to the regular digitalWrite() and friends.

  3. #163
    Join Date
    Jan 2008
    Location
    Norway, Stavanger
    Posts
    774
    Images
    276
    Rep Power
    71

    Re: PhantomX using a Teensy 3.1

    Thanks guys, I'll try to change it. I did download the files from the same place you are linking to Kurt, maybe I picked wrong version. Anyway, if we don't need it I'll try to change it.

    Glad you liked the video Kurt!
    Kåre Halvorsen aka Zenta
    ---------------------------------
    Zenta's YouTube channel
    Zenta's Blog
    Zenta's Instagram

  4. #164

    Re: PhantomX using a Teensy 3.1

    Oops

    If you are looking at my Teensy Test, the inclusion of digitalwritefast is detritus from earlier versions of the test program, that has been bouncing around since the start of the development of the Botboarduino and having an app to try different things out.

    Just delete the include of this file. There are no longer any uses of digitalWriteFast in the code. There have been many discussions on several forums for several arduino platforms (Arduino, Teensy, mpide...) about these functions. Many think they should just be killed, others believe that the functionality should be simply folded into the real DigitalWrite/DigitalRead functions. That is if you pass in a constant to the function, it should optimize it... I have read some different threads where Paul (Teensy) was involved in many of these discussions.

    Looking in the actual Teensy installation, I believe that these functions are fully defined in core and defined in core_pins.h

    Kurt

  5. #165
    Join Date
    Jan 2008
    Location
    Norway, Stavanger
    Posts
    774
    Images
    276
    Rep Power
    71

    Re: PhantomX using a Teensy 3.1

    Thanks! The test program seem to work ok, so far. I did had to update some other lib files though. Now I've to see if I can test the MX-64. Not sure if anyone has made a MX64serial library files?
    Kåre Halvorsen aka Zenta
    ---------------------------------
    Zenta's YouTube channel
    Zenta's Blog
    Zenta's Instagram

  6. #166

    Re: PhantomX using a Teensy 3.1

    Not sure? Do you have the TTL or the RS485 version? with TTL, not sure what needs to change in the code?

    Baud rate? I believe my code defaults to 1mbs.
    change the default positions in the BioloidEx class from 512 to 2048?

    In Phoenix Ax12 driver code(Phoenix_Driver_ax12), need to change:
    Code:
    #define cPwmMult      128
    #define cPwmDiv       375  
    #define cPFConst      512    // half of our 1024 range
    Note: however with these higher resolution servos, you might have better luck turning on having the servos do their own interpolation. I believe Kevin has had pretty good luck with this.

    Not sure what else?
    Kurt

  7. #167
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    821
    Images
    25
    Rep Power
    78

    Re: PhantomX using a Teensy 3.1

    In regards to what Kurt posted I do it a little different. I took a cue from either... Jwatte, Fergs, Tican or Ryan... (So sorry I'm not sure which!)

    Code:
    #define MX_CENTER_VALUE  2048
    
    #define MX_TIC_PER_DEG   11.36
    
    
    
    void servoDriver::OutputServoInfoForLeg ( int legIndex, float coxaAngle, float femurAngle, float tibiaAngle, float tarsusAngle ) 
    { 
        // Update Right Legs 
        if ( legIndex <= 2 ) 
        { 
            goalPos[FIRST_COXA_ID  + legIndex] =  (-coxaAngle  * MX_TIC_PER_DEG ) + MX_CENTER_VALUE; 
            goalPos[FIRST_FEMUR_ID + legIndex] =  ( femurAngle * MX_TIC_PER_DEG ) + MX_CENTER_VALUE; 
            goalPos[FIRST_TIBIA_ID + legIndex] =  ( tibiaAngle * MX_TIC_PER_DEG ) + MX_CENTER_VALUE; 
            goalPos[FIRST_TARSUS_ID + legIndex] = ( tarsusAngle * MX_TIC_PER_DEG ) + MX_CENTER_VALUE; 
        } 
     
        // Update Left Legs 
        else 
        { 
            goalPos[FIRST_COXA_ID  + legIndex] =  ( coxaAngle  * MX_TIC_PER_DEG ) + MX_CENTER_VALUE; 
            goalPos[FIRST_FEMUR_ID + legIndex] =  (-femurAngle * MX_TIC_PER_DEG ) + MX_CENTER_VALUE; 
            goalPos[FIRST_TIBIA_ID + legIndex] =  (-tibiaAngle * MX_TIC_PER_DEG ) + MX_CENTER_VALUE; 
            goalPos[FIRST_TARSUS_ID + legIndex] = (-tarsusAngle * MX_TIC_PER_DEG ) + MX_CENTER_VALUE; 
        } 
    }

  8. #168
    Join Date
    Jan 2008
    Location
    Norway, Stavanger
    Posts
    774
    Images
    276
    Rep Power
    71

    Re: PhantomX using a Teensy 3.1

    Thanks guys. At the moment I'm just trying a AX-12 servo using AXservo test (A) in your test program. But the servo does not move at all. The test program rush through the loop very fast, it does return the servo position though, but no panning of the servo.
    The output is:
    Current Tests:1 - Digital Pin Test
    2 - Analog Pin Test
    3 - Serial SSC32 Test
    4 - Sound Test
    5 - I2c/SRF08 Test
    6 - PS2 Test
    7 - Test XBee
    8 - Configure XBee
    9 - Servo Test
    A - AX12 Servo Test
    C - Commander Test
    Choose: 61
    Begin AX Servo Test
    Read pose returned
    Servo Voltage: 124
    344 191 0
    Move one direction
    Move other direction
    Move to center
    Free servo
    Servo test done
    Current Tests:
    1 - Digital Pin Test
    2 - Analog Pin Test
    3 - Serial SSC32 Test
    4 - Sound Test
    5 - I2c/SRF08 Test
    6 - PS2 Test
    7 - Test XBee
    8 - Configure XBee
    9 - Servo Test
    A - AX12 Servo Test
    C - Commander Test

    Any thoughts?

    EDIT: Oh, sigh. Changed the ID to 1 and it moved! Sigh, what a noob
    Last edited by Zenta; 05-05-2014 at 01:39 PM. Reason: NOOB
    Kåre Halvorsen aka Zenta
    ---------------------------------
    Zenta's YouTube channel
    Zenta's Blog
    Zenta's Instagram

  9. #169
    Join Date
    Jan 2008
    Location
    Norway, Stavanger
    Posts
    774
    Images
    276
    Rep Power
    71

    Re: PhantomX using a Teensy 3.1

    At first I was using a brand new AX-18A. And of course, the default ID is 1.. But what confused me was that I afterwards had connected 4 old AX-12+ (ID 1 to 4) and the ID 2 didn't move either. My guess is that something got messed up and two servos probably had the same ID. Anyway, its working fine with both AX-18A and AX-12+.

    Next step is trying a MX-64 (TTL).
    Kåre Halvorsen aka Zenta
    ---------------------------------
    Zenta's YouTube channel
    Zenta's Blog
    Zenta's Instagram

  10. #170
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    821
    Images
    25
    Rep Power
    78

    Re: PhantomX using a Teensy 3.1

    Quote Originally Posted by Zenta View Post

    Next step is trying a MX-64 (TTL).
    Once you go to the MX line you will never want to go back to the AX line. :P So smooth... and strong.

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Similar Threads

  1. PhantomX Hexapod Kit
    By SuperMiguel in forum Projects For Request and/or Sale
    Replies: 12
    Last Post: 12-29-2013, 09:36 PM
  2. Question(s) PhantomX AX Quadruped Mark II PhantomX Robot Turret Equipped??
    By hwan we in forum Robotics General Discussion
    Replies: 1
    Last Post: 03-11-2013, 02:09 PM
  3. Question(s) PhantomX Drawings?
    By phil0stine in forum Humanoids, Walkers & Crawlers
    Replies: 2
    Last Post: 01-03-2013, 02:09 PM
  4. For learning: PhantomX Hexapod vs PhantomX Quadruped
    By Leugim in forum Humanoids, Walkers & Crawlers
    Replies: 4
    Last Post: 10-26-2012, 08:50 AM
  5. My PhantomX Hexapod
    By Gilrock in forum Humanoids, Walkers & Crawlers
    Replies: 0
    Last Post: 09-26-2012, 02:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •