SERVO_TRIGGER and SERVO_SET

General discussions on the Gluon-project that don't fit elsewhere. If required, I will create more subforums.

Moderator: lukasz

SERVO_TRIGGER and SERVO_SET

Postby daedalus » Tue Apr 19, 2011 2:14 pm

I want some pictures so I moved to r87 and began to test the servo_set and servo_trigger navigation commands.
The example you suggested in this post viewtopic.php?f=4&t=275#p1245 did not work out of the box (the servo moved very briefly) and I've thought that maybe the channel 5 is in control loop and tried with channel 6. It worked :D .

Now my question is if it is possible with the navigation scripting language to trigger the servo every x seconds, while flying between two waypoints.
daedalus
 
Posts: 38
Joined: Tue Apr 05, 2011 4:50 pm
Location: Romania

Re: SERVO_TRIGGER and SERVO_SET

Postby Tom » Wed Apr 20, 2011 8:57 pm

Hmmm no I didn't think of that...

So basically you would need a START_SERVO_TRIGGERING and a STOP_SERVO_TRIGGERING function?
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: SERVO_TRIGGER and SERVO_SET

Postby daedalus » Thu Apr 21, 2011 7:09 am

Yes, I think so.
Do you think to incorporate two SERVO_TRIGGER (pulse width and position hold for both positions) commands in the START_SERVO_TRIGGERING?
daedalus
 
Posts: 38
Joined: Tue Apr 05, 2011 4:50 pm
Location: Romania

Re: SERVO_TRIGGER and SERVO_SET

Postby Tom » Fri Apr 22, 2011 11:05 am

I was not thinking about that :-)
Do you want to trigger 2 cameras?
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: SERVO_TRIGGER and SERVO_SET

Postby daedalus » Fri Apr 22, 2011 3:21 pm

No, I don't think I need 2 cameras...

I've experimented with the following:

1. servo_set(6, 1200)
2. servo_trigger(6, 1800, .5)
3. servo_trigger(6, 1200, 2.5)
3. goto 2

which moved the servo , hold it .5 seconds, moved it back and hold it 2.5 seconds and then repeat the sequence - this was for a 3 seconds total interval between shots.

What I was having in mind was a pair of functions like this:
START_SERVO_TRIGGERING(channel, position1_us, hold1_sec, position2_us, hold2_sec)
#other navigation commands to fly while taking pictures
STOP_SERVO_TRIGGERING(channel)

Unfortunately I'm not a developer and my ideas here might be dumb...
daedalus
 
Posts: 38
Joined: Tue Apr 05, 2011 4:50 pm
Location: Romania

Re: SERVO_TRIGGER and SERVO_SET

Postby daedalus » Tue May 17, 2011 12:16 pm

I am trying to build the gluonpilot v0.52 using MPLAB Tools v8.66 and MPLAB C30 v3.25. I get some warnings but it finally worked - just the resultant rtos_pilot.hex is smaller and not quite working.

In attachment is the build log.
Attachments
build log.zip
(3.09 KiB) Downloaded 533 times
daedalus
 
Posts: 38
Joined: Tue Apr 05, 2011 4:50 pm
Location: Romania

Re: SERVO_TRIGGER and SERVO_SET

Postby Tom » Tue May 17, 2011 5:42 pm

There is a bug in version 3.25 of the C30 compiler (uses twice as much RAM).
Please use version 3.11, which should work better (or use legacy-libs from the compiler option).
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: SERVO_TRIGGER and SERVO_SET

Postby daedalus » Wed May 18, 2011 1:14 pm

Could not find the 3.11 academic version of the compiler but the "-legacy-libc" option did the trick.

I've put (a bit modified from the servo_trigger) the following piece of code in the navigation.c file in the "case FROM_TO_ABS:" area, just below nav_leg_progres line:

{
servo_set_us(5, 2000); // channel 5, microseconds 2000
unsigned int ms_delay = (unsigned int)(2 * 1000.0);
vTaskDelay(( ( portTickType ) ms_delay / portTICK_RATE_MS ) );
servo_set_us(5, 1500); // set back to middle position
}

It triggers the servo OK but the delay is mostly 4 seconds and sometimes 6 seconds (while I intended to be 2 seconds).
What I am doing wrong?
daedalus
 
Posts: 38
Joined: Tue Apr 05, 2011 4:50 pm
Location: Romania

Re: SERVO_TRIGGER and SERVO_SET

Postby Tom » Thu May 19, 2011 8:29 pm

Everything looks fine... I'll need to investigate it a bit deeper. Is the delay OK when you use servo_trigger?
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: SERVO_TRIGGER and SERVO_SET

Postby daedalus » Wed Jun 01, 2011 11:44 am

When using servo_trigger the delay is OK.
Also with my modified code the navigation is affected, so maybe some programmer skills are needed.
daedalus
 
Posts: 38
Joined: Tue Apr 05, 2011 4:50 pm
Location: Romania


Return to General

Who is online

Users browsing this forum: No registered users and 25 guests

cron