Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Operator Interface is crazee !!! HELP (http://www.chiefdelphi.com/forums/showthread.php?t=13995)

punarhero 01-07-2002 11:15

Operator Interface is crazee !!! HELP
 
Hi,
I have two questions. First of all, if u press "robot reset" on the Operator Interface, does it just refreshes the program in the robot Controller or changes the program on the Robot Controller back to the default program???

Secondly, we went to the SCRRF summer event last Saturday. We ran the robot and it was running fine. When we started competing, it started giving BASIC error for some reason. I press reset couple of time and then it worked fine. Any ideas of what kind of problem might it be? Hardware or programming problem?

HELP ME !!!

Punar Sikka
Team 696
Clark Magnet Robotics
VIPER

srawls 01-07-2002 11:42

'robot reset' will reboot the robot controller, meaning the program will start over with all vars initialized again (but the default code does not start up unless that's what you're running anyway). BASIC error usually means something with the program, like an infinite loop or something, but if it went away with just hitting reset it could be that there was a loose connection somewhere, or it was just a wierd bug. I'd really have to 'play around'/test your 'bot out before I could say for sure. Maybe someone with more experience than me will know, though ...

Stephen

rbayer 01-07-2002 12:17

Basic errors can also be caused if you give invalid input to a command. For example, if you try to do a "put" to location 63, I believe it will give you a basic run error b/c this location is read-only. I've only ever seen basic run errors be a software thing, so if you want to post your code, I'd be happy to take a look.

Pushing the "robot reset" does the same thing that turning the robot off then back on again would do. It's just a quick, remotely-accessible way of doing it.

Ian W. 01-07-2002 12:26

scrawls is right about both, but a little more insight on the basic error.

if your program is flawed, but syntax is correct, you'll get a basic error.

if your program can become flawed if a certain condition is met (like an if statement not normal met becomes true, and leads to bad code).

i believe if the battery voltage drops to low, you will get a basic error which effectivly shuts the robot off so it doesn't go crazy and kill people (and yes, the uP will screw up if there's not enough power).

if there was any problem in downloading the code (from computer to RC), it may give you an error.

i'm sure there's plenty of other ways to get errors, but these are ones i know off the top of my head.

ChrisA 01-07-2002 12:53

Quote:

Originally posted by srawls
'robot reset' will reboot the robot controller, meaning the program will start over with all vars initialized again (but the default code does not start up unless that's what you're running anyway).
thought id just clarify this....
robot reset does not initialize the vars unless the vars are initialized in the code. all previous vars stored in ram are still there until the ram is cleared.

whatever program was downloaded to the robot is the code that it has stored in eeprom. the eeprom is not changed unless u either write something to eeprom in the code or you download new code to the robot controller.

also my team has found that you can get basic run errors from most anything. if you get a basic run error here are some steps to try to clear it:
1. regular old robot reset from the operator interface (usually works)
2. reset robot from the robot controller (basically same as controller but sometimes works when oi doesnt
3. turn off robot for about 15 seconds or so then turn back on (this will clear the ram in the robot controller)
4. check through your code to see if there is something wrong. if you cant find anything wrong try an older code and see if that works. if it works then there is definitely something wrong with ur new code.
5. redownload the code to the robot controller (if its fine then maybe there was an error with the download)

Matt Leese 01-07-2002 13:53

First of all, when the battery voltage drops too low (I want to say below 7 volts but don't quote me on it), the robot controller resets itself (it doesn't have enough voltage to maintain itself on, so it turns off, dropping the load on the battery, which means that there's enough voltage to power the robot controller so it restarts).

As far as the basic run errors, it's almost definately a code problem. It can be caused by an infinite loop. It can also be caused by doing something illegal in the code. I also believe if you SerIn more or less data than you should or Serout the wrong amount, you'll get a Basic Run Error.

Matt

Ian W. 01-07-2002 14:11

Matt, doesn't the uP take an almost insignificant amount of power? When compared to a motor, a bunch of transistors can't take more power. And i think once the voltage drops below 9 volts, you get the low battery warning, and you start having some unexplained errors (the uP is slowly dieing). once it drops below 8 volts, i think it gives a basic error, which has the effect of shutting down the robot, cause once a basic error occurs, you must reset or power cycle.

srawls 01-07-2002 14:17

Just to clear things up, if you drop below 9 volts in the default program then the low battery light will blink. You can always change the constant dataInitVolt to set the voltage you want the light to start blinking on. From the default code, here's the equation:
Code:

VOLTAGE = INT ((DESIRED FLASH VOLTAGE + 0.4) * 16.3)
Stephen

[edit]
PS. this is also from the default code:

If you see a BASIC INIT ERR on the Robot Controller after programming and pressing RESET, then there is a problem with the Serin command

[/edit]

rbayer 01-07-2002 15:16

Direct from innovationFIRST's documentation:

"If after programming and reseting the Robot Controller, the BASIC RUN ERR light is ON, then the basic code has no output. This means that the code is not running properly. Check for errors in the code. The BASIC RUN ERR light is controlled by the Output microprocessor."

Matt Leese 01-07-2002 15:38

Quote:

Originally posted by Ian W.
Matt, doesn't the uP take an almost insignificant amount of power? When compared to a motor, a bunch of transistors can't take more power. And i think once the voltage drops below 9 volts, you get the low battery warning, and you start having some unexplained errors (the uP is slowly dieing). once it drops below 8 volts, i think it gives a basic error, which has the effect of shutting down the robot, cause once a basic error occurs, you must reset or power cycle.
The RC most definately does not shut itself down when voltage drops below 8 volts (I suppose my 7 was wrong; I was giving that number off the top of my head). While the RC doesn't use very much power directly, it does however control the power used by the motors. These motors in turn put a large load on the battery. When the RC cuts out because of lack of voltage (and it needs a certain voltage to continue functioning), the control signals to the speed controllers and spikes stop, thereby causing the motors to stop. There then is a significant decrease in load on the battery allowing the RC to start because the voltage has come back up. You'll sometimes see teams with their lights going on and off (it frequently will die any time they try and move because the battery can't support the load of the motors); this is generally caused by a too low battery.

Matt

Ian W. 01-07-2002 15:53

oh, i thought you were talking soely about the RC, not an entire robot. but, once the voltage drops too low (like 8 volts), i think that the RC will shut itself off, or a basic run error will occur, and the robot will die. this is to protect it from going crazy, because if there isn't enough voltage, the RC cannont function, and it's designed to stop functioning completely when it reaches that threshold.

Matt Leese 01-07-2002 16:04

It's not so much designed to as has to. It's inherent in a digital electronics circuit. You don't have enough voltage to power it and nothing works. It most definately does shut off because of the lack of power as I've seen it happen numerous times.

Matt

Nate Smith 01-07-2002 16:08

Quote:

Originally posted by Matt Leese
It's not so much designed to as has to. It's inherent in a digital electronics circuit. You don't have enough voltage to power it and nothing works. It most definately does shut off because of the lack of power as I've seen it happen numerous times.

Matt

Exactly...the minimum voltage that the RC can run at is 8.0...as soon as your voltage drops below that, it's going to shut down until the voltage comes back up...

ChrisA 02-07-2002 00:54

ok let me clearify something for you all...
this is about the only thing i learned about the robots electronics while programming :)
8 is correct number for the voltage that the robot controller will stop 'working'
the problem with this statement though is that its not the robot controller that stops working... its the radio controller (ur saying rc but that can stand for robot controller or radio controller so i dont know which ur talking bout) that stops working... when voltage drops below 8 volts the radio controller will lose signal... when the robot controller sees this it will tell you that there is no signal. not sure exactly why you guys bring this up... from what i remember the basic run error will not come on at this point (most likely anyways) you should instead see the no data/radio signal light on. if you do have a problem with power just let me know if i can help... my team has 6 electrical guys which can answer any questions you might have on the electrical workings of the robot controller.

Ian W. 02-07-2002 12:06

hmm, i thought when the voltage dropped too low, the robot controller (that's what i meant by RC) recognizes that the battery is dead for the purposes that we use them for. sure, the voltage will pop back up, but any drain on the battery will bring it down again. so, i thought that it was programmed to turn off after the voltage drops too low. i know i saw a red light, so it may have been the data signal, but i can't remember now.

also, i'm pretty sure i've seen the low battery light stay solid, even when the voltage is in 10, because it drop down to like 9.1 then went back up. so at least the RC knows when the battery is dieing. and i didn't change that section of the code at all, so that's not it.

Nate Smith 02-07-2002 12:22

The blinking value is set in the code, the solid value is fixed...I don't remember exactly what it's set at, but you are correct in saying that once it drops below the "keep LED on" point, it will not turn the LED back off without resetting the Robot Controller(on the robot, not from the OI)

ChrisA 02-07-2002 12:32

as i remember from my teams tests, we had found that when the voltage drops below 9 volts the low battery light comes on (this is default for it) and stays on (as soon as it drops below 9 it will turn on and it will stay on until you robot reset)... when it gets below 8 as told to me by one of our electrical engineers the radio controller doesnt have enough power to function so the no data/radio signal led comes on (this one is an orange light). on our prototype this last year, which we used for driver practice, we would run our batteries down as far as they would go before the robot started to 'spaz' (not function properly or at all). we would find that the no data/radio signal light was on most every time and the battery voltage was usually around 8 or 9 (sometimes even 10). we would then give the robot a full reset and see how much longer we could run the battery because we often only had a couple batteries to work with for our few hour driving practice so we had to make them last. now as i remember right, sometimes the basic run error light was on at this point. come to think of it im not sure if it was the basic run error but it was a red led. but anyways no matter what you do when the battery voltage drops down to like 8 or 9 volts its best to change it... depending on the robot and how much other stuff ur running on it you may want to change it at like 10. and just to support what i just said... in our practices we have had voltage drops down to like 6. i know we have had it reset but i think it was programmed to reset at some point. not sure on this but as far as i remember the controller itself isnt the power hog here.

Ian W. 02-07-2002 13:04

no, the controller itself takes almost no power to run. what it controls is what consumes the power. and i'm pretty sure once the voltage drops too low, the controller is designed to shut it self off, so the robot doesn't 'spaz out' and kill someone. the controller cannot function with less than 8 volts, for reasons i can't explain. but, i know that below 8 volts, and it can start flipping out, so i'm almost certain it's designed to automatically shut down so it can't destroy anything. the fact that the solid low battery light is coded in and unchangeable supports my theory, i think.

Jnadke 02-07-2002 13:13

There should be an error in your code, maybe specialized inputs returning invalid numbers...

But also you said it worked fine. Hrrm...

Put it up here and I'll take a look at it... just be sure to briefly explain your bot so I can get a good idea of what it's supposed to do...

Remember to rename the file to .txt before uploading (server won't accept .bs2 extension).


These are the worst kind of errors because it's in some obscure part of the robot code. Something like a counter not being reset... or an infinite loop. Something that allows the robot code to work, but only becomes apparent after a few minutes of operation.

Matt Leese 02-07-2002 13:35

I'll say it one last time. The Robot Controller does NOT turn itself off. It just physically can't run w/ less than 8 volts input. The onboard microprocessors just can't function with that small amount of voltages (it's actually much smaller but there's some transforming going on inside the controller I believe). This has nothing to do with the robot "spazzing out." It has everything to do with the robot controller not having enough voltage. I'm also pretty sure it's the robot controller and not the radio modem that doesn't have enough power. Given that the radio modem draws power from the robot controller, this isn't too far fetched (and if the robot controller is off, there is no signal between the robot and OI).

Matt

srawls 02-07-2002 13:46

Matt's right. From the Innovation First documentation "The minimum required voltage is 8.0V." And yes, that's for the robot controller, not the radio modem. The original question also said something about pushing the robot reset from the oi. This is slightly off topic, but I must admit I didn't know about it before, so I thought I'd share it: pushing robot reset from the oi is NOT the same as pushing it on the rc. From the oi, reset only resets the BS2SX, not the entire rc.

Stephen

PS.
Also from the docs ... "When in doubt, pressing reset won't hurt."

punarhero 03-07-2002 10:47

BUT THAT'S NOT THE PROBLEM !!!
 
Thanks for all u guys input, but that's not the problem. I know about less than 8 V thing and other ways of getting and fixing an error, but what if the controller says BASIC error, you press Robot reset, and it says it again, and u do the same thing. I repeated this process while in a match for about 5-6 times, and then the robot was running fine. The error surely didn't just disappear, and I didn't change the code.
WHAT HAPPENED THEN?

pUNAR sIKKA
cLARK mAGNET rOBOTICS
696

ChrisA 03-07-2002 12:17

for the record....
read this about the radio controller and battery voltage (look under the robot controller section)
http://www.innovationfirst.com/FIRST...ntroller%20FAQ

back to the original question...
i dont think we really have a answer for you at this point punarhero....
have you checked your code over?
if you do a full power cycle on the robot (turn it completely off for about 15secs or so and then back on) does it go away?
its possible that when it gets to some point in the code it has a problem... some place in the code that it normally doesnt do unless told to...
have you found any coincidence in when it occurs or is it sparatic?

if what you say about reseting from the operator interface multiple times to get rid of it is true then there might be something wrong with the code. as stated earlier the basic stamp is essentially the only thing reset when u hit robot reset on the operator interface which would indicate that it most likely has to do with the processor or the code in it.

is there any other information that you might be able to put forth about this?
i think we are lacking information to figure out your problem... if you can tell us maybe what you did just before the light came on it might help

Greg Ross 03-07-2002 22:38

Re: BUT THAT'S NOT THE PROBLEM !!!
 
Quote:

Originally posted by punarhero
Thanks for all u guys input, but that's not the problem. I know about less than 8 V thing and other ways of getting and fixing an error, but what if the controller says BASIC error, you press Robot reset, and it says it again, and u do the same thing. I repeated this process while in a match for about 5-6 times, and then the robot was running fine. The error surely didn't just disappear, and I didn't change the code.
WHAT HAPPENED THEN?

pUNAR sIKKA
cLARK mAGNET rOBOTICS
696

Punar,

Sounds like it's probably an obscure software problem. If you'll post your code, we can check it over for you.

sanddrag 05-07-2002 16:15

Punar,
I'm not sure if you were aware of this but the problem occurred only when our revovling light button on one of the joysticks was pressed. To let everyone else know, our light button was set up to work only when you keep it pressed; not toggle. Hope this info helps others trying to help us.:)

rbayer 05-07-2002 16:54

Quote:

Originally posted by sanddrag
Punar,
I'm not sure if you were aware of this but the problem occurred only when our revovling light button on one of the joysticks was pressed. To let everyone else know, our light button was set up to work only when you keep it pressed; not toggle. Hope this info helps others trying to help us.:)

That definately sounds like a code problem. If you're willing to post it, several of us would be happy to take a look.

Ian W. 05-07-2002 16:57

um, weren't you supposed to have the light hardcoded in so it was always on as long as the uP was running (during the match, and not when the robot was disabled through the competition port). also, that means that when that part of the code executes, something is going wrong. check it out yourself, and if it still doesn't work, post it here so we can help. we can't do much else without seeing the code ourselves.

VanWEric 16-07-2002 23:43

I remember once I had my light rotate in the other direction apparently randomly. After a good deal of searching, we realized that our serout line didn't have enough 0s, so that relay 8 was being controlled by one of the variables for our tracks. We decided to leave it that way.

Ian W. 17-07-2002 08:04

i thought the light could only turn one way... :/

srawls 17-07-2002 08:56

Quote:

i thought the light could only turn one way... :/
Just apply reverse polarity and it'll turn the other way.

Our robot does that when pressing some buttons ... us programmers like to keep the operaters on their toes :D

Stephen

Ian W. 17-07-2002 14:23

wasn't there something bad that happened when the light went in reverse though? oh well, i must just be going crazy...


All times are GMT -5. The time now is 20:38.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi