Change pin used for motor in MultiWii code

Post Reply
Marvos
Posts: 4
Joined: Sat Aug 18, 2012 3:08 pm

Change pin used for motor in MultiWii code

Post by Marvos »

Crosspost from RCGroups forums. I got no answer there...

Hello everyone. I have a promini 328P board. The promini is supposed to be able to control 6 motors, for a hexacopter.

I have recently managed to fry (it would seem) pin nr.3, so it can no longer control an esc.

Since I am trying to run a quad, I hope I correctly assume that I am left with two usable pins on the board, which could be used as a replacement for pin nr.3.

The only thread I found on this subject is this one viewtopic.php?f=8&t=1382

I tried the advice from that thread, but it did not work.

How can I change the code to use pin nr. 5 or 6 (or perhaps A1 or A2??) instead of pin 3?
I am using MultiWii 2.1.

Marvos
Posts: 4
Joined: Sat Aug 18, 2012 3:08 pm

Re: Change pin used for motor in MultiWii code

Post by Marvos »

I solved this problem now, I used ronco's solution and configured the board for a HEX6X layout.

http://www.multiwii.com/forum/viewtopic.php?f=8&t=1625&p=13109&hilit=change+pin#p13347

EDIT: I also needed to do this in order for my yaw and pitch to work with no changes to my Tx/Rx setup: http://www.multiwii.com/forum/viewtopic.php?f=18&t=1203

cururu
Posts: 5
Joined: Thu Jan 10, 2013 3:21 pm

Re: Change pin used for motor in MultiWii code

Post by cururu »

Hi Marvos!

Your post helped me a lot, thank you very much!

I have this board: " HK_MultiWii_328P // Also labeled "Hobbybro" on the back. ITG3205 + BMA180 + BMP085 + NMC5583L + DSM2 Connector (Spektrum Satellite) "

I fried the D3 when I connected the esc plug on a wrong way.

I am using Multiwii 2.1 and quadX.

Below are the changes I had to do to change my D3 motor pin connection that was not working:

I selected HEX6X on the config

config.h:

Code: Select all

   #define HEX6X


Uncommented the following line on config.h:

Code: Select all

   #define A0_A1_PIN_HEX


And changed the HEX6X motor settings:

Output.ino:

Code: Select all

    #ifdef HEX6X // now quad x with pin 10,11,A0,A1
    motor[0] = 1000; // pin 3 .. not used
    motor[1] = PIDMIX(+1,+1,+1); //REAR_L -> pin 10
    motor[2] = PIDMIX(-1,-1,+1); //FRONT_R -> pin 11
    motor[3] = 1000; // pin 9.. not used
    motor[4] = PIDMIX(+1,-1,-1); //FRONT_L -> pin 6 (A1)
    motor[5] = PIDMIX(-1,+1,-1); //REAR_R -> pin 5 (A0)
   #endif


Thanks!

IamTheVector
Posts: 7
Joined: Mon May 25, 2015 5:53 pm

Re: Change pin used for motor in MultiWii code

Post by IamTheVector »

this is the correct answer. Worked for me :

viewtopic.php?f=16&t=1681&p=66138#p66138

cururu
Posts: 5
Joined: Thu Jan 10, 2013 3:21 pm

Re: Change pin used for motor in MultiWii code

Post by cururu »

Hi IamTheVector

Its not "THE" correct answer, its another way to solve the same problem. The solution I posted worked for my board.

Post Reply