Showing posts with label Microcontrollers. Show all posts
Showing posts with label Microcontrollers. Show all posts

Thursday, May 30, 2013

29. Battery Monitoring Circuit for #UAV - #Software

Now we are working to create a program where we will guide our aircraft in case of insufficient battery. For this purpose we have added a voltage divider circuit, using 1k (R1) and .33k (R2) ohm resistances, to our existing UDB4 board and made the following changes in the telemetry.c file: 

#define batt_min_value 88

///////////////////////// battery health testing code
if(udb_analogInputs[0].value<batt_min_value)
{
init_flightplan( 1 );
}
//////////////////////////////////////////////////////

Here udb_analogInputs[0].value is real-time or current value that comes on one of our Analog pins of PIC controller (from AN15 to AN 18). If it goes below a certain value (for 3S LIPO battery - below 3.6 Volts each or net 10.8 Volts) then the program will switch to Return to Land (RTL) mode. 

In order to read what exact value that will come at full charge i.e. 12.48 Volts on the Analog Pins we replaced our diff in telemetry.c with udb_analogInputs[0].value so that we may set our batt_min_value:

// The Ardupilot GroundStation protocol is mostly documented here:
//    http://diydrones.com/profiles/blogs/ardupilot-telemetry-protocol
///////////////////////// battery health testing code
if(udb_analogInputs[0].value<batt_min_value)
{
init_flightplan( 1 );
}
//////////////////////////////////////////////////////


if (udb_heartbeat_counter % 40 == 0)  // Every 8 runs (5 heartbeat counts per 8Hz)
{
serial_output("!!!LAT:%li,LON:%li,SPD:%.2f,CRT:%.2f,ALT:%li,ALH:%i,CRS:%.2f,BER:%i,WPN:%i,DST:%i,BTV:%.2f***\r\n"
 "+++THH:%i,RLL:%li,PCH:%li,STT:%i,***\r\n",
lat_gps.WW / 10 , long_gps.WW / 10 , (float)(sog_gps.BB / 100.0), (float)(climb_gps.BB / 100.0),
(alt_sl_gps.WW - alt_origin.WW) / 100, desiredHeight, (float)(cog_gps.BB / 100.0), desired_dir_deg,
waypointIndex, udb_analogInputs[0].value, (float)(voltage_milis.BB / 100.0), 
(int16_t)((udb_pwOut[THROTTLE_OUTPUT_CHANNEL] - udb_pwTrim[THROTTLE_OUTPUT_CHANNEL])/20),
earth_roll, earth_pitch,
mode
) ;
}

We will be able to monitor it on Happy Killmore GCS software as we did our diff variable earlier (Switch-out from Auto-Pilot Mode : Another function for #UAV)

Also, if init_flightplan( 1 ); is set to one as here, then we will be able to switch to RTL mode or else not as we can see in the flightplan-waypoints.c file:

// In the future, we could include more than 2 waypoint sets...
// flightplanNum is 0 for main waypoints, and 1 for RTL waypoints
void init_flightplan ( int16_t flightplanNum )
{
if ( flightplanNum == 1 ) // RTL waypoint set
{
currentWaypointSet = (struct waypointDef*)rtlWaypoints ;
numPointsInCurrentSet = NUMBER_RTL_POINTS ;
}
else if ( flightplanNum == 0 ) // Main waypoint set
{
currentWaypointSet = (struct waypointDef*)waypoints ;
    numPointsInCurrentSet = NUMBER_POINTS ;
    }

Wednesday, May 22, 2013

26. Pictures - #Funny - #Ailerons going out of function for a while

As I had posted previously, we had to remove one of the servos of the drone. Reason being that in Auto-Pilot mode it was skipping a step. This was as shown earlier it had a broken step or tooth. We tried to repair that servo motor (like by exchanging its gear set with another ones, that was a metal one) but it could not be possible. Therefore we have decided to order a new one. 

But then we thought that how are we going to test our program in real time environment? For this purpose we have removed the other aileron's motor too and fixed both of them for a while.

So now we had to extend the rudder so that it may take on the role of ailerons too. Well this is funny, but it will work n its innovation at its best. This is how we did it:




Saturday, April 27, 2013

1. My first serious project - Unmanned Aerial Vehicle

Hi! I am Manya Sharma from India.

First things first - What is an Unmanned Aerial Vehicle or an U.A.V?

An Unmanned Aerial Vehicle (U.A.V.) is an aircraft that has the capability of autonomous flight, without a pilot in control. Amateur U.A.V.s are non-military and non-commercial. They typically fly under “recreational” exceptions to F.A.A. regulations on U.A.V.s, so long as the pilots/programmers keep them within tight limits on altitude and distance. Usually the U.A.V. is controlled manually by Radio Control (RC) at take-off and landing, and switched into G.P.S.-guided autonomous mode only at a safe altitude.

It is also commonly known as a drone, is an aircraft without a human pilot on board.

There are a wide variety of drone shapes, sizes, configurations, and characteristics. Historically, U.A.V.s were simple remotely piloted aircraft, but autonomous control is increasingly being employed.

They are now deployed professionally for military applications and are also use in a small but growing number of civil applications, such as policing, firefighting, and nonmilitary security work, such as surveillance of pipelines. U.A.V.s are often preferred for missions that are too "dull, dirty, or dangerous" for manned aircraft.