View unanswered posts | View active topics It is currently Fri Aug 22, 2014 12:04 am






Reply to topic  [ 6 posts ] 
LCD showing PID error or just status? 
Author Message
Rookie

Joined: Sat Jun 02, 2007 8:54 pm
Posts: 17
Post LCD showing PID error or just status?
Running a simple PID program in my course I get displayed on the LCD:

Running
clock 0:19.35.3
straight
PgmCnt FFED2A0C

when the program stops I get:

clock: etc.
PgmCnt 00000
Err Type 0

Why am I getting this feedback on the display.. Is this status supposed to be displayed?

I am running V1.40 of RobotC with 7.53 firmware..

The program I am running is:

nSynchedMoters=synchAB;
nSyncedTurnRatio=100;
motor[motorB]=70
wait1Msec(2800);

Dave Crabbe
Nova ScotiaCommunity College


Fri Oct 03, 2008 1:44 pm
Profile
Expert
User avatar

Joined: Sat Sep 20, 2008 12:16 pm
Posts: 106
Location: Curently fighting aliens on P3X-828
Post Re: LCD showing PID error or just status?
Thats odd, I get the same problem with FW version 7.58...

_________________
:downloading:
Sorry, your program could not be downloaded. Please reboot your computer.
FTC Team #2959 Team Smash Bros CLICK HERE.(or click www)
Quote:
What the world needs is more geniuses with humility, there are so few of us left.

Agreed


Fri Oct 03, 2008 5:37 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3188
Location: Rotterdam, The Netherlands
Post Re: LCD showing PID error or just status?
When you have syncAB, you need to set the speed on the A motor, not B. syncAB means you are making A the master and B the slave.
Code:
nSynchedMoters = synchAB;  // setting up A as master, B as slave
nSyncedTurnRatio = 100;
motor[motorA] = 70         // set the speed of the master motor
wait1Msec(2800);


You will get a similar error if you try to set the tacho of a slave when it's in sync with a master. If you really do want to reset the slave tacho, you need issue
Code:
nSynchedMotors = syncNone;  // make them unsynchronised
nMotorEncoder[motorA] = 0;  // reset the tacho of the master
nMotorEncoder[motorB] = 0;  // reset the tacho of the slave
nSynchedMotors = syncAB;    // set up the synch'd motors again


Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Oct 04, 2008 3:15 am
Profile WWW
Expert
User avatar

Joined: Sat Sep 20, 2008 12:16 pm
Posts: 106
Location: Curently fighting aliens on P3X-828
Post Re: LCD showing PID error or just status?
I don't use syncAB, so I am going to need help with my code:
Code:
#pragma config(WizType, FTC, 2, Tankbot, Analog)
#pragma config(Hubs,  S1, HTMotor,  HTServo,  none,     none)
#pragma config(Hubs,  S2, HTMotor,  none,     none,     none)
#pragma config(Driving, Tankbot, Y1, X1)
#pragma config(Sensor, S3,     Light,               sensorLightActive)
#pragma config(Sensor, S4,     Sonar,               sensorSONAR)
#pragma config(Motor,  mtr_S1_C1_1,     motor1,        tmotorNormal, PIDControl)
#pragma config(Motor,  mtr_S1_C1_2,     motor2,        tmotorNormal, PIDControl)
#pragma config(Motor,  mtr_S2_C1_1,     motor3,        tmotorNormal, PIDControl)
#pragma config(Motor,  mtr_S2_C1_2,     motor4,        tmotorNormal, PIDControl)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

// #pragma config is for motor setings and is NOT to be edited unless the design of the robot completely changes.

#include "HeaderFTC.c" // include the FTC header file
#include "teleopHeader.c" // include teleop code
task main() // main program
{
   startup();
  getJoystickSettings(joystick); // get joystick setings
  if(joystick.UserMode == false) // the following code is hard to explain
  {
     while(true)
     {
       if(mode1 == false) // red code...
       {
        if (mode2 == 1)
         {
           if (SensorValue(Sonar) < 30)
           {
              mode2 = 2;
          }
        }
         if (mode2 == 1)
         {
           motor[motor1] = 100;
           motor[motor2] = 100;
        }
        if (mode2 == 2)
        {
           motor[motor1] = - 75;
           motor[motor2] = 75;
           wait10Msec (85);
           mode2 = 3;
        }
        if (mode2 == 3)
        {
           motor[motor1] = 100;
           motor[motor2] = 100;
           if (SensorValue(Light) < 30)
           {
              wait10Msec (300);
              motor[motor1] = - 75;
              motor[motor2] = 75;
              wait10Msec (85);
              motor[motor1] = 100;
              motor[motor2] = 100;
              wait10Msec (100);
              mode2 = 4;
           }
         }
         if (mode2 == 4)
         {
            motor[motor1] = 0;
            motor[motor2] = 0;
            servoTarget[servo3] = 100;
         }
         wait1Msec (9);
       }
       else // blue code...
       {
          if (mode2 == 1)
          {
            if (SensorValue(Sonar) < 30)
            {
               mode2 = 2;
           }
         }
          if (mode2 == 1)
          {
            motor[motor1] = 100;
            motor[motor2] = 100;
         }
         if (mode2 == 2)
         {
            motor[motor1] = 75;
            motor[motor2] = - 75;
            wait10Msec (85);
            mode2 = 3;
         }
         if (mode2 == 3)
         {
            motor[motor1] = 100;
            motor[motor2] = 100;
            if (SensorValue(Light) < 30)
            {
              wait10Msec (300);
              motor[motor1] = 75;
              motor[motor2] = - 75;
              wait10Msec (85);
              motor[motor1] = 100;
              motor[motor2] = 100;
              wait10Msec (100);
              mode2 = 4;
           }
         }
         if (mode2 == 4)
         {
            motor[motor1] = 0;
            motor[motor2] = 0;
            servoTarget[servo3] = 100;
         }
         wait1Msec (9);
       }
     }
   }
   else // and Tele-op code
   {
       teleop();
   }
} // end of file


However, the code only gets killed at line 28 0f teleopHeader.c

Code:
void teleop()
{
  while(true)
       {
         getJoystickSettings(joystick);
        motor[motor1] = joystick.joy1_y1;
        motor[motor2] = joystick.joy2_y1;

        if(joy1Btn(1))
        {
          servoTarget[servo3] = 200;
        }
        else
        {
          servoTarget[servo3] = 0;
        }
        if(joy2Btn(1))
        {
          motor[motor3] = 100;
          motor[motor4] = - 100;
        }
        else
        {
          motor[motor3] = 0;
          motor[motor4] = 0; //code gets killed here
        }
        if(joy1Btn(3))
        {
          servoTarget[servo1] = 200;
          servoTarget[servo2] = - 200;
        }
        else
        {
          servoTarget[servo1] = 0;
          servoTarget[servo2] = 0;
        }
      }
  }

_________________
:downloading:
Sorry, your program could not be downloaded. Please reboot your computer.
FTC Team #2959 Team Smash Bros CLICK HERE.(or click www)
Quote:
What the world needs is more geniuses with humility, there are so few of us left.

Agreed


Sat Oct 04, 2008 9:54 am
Profile WWW
Rookie

Joined: Sat Jun 02, 2007 8:54 pm
Posts: 17
Post Re: LCD showing PID error or just status?
Sorry, I mistyped my code in the orginal post.... I have

motor[motorA] = 70;

and I get the PID error/status message..

It actually seems to be some debugging message that got turned on in the RobotC code and never got turned off before it was released..

dave


Sat Oct 04, 2008 11:56 am
Profile
Expert
User avatar

Joined: Fri Nov 09, 2007 4:51 am
Posts: 121
Location: Hungary, Europe
Post Re: LCD showing PID error or just status?
Hi,

There is a production (not debugging) version of 1.44 on the downloads page,
you might want try that one.

L


Mon Oct 06, 2008 1:26 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.