Setup of RC receiver and another question

Here is the place for all your dsPic or autopilot questions.

Moderator: lukasz

Re: Setup of RC receiver and another question

Postby Tom » Thu Nov 11, 2010 10:09 am

Did you do a "Read"? If the servos are moving correctly, than the neutral value must be correct as well.
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Setup of RC receiver and another question

Postby TheBoD » Mon Nov 15, 2010 5:48 am

Tom, thanks. I did the read but still no sign of servo readings on the servo tab.

Do you plan to post the changes in the source code that you made to allow the PWM inputs to work ?

I installed the hex output OK but I will try and trace the problem when I get some time next week. I did order a new GPS module from Sparkfun as per your recommendation.

I also notice that you have released a new version of the config tool (V0.5.1) - do you suggest that I download this and try it ?

Thanks for your help.
TheBoD
 
Posts: 37
Joined: Mon Dec 07, 2009 8:45 pm

Re: Setup of RC receiver and another question

Postby Tom » Wed Nov 17, 2010 7:01 pm

Yes you can download the latest gluonconfig, but the old version should work fine too.

If you can move the servos normally in manual mode, than the neutral values in Servos should be around 1500. I don't know how it otherwise could work :-)

Let us know when you had some time to figure things out!
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Setup of RC receiver and another question

Postby Jippieee » Thu Nov 18, 2010 8:51 pm

Thanks for the update! I also had some strange problems with my pcm inputs (sometimes working, sometimes not) until I put in a delay on gluon strartup. I have an old "non micro controller" receiver so it surprised me a bit that a delay was necessary in this case.
Jippieee
 
Posts: 24
Joined: Mon Jul 19, 2010 1:50 pm

Re: Setup of RC receiver and another question

Postby Tom » Thu Nov 18, 2010 10:11 pm

Thanks for the update!
How long was the update you needed? Should I increase it in the current code?
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Setup of RC receiver and another question

Postby Jippieee » Mon Nov 22, 2010 3:31 pm

I used a "vTaskDelay( 500 );" in control_init().

I guess your solution 0.5.1 by checking the input signals is better and does not cause startup delay.

Code: Select all
void control_init()
{
   int i;
   
   //ppm_in_open(); MOVED TO MAIN
   
   // Manual trim mode: the servo's neutral settings are defined by the RC-transmitters trim settings. See wiki.
   if (1/*config.control.manual_trim*/)
   {   
      
        for (i = 0; i < 6; i++)
         config.control.servo_neutral[i] = 1500;
         
      // The current position of the sticks on the RC-transmitter are
      // saved as the neutral values
      
        vTaskDelay( 500 );

        for (i = 0; i < 8; i++)
         config.control.channel_neutral[i] = ppm.channel[i];


Jippieee
 
Posts: 24
Joined: Mon Jul 19, 2010 1:50 pm

Re: Setup of RC receiver and another question

Postby TheBoD » Fri Nov 26, 2010 3:07 am

Tom, I have now installed the LS GPS unit and it works fine. I have also bought a new 2.4Ghz radio control system as my original one was very old. This works fine and I can read the receiver values and run the servos OK via the Gluon module - however I still get no max/min/neutral values on the Servo tab page of the Config tool.

When I look at the C# source code for the Servo tab page I notice that you have the following code installed in the file ConfigurationModel.cs

// Due to an annoying bug
_model.ServoMin = new int[6];
_model.ServoMax = new int[6];
_model.ServoNeutral = new int[6];

for (int i = 0; i < 6; i++)
{
_model.ServoMin[i] = ac.servo_min[i];
_model.ServoMax[i] = ac.servo_max[i];
_model.ServoNeutral[i] = ac.servo_neutral[i];

}

You also have the following comment in the configuration tab page

if (_model.ServoMin != null) // EXTREMELY ANNOYING BUG
{
_tb_servo1_min.Text = _model.ServoMin[0].ToString();
_tb_servo2_min.Text = _model.ServoMin[1].ToString();

Why are these comments there ?

Thanks
TheBoD
 
Posts: 37
Joined: Mon Dec 07, 2009 8:45 pm

Re: Setup of RC receiver and another question

Postby Tom » Fri Nov 26, 2010 9:50 am

The "annoying bug" I refer to has to do with the Model I use. The Model is needed by the GUI to show data on the screen. For some reason Visual Studio saves a serialized model in the resources file of this GUI. So instead of just creating a new one on creation on the GUI, it loads the model from the resource file.

What I understand is that the gluonconfig works OK, but the Servo's tab doesn't show any values?
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Setup of RC receiver and another question

Postby TheBoD » Sat Nov 27, 2010 12:29 am

Tom, just to let you know I have solved why I cannot see the servo max/min/neutral values in the config tool. The reason is that I am using XBee modules(running at 115200) for the communication but when I switch to the FTDI cable connection the serno max/min/neutral readings are there after I run the READ command.

I think the reason is that the configuration upload string beginning "CA" is more than 256 characters long so it overruns the input buffer on the XBee module so the entire string is deleted. I noticed this because when I ran the read command the input string in the bottom box of the Gluonconfig page was blank.

I will see if I can get the Xbee module to handle more than 256 characters in one block but I suspect this is a built in limit. The alternative is for me to fix the C code on the Gluonpilot and the C# code on the Gluonconfig tool to transmit the config data in two packets with a short delay in between to allow the Xbee to get the data across the link.

By the way the C# code in the Gluonconfig tool is well written and easy to follow .
TheBoD
 
Posts: 37
Joined: Mon Dec 07, 2009 8:45 pm

Re: Setup of RC receiver and another question

Postby Mitch » Sat Nov 27, 2010 11:58 am

That's a good find. I expect the xbee buffer is 256 characters.
User avatar
Mitch
 
Posts: 118
Joined: Sat Dec 05, 2009 1:59 pm
Location: Florida, USA

PreviousNext

Return to Firmware

Who is online

Users browsing this forum: No registered users and 13 guests

cron