Forum Replies Created
-
AuthorPosts
-
Sumit GoyalParticipantYes. I am trying to make a segway with the help of color sensor and a PID control.
Yes, I think it might be a problem with the kernel modules.
Sumit GoyalParticipantHi Anders!
Creepy enough I tried the same task with Monobrick Firmware…and it has the same problem. The loop terminates anywhere in between. I really need to figure it out very soon. Please help.
Sumit GoyalParticipantHi Anders!
I added a simple try and catch around. It avoids the error but the delay is too much for my program. My robot falls in that time delay. Did you get any clue.
Sumit GoyalParticipantYa sure!
The code chunk is:
do {
Console.Write(“Loop:”+ i);
// Error comes here in the next statement
int CurrentReading = brick.Sensor1.Read();
Console.Write(” CSR: “+ CurrentReading);Error = SetPoint – CurrentReading;
Integral = 0.5 * Integral + Error;
Derivative = Error – PrevError;
PrevError = Error;Dgain = Derivative * Kd;
Igain = Integral * Ki;
Pgain = Error * Kp;
gain= Dgain+Igain+Pgain;Total= (Dgain+Igain+Pgain)*-1;
Total= Convert.ToInt16(Total);if(Total<-100)
Total= -100;
if(Total>100)
Total=100;spower = Convert.ToSByte(Total);
Console.Write(” spower:”+ spower);
brick.MotorB.On (spower);
brick.MotorC.On (spower);
i=i+1;Console.Write(” Power: ” + Total+”\n”);
// Thread.Sleep(30); helps, but does not solve
} while(i<1000);
watch.Stop();
var elapsedMs = watch.ElapsedMilliseconds/1000;
Console.Write(” Time: ” + elapsedMs);brick.MotorB.Off();
brick.MotorC.Off();
brick.MotorA.Off();
brick.Connection.Close();
}
Sumit GoyalParticipantHi again,
Unfortunately that does not solve the problem. But I tried programming the same code with the matlab. It has the same problem there. I am not sure of the reason.
Sumit GoyalParticipantHey again,
I guess I solved it. May it had something to do with the cycle time of my loop and the frequency of the Ev3 brick to process request. I added a small delay in my loop and now it works just perfect, aleast for now. 🙂
:
Sumit GoyalParticipantOha!
It works fine now. Apparently there was some problem with the complete download of the image file. I tried it with the server of my university and it works now. Thanks. 🙂
Sumit GoyalParticipantHi!
Download of the 147 mb GZ file is perfectly okay. File is broken while unzipping. Both with 7Zip and WinRAR
Sumit GoyalParticipantHey Anders!
Good day,
I have the same problem. I have tried to download the firmware several time, with different browsers and different systems. But the image file is broken. Please verify if you have he same problem while downloading it from the server.
Many Thanks
-
AuthorPosts
Follow