Shop OBEX P1 Docs P2 Docs Learn Events
Reading additional PING sensors from Eddie firmware — Parallax Forums

Reading additional PING sensors from Eddie firmware

u.asifu.asif Posts: 21
edited 2012-10-01 08:11 in Robotics
Hi all,

I intend to install two additional PING sensors at the back of the eddie robot. I have tried to understand the eddie firmware and I suppose that it is hard-coded for two PING sensors only. Are my inferences correct?

So, let's say I plug-in the additional PINGs to GPIO pins 3 & 4 (as they are numbered on the eddie control board), what changes/additions do I need to make in the eddie firmware to get the additional PINGs working?

Any suggestions?

Thanks

Edit: Can anyone direct me to the part of the code in eddie formware which is used to communicate with IR sensors. I do not find any such description in the comments.

Comments

  • TLCTLC Posts: 74
    edited 2012-09-18 09:07
    I added an additional PING sensor to pin 3. I then modified the Eddie control board firmware to reflect the additional PIN assignment as well as adding it to the PING mask. After compiling and loading this to the Eddie control board I saw polling on the new sensor. When I go the the Parallax2011ReferencePlatformIoController service I get values for pins 8, 9 and (the new PING sensor) 10. Assigning a manifest to the service adds a MARK manifest xml file to the subdirectory that my VPL project is in. When I open the manifest I see the IR and Sonar sensors enumerated. The Sonic sensor list only shows two sensors, so I tried to add a third. After that I was able to access all three sensors from the MARK service (which returns the distance value in meters), but my newly added sensor gave a bogus value. Looking at the other parameters in the sonar sensors there is one marked "Pose" and it is different for PING sensors 0 and 1. So far I can't find documentation on this parameter so not sure if my copy paste from the other sensor without properly configuring this is the problem.

    Anyway, that's what I figured out to this point.

    Todd
  • u.asifu.asif Posts: 21
    edited 2012-09-18 19:20
    TLC wrote: »
    I added an additional PING sensor to pin 3. I then modified the Eddie control board firmware to reflect the additional PIN assignment as well as adding it to the PING mask. After compiling and loading this to the Eddie control board I saw polling on the new sensor. When I go the the Parallax2011ReferencePlatformIoController service I get values for pins 8, 9 and (the new PING sensor) 10. Assigning a manifest to the service adds a MARK manifest xml file to the subdirectory that my VPL project is in. When I open the manifest I see the IR and Sonar sensors enumerated. The Sonic sensor list only shows two sensors, so I tried to add a third. After that I was able to access all three sensors from the MARK service (which returns the distance value in meters), but my newly added sensor gave a bogus value. Looking at the other parameters in the sonar sensors there is one marked "Pose" and it is different for PING sensors 0 and 1. So far I can't find documentation on this parameter so not sure if my copy paste from the other sensor without properly configuring this is the problem.

    Anyway, that's what I figured out to this point.

    Todd

    That's great. I am using C# to send commands to eddie control board rather than using vpl. It's a little complicated for me I guess. The "PING" command polls all the sonars connected to the configured ports (as mentioned in the Parallax command Set). I am waiting for the additional sensor to arrive so I would update my findings.

    I can see how to include an additional PIN assignment in the eddie firmware. Regarding the addition to PING mask, are you referring to this command " INITIAL_PING = |< PING_0 | |< PING_1 "?

    Furthermore, I wanted to ask as how to send both "ADC" & "PING" commands concurrently through the serial interface so that I could read all the 10 channels (first 8 for ADC and the next 2 for PING) simultaneously. Any idea how to poll both the ADC and PING simultaneously rather than one by one?

    Thanks.
  • TLCTLC Posts: 74
    edited 2012-09-20 06:45
    That's right. You need to add the PIN definition, then modify the INITIAL_PING mask with your additional sensors.

    I don't think you can stack commands.

    tlc
  • u.asifu.asif Posts: 21
    edited 2012-09-20 08:04
    TLC wrote: »
    That's right. You need to add the PIN definition, then modify the INITIAL_PING mask with your additional sensors.

    I don't think you can stack commands.

    tlc

    If serial commands cannot be stacked in a single serial write statement then how to poll both the ADC and PING sensors simultaneously. Since both commands return a response so it could be more convenient to read all the data in a single instance rather than one after the other.
    Any suggestions?
  • TLCTLC Posts: 74
    edited 2012-10-01 08:11
    If two requests is a problem for you, simply add a command to the Eddie Firmware that reads the values that you need and returns them in the format that you require.
Sign In or Register to comment.