Hello all,

I am very much a newbie to RC and quadricopters but I'm working with a group of fellow students on constructing an autonomous quad for a university project. We are currently performing our initial setup.

We do not have an RC transmitter and whilst we could beg/borrow one, we would like to know, first, how to go about calibrating the 4-in-1 ESCs without one. I have read online that it is possible to do this (although the commenter didn't say how) but that it is dangerous since for a first flight you would have no manual override in the event of mis-calibration(s) causing erratic behaviour, however we plan to tether the quad in test flights to overcome such an issue and then fine tune it with/without an RC transmitter (depending on whether we can get our hands on one without purchase).
So, what is the method for performing this calibration through the APM 2.6 in Mission Planner/APMPlanner 2?

One more question:
We would also like to know how to incorporate an Arduino code program into a weypoint Flight Plan in Mission Planner/APMPlanner 2.



A bit more background:

We have built up the frame (except for the landing gear, which will be Araldite-d on soon), mounted the motors, prop savers and props, and connected the electronics to the latest versions of Mission Planner and APMPlanner 2 on the laptop by USB cable, however we have not connected the electronics to the motors.

As soon as the quadricopter has left the ground there must be no further human intervention and it must autonomously carry out a mission to cross a generic flight zone and then enter a target area. It must have a payload release system and must deliver a water payload accurately over an imaginary fire in this target area and then return to launch. Throughout the flight it must be able to stay within a geofence (or if it does exit, it must swiftly and in a stable manner return to the geofenced area) and it must be able to cope with rain and gusts of wind up to 8m/s. Our permitted budget for the entire project is £250 and we are currently JUST on budget.

In terms of components, we have:
3DR (clone) APM 2.6
3DR uBlox LEA-6H GPS with compass
3DR Power Module
3DR (clone) Radio Wireless Telemetry
Turnigy 3S 20C 3300 mAh LiPo battery
Hobbywing 20A Skywalker 20Ax4 UBEC 4-in-1 Brushless ESC
4 Turnigy Aerodrive SK3 - 2830-1020kv Brushless Outrunner Motors
4 10x4.5 Black Rubber Propellers; 2 CW, 2 CCW
4 Prop Savers
'Thermal Knife' circuit as per Bovine Aerospace
Kilner strainer funnel
Custom, self-built aluminium frame
Coat hanger landing gear
3D printed anti-vibration mount as per Omnimac
3D printed GPS stalk mounts as per Omnimac
LED flasher unit



With regards to our second question, we would like the quad to automatically fly by waypoints to the target area, hover and release the water payload. This latter process is controlled by a piece of Arduino code written by Bovine Aerospace and made open to the public. It is this piece of code that we would like to incorporate into the Flight Plan in Mission Planner/APMPlanner 2.

We would be extremely grateful if the members of this community would help us out.



Yours faithfully,
FlyPhi

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

        • Ah right, ok well I copied and pasted the script that you wrote in your comment above into Notepad, saved it as a .py file and then uploaded it to Mission Planner as you said to. Was I then supposed to click on 'Run Script' ? Do I need to take any further steps after this to ensure that this is what the APM will read?

          Yup that's it! My apologies, I'm afraid my electronics knowledge isn't as good as it should be (and of course voltage doesn't go through but across a component...silly me). I've already put the circuit together on a stripboard (with no end of the problem of the copper trace detaching from the board) and yes that is what I'm doing, I'm using the 5V from the APM to close the switch in the reed relay, which allows the current from the 9V PP3 battery to flow through an inch length of 30SWG Nichrome wire, which has a resistance of about 14 Ohms/metre. I spoke with a doctor in electronics at my University today and he reassured me that the circuit as it is, is isolated from the APM so the 9V won't reach it and fry it - phew! I suppose using Ohm's Law that the current draw of the Nichrome wire will be roughly 9 / 1.7 mOhms = 5.3 kA ?

          Ah no, no don't worry the method you suggested sounds great I was just curious! Maybe it's better not to be, after all that 'killed the cat'... ;)

          • 'Run Script' is all you need. To use this script for the purpose you have outlined, you will need to first use MP to set auto mode and arm before running the script (and define a mission of course!).

            If you want to get a bit fancier with your script you can take a look here: 

            http://copter.ardupilot.com/wiki/python-scripting/

            If you want to control everything from the script including selecting the correct mode waiting for GPS and arming then you could look at something like this (untested!):

            print 'Start Script'

            # Set all channels to mid range:
            for chan in range(1,9):
            Script.SendRC(chan,1500,False)
            # Set throttle ch3 to minimum:
            Script.SendRC(3,Script.GetParam('RC3_MIN'),True)

            # Wait for GPS:
            while cs.lat == 0:
            print 'Waiting for GPS'
            Script.Sleep(1000)
            print 'Got GPS'

            # Send yaw right max and wait for ARM message:
            Script.SendRC(4,Script.GetParam('RC4_MAX'),True)
            cs.messages.Clear()
            Script.WaitFor('ARMING MOTORS',30000)
            Script.SendRC(4,1500,True)
            print 'Motors Armed!'

            # Change to AUTO mode:
            Script.ChangeMode('AUTO')

            # Bump throttle to initiate mission:
            Script.SendRC(chan,1500,True)

            Script.Sleep(500)
            Script.SendRC(3,Script.GetParam('RC3_MIN'),True)

            21A is correct but is quite high. The 9V batery will not like this but will probably handle it for a few seconds. The nichrome wire itself may not handle the 9 x 21=189W dissipated across one inch though. Your connecting wires will be under a fair bit of stress too... What is the current capacity of the relay? Maybe you could try 2 x AA cells for 3V to give around 8A, 24W?

          • My bad, not sure how I ended up with that answer, it should have been 9 / (14.37 x 0.025) = 25.1 A...

    • Thank you James for the really helpful reply.

      Ah I didn't notice that about the default throttle settings, maybe someone online like Richard (the commenter who posted the code mod for Mission Planner to enable ESC initialisation) would know what they are. Thankfully we now have an RC transmitter to work with so this shouldn't be a problem anymore.

      The change I was referring to was the low voltage cut off; since the APM 2.6 has that failsafe set to Return to Launch, there's no need to have the low voltage cut off setting on the ESCs activated, which would shut down the motors gradually or immediately, depending on what it was set to. I'm not sure though if there are other changes that would need to be made according to those notes because I haven't got a copy of the ESC instructions handy.

      Thanks for clarifying the calibration point and the ebay link was helpful, I took your advice and ordered one from Hurricane Models for my own personal quadricopter project.

      Oh, I'd thought they required different modules connected inside them after reading an article where a guy turned a PS3 controller into an RC transmitter but if you can do it with firmware alone that makes it a lot easier. Yeah that's what I'd heard regarding the responsiveness of such a controller.

      Yeah I read some of the old wiki and saw that but someone I was talking to in another group here at University said that take-off and motor arming could be achieved through Mission Planner and via MAVLink, where you choose a particular setting with a delay timer and save this to the APM, disconnect the APM from the laptop, stand a safe distance away and wait for the timer to count down, at which point the quad arms the motors and takes off automatically. Thanks for the link, that helps - someone commented on it that they weren't entirely sure how those who said it was possible had gone about enabling it and I'm in the same boat!

      Yup that's what it is. Obviously in our case it's not release at a certain altitude but once a particular waypoint (the target area) has been reached.

      What you describe as far as you understand is exactly what we plan to do. We have three leads coming from the Thermal Knife circuit, a ground lead, a 5V lead and a lead for a digital output pin. I presume that ground -> a negative pin, 5V -> a positive pin, and digital output pin -> an 's' signal pin?

      Another friend was saying that I could set a 'channel' in Mission Planner to turn on for a set period of time through a particular pin number between 2 and 12 when the quad has reached the target area waypoint. Does that make any sense to you? If so, where do I find these 'channels' in Mission Planner?

      No worries, your response was incredibly helpful!
      • FlyPhi,

        It looks like things are a bit easier for you now you have a transmitter/Receiver. I had a play with an APM here on my desk (connected to nothing but my USB) running AC3.15 default params and can confirm that Auto missions are possible without RC. The application of the throttle does seem to be required to initiate the auto mission but this is easily achieved by running very short script after arming:

        Script.SendRC(3,1300,True)
        Script.Sleep(1)
        Script.SendRC(3,1100,True)

        Basically this just simulates you raising the throttle (ch3) a bit for one second then dropping it back to zero (default throttle calibration on APM is 1100). Using MP in tuning mode and graphing the motor outputs, I can see the the APM arms and attempts to launch on its mission. It also responds appropriately to a mode change to LAND and disarms. If you need to demonstrate your system working with no input from your RC transmitter then this is doable (though obviously if you have one then having it on standby is advisable!)

        Your thermal knife device sounds interesting. I presume it is arranged so that the weight of the load applies tension in the rope across the 'blade' such that as soon as it is activated, the rope is melted through and the load released. You need to be careful how you connect this device as it sounds like it could consume some reasonable current. I would not connect it directly to your APM. Do you have the specs of the knife (voltage/current of input/output)? Depending on the voltage range it operates over, you may be able to connect it either directly to your battery or to a BEC (possibly on one of your ESC's). The current requirement will also affect how you set this up. 

        Arducopter allows you to automate various commands at way points in an auto mission. In your case it looks like you need to alter the digital state of an output pin (does your thermal knife become active on a high-5V or low-0V signal?). Arducopter is already set up to do this for the purpose of operating a camera shutter (ie take a picture) On the 'Flight Plan' screen in MP you can define your mission. After reaching a waypoint you can define a command DO_DIGICAM_CONTROL This will cause the A9 pin to go high (5V) for a set period and hopefully activate your thermal knife. You need to configure your 'Camera Shutter' on the gimbal setup page (Initial Setup>>Optional Hardware). Set it to 'relay' and set the duration as described here:

        http://copter.ardupilot.com/wiki/common-camera-shutter-with-servo/

        There are other options for servo type PWM outputs on other pins but I do not believe that this is what you want.

        Feel free to ask questions if anything is not clear

        • Good evening James,

          I've just gone through the steps you indicated and the ardupilot.com link you sent but when I went to 'write params' after changing Ch7_Opt to Camera Trigger, it came up with a message saying: 'CH7_OPT has more than doubled the last input. Are you sure?' I selected yes but I presume this message is just saying that when the DO_DIGICAM_CONTROL command is activated, the A9 pin will be pulled high and that the PWM value will therefore be more than twice what it would be on 'do nothing'? 

          • FlyPhi, The Ch7 setting is only if you want to be able to remotely activate the shutter (balloon perforator)  from your RC transmitter. If you select the 'relay' setting for shutter control on teh gimbal setup page then it will output a digital 0 or 5v on A9 and the PWM settings do not apply

        • James, would this work? Sounds like a good idea for something that requires more than 5V, although whilst the reed relay switch in the Thermal Knife circuit doesn't require more than 5V, the PP3 battery would then put 9V through the circuit, which would probably be directly connected to the APM...

          http://copter.ardupilot.com/wiki/common-using-the-relay-switch/

          • This relates to the on board relay on the old APM1. The method I gave you should work just fine to activate your knife circuit using either the relay in the circuit you referenced or using a mosfet

            • ah I see so the current board doesn't actually have a relay on it then? Yeah I think it will work swell, just sorting it out now :) Thank you so much once again!

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…