Is this Right for Y4

Post Reply
rocketray
Posts: 44
Joined: Tue Feb 01, 2011 3:14 am

Is this Right for Y4

Post by rocketray »

Hi, :D

Havn't got a clue about coding but was told i need roll on front motors and no yaw, and yaw on back motors and no roll, so i copied xQuad and altered it.
could someone check it and see if i have got it right "Thanks very much"


//#Define Y4


#ifdef Y4
motor[0] = rcCommand[THROTTLE] + axisPID[PITCH] - YAW_DIRECTION * axisPID[YAW]; //REAR_R

motor[1] = rcCommand[THROTTLE] - axisPID[ROLL] - axisPID[PITCH]; //FRONT_R

motor[2] = rcCommand[THROTTLE] + axisPID[PITCH] + YAW_DIRECTION * axisPID[YAW]; //REAR_L

motor[3] = rcCommand[THROTTLE] + axisPID[ROLL] - axisPID[PITCH]; //FRONT_L
#endif

If its wrong can you please explain(in simple terms)

Ray

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Is this Right for Y4

Post by Alexinparis »

Hi, I think it should work like this.
But you'll maybe have to apply a weight coefficient on the 2 rear motors. (I would say /2)

rocketray
Posts: 44
Joined: Tue Feb 01, 2011 3:14 am

Re: Is this Right for Y4

Post by rocketray »

Hi Alex, :)

Thanks for checking it out, its good to know i got it right although i just deleted things that didn't apply!
I checked through the code and cant find any mention of a weight coefficent and i haven't a clue how or where to apply it, sorry, I did mention that i know absolutely nothing about codeing and i am fumbleing about in the dark. Could you please point me in the right direction?

Ray :?

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Is this Right for Y4

Post by Alexinparis »

something like this:

motor[0] = rcCommand[THROTTLE] + axisPID[PITCH]/2 - YAW_DIRECTION * axisPID[YAW]; //REAR_R

motor[1] = rcCommand[THROTTLE] - axisPID[ROLL] - axisPID[PITCH]; //FRONT_R

motor[2] = rcCommand[THROTTLE] + axisPID[PITCH]/2 + YAW_DIRECTION * axisPID[YAW]; //REAR_L

motor[3] = rcCommand[THROTTLE] + axisPID[ROLL] - axisPID[PITCH]; //FRONT_L

rocketray
Posts: 44
Joined: Tue Feb 01, 2011 3:14 am

Re: Is this Right for Y4

Post by rocketray »

Thank you Alex Your a star :D :D :D

Post Reply