Shop OBEX P1 Docs P2 Docs Learn Events
Trim disabled vs trim with 0 values — Parallax Forums

Trim disabled vs trim with 0 values

BlackSoldierBBlackSoldierB Posts: 45
edited 2014-06-04 02:47 in Propeller 1
When i disable the trim function the robot drives almost straight (+- 0,5 cm).
But when i enable it the robot starts to curve to the right (around 5 cm), at the end it correct so it is pointing forward again. This even happens when all the trim values are 0.
This results are on a hard surface and over a distance of 90 cm.

Anyone have seen this effect before?

Comments

  • PublisonPublison Posts: 12,366
    edited 2014-06-03 08:24
    You will have to be more specific. Which robot? Which code? Did you do a calibration on the servos?
  • BlackSoldierBBlackSoldierB Posts: 45
    edited 2014-06-04 02:47
    Yes i did calibrate the servo's.Below is the code of both situations.
    I would expect that both situations produced the same result.
    I tested both versions 4-5 times, and the results where consistent.

    This is the code with the trim enabled, this will move to the right.
    drive_trim(1);
    drive_trimSet(AB_FORWARD, AB_LEFT, 0);
    drive_trimSet(AB_FORWARD, AB_RIGHT, 0);
    drive_trimSet(AB_BACKWARD, AB_LEFT, 0);
    drive_trimSet(AB_BACKWARD, AB_RIGHT, 0);
     
    drive_speed(0,0); 
    drive_setRampStep(4);
    drive_setMaxSpeed(32);
    
    double ticks = 900 / 3.25; //900 mm
    drive_goto(-ticks, -ticks);
    

    This is the code with trim disabled, this will do +- 0,5 cm.
    drive_trim(0);
    drive_trimSet(AB_FORWARD, AB_LEFT, 0);
    drive_trimSet(AB_FORWARD, AB_RIGHT, 0);
    drive_trimSet(AB_BACKWARD, AB_LEFT, 0);
    drive_trimSet(AB_BACKWARD, AB_RIGHT, 0);
     
    drive_speed(0,0); 
    drive_setRampStep(4);
    drive_setMaxSpeed(32);
    
    double ticks = 900 / 3.25; //900 mm
    drive_goto(-ticks, -ticks);
    
Sign In or Register to comment.