Hi,
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
Is this Right for Y4
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Is this Right for Y4
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)
But you'll maybe have to apply a weight coefficient on the 2 rear motors. (I would say /2)
Re: Is this Right for Y4
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
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
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Is this Right for Y4
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
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
Re: Is this Right for Y4
Thank you Alex Your a star