Shop OBEX P1 Docs P2 Docs Learn Events
New here. Getting Activity Bot For Christmas - Page 2 — Parallax Forums

New here. Getting Activity Bot For Christmas

2»

Comments

  • Tony 4dTony 4d Posts: 45
    edited 2015-01-05 14:09
    ratronic wrote: »
    Glad to hear your success. If you have any questions about the program ask away.

    I sure will. I had to Change the center point in the define statement just a bit 1400 to get it perfectly centered. I also adjust the scan view a bit to get a wider amount of degree's. Now Can one also add the whiskers to this at the same time that the ping sensors are work? If so I may take a stab at that later down the way. I think that now I know my ping, and bracket are working just fine, I my go back to the very first Blink program, and start from there.
  • ratronicratronic Posts: 1,451
    edited 2015-01-05 14:51
    EDIT: See post below
  • ratronicratronic Posts: 1,451
    edited 2015-01-05 15:35
    You should use this code instead to center the pot's on the servo's so that they stop while running this code. The reason being that the servo's need to be

    set to stop while running this code not using the abdrive library. After this you can run the calibration routine.
    #include "simpletools.h" 
    #include "servo.h"
    
    #define CENTER 1500
    #define LFTSRV 12
    #define RGTSRV 13                    
    
    int main()  {
      servo_set(LFTSRV, CENTER);
      servo_set(RGTSRV, CENTER);
      while(1) {
      }  
    }
    
  • Tony 4dTony 4d Posts: 45
    edited 2015-01-07 07:26
    ratronic wrote: »
    You should use this code instead to center the pot's on the servo's so that they stop while running this code. The reason being that the servo's need to be

    set to stop while running this code not using the abdrive library. After this you can run the calibration routine.
    #include "simpletools.h" 
    #include "servo.h"
    
    #define CENTER 1500
    #define LFTSRV 12
    #define RGTSRV 13                    
    
    int main()  {
      servo_set(LFTSRV, CENTER);
      servo_set(RGTSRV, CENTER);
      while(1) {
      }  
    }
    

    I tried adding this code to the proper locations in the program, but it just seems to make the two drive servos run constantly.
  • PublisonPublison Posts: 12,366
    edited 2015-01-07 07:35
    I believe it was ratronic's intent to have you run just the code he supplied by itself. While running his code, you would adjust the pot on the servos to stop them from turning. That would be the center .
  • ratronicratronic Posts: 1,451
    edited 2015-01-07 07:38
    You will need to run that code all by itself. When you do the servo's may turn but then you need to adjust the pot on each servo so that it stops while just this

    code is running. Servo's require a pulse ranging from 1000us to 2000us 50 times a second. So the above program sends out a constant 1500us pulses to

    the servo which is stop for continuous rotation servo's. After you adjust them to stop with the above program you can put the bot back together and run the

    calibration program for the abdrive.

    Edit: Publison beat me too it!
  • Tony 4dTony 4d Posts: 45
    edited 2015-01-07 07:39
    Oh I see. I had talked with parallax the other day about the servos, and I thought he said something about the calibration routine on the activity bot actually handles the centering differently than the Boe bot, and he suggested not to touch the pots. I think I understood him correctly, but I may be wrong.
  • ratronicratronic Posts: 1,451
    edited 2015-01-07 07:53
    Now that maybe possible - that is just the way I setup continous rotation servos and what I did before I ran the calibration routine. I would run the routine and see how it works.
  • PublisonPublison Posts: 12,366
    edited 2015-01-07 07:54
    Tony 4d wrote: »
    Oh I see. I had talked with parallax the other day about the servos, and I thought he said something about the calibration routine on the activity bot actually handles the centering differently than the Boe bot, and he suggested not to touch the pots. I think I understood him correctly, but I may be wrong.

    The calibration routine may indeed handle the centering, but it's always a good idea to center the servos to get them very close to the optimal settings.
  • ratronicratronic Posts: 1,451
    edited 2015-01-07 08:41
    The last program I posted above when run will show how far off stop the servo's are. If they are not spinning fast then they are close. You can run

    Activitybot Calibrate with some room for the robot to spin some circles to make sure the drive system is calibrated. If it is this code should make the wheels

    stop.
    #include "simpletools.h" 
    #include "abdrive.h"
    
    #define CENTER 1500
    #define LFTSRV 12
    #define RGTSRV 13                    
    
    int main()  {
      drive_ramp(0, 0);
      while(1) {
      }  
    }
    
  • Tony 4dTony 4d Posts: 45
    edited 2015-01-07 18:53
    I'll give this a shot tomorrow.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-01-08 08:18
    Publison wrote: »
    The calibration routine may indeed handle the centering, but it's always a good idea to center the servos to get them very close to the optimal settings.

    I worked through the first few ActivityBot lessons a while back and I was very surprised to find there was no longer a step to center the pots. The calibration routine does in fact make this step unnecessary but I find I'm not thrilled with the idea of making this correction in hardware.

    I did notice the new high speed servos are a bit harder to center than most other CR servos I've used. The servo's pots required a very light touch to keep the wheel stopped with a 1500us pulse.
  • PublisonPublison Posts: 12,366
    edited 2015-01-08 08:26
    I like to center my servos in case I am using SPIN and doesn't make use of the C calibration routines. I guess there might be a way to use the calibration table in the upper EEPROM in SPIN.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-01-08 08:36
    Publison wrote: »
    I guess there might be a way to use the calibration table in the upper EEPROM in SPIN.

    I'm sure there is a way to do this.

    I've wondered if a similar calibration table would help when using Arlo hardware.
Sign In or Register to comment.