i've messed around a little with the bs2 code for the geocrawler 4 project and would like to point out one flaw:

Get_Angle:
DeltaLong = -1 * DeltaLong 'reverse to conform with ArcTangent coordinate standards
DeltaLat = DeltaLat * (128 / 9999) 'adjust them so the max values are +- 128, to conform with ArcTangent standards.
DeltaLong = DeltaLong * (128 / 9999)
workVal = DeltaLong ATN DeltaLat ' reuse workVal (to save variable memory) to hold binary radian result of ArcTangent

RETURN

" (128 / 9999)" will return a decimal which of course the stamp cant handle so i replaced it with "DeltaLat = DeltaLat ** 839"
and it debugs a good number .before it would only debug "0". i have further modified the code to use the parallax servo controller and hope to do some test flghts in the next month or two when time/wheather allow

Views: 160

Reply to This

Replies to This Discussion

Excellent! That's just why I shared the code--"with enough eyes, all bugs are shallow".

If you send me the improved code, I'll post it here as a replacement, and add you to the credits.

-c
sorry its a bit messy, and i have not included altidude to reduce complication. the waypoints i used were for a "driving " test i did around my 'hood . it seems to work but you never know till you fly
Attachments:
Replaced. You're credted in the navigation file, where that bug is fixed. Thanks again!
just to clarify , the code i sent you uses the "Parallax Servo Controller (Serial) " not the FT639
Ah. That's good to know. I'll clarify that in the comments on the code.
Correction: Rather than make people figure out what to comment or uncomment depending on their servo driver, I've actually posted two different sets of code in that overview post.
Question. I am working on some BS2 code to pass my futaba receiver signals through the BS2 onto the Servo controller. However, even though I got some results, my servos tend to chatter back and forth quite a bit, although the pulse width values are holding constant. Is this due to the nature of the BS2 as I have ordered a BS2p to replace this one.

Jim
Do you have a snapshot of your hardware your are using for these attachments?

Jim
James,

I'm not at home right now, but will get you a shot when I'm back, tonight or tomorrow. Which servo interface are you using: the FT639 or the Parallax servo controller?
Chris,

I am using the Parallax servo controller. I think I eliminate the servo chatter for now, but when I move the transmitter sticks the serout pulse to the servo's operates them in jerky motion, not smooth a when seen with a servo directly connected to the receiver. Could it be something to do with the processing speed of the bs2 as opposed to the bs2p?

Jim
the best way to smooth it out is to use a higher baud rate . the parallax servo driver can be commanded to a baud of 38k4 . dont forget to throw the servo controller a new baud rate command once every program cycle or you it could reset to default baud mode and communications will fail. this will considerably smooth things out but you have to realize that the serial communication is the slowest thing happening .ie... 2400 baud or 2.4 KHz in much much slower then the 20 MHz of you procceser. also realize that the ratchety feel of the servo wont effect flight enough to worry about . i have flown the same setup as you have with no problems
Here is a picture the project I am working on. The IC chip on the BOE is for temperature measurement.
Attachments:

RSS

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service