Mixing channels to create 3-way switch ?

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

Moderator: lukasz

Re: Mixing channels to create 3-way switch ?

Postby Tom » Fri Mar 02, 2012 8:28 pm

Just download the latest source code from the SVN and it contains both MpLab and MpLab X project files?
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Mixing channels to create 3-way switch ?

Postby cassini » Mon Mar 05, 2012 11:15 am

Ok, thanks. Major problem now though-

I opened the project file (from 0.5.1 because i didn't know how to download from the source tab) in MPLAB and edited the bits I wanted (just the two lines as shown by DaveK) and exported a .hex

However, something must've been wrong with my settings. The firmware upgrade was successful, but now the log just looks like-

????????????????????????????????????J?????????HGJHGH etc. constantly updating
the sensors aren't responding

and I can't write any new firmware - the terminal repeats 'hardware detected framing errror' then closes. (tried with the new 0.8 hex too)

any ideas... ? :(

hope I haven't bricked the device... not sure where I went wrong though.

Thanks.
cassini
 
Posts: 49
Joined: Mon Oct 17, 2011 4:12 pm

Re: Mixing channels to create 3-way switch ?

Postby Tom » Mon Mar 05, 2012 11:26 am

You really should download the code from the SVN. It is not so hard. Download TortoiseSVN or something similar.

The version you have is old and still at 115200 baud...
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Mixing channels to create 3-way switch ?

Postby cassini » Mon Mar 05, 2012 11:47 am

It should still work though? I can't update the firmware at all at the moment, even the new 0.8.

when trying to update to 0.8, the dsLoader output -

Initiating write...
Searching for bl .
Found dsPIC33FJ128MC710A fw ver. 4.3.11
Wrong pic detected(84)/selected(199), aborting
Tx 19 byte / Rx 3 bytes / 1.5s
Write failed

Is there a 'hard reset' or something I can do?
cassini
 
Posts: 49
Joined: Mon Oct 17, 2011 4:12 pm

Re: Mixing channels to create 3-way switch ?

Postby Tom » Mon Mar 05, 2012 12:21 pm

Hmm... You could try to connect the FTDI cable to the module when the console screen says "looking for bootloader...". The bootloader is only active during the first few milliseconds of power-up.

The problem is that the module is now working at 115200 baud, and the reset command gluonconfig sends doesn't work because it is being sent at 57600 baud...

Here you can download a separate GUI for the programmer.
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Mixing channels to create 3-way switch ?

Postby cassini » Mon Mar 05, 2012 12:33 pm

Hmm, not sure what I did but seems to be working with 0.8 now.

Got the SVN now, so I'm going to attempt uploading the custom code again. Just checking, in MPLAB-

the compiler 'C30' s ok?
cassini
 
Posts: 49
Joined: Mon Oct 17, 2011 4:12 pm

Re: Mixing channels to create 3-way switch ?

Postby cassini » Mon Mar 05, 2012 12:34 pm

under 'select compiler' it says 'dsPIC(none found)'
cassini
 
Posts: 49
Joined: Mon Oct 17, 2011 4:12 pm

Re: Mixing channels to create 3-way switch ?

Postby Tom » Mon Mar 05, 2012 12:37 pm

You'll need to download the dspic c30 compiler from the microchip website.
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Mixing channels to create 3-way switch ?

Postby cassini » Mon Mar 05, 2012 2:34 pm

Thanks! Firmware uploading seems to be working just fine!

Hmm, adding the following code -

-----------------------------------
if (!ppm.connection_alive || ( ppm.channel[4] > 1700 && ppm.channel[5] > 1700 ))

{
control_state.flight_mode = AUTOPILOT;
-----------------------------------

and

------------------------------------
else if (ppm.channel[4] > 1700 && ppm.channel[5] < 1300)

{
control_state.flight_mode = STABILIZED;
-----------------------------------


as DaveK suggested, doesn't seem to work quite right. As viewed in GCS, the flight mode seems to cycle randomly regardless of channels 4 and 5. It seems as though there is another setting somewhere.

EDIT - actually the mode now seems to controlled solely by channel 5.. how strange!

Couple of thoughts -

1. Where can 'channel.ap' be accessed? I can't find the part where ppm.channel[1],[2] etc are assigned to pitch, roll etc. Maybe I should alter that too?

2. In Gluon config, what should I do about the dot matrix where channels are assigned? Maybe that setting is overriding the code in control.c?

Many thanks.
Last edited by cassini on Mon Mar 05, 2012 3:52 pm, edited 1 time in total.
cassini
 
Posts: 49
Joined: Mon Oct 17, 2011 4:12 pm

Re: Mixing channels to create 3-way switch ?

Postby cassini » Mon Mar 05, 2012 4:58 pm

SORTED!

Woooohooo. That shouldn't have taken so long.... :D

My mistake - using ppm.channel[4] instead of [3] ... :oops: total noob error ahah.

Thanks Tom!
cassini
 
Posts: 49
Joined: Mon Oct 17, 2011 4:12 pm

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 10 guests

cron