Hiya.
So this is what Ive done,
;*************************************************************************************
;*** Individual leg control mode choose between 6 legs with 2-state button ***
;*************************************************************************************
elseif LegMode
BalanceMode = 1
GaitType = 2
TestLeg = RRGaitLegNr
TravelLengthX = (RCInput(1)-1500)/4.5
TravelLengthZ = (RCInput(0)-1500)/4.5
TravelHeightY = (RCInput(3)-1500)/3
serout S_OUT, i9600, "GaitPosX=", sdec GaitPosX," GaitPosY=", sdec GaitPosY," GaitPosZ=", sdec GaitPosZ, 13]
ENDIF
return
Ignore the travel lengthX’Y’Z channels which are assigned to the wrong channels of the remote… I’ll fix that later.
So with that serout command Ive noticed that the 3 angles max limits are -24 and +24 for GaitPosY,X,Z which is why Ive used 4.5/4.5/3 respectively where you had used 4/4/3 “I’m just experimenting with the values I used based off visually the problems Ive been experiencing.” I have some values to shoot for now less then 24 and no more then -24
I see your max and min values are not the same as the ones I see, due to adjusting the end points, what I believe I will do is adjust all of the end points so that max is 2000 and min is 1000 and centered is as close to 1500 as possible.
RCpwmMAX con 1850 <— your values
RCpwmMIN con 1150 <— your values
As for your comment of the Sbyte values getting larger then they should, I did not find this was the case but good call.
I’m looking at how you had used the max min commands and realize now why you had used that to avoid issues like this. I just want to avoid a large deadzone on the far reaches of each stick.
What I think I need to do on the transmitter is adjust all the End Points so that they all end at 1000 and 2000 'which is around 121%-123%
I had remembered a while back when I asked you why my phoenix was having issues and you explained the max and min thing a while ago, now I understand what was happening with the values so that makes sense to me.
So as for monitoring the Gait variables I had noticed that when any one of the 3 axis value gets larger then 24 they quickly become inverted from 24 to -24 which is what causes the leg to quickly jump into the opposite direction… I cant say exact but I’m going to take a guess at this and say it has to do with one of the trig values getting larger then they should. Id have to learn some of that again to give you a better idea, but since you understand the code more then me you would have a better idea of what is happening with the large values and why they happen to get inverted like that when that value is 25 and higher
Actually do you have any notes on what the max and min of all the variables are? so i can adjust my division values accordingly? the other option is to just not use endpoints and set them all to 100%
One other idea I was going to implement was when the individual leg is selected it simply taps twice or something, I think I can do this by just adding then subtracting 10 or so from one of the TravelLength variables that deals with up and down movement and then return to the other loop which deals with actually controlling the arm, and would only do this on a new leg selected.
other then having the ability for every leg to be controlled which you did in the modified remote code you sent me for reference, that’s what my goal is now.
Oh I almost forgot, I cant find in the 'Modified remote" version you had sent me what it is that keeps your leg stuck in 3d space when you switch from Mode3 to Mode2 “balance one leg mode”…
I notice that your balance one leg mode and BodyRotX’y’z are in the same mode where as mine are in different sub routines…is that why? is there anyway I can make the un modified code perform like the modified remote code when it comes to holding that leg in 3d space while switching from mode 3 "leg control’ to mode 2 “body rotation” ?? or am i stuck
–Aaron
Actually do you have any notes on what the max and min of all the variables are? I have found the limits of the travelLength variables being -24 and 24.
thanks again.