Re: [drones-discuss] AC Sprayer Function on Copter

237 views
Skip to first unread message
Message has been deleted

Randy Mackay

unread,
Aug 5, 2013, 9:52:28 AM8/5/13
to drones-...@googlegroups.com
Daniel,

     The crop sprayer is implemented as a library so if the plane based crop sprayer works like the one I have it should be reasonably straight forward to make it work as long as the mechanics of the sprayer itself are similar.

     I'm planning to make a video of the crop sprayer in action over the next week or two and do a blog post (assuming it works) but until then I've attached a picture of the hexacopter along side a standard 3dr copter for reference.  You can see there's a big white jug hanging down from the body of the copter that holds 2 or 3 liters of the crop spraying chemicals (whatever they are).  There's a brushed ESC that drives the pump that pulls the liquid from the tank and pushes it out to the red nozzles hanging below two of the arms.  There are actually little motors in those red nozzles that cause the liquid to be spun out like a sprinkler I guess.

     The pump and the spinner only activate when the cotper is travelling over 1m/s (the speed is configurable).  There's also a stop and start timer (defaults to 1second) so the pump doesn't turn on/off too much if you're flying around that speed.

-Randy



From: DanielB <dber...@gmail.com>
To: drones-...@googlegroups.com
Sent: Monday, August 5, 2013 10:30 PM
Subject: [drones-discuss] AC Sprayer Function on Copter

Hi Randy, guys.

Thanks for the fantastic work!  Looks very promising.

Just a thought, the new Sprayer function potentially can be significantly value adding with fix-wing. 

Would it be easy to re-use them with Arduplane and in waypoints as well?

Cheers.
Daniel
--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


HexaCropSprayer.JPG

DanielB

unread,
Aug 5, 2013, 10:43:06 AM8/5/13
to drones-...@googlegroups.com, Randy Mackay
Randy, again, sounds incredibly value adding.. potentially crosses the line from hobby into direct-high impact agriculture (commercial) use. 

I won't be surprise to soon see multicopters, helis and fixwing planes buzzing around doing crop dusting, as well as anything from mining exploration/staking to deliveries (pizza, mail, etc. ;). 

Thanks very much for the info. and looking forward to your videos.  I'll work it in an arduplane and see how it goes.

All the best.
Daniel

DanielB

unread,
Aug 5, 2013, 11:31:51 AM8/5/13
to drones-...@googlegroups.com, Randy Mackay
Hi Randy.

Don't mean to preempt the blog you're about to post, but I'm just wondering if you've been able to bench test the sprayer design in the picture (thanks for the pic, BTW, looks like a big jug...).

Also, if you don't mind can you share a bit more detail on the sprayer design, particularly the ESC driven pump that you're using?

I'm trying to figure out if I can use the 12 v pumps I have for my "giant) gas planes or might be better, in the interest of weight to use a compress air aluminum canister hooked up to a valve regulator that is controlled by a servo..

Thanks.

Daniel


On Monday, August 5, 2013 9:52:28 AM UTC-4, Randy Mackay wrote:

DanielB

unread,
Aug 5, 2013, 4:02:14 PM8/5/13
to drones-...@googlegroups.com
Hi Randy,

I'm not sure where to make the connections of pump and spinner.  Code specifies:

k_sprayer_pump          = 22,            ///< crop sprayer pump channel
k_sprayer_spinner       = 23,            ///< crop sprayer spinner channel  

What output channels does this correlate to? Are these output channels  5 and ch 6 respectively?

Also kindly confirm that on/off is option 15 on either ch7 or 8, and pump ESC control is ch6.

Thanks for any inputs.
Daniel

DanielB

unread,
Aug 5, 2013, 4:45:13 PM8/5/13
to drones-...@googlegroups.com
Randy.


I might be missing something but compile comes up with the following errors when sprayer is enabled in config.h:

Building for ArduPilot Mega 2.x
Excluding arduino core from include paths
ArduCopter:861: error: 'AC_Sprayer' does not name a type
ArduCopter.pde: In function 'void slow_loop()':
ArduCopter:1288: error: 'sprayer' was not declared in this scope
Parameters.pde: At global scope:
Parameters:1032: error: 'sprayer' was not declared in this scope
Parameters:1032: error: 'AC_Sprayer' has not been declared
control_modes.pde: In function 'void do_aux_switch_function(int8_t, uint8_t)':
control_modes:268: error: 'sprayer' was not declared in this scope

Any thoughts?

DanielB

unread,
Aug 5, 2013, 5:45:14 PM8/5/13
to drones-...@googlegroups.com
Pls. ignore this comment.

Chris Anderson

unread,
Aug 6, 2013, 2:18:51 AM8/6/13
to drones-discuss
Amazing! Please post on DIY Drones!

-c
--
Chris Anderson
CEO, 3D Robotics

Randy Mackay

unread,
Aug 6, 2013, 9:00:55 AM8/6/13
to drones-...@googlegroups.com

     Thanks.  Here's the first video of the large hexa it in action but I don't have the brushed motor controller so the APM can't control the sprayer yet.  I hope that get that this week and then I'll do a blog post about it.
            https://www.youtube.com/watch?v=TkUvgYWZguU

     It has a bit of a crash at the end because I set the min throttle two low so the left motor stopped during an aggressive roll left.

     It has two 4000mAh 6S batteries and very low KV motors (340kv) and it's surprisingly responsive despite it's size.

-Randy



From: Chris Anderson <ch...@3drobotics.com>
To: drones-discuss <drones-...@googlegroups.com>
Sent: Tuesday, August 6, 2013 3:18 PM
Subject: Re: [drones-discuss] AC Sprayer Function on Copter

Randy Mackay

unread,
Aug 6, 2013, 10:22:49 AM8/6/13
to drones-...@googlegroups.com
Daniel,

      Sorry, I missed this email originally.

     You can set the RC10_FUNCTION and RC11_FUNCTION to 22 and 23 respectively. in the advanced parameters list to set the pump and spinner servos to be 10 and 11.

      Yes, setting CH7_OPT or CH8_OPT to 15 will allow you to turn it on/off with the channel 7 or 8 switch.

      I haven't yet implemented the ability to control the pump speed with the ch6 yet but that'll go in over the next couple of weeks.

-Randy



Sent: Tuesday, August 6, 2013 5:02 AM
Subject: [drones-discuss] Re: AC Sprayer Function on Copter

DanielB

unread,
Aug 6, 2013, 11:37:18 AM8/6/13
to drones-...@googlegroups.com, Randy Mackay
Got it.  Help and inputs are very much appreciated, Randy. 

Thanks for the vid as well. Looks very promising.  Sorry about the near crash at the end.  Perhaps the motors's KVs are too low and/or props used, too narrow/thin and low pitch  and lacks torque/thrust?

Good news. Finally got a clean compile with the following sprayer codes (in blue) integrated in ArduPlane. 

Pls. note that other than these, additional modifications in parameters.h, parameters.pde and config.h are as per your "integrate AC_Sprayer.." commit. 

Also, I'm still trying to figure out how to do the changes in control_modes.pde and defines.h to include your "enable added to CH7/CH8 switch" commits, given ArduPlane's different input channel assignments and lack of definitions (I could just be missing them) for supporting AUX channels.  Any thoughts on this?

Can you pls. do a sanity check on the ff. code modifications, just to make sure...

File:  ArduPlane.pde:
~~~~  inserted lines 93 - 97 
~~~
#if SPRAYER == ENABLED
   #include <AC_Sprayer.h>        // Crop sprayer library   
   #include <AP_InertialNav.h>     // ArduPilot Mega inertial navigation library
#endif

~~~
~~~~  inserted lines 687- 690
~~~
#if SPRAYER == ENABLED
   // Counter for branching from 3 1/3hz control loop, for the sprayer runtime
   static uint8_t slow_loopCounter;
#endif

~~~
~~~~  inserted line 751

static const AP_Scheduler::Task scheduler_tasks[] PROGMEM = {
    { update_speed_height,    1,    900 }, // 0
    { update_flight_mode,     1,   1000 },
    ~~~
    { slow_loop,            10,     500 }, //3 1/3hz control loop
    ~~~
~~~~  inserted lines 966 - 983
~~~
// slow_loop - 3.3hz loop
static void slow_loop()
{
    // This is the slow (3 1/3 Hz) loop runtime
    switch (slow_loopCounter) {
    case 0:
        slow_loopCounter++;
#if SPRAYER == ENABLED
        sprayer.update();
#endif
        break;
    default:
        slow_loopCounter = 0;
        break;
    }
}


static void one_second_loop()
{
~~~

Many thanks.

Cheers.
Daniel
Message has been deleted

Randy Mackay

unread,
Aug 7, 2013, 1:22:32 AM8/7/13
to drones-...@googlegroups.com
Daniel,

     Ah, of course.  ArduPlane doesn't use inertial navigation!  We will need to modify the library to allow using the gps position instead.  oops.

     There's no aux switches on arduplane either I think.  Not sure, better ask Tridge.

-Randy



Cc: Randy Mackay <rmac...@yahoo.com>
Sent: Wednesday, August 7, 2013 12:51 AM
Subject: Re: [drones-discuss] Re: AC Sprayer Function on Copter

Almost forgot:  I've updated the metadata for MP to support all params descriptor changes sprayer included, as attached and to update existing, just move them over into ..Program Files (x86)/APM Planner.. folder. Hope this helps.
Reply all
Reply to author
Forward
0 new messages