Regarding the “Aluminum Ground Contact Switch assembly”
do you have any further images/diagrams/illustrations of one connected to the ABB or SSC?
how about functioning code. so far i have pulled together this.
**Note: code is for a quad running phoenix2.0 **
[code];[Terain adaption]
RF_FSR var bit
RR_FSR var bit
LF_FSR var bit
LR_FSR var bit
prev_RF_FSR var bit
prev_RR_FSR var bit
prev_LF_FSR var bit
prev_LR_FSR var bit
RF_FSR_PosY var sword
RR_FSR_PosY var sword
LF_FSR_PosY var sword
LR_FSR_PosY var sword
FSROn var bit[/code]
[IN MAIN]
[code];Terrain adaption
IF FSROn THEN
gosub ReadFSR
ELSE
RF_FSR_PosY=0
RR_FSR_PosY=0
LF_FSR_PosY=0
LR_FSR_PosY=0
ENDIF
;Balance calculations
TotalTransX = 0 'reset values used for calculation of balance
TotalTransZ = 0
TotalTransY = 0
TotalXBal = 0
TotalYBal = 0
TotalZBal = 0
IF (BalanceMode>0) THEN
gosub BalCalcOneLeg -RFPosX+RFGaitPosX, RFPosZ+RFGaitPosZ, (RFPosY-cRFPosY)+RFGaitPosY+RF_FSR_PosY, RFOffsetX, RFOffsetZ]
gosub BalCalcOneLeg -RRPosX+RRGaitPosX, RRPosZ+RRGaitPosZ, (RRPosY-cRRPosY)+RRGaitPosY+RR_FSR_PosY, RROffsetX, RROffsetZ]
gosub BalCalcOneLeg [LFPosX+LFGaitPosX, LFPosZ+LFGaitPosZ, (LFPosY-cLFPosY)+LFGaitPosY+LF_FSR_PosY, LFOffsetX, LFOffsetZ]
gosub BalCalcOneLeg [LRPosX+LRGaitPosX, LRPosZ+LRGaitPosZ, (LRPosY-cLRPosY)+LRGaitPosY+LR_FSR_PosY, LROffsetX, LROffsetZ]
gosub BalanceBody
ENDIF[/code]
[AFER FREE SERVOS]
[code];[ReadFSR] Reading input from Tars pressure sensors
ReadFSR:
input P0
input P1
input P2
input P3
prev_RF_FSR = RF_FSR
prev_RR_FSR = RR_FSR
prev_LF_FSR = LF_FSR
prev_LR_FSR = LR_FSR
RF_FSR = IN0
RR_FSR = IN1
LF_FSR = IN2
LR_FSR = IN3
IF RF_FSR=0 THEN
RF_FSR_PosY = (RF_FSR_PosY+1)max 60
ENDIF
IF RR_FSR=0 THEN
RR_FSR_PosY = (RR_FSR_PosY+1)max 60
ENDIF
IF LF_FSR=0 THEN
LF_FSR_PosY = (LF_FSR_PosY+1)max 60
ENDIF
IF LR_FSR=0 THEN
LR_FSR_PosY = (LR_FSR_PosY+1)max 60
ENDIF
IF (RF_FSR+RR_FSR+LF_FSR+LR_FSR)>=6 THEN
RF_FSR_PosY = (RF_FSR_PosY-1)min 0
RR_FSR_PosY = (RR_FSR_PosY-1)min 0
LF_FSR_PosY = (LF_FSR_PosY-1)min 0
LR_FSR_PosY = (LR_FSR_PosY-1)min 0
ENDIF
;serout s_out, i57600, [sdec RF_FSR_PosY, 13]
return[/code]