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.
Hi, if I remember right I set the range 1100 - 2000 us. The PWM standard isn't changed so they will work with arducopter like SimonK etc. I found that my skywalker run best with 400Hz PWM (flashed or unflashed), so look in the missionplaner and set the esc pwm to 400, I think it is 490 default. (note: dji naza also uses 400 hz pwm, so don't expect a degraded flightperformance by doing so)
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:
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:
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
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...
The script is a plain text file with a .py extension. You can load and run scripts from the 'Scripts' Tab on the 'Flight Data' page. I have not done a lot of scripting but it may be possible to set auto mode, arm the copter and bump the throttle all from the script.
I found the circuit diagram for the 'knife' here:
If you have this circuit built already then you can hook it up the same way they have. Note that the 5v power for the relay is SHARED by the Arduino and does not pass through it. Also the knife itself has a separate power supply (perhaps you could use a 9v battery?).
If you have not made this circuit yet then I would suggest perhaps using a single mosfet as the switching element rather than the relay. This will simplify the circuit. You do not mention the current draw of the 'knife' part of the circuit. Do you know the gauge/length of the nicrome wire you are using?
I am not sure if there are any other options for changing the state of a digital pin in AC but I do not think so. It relatively straight forward to do in code though. Is there any reason that the method I described is not suited to your task?
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 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'... ;)
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!