New Parallax 360 Feedback Servo

12346»

Comments

  • I ran some more tests. When I run the full scale range section of the demo, it seems that once "WaitSet" is called (which in turn calls "CheckDone" which returns "Complete") if the movement has not reached the target, the program stalls. I think that it is supposed to keep trying until it is at the target within the allowable error.

    I replaced the full scale section with the following code:
    for(int ii = 0; ii <=3; ii++)
      {
        MySet(1,gotodeg[ii]);         // gotodeg[] defined as 180, 0, 359, 0
        print("\n%d\n", gotodeg[ii]);
        for(int iii = 0; iii <= 5; iii++)
        {
        err1 = gotodeg[ii] - GetPos(1);
        print("%4d,%8d,%8d \n", err1, gotodeg[ii], GetPos(1));
        pause(300);
        }    
      }
    
    The code shows how the actual approaches target.
    And I varied the pause from 100 to 400. Then I looked at changing the gain parameter.

    The results I got are listed below for a couple of cases for the motion from 0 to 259 and from 359 to 0.

    Tom

  • twm47099twm47099 Posts: 574
    edited November 11 Vote Up0Vote Down
    I've corrected a couple of errors, and it seems to work better.
    Tom
    I deleted the attachment - The fixed one is attached to the next post
  • Found another error. This one is what resulted in differences between the parameter values that work in Spin vs C. -- I was returning an array element from a function - bad.

    These were my reflections from the first version:
    I found that the parameters, particularly gain and Dmin required different values in the C program than they did in the Spin program. In the spin version, I used a gain of 12 for all 3 of my servos. The C version requires approx gain =18 to 24.
    With the fix to my C program a gain of 12 works, but tuning for individual servos gives best running at 12 - 18.
    Dmin in the Spin program was 30 for my 2 easy servos and 32 for the problem servo. In the C program, I have to use 38 for all the servos.
    The corrected Dmin is now the same as used in the Spin version 29-30 for the good servos and 31 for the problem one.
    Even then with the full scale changes (0 to 359 to 0) I had to add a long delay (1.5 to 2 seconds) between sending the position command and checking for complete. I also had to increase the allowable error. I can still have the problem servo freeze occasionally.

    Now, no need for any programmed delay; the driver function CheckDone and its PASM does it automatically. With the good setting of Dmin - no more freezes.

    The new version is attached.

    Tom
  • Sounds good to me. One other thing I was thinking of for the pasm is a "constant velocity" mode. SetVelocity(servo, rpm). Sound useful?
    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
    Cool, CA, USA 95614
  • Found another error.
    Sounds good to me. One other thing I was thinking of for the pasm is a "constant velocity" mode. SetVelocity(servo, rpm). Sound useful?
    Yes, it does. One of the tricky things if using these for robot wheels will be getting equal velocity of multiple wheels. Will 1500+70 give same rpm as 1500-70 or (I assume) will actual feedback in deg/time of each have to be measured and pulse be adjusted?

    Tom
  • The latter, for sure. Probably have to measure over "several" pulses.
    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
    Cool, CA, USA 95614
  • Any chance of replacing the circuit board in this servo?

    I've thought about making a QFN Propellerized servo for years...

    Nice thing about 4-wires is that main board could talk to servo using simple serial I/O.
    One wire for transmit and one for receive...
    Prop Info and Apps: http://www.rayslogic.com/
  • Hopefully there is someone here who is familiar with Rev robotics and their Expansion Hub. My question is: is this servo compatible and does the control signal frequency match the output on the REV hub?

    -Magi
  • MagiW wrote: »
    Hopefully there is someone here who is familiar with Rev robotics and their Expansion Hub. My question is: is this servo compatible and does the control signal frequency match the output on the REV hub?

    -Magi

    Welcome to the forums!

    Do you have a link to the hardware?


    Infernal Machine
  • Here is their website, there is a link to a PDF:
    http://www.revrobotics.com/REV-31-1153/

    -Magi
  • Hello everyone.

    I would like to use the 360 feedback servo as multi-turn regular servo, position control and holding the position.

    I'm using SimpleIDE and a Cog per servo and using a PID algorithm, the PID interval is 20 ms.

    Position control without any torque is easy.
    If i put some torque, the problems will start, back and forward, and i can't get the servo to stop.

    I have a spent a lot of time trying to tune the PID parameters without success.

    Can some help with a working solution ? What i really want is to replace a regular servo with the 360 feedback servo.

    So no fast movements back & forward, responsive keeping the the position, etc. Is this possible ?

    I can post the relevant code (cog code) if it helps, a full working project to test, but like, i said i don't know if a PID is the correct way to go.

    Thanks









  • Ptiago,
    Did you take a look at twm's C version about nine comments back?
    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
    Cool, CA, USA 95614
  • ptiagoptiago Posts: 32
    edited November 17 Vote Up0Vote Down
    Tom,

    yes and no, before asking the question i unziped the file and i dig in and then i found this:

    extern int binary_FourPly_dat_start[];
    cog360servo = cognew((void*)binary_FourPly_dat_start, MyParm);

    but where is linked/loaded the binary_FourPly_dat_start reference ?

    I assumed it was not finished, I'm missing something ?




  • twm47099twm47099 Posts: 574
    edited November 17 Vote Up0Vote Down
    ptiago wrote: »
    Tom,

    yes and no, before asking the question i unziped the file and i dig in and then i found this:

    extern int binary_FourPly_dat_start[];
    cog360servo = cognew((void*)binary_FourPly_dat_start, MyParm);

    but where is linked/loaded the binary_FourPly_dat_start reference ?

    I assumed it was not finished, I'm missing something ?

    That statement refers to the FourPly.spin file included in the zip folder. It results in the PASM (DAT section of the spin program) being run when the statement:
    cog360servo = cognew((void*)binary_FourPly_dat_start, MyParm);
    
    is executed.

    If you are using SimpleIDE click on the button in the lower left corner of the window. That will open the Project frame. You should see the spin file listed. If it is not, click on Project in the menu and then on "Open Tab to Project:". That will give a file open screen. Change the file type to spin and double click on FourPly.spin. Then click on the Servo360driver tab in the main frame and you should be able to build and run the program.

    Note that PASM can control 4 servos in 1 cog. I only have the main program running 3 servos since that's all I have. I've also used the driver to have one manually turned servo control a second.

    Hope this helps,
    Tom M.
  • Twm,

    Thanks for the help, it's my first time with spin, i really missed that detail.

    I opened the file before, but i didn't find any reference to the c variable, but, makes sense in both assembly and c after the compilation there are no variables names, only references.

    I'll need to study more :)

    I have 4 servos, I'm surprised you need only one cog.

  • Tom Crawford wrote the Spin/PASM. I am a real Spin/PASM novice, but his program is nicely commented, and it's interesting to see how he managed to get 4 servos to work in one cog.

    Tom M.
  • I was playing with some test code on the 360 servo and notice that the position sensor only returns 148 different positions as each position only varies by 6.8 microseconds.

    So the closest angle that can be made would be about 2.4 degrees.

    Mike
  • Which microcontroller are you using it with? The Propeller can easily resolve 1024 positions per rotation. The sensor itself is capable of resolving 4096.

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
Sign In or Register to comment.