Ping)))Dar - Radar Style Display
I'm somewhat new to PBASIC and the Ping system and need some help. I've set up a Boe-Bot with a Ping module and loaded the software (named above in the Title) from the Parallax "Mini Projects" book link. I'm using a BS2 Stamp and haven't messed with the original code I downloaded, so timing shouldn't be an issue. The problem is this: The sweep display (with nothing in the field of view) looks like the jpg above. Notice that the edge of the scan field markers stop short of completing the final portion of the 180 deg scan on the left side. The sweep servo is accuratey calibrated, and the proper limit values updated in the code. The Ping is physically sweeping the full 180 deg arc. Everything works well escept for the missing portion of the DEBUG screen display! Can someone suggest why my "clear field" sweep display is not indicating a full 180 deg sweep?
Comments
When using the Ping))) normally you care about objects closer than a threshold, so this isn't a problem.
Questions for snit3: are you sure the ping is sweeping a FULL 180? Is the missing segment from the beginning or the end of the servo rotation?
Of course, now that I look at it, another question comes to mind... have you examined the actual data points returned from your sweep? Maybe the left-hand portion just isn't being plotted? (i.e., maybe the plot X-axis needs to slide to the right).
Yes. The ping is "physically" sweeping the full 180 deg, but I just noticed something new. If I place an object at the extreme 180 deg position on the right side of the sweep it shows up perfectly positioned on the display. However, if I put the object on the extreme left side it doesn't show at all even though the ping is looking right at it. I have to move the object 15 or 20 deg away from left side of the arc before it's shown in the display. That's exactly where the arc in my jpg picks up.
Is it possible that the math is producing a non-linear representation of the actual, physical arc of the ping servo? In other words, the data points toward the left side of the field are compressed relative to those on the right, and that's why the displayed arc is truncated on the left? My head hurts...
Could you post either a link to the code you're using or the code itself?
It looks like this should be something relatively easy to fix.
Here's the link to the text. The project "Ping)))Dar is # 10 in the index. https://www.parallax.com/portals/0/Downloads/docs/prod/sic/Web-122-28100-SicMiniProjects-v1.0.pdf
*******CASE CLOSED - I figured it out and, of course, it was my error. The "PingDirToAngle CON" needed to recalculated to account for my servo calibration numbers. I changed the right and left limit CON's, but forgot to change the scaling! That's why the sweep was short. Whew!
Thanks for all your input on this. It's really a learning experience!
First try changing the line:
to:
If that does do the trick then use:
To see what the lowest value of x is being displayed.
If the first fix doesn't work, let us know if it looks different and let us know what the lowest value displayed for the variable "x" is (using the second change).
Edit: If the first suggestion works, you'll also need to change the "X" at the origin.