Quadrocopter drone...noob help

Discussion in 'The Projects Forum' started by rmcgeown, Jan 31, 2012.

  1. rmcgeown

    Thread Starter New Member

    Jan 31, 2012
    6
    0
    Hi all,

    I will start by saying in am a rank amateur noob! I know very little about electronics, but i have the ability and willingness to learn quickly!

    I was recently flame grilled at the PICAXE forums for my idea of using a PIC to control a quadrocopter on a pre-programmed flight, using a few sensors and a gyro.

    The idea is to write a GUI in which the user enters variables such as altitude, and a series of directional commands which are then written to the drone for it to execute...eg. take off altitiude= 2 meter, forward = 3 meter, left = 1 meter, decrease alt = 1 meter. THe drone would then reverse the commands to return to its starting point.

    The opinion was that it was too difficult and a PIC would be too slow. There was no further explanation which has only made me determind to see what i can do and learn.

    If a pic really is too slow to process the inputs and out put the commands, what other options could i use? Arduino?
     
  2. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    I don't think a PIC would be too slow. Depending on the one you get, they can run at a range from 2-32 MHz, which should be fast enough. The part I would worry the most about would be that its movement wouldn't be very precise. I imagine to turn left you would slow down the motors on the left, so that it tips and the rotors on the right push it towards that direction, but doing the reverse wouldn't necessarily put it back where it started. I think a PIC with any decent oscillator should work--they can be pretty fast. Being a quadracopter, I know it would be very stable and probably not move very fast, so your PIC should be able to keep up with it.

    This is a very interesting idea. I look forward to seeing what comes of it! :)

    Regards,
    Der Strom
     
  3. pilko

    Active Member

    Dec 8, 2008
    213
    20
    You were not grilled on the Picaxe forum. Be fair, you asked:-
    "I have an idea that I would like to explore and hopefully build, but at the moment i do not know if it is possible or feasable with the PICAXE and other electronics."
    You were told:-
    "Massive challenge, even for someone very experienced in electronics, programming microcontrollers and RC type equipment.
    Low cost, very unlikley, with a PICAXE very very unlikley, way too slow.
    And looks like some very good SMT PCB design and construction skills required too.
    So basically, No."
    On this forum you are asking if it can be done with a PIC.-- Not the same question.

    pilko
     
  4. rmcgeown

    Thread Starter New Member

    Jan 31, 2012
    6
    0
    Your right Pilko, it wasnt fair to say i was grilled. It maybe my lack of understanding that makes it seem that way; I assumed a PICAXE with just a variant or brand of a PIC.

    Thanks for the reply DerStrom8. Im not concerned with the speed of movement really, the idea is to have it fly a set path indoors or around the office just for fun and too see if i can make it work.

    I guess I need to start with the difference between a PIC and a PICAXE!
     
  5. rmcgeown

    Thread Starter New Member

    Jan 31, 2012
    6
    0
    Well i have done a little more research and I think I will just start with small tasks, like programming a PIC to interpret singals from the SRF005 ultrasonic distance measuring module and power 4 motors via PWM acordingly.

    Is there a PIC that has 4 PWM outputs and can they be used simultaneously?

    I hope this would give me basic altitude control. A take off power to the motors would be ramped up gradually until the SRF005 returned a value equal to say 100cm, at which point the motors would be modulated to maintain that.

    I could start just by using LEDs with the sensor. PWM would increase and decrease drightness to simulate power to the motors. A simple test rig could raise and lower the board.

    Later testing could include a gyro and accelerometer to control each motor (LED) to produces stable platform...

    Problem is i dont know how to start and what i need!
     
  6. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    I think the PIC18F4x31 (4331 and 4431) have 4 independent PWM outputs. You may want to look into that. For that matter, I would recommend getting the C18 Lite compiler from Microchip, and the PICkit2 or 3. I'm not sure if the PK2 supports that processor, so you'll want to check their specs. You might just need to pick up a PK3.

    What you describe sounds plausible, but keep in mind it probably won't be terribly accurate. I suggest you start by getting one of the chips I mentioned above (Actually, probably two or three, just in case), the programmer (PK2/3), and a solderless breadboard. Of course you'd need assorted components and jumper wires, too. Anyway, see if you can get a handle on programming before diving in to the full project. I think you'll find it much less overwhelming that way. Start small, and work your way up. And as always, we're here for you.

    Regards,
    Der Strom
     
    rmcgeown likes this.
  7. rmcgeown

    Thread Starter New Member

    Jan 31, 2012
    6
    0
    Thank you very much DerStorm. I will look into those components :)
     
  8. BSomer

    Member

    Dec 28, 2011
    433
    106
    Google "arducopter". There is a company that makes arduino compatible boards that can control RC airial vehicles.

    Unless that is where you got your idea...

    Beyond that I am of no help. I'm still learning programming myself.
     
  9. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Just to clarify Picaxe vs PIC. Picaxe chips are PICs and each model Picaxe cross references to a PIC model. The main difference with a Picaxe is the internal 'bootstrap program' that's used to convert the Picaxe from C code to Picaxe Basic. The language conversion makes learning the programming easy but it does sacrifice speed and available memory to do this.
     
  10. rmcgeown

    Thread Starter New Member

    Jan 31, 2012
    6
    0
    thanks for the info CDRIVE.

    I just had another thought, i dont know if you have seen the Raspberry-Pi board due to be released this month, but i was planning on getting one anyway and thought that it may be possible to use it along with its GPIO headers for both PWM and I/O for the sensors.

    Its a 700Mhz ARM11 with 256MB RAM (www.raspberrypi.org/faqs). The GPIO supports low lever pripherals (http://elinux.org/RPi_Low-level_peripherals#General_Purpose_Input.2FOutput_.28GPIO.29) on 17 GPIO header PINS.

    In theory I should be able to have its KERNEL load a C program in a similar way ti a PIC but with much more power. Its a small enough board and i could remove unecessary components like the Audio, Video, Ethernet etc.

    Thoughts?
     
  11. rmcgeown

    Thread Starter New Member

    Jan 31, 2012
    6
    0
    Hi all, i think i may have something that will work:
    http://www.hobbyking.com/hobbyking/...i_Rotor_Control_Board_V3_0_Atmega328_PA_.html

    Would it be possible to re-programme the Atmega328PA to use a specific set of instructions, i.e fool it into thinking its getting the instruction from the Radio RX? I would need to add a Ultrasonic sensor onto it as well. Would this need another IC like a PIC, or do you think it could all be done on the Atmega328PA?

    Thanks
     
Loading...