To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1248
  Re: light sensor problem?
 
(...) Having fixed the other screwup, I can report that snipping the code I discussed earlier allows everything to build just fine. It doesn't, however, solve the issue with the light sensors. I also tried swapping the two lines I mentioned earlier: (...) (24 years ago, 23-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) I'm the one that fixed active sensor reading... :-) Settle time is one of mine... Kekoa msg about this problem (a very old one in this ng if I remember) helped me to solve things. (...) I patched the reading routine in ds_handler to fix a vary (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) I looked through the dsensor stuff, and it looks quite bad to me... We execute a delay loop inside an interrupt handler. We issue the command to start the next read from that same handler. This will read the sensors very quickly, for the cost (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) To achive scaling of light sensor reading from 0..100 the following theoretical formula should be used: light = 146 - scaled / 7, where scaled is the reading of AD_X >> 6. I found this at (URL) this page contains a lot of electrical (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) Oh! So readings are more stable, and it isn't just my imagination. That's good to know :) (...) Those values used to pretty cleanly define max and min- or at least, they must have, since I consistently got 15-105 values (or roughly what he (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) It doesn't surprise me that someone has already worked this out. (...) It really, really doesn't surprise me that Michael was the one who worked it out. If no one thinks it is too big an overhead, I can put it in in an hour or so when I do a (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) :) Bad is, of course, all relative... (...) Yes, though IMHO fast = good. It allows us to do things with legOS that might not be doable with other firmwares. (...) I'm not sure which comments you are referring to- do you have a URL for the (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) (URL) > I doubt we need this very fast reading of sensors. This makes implementing (...) Yes, when we have user space timers... (...) This is correct, but there are many good reasons for keeping assembly low bandwidth, like pitfalls in (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) proof that this occurs (even though his logic does seem pretty dead on.) (...) Well, we do... time_t current_time = sys_time; while (sys_time < current_time + the amount of time I want to wait) { do nothing; } It's not pretty, but it is (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) This is why I want to measure things in our lab at work ;) (...) And keeps lower prio tasks from running, which they could do if we slept... (...) Oh well, there are some optimizations missing. I just looked at the code generated by (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) Right. I made the connection between Kekoa saying "I need to test" and you saying "I will test" right /after/ sending the message, of course :) (...) True. (...) I figured this would be the case. gcc is a wonderful tool, but it does tend to (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  dsound
 
Hi Luis, (...) I wonder if it would be interesting to include a small utility I wrote assisted by a friend of mine (Paolo Masetti) to convert MIDI files into LegOs C code: since then all of our robots are equipped with a subroutine generated by this (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) That's good. Now I wonder about some other questions: - Will it get the same value as the original firmware? - Will be influenced by offset (eg. from battery voltage)? In other words, do you think that the settle time is enough? I've tested (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) :-) It is not the best implementation I've seen... :-) (...) Yes. I hate the delay loop but we I can't imagine how to do it better if we still need maximum speed in reading values from sensors. The routine also change his sampling speed if we (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  RE: light sensor problem?
 
(...) I've used the OC1B interrupt for my servo driver code in pbForth. You could use the OC1B to set the settle time for each reading, and then actually read the results when the interrupt expires. Having a structure to tell you which A/D to read (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) Let me think about how to uncouple this from sys_time, so the code can get higher resolutions. (...) Yes, but even if all active sensors are turned of we are running with a lot of CPU power due to the high sampling speed. If you lower the (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) That should be great! :-) (...) use (...) Absolutely True!!!! :-) (...) I'm quite sure that you can do it!!!! :-) And this should be a real step forward!!!! What a beautiful thing to have some time to spend in this section of code... :-) I'm (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) I personally forget the numbers of the lugnet posts. The gist is that the firmware and LegOS were, at the time, different in a critical way. I don't know the current status of LegOS. At the time, LegOS cycled through the 4 A/D sensors, reading (...) (24 years ago, 25-Jul-00, to lugnet.robotics.rcx.legos)
 
  RE: light sensor problem?
 
(...) And I'll add the reminder (for all the newbies) that without Kekoa's efforts in doing the low-level documentation, we would not be where we are today.... Thanks again, Kekoa....... As a side note, I wonder how the power to the LCD controller (...) (24 years ago, 25-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) I supposed so, but only to get a "fast scaling"? (...) I can "rescale" those values by theoretical calculation and maintain >>7 or make the right conversion (0-100). Now I've done the right scaling (ready to commit), but I sincerely think that (...) (24 years ago, 25-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) I remember wondering what port 6 bit 3 did and so I think I tried setting it on and off and not noticing anything broken either way. Maybe I didn't test enough though. Somebody might want to try repeating the experiment. Some extra evidence is (...) (24 years ago, 26-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) Can you please tell me where to find this documentation? Mike (24 years ago, 27-Jul-00, to lugnet.robotics.rcx.legos)
 
  Re: light sensor problem?
 
(...) (URL) particular, scroll down to "notes on addresses" and "notes on routines". The routines for the firmware start at 0x8000. The routines for the ROM start at 0x3ae. Ultimately, both kinds of routines are important to figuring out how the (...) (24 years ago, 28-Jul-00, to lugnet.robotics.rcx.legos)

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR