LINK Bugs

3 replies [Last post]
amehta
Title: NooBot
Joined: 07/18/2011
Posts:
BotPoints: 136
User offline. Last seen 5 years 33 weeks ago.

So various functions [such as get_servo_position() and mav()] don't seem to work, or are very buggy. For example, I tried to write a simple program that would give me servo positions (I'm using them in a dual setup), but it gave me servo values such as 33608 or some large impossible number like that. Also, when I was at the workshop trying to use mav() there were problems. I asked the instructor about it, and he mentioned that there might be some non-working or unfinished things.

Here's the servo code I used:

  1. int main()
  2. {
  3. int x, y;
  4. while (1)
  5. {
  6. x = get_servo_position(1);
  7. y = get_servo_position(0);
  8. printf("Port 1 is at position %d and port 0 is at position %d.\n", x, y);
  9. sleep(.5);
  10. }
  11. }

I tried redownloading and restarting the LINK, but that only gave me different values. So something is wrong...

We installed the 1.9.5 firmware fresh at the workshop, should we try redoing that?

Thanks.

-amehta (Andrew Mehta)

Beta
Beta's picture
Title: The Magnificent
Joined: 02/24/2012
Posts:
BotPoints: 266
User offline. Last seen 8 years 34 weeks ago.

Try enabling the servos first. enable_servos();

Mav and PID control are indeed buggy. There might not be a way for us to fix this (hardware limitations).

Let me know if that works.

Braden McDorman

Developer of the KIPR Link, KISS IDE, KIPR's 2D Simulator, and CBCJVM.

Reach me at bmcdorman(cat)kipr(dog)org where (cat)=@ and (dog)=. if you need assistance of any kind.

amehta
Title: NooBot
Joined: 07/18/2011
Posts:
BotPoints: 136
User offline. Last seen 5 years 33 weeks ago.

Yeah, enabling the servos just locks them up, it still gives me those bad values-

-amehta (Andrew Mehta)

Beta
Beta's picture
Title: The Magnificent
Joined: 02/24/2012
Posts:
BotPoints: 266
User offline. Last seen 8 years 34 weeks ago.

Did you ever set the values to something? get_servo_position()'s return value is undefined if you haven't set it to begin with. This was also the behavior on the CBCv2 and XBC.

Braden McDorman

Developer of the KIPR Link, KISS IDE, KIPR's 2D Simulator, and CBCJVM.

Reach me at bmcdorman(cat)kipr(dog)org where (cat)=@ and (dog)=. if you need assistance of any kind.