Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Small RC Receiver

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
13 postsPage 1 of 1
13 postsPage 1 of 1

Small RC Receiver

Post by Pev » Sun Apr 09, 2006 4:09 pm

Post by Pev
Sun Apr 09, 2006 4:09 pm

I've just set about adding RC control to my RN1 so firstly thank you to everyone who has posted information, advice and code - has been a great help.

I needed a small receiver just as we all do and I managed to find a pretty small but not overly expensive one and it works great. It's a 4 Channel unit from Futaba called the R114F and it's around £30. the dimesions are 22mm X 32mm x 13.5mm. Its only a short range unit but works great for the RN1.

Image


Pev
I've just set about adding RC control to my RN1 so firstly thank you to everyone who has posted information, advice and code - has been a great help.

I needed a small receiver just as we all do and I managed to find a pretty small but not overly expensive one and it works great. It's a 4 Channel unit from Futaba called the R114F and it's around £30. the dimesions are 22mm X 32mm x 13.5mm. Its only a short range unit but works great for the RN1.

Image


Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by Morbeious » Sun Apr 09, 2006 4:48 pm

Post by Morbeious
Sun Apr 09, 2006 4:48 pm

eh, Pev

I picked up the Futaba 4 channel R124F, it pretty small, even has smaller connectors I hear is pretty new, cost only $25, and its long ranges, its also on 72Mhz.. for air though.

I will post a picture later..
eh, Pev

I picked up the Futaba 4 channel R124F, it pretty small, even has smaller connectors I hear is pretty new, cost only $25, and its long ranges, its also on 72Mhz.. for air though.

I will post a picture later..
Robots Own/Operated: HeathKit Jr, OmniBot 2000, Lego MindStorms, RSV2, RoboNova-1
Morbeious
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 56
Joined: Tue Mar 21, 2006 1:00 am
Location: Metro Detroit, Michigan, USA

Post by Pev » Sun Apr 09, 2006 5:18 pm

Post by Pev
Sun Apr 09, 2006 5:18 pm

Morbeious wrote:eh, Pev

I picked up the Futaba 4 channel R124F, it pretty small, even has smaller connectors I hear is pretty new, cost only $25, and its long ranges, its also on 72Mhz.. for air though.

I will post a picture later..


Hi Morbeious,

I have just checked the freq available in the uk and it doesn't look like 72Mhz is allowed (according to OfCom the governing body over here) - we seem to have 27Mhz AM (anything), 35Mhz FM (aircraft), 40Mhz FM (ground) and 2.4Ghz (ground). There is a 458Mhz but I haven't found much equipment for it. Also haven't found the R124F in my catalogue so may not be available in the UK. The R114F and Hitech Micro/Feather receivers seem to be the smallest 4 channels around over here unless you go for the tiny sub micro stuff I saw today (the receiver was about the size of my thumb nail and had a price tag to match lol).

If anyone in the UK needs to know the freq available you can check out the OfCom site at :

http://www.ofcom.org.uk/radiocomms/ifi/licensing/classes/rlans/technical/ofw311/


Pev
Morbeious wrote:eh, Pev

I picked up the Futaba 4 channel R124F, it pretty small, even has smaller connectors I hear is pretty new, cost only $25, and its long ranges, its also on 72Mhz.. for air though.

I will post a picture later..


Hi Morbeious,

I have just checked the freq available in the uk and it doesn't look like 72Mhz is allowed (according to OfCom the governing body over here) - we seem to have 27Mhz AM (anything), 35Mhz FM (aircraft), 40Mhz FM (ground) and 2.4Ghz (ground). There is a 458Mhz but I haven't found much equipment for it. Also haven't found the R124F in my catalogue so may not be available in the UK. The R114F and Hitech Micro/Feather receivers seem to be the smallest 4 channels around over here unless you go for the tiny sub micro stuff I saw today (the receiver was about the size of my thumb nail and had a price tag to match lol).

If anyone in the UK needs to know the freq available you can check out the OfCom site at :

http://www.ofcom.org.uk/radiocomms/ifi/licensing/classes/rlans/technical/ofw311/


Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by mochung » Sun Apr 09, 2006 6:17 pm

Post by mochung
Sun Apr 09, 2006 6:17 pm

Hi PEV, I would like to see if you can set up the RX with RN-1 smoothly. I am currently expericing some issues with RX setup. I can control RN-1 with my 9CH TX but its not always the case. Most of the time I have some sort of delay issues. It means that when I move the TX's stick RN-1 doesnt react right the way. The delay is like at least 10 seconds! Sometimes there is no reaction at all.

So I just want to see if you dont have that kind of problem and if you can also share with us your RX setup and the code to run RC with RN-1.

Best,

Mo
Hi PEV, I would like to see if you can set up the RX with RN-1 smoothly. I am currently expericing some issues with RX setup. I can control RN-1 with my 9CH TX but its not always the case. Most of the time I have some sort of delay issues. It means that when I move the TX's stick RN-1 doesnt react right the way. The delay is like at least 10 seconds! Sometimes there is no reaction at all.

So I just want to see if you dont have that kind of problem and if you can also share with us your RX setup and the code to run RC with RN-1.

Best,

Mo
mochung
Robot Builder
Robot Builder
User avatar
Posts: 10
Joined: Mon Apr 03, 2006 1:00 am

Post by Pev » Sun Apr 09, 2006 9:38 pm

Post by Pev
Sun Apr 09, 2006 9:38 pm

Hi Mo

Okay I'll try to make this as clear as I can.

The TX is an ACOMS 4 channel FM setup on 40Mhz (cheapest I could buy today lol) with the RX I mentioned earlier in the thread the Futaba R114F - This is 4 channel RX and picks up its power input on Channel 4 (although I think it would work on any channel). I also have a GWS PG-03 gyro. They are connected as follows

GWS PG-03 gyro connected to Gyro Port 1 which is AD port 0 and 4
4 channel RX connected to AD ports 1,2,3 and 5

I am powering the gyro from AD port 0 and the RX from AD port 5

I have connected the ground and signal lines on the other AD ports to the RX and gyro devices as required but not the +ve.

To date I have only written code for basic walking and turning on channels 1 and 4 of the RX (that is my left stick). The code is as follows and the variables CH1 through to CH4 are dimensioned as byte:

'Gyro Setup
GYROSET G6A,0,1,1,0,0,0
GYROSET G6D,0,1,1,0,0,0

GYRODIR G6A,0,1,1,0,1,1
GYRODIR G6D,0,1,1,0,1,1

GYROSENSE G6A,0,200,200,00,0,0
GYROSENSE G6D,0,200,200,00,0,0

MAIN:

GOSUB robot_voltage
'GOSUB robot_tilt

' RC control - CH1 = left stick Vertical, CH2 = Right Stick Horizontal, CH3 = Right Stick Vertical, CH4 = Left Stick Horizontal
'Max movement values per channel are:
' CH1 : top = 21, mid = 96, bot = 180 ----- CH2 Left = 10, mid = 101, right = 190
' CH3 : top = 10, mid = 99, bot = 185 ----- CH4 Left = 10, mid = 100, right = 188
CH1 = RCIN(1)
CH2 = RCIN(2)
CH3 = RCIN(3)
CH4 = RCIN(5)

'rem forwards and backwards
IF CH1 < 75 AND CH1 > 40 THEN GOSUB k11 'walk fwds
IF CH1 < 40 THEN GOSUB K10 'run fwds
IF CH1 > 125 THEN GOSUB K12 'walk backwards

'Left and Right
IF CH1 > 75 AND CH1 < 120 THEN GOSUB RC_TURN ' Check for Channel 4 input

'-----------------------------

'IR Control

IF RR = 0 THEN GOTO MAIN1

ON RR GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
GOTO main_exit
'-----------------------------
MAIN1:
A = REMOCON(1)
A = A - ID
ON A GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
GOTO MAIN
'-------------------------------------------------
action_proc:
A = RR - 50
ON A GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
RETURN
'-----------------------------
main_exit:
IF RR > 50 THEN RETURN
RR = 0
GOTO MAIN
'================================================
'RC Left-Right
RC_TURN:

IF CH4 < 75 AND CH4 > 40 THEN
GOSUB k22 'turn left
ELSEIF CH4 > 125 AND CH4 < 160 THEN
GOSUB k24 'trun right
ENDIF

IF CH4 > 160 THEN GOSUB k23 ' quick turn right (custom move)
IF CH4 < 40 THEN GOSUB k18 ' quick turn left (custom move)

RETURN

I am using the hitec supplied walking and turning routines except for K23 and K18 which are custom routines for a faster turn but are somewhat less stable. These two routines are the only ones at the moment that cause him to fall over. I have also modified the walking forwards and backwards routines for continuous motion as per Tacoman's code example in an earlier post (thanks Tacoman). The CH1 <75 and CH1 >125 on channel 1 is used to create a dead zone near the TX stick centre. I also have multiple moves on the TX stick based on how far you move it.

I do see a few minor issues with this setup. I am not getting the delay you refer to but I do see two issues:

1. When he has been walking around for a good period of time (10 t0 15 minutes) I sometimes see the processor board reset and then loop in a reset. This means he judders and I have to turn him on and off to get him started again. I think it may be a brownout problem with the power as it is only after some of my custom rountines that move just about every servo at once.
2. He occasionally pauses mid movement for 2 to 3 seconds, but then carries on. This is as if the processor is busy processing something and the servo movement is to low down the interupt table (hope that makes sense). He does however always come out of this without any intervention from me.

As you can see from the code I am still allowing the IR unit to be used to access the other movements and this seems to work well. My intention is to move as many of the movements I want to the RX based system and remove the IR sensor.

I am not seeing the random delays I have seen you mention in your previous posts so am not sure what may be causing them. I hope some of the above is useful and helps address your issue. Feel free to send me any data/code you have and I'll happily take a look at it.

All the best

Pev
Hi Mo

Okay I'll try to make this as clear as I can.

The TX is an ACOMS 4 channel FM setup on 40Mhz (cheapest I could buy today lol) with the RX I mentioned earlier in the thread the Futaba R114F - This is 4 channel RX and picks up its power input on Channel 4 (although I think it would work on any channel). I also have a GWS PG-03 gyro. They are connected as follows

GWS PG-03 gyro connected to Gyro Port 1 which is AD port 0 and 4
4 channel RX connected to AD ports 1,2,3 and 5

I am powering the gyro from AD port 0 and the RX from AD port 5

I have connected the ground and signal lines on the other AD ports to the RX and gyro devices as required but not the +ve.

To date I have only written code for basic walking and turning on channels 1 and 4 of the RX (that is my left stick). The code is as follows and the variables CH1 through to CH4 are dimensioned as byte:

'Gyro Setup
GYROSET G6A,0,1,1,0,0,0
GYROSET G6D,0,1,1,0,0,0

GYRODIR G6A,0,1,1,0,1,1
GYRODIR G6D,0,1,1,0,1,1

GYROSENSE G6A,0,200,200,00,0,0
GYROSENSE G6D,0,200,200,00,0,0

MAIN:

GOSUB robot_voltage
'GOSUB robot_tilt

' RC control - CH1 = left stick Vertical, CH2 = Right Stick Horizontal, CH3 = Right Stick Vertical, CH4 = Left Stick Horizontal
'Max movement values per channel are:
' CH1 : top = 21, mid = 96, bot = 180 ----- CH2 Left = 10, mid = 101, right = 190
' CH3 : top = 10, mid = 99, bot = 185 ----- CH4 Left = 10, mid = 100, right = 188
CH1 = RCIN(1)
CH2 = RCIN(2)
CH3 = RCIN(3)
CH4 = RCIN(5)

'rem forwards and backwards
IF CH1 < 75 AND CH1 > 40 THEN GOSUB k11 'walk fwds
IF CH1 < 40 THEN GOSUB K10 'run fwds
IF CH1 > 125 THEN GOSUB K12 'walk backwards

'Left and Right
IF CH1 > 75 AND CH1 < 120 THEN GOSUB RC_TURN ' Check for Channel 4 input

'-----------------------------

'IR Control

IF RR = 0 THEN GOTO MAIN1

ON RR GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
GOTO main_exit
'-----------------------------
MAIN1:
A = REMOCON(1)
A = A - ID
ON A GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
GOTO MAIN
'-------------------------------------------------
action_proc:
A = RR - 50
ON A GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
RETURN
'-----------------------------
main_exit:
IF RR > 50 THEN RETURN
RR = 0
GOTO MAIN
'================================================
'RC Left-Right
RC_TURN:

IF CH4 < 75 AND CH4 > 40 THEN
GOSUB k22 'turn left
ELSEIF CH4 > 125 AND CH4 < 160 THEN
GOSUB k24 'trun right
ENDIF

IF CH4 > 160 THEN GOSUB k23 ' quick turn right (custom move)
IF CH4 < 40 THEN GOSUB k18 ' quick turn left (custom move)

RETURN

I am using the hitec supplied walking and turning routines except for K23 and K18 which are custom routines for a faster turn but are somewhat less stable. These two routines are the only ones at the moment that cause him to fall over. I have also modified the walking forwards and backwards routines for continuous motion as per Tacoman's code example in an earlier post (thanks Tacoman). The CH1 <75 and CH1 >125 on channel 1 is used to create a dead zone near the TX stick centre. I also have multiple moves on the TX stick based on how far you move it.

I do see a few minor issues with this setup. I am not getting the delay you refer to but I do see two issues:

1. When he has been walking around for a good period of time (10 t0 15 minutes) I sometimes see the processor board reset and then loop in a reset. This means he judders and I have to turn him on and off to get him started again. I think it may be a brownout problem with the power as it is only after some of my custom rountines that move just about every servo at once.
2. He occasionally pauses mid movement for 2 to 3 seconds, but then carries on. This is as if the processor is busy processing something and the servo movement is to low down the interupt table (hope that makes sense). He does however always come out of this without any intervention from me.

As you can see from the code I am still allowing the IR unit to be used to access the other movements and this seems to work well. My intention is to move as many of the movements I want to the RX based system and remove the IR sensor.

I am not seeing the random delays I have seen you mention in your previous posts so am not sure what may be causing them. I hope some of the above is useful and helps address your issue. Feel free to send me any data/code you have and I'll happily take a look at it.

All the best

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by mochung » Mon Apr 10, 2006 7:16 pm

Post by mochung
Mon Apr 10, 2006 7:16 pm

Hi PEV, would you try this code and let me know if you experience any delay whenever you move the stick? To me the stick and the movement doesnt sync at all. I really need to wait for more than 10 sec just to get RN-1 CPU understand my TX command and get it up and running.

'== Robot walk ================================

GOTO AUTO
FILL 255,10000

DIM RCX AS BYTE
DIM RCY AS BYTE

CONST ID = 0 ' 1:0, 2:32, 3:64, 4:96,


PTP SETON
PTP ALLON

'== motor diretion setting ======================
DIR G6A,1,0,0,1,0,0
DIR G6B,1,1,1,1,1,1
DIR G6C,0,0,0,0,0,0
DIR G6D,0,1,1,0,1,0


'== motor start position read ===================
TEMPO 230
MUSIC "CDE"
GETMOTORSET G24,1,1,1,1,1,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,1,0
'== motor power on =============================
SPEED 5
MOTOR G24
GOSUB standard_pose
'================================================


'Gyro Setup
GYROSET G6A,0,1,1,0,0,0
GYROSET G6D,0,1,1,0,0,0

GYRODIR G6A,1,0,0,1,0,0
GYRODIR G6D,1,0,0,1,0,0

GYROSENSE G6A,0,200,200,0,0,0
GYROSENSE G6D,0,200,200,0,0,0

'================================================
MAIN:

RCX = RCIN(3)
RCY = RCIN(1)

'RC Walk


IF RCX >= 125 THEN ' RIGHT TURN
GOSUB right_turn
GOSUB standard_pose
ENDIF

IF RCX <= 75 AND RCX > 10 THEN 'LEFT TURN
GOSUB left_turn
GOSUB standard_pose
ENDIF

IF RCY > 125 THEN ' BACKWARD
GOSUB backward_walk
GOSUB standard_pose
ENDIF

IF RCY < 75 AND RCY > 40 THEN ' FORWARD
GOSUB forward_walk
GOSUB standard_pose
ENDIF

RETURN

'================================================
forward_walk:

SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

fwd_walk_main:

SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 114, 76, 145, 93, 90, 60,
'---------------------------------------
'left down
MOVE24 90, 56, 143, 122, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 113, 80, 145, 90, 90, 60,
MOVE24 90, 46, 163, 112, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 112, 80, 145, 90, 90, 60,

SPEED 10
'left center
MOVE24 100, 66, 141, 113, 100, 100, 90, 40, 80, , , , 100, 40, 80, , , , 100, 83, 156, 80, 100, 100,
MOVE24 113, 78, 142, 105, 90, 60, 100, 40, 80, , , , 100, 40, 80, , , , 90, 102, 136, 85, 114, 60,

SPEED 14
'right up

MOVE24 113, 76, 145, 93, 90, 60, 100, 40, 80, , , , 90, 40, 80, , , , 90, 107, 105, 105, 114, 60,

'right down
MOVE24 113, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 56, 143, 122, 114, 60,

SPEED 10
'right center
MOVE24 100, 83, 156, 80, 100, 100, 100, 40, 80, , , , 90, 40, 80, , , , 100, 66, 141, 113, 100, 100,
MOVE24 90, 102, 136, 85, 114, 60, 100, 40, 80, , , , 100, 40, 80, , , , 113, 78, 142, 105, 90, 60,

RCX = RCIN(3)
RCY = RCIN(1)

IF RCX >= 75 AND RCX <= 125 THEN

IF RCY <= 75 THEN
GOTO fwd_walk_main
ENDIF


SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,


RETURN
'================================================
'================================================
left_turn:
SPEED 6
MOVE G6D, 85, 71, 152, 91, 112, 60
MOVE G6A, 112, 76, 145, 93, 92, 60
MOVE G6C, 100, 40, 80, , , ,
MOVE G6B, 100, 40, 80, , , ,
WAIT

SPEED 9
MOVE G6A, 113, 75, 145, 97, 93, 60
MOVE G6D, 90, 50, 157, 115, 112, 60
MOVE G6B, 105, 40, 70, , , ,
MOVE G6C, 90, 40, 70, , , ,
WAIT

MOVE G6A, 108, 78, 145, 98, 93, 60
MOVE G6D, 95, 43, 169, 110, 110, 60
MOVE G6B, 105, 40, 70, , , ,
MOVE G6C, 80, 40, 70, , , ,
WAIT
RETURN
'================================================
'================================================
right_turn:
SPEED 6
MOVE G6A, 85, 71, 152, 91, 112, 60
MOVE G6D, 112, 76, 145, 93, 92, 60
MOVE G6B, 100, 40, 80, , , ,
MOVE G6C, 100, 40, 80, , , ,
WAIT

SPEED 9
MOVE G6D, 113, 75, 145, 97, 93, 60
MOVE G6A, 90, 50, 157, 115, 112, 60
MOVE G6C, 105, 40, 70, , , ,
MOVE G6B, 90, 40, 70, , , ,
WAIT

MOVE G6D, 108, 78, 145, 98, 93, 60
MOVE G6A, 95, 43, 169, 110, 110, 60
MOVE G6C, 105, 40, 70, , , ,
MOVE G6B, 80, 40, 70, , , ,
WAIT
RETURN
'================================================
'================================================

backward_walk:

SPEED 5
GOSUB backward_walk1

SPEED 13
GOSUB backward_walk2

SPEED 7
GOSUB backward_walk3
GOSUB backward_walk4
GOSUB backward_walk5

SPEED 13
GOSUB backward_walk6

SPEED 7
GOSUB backward_walk7
GOSUB backward_walk8
GOSUB backward_walk9

SPEED 13
GOSUB backward_walk2

SPEED 5
GOSUB backward_walk1

RETURN
'================================================

backward_walk1:
MOVE G6A, 85, 71, 152, 91, 112, 60
MOVE G6D,112, 76, 145, 93, 92, 60
MOVE G6B,100, 40, 80, , , ,
MOVE G6C,100, 40, 80, , , ,
WAIT
RETURN

backward_walk2:
MOVE G6A, 90, 107, 105, 105, 114, 60
MOVE G6D,113, 78, 145, 93, 90, 60
MOVE G6B, 90, 40, 80, , , ,
MOVE G6C,100, 40, 80, , , ,
WAIT
RETURN

backward_walk9:
MOVE G6A, 90, 56, 143, 122, 114, 60
MOVE G6D,113, 80, 145, 90, 90, 60
MOVE G6B, 80, 40, 80, , , ,
MOVE G6C,105, 40, 80, , , ,
WAIT
RETURN

backward_walk8:
MOVE G6A,100, 62, 146, 108, 100, 100
MOVE G6D,100, 88, 140, 86, 100, 100
MOVE G6B, 90, 40, 80, , , ,
MOVE G6C,100, 40, 80, , , ,
WAIT
RETURN

backward_walk7:
MOVE G6A,113, 76, 142, 105, 90, 60
MOVE G6D,90, 96, 136, 85, 114, 60
MOVE G6B,100, 40, 80, , , ,
MOVE G6C,100, 40, 80, , , ,
WAIT
RETURN

backward_walk6:
MOVE G6D,90, 107, 105, 105, 114, 60
MOVE G6A,113, 78, 145, 93, 90, 60
MOVE G6C,90, 40, 80, , , ,
MOVE G6B,100, 40, 80, , , ,
WAIT
RETURN

backward_walk5:
MOVE G6D,90, 56, 143, 122, 114, 60
MOVE G6A,113, 80, 145, 90, 90, 60
MOVE G6C,80, 40, 80, , , ,
MOVE G6B,105, 40, 80, , , ,
WAIT
RETURN

backward_walk4:
MOVE G6D,100, 62, 146, 108, 100, 100
MOVE G6A,100, 88, 140, 86, 100, 100
MOVE G6C,90, 40, 80, , ,,
MOVE G6B,100, 40, 80, , , ,
WAIT
RETURN

backward_walk3:
MOVE G6D,113, 76, 142, 105, 90, 60
MOVE G6A, 90, 96, 136, 85, 114, 60
MOVE G6C,100, 40, 80, , , ,
MOVE G6B,100, 40, 80, , , ,
WAIT
RETURN
'================================================
'================================================
standard_pose:

MOVE G6A,100, 76, 145, 93, 100, 100
MOVE G6D,100, 76, 145, 93, 100, 100
MOVE G6B,100, 30, 80, 100, 100, 100
MOVE G6C,100, 30, 80, 100, 100, 100
WAIT

RETURN
'================================================

Best,

Mo
Hi PEV, would you try this code and let me know if you experience any delay whenever you move the stick? To me the stick and the movement doesnt sync at all. I really need to wait for more than 10 sec just to get RN-1 CPU understand my TX command and get it up and running.

'== Robot walk ================================

GOTO AUTO
FILL 255,10000

DIM RCX AS BYTE
DIM RCY AS BYTE

CONST ID = 0 ' 1:0, 2:32, 3:64, 4:96,


PTP SETON
PTP ALLON

'== motor diretion setting ======================
DIR G6A,1,0,0,1,0,0
DIR G6B,1,1,1,1,1,1
DIR G6C,0,0,0,0,0,0
DIR G6D,0,1,1,0,1,0


'== motor start position read ===================
TEMPO 230
MUSIC "CDE"
GETMOTORSET G24,1,1,1,1,1,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,1,0
'== motor power on =============================
SPEED 5
MOTOR G24
GOSUB standard_pose
'================================================


'Gyro Setup
GYROSET G6A,0,1,1,0,0,0
GYROSET G6D,0,1,1,0,0,0

GYRODIR G6A,1,0,0,1,0,0
GYRODIR G6D,1,0,0,1,0,0

GYROSENSE G6A,0,200,200,0,0,0
GYROSENSE G6D,0,200,200,0,0,0

'================================================
MAIN:

RCX = RCIN(3)
RCY = RCIN(1)

'RC Walk


IF RCX >= 125 THEN ' RIGHT TURN
GOSUB right_turn
GOSUB standard_pose
ENDIF

IF RCX <= 75 AND RCX > 10 THEN 'LEFT TURN
GOSUB left_turn
GOSUB standard_pose
ENDIF

IF RCY > 125 THEN ' BACKWARD
GOSUB backward_walk
GOSUB standard_pose
ENDIF

IF RCY < 75 AND RCY > 40 THEN ' FORWARD
GOSUB forward_walk
GOSUB standard_pose
ENDIF

RETURN

'================================================
forward_walk:

SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

fwd_walk_main:

SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 114, 76, 145, 93, 90, 60,
'---------------------------------------
'left down
MOVE24 90, 56, 143, 122, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 113, 80, 145, 90, 90, 60,
MOVE24 90, 46, 163, 112, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 112, 80, 145, 90, 90, 60,

SPEED 10
'left center
MOVE24 100, 66, 141, 113, 100, 100, 90, 40, 80, , , , 100, 40, 80, , , , 100, 83, 156, 80, 100, 100,
MOVE24 113, 78, 142, 105, 90, 60, 100, 40, 80, , , , 100, 40, 80, , , , 90, 102, 136, 85, 114, 60,

SPEED 14
'right up

MOVE24 113, 76, 145, 93, 90, 60, 100, 40, 80, , , , 90, 40, 80, , , , 90, 107, 105, 105, 114, 60,

'right down
MOVE24 113, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 56, 143, 122, 114, 60,

SPEED 10
'right center
MOVE24 100, 83, 156, 80, 100, 100, 100, 40, 80, , , , 90, 40, 80, , , , 100, 66, 141, 113, 100, 100,
MOVE24 90, 102, 136, 85, 114, 60, 100, 40, 80, , , , 100, 40, 80, , , , 113, 78, 142, 105, 90, 60,

RCX = RCIN(3)
RCY = RCIN(1)

IF RCX >= 75 AND RCX <= 125 THEN

IF RCY <= 75 THEN
GOTO fwd_walk_main
ENDIF


SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,


RETURN
'================================================
'================================================
left_turn:
SPEED 6
MOVE G6D, 85, 71, 152, 91, 112, 60
MOVE G6A, 112, 76, 145, 93, 92, 60
MOVE G6C, 100, 40, 80, , , ,
MOVE G6B, 100, 40, 80, , , ,
WAIT

SPEED 9
MOVE G6A, 113, 75, 145, 97, 93, 60
MOVE G6D, 90, 50, 157, 115, 112, 60
MOVE G6B, 105, 40, 70, , , ,
MOVE G6C, 90, 40, 70, , , ,
WAIT

MOVE G6A, 108, 78, 145, 98, 93, 60
MOVE G6D, 95, 43, 169, 110, 110, 60
MOVE G6B, 105, 40, 70, , , ,
MOVE G6C, 80, 40, 70, , , ,
WAIT
RETURN
'================================================
'================================================
right_turn:
SPEED 6
MOVE G6A, 85, 71, 152, 91, 112, 60
MOVE G6D, 112, 76, 145, 93, 92, 60
MOVE G6B, 100, 40, 80, , , ,
MOVE G6C, 100, 40, 80, , , ,
WAIT

SPEED 9
MOVE G6D, 113, 75, 145, 97, 93, 60
MOVE G6A, 90, 50, 157, 115, 112, 60
MOVE G6C, 105, 40, 70, , , ,
MOVE G6B, 90, 40, 70, , , ,
WAIT

MOVE G6D, 108, 78, 145, 98, 93, 60
MOVE G6A, 95, 43, 169, 110, 110, 60
MOVE G6C, 105, 40, 70, , , ,
MOVE G6B, 80, 40, 70, , , ,
WAIT
RETURN
'================================================
'================================================

backward_walk:

SPEED 5
GOSUB backward_walk1

SPEED 13
GOSUB backward_walk2

SPEED 7
GOSUB backward_walk3
GOSUB backward_walk4
GOSUB backward_walk5

SPEED 13
GOSUB backward_walk6

SPEED 7
GOSUB backward_walk7
GOSUB backward_walk8
GOSUB backward_walk9

SPEED 13
GOSUB backward_walk2

SPEED 5
GOSUB backward_walk1

RETURN
'================================================

backward_walk1:
MOVE G6A, 85, 71, 152, 91, 112, 60
MOVE G6D,112, 76, 145, 93, 92, 60
MOVE G6B,100, 40, 80, , , ,
MOVE G6C,100, 40, 80, , , ,
WAIT
RETURN

backward_walk2:
MOVE G6A, 90, 107, 105, 105, 114, 60
MOVE G6D,113, 78, 145, 93, 90, 60
MOVE G6B, 90, 40, 80, , , ,
MOVE G6C,100, 40, 80, , , ,
WAIT
RETURN

backward_walk9:
MOVE G6A, 90, 56, 143, 122, 114, 60
MOVE G6D,113, 80, 145, 90, 90, 60
MOVE G6B, 80, 40, 80, , , ,
MOVE G6C,105, 40, 80, , , ,
WAIT
RETURN

backward_walk8:
MOVE G6A,100, 62, 146, 108, 100, 100
MOVE G6D,100, 88, 140, 86, 100, 100
MOVE G6B, 90, 40, 80, , , ,
MOVE G6C,100, 40, 80, , , ,
WAIT
RETURN

backward_walk7:
MOVE G6A,113, 76, 142, 105, 90, 60
MOVE G6D,90, 96, 136, 85, 114, 60
MOVE G6B,100, 40, 80, , , ,
MOVE G6C,100, 40, 80, , , ,
WAIT
RETURN

backward_walk6:
MOVE G6D,90, 107, 105, 105, 114, 60
MOVE G6A,113, 78, 145, 93, 90, 60
MOVE G6C,90, 40, 80, , , ,
MOVE G6B,100, 40, 80, , , ,
WAIT
RETURN

backward_walk5:
MOVE G6D,90, 56, 143, 122, 114, 60
MOVE G6A,113, 80, 145, 90, 90, 60
MOVE G6C,80, 40, 80, , , ,
MOVE G6B,105, 40, 80, , , ,
WAIT
RETURN

backward_walk4:
MOVE G6D,100, 62, 146, 108, 100, 100
MOVE G6A,100, 88, 140, 86, 100, 100
MOVE G6C,90, 40, 80, , ,,
MOVE G6B,100, 40, 80, , , ,
WAIT
RETURN

backward_walk3:
MOVE G6D,113, 76, 142, 105, 90, 60
MOVE G6A, 90, 96, 136, 85, 114, 60
MOVE G6C,100, 40, 80, , , ,
MOVE G6B,100, 40, 80, , , ,
WAIT
RETURN
'================================================
'================================================
standard_pose:

MOVE G6A,100, 76, 145, 93, 100, 100
MOVE G6D,100, 76, 145, 93, 100, 100
MOVE G6B,100, 30, 80, 100, 100, 100
MOVE G6C,100, 30, 80, 100, 100, 100
WAIT

RETURN
'================================================

Best,

Mo
mochung
Robot Builder
Robot Builder
User avatar
Posts: 10
Joined: Mon Apr 03, 2006 1:00 am

Post by Pev » Mon Apr 10, 2006 8:19 pm

Post by Pev
Mon Apr 10, 2006 8:19 pm

Mo

I couldn't get this to work at all the first time I loaded it - I had a check and I think I have found the issue. The main routine is only ever called once. I added a single line of code and it immediately started to work for forwards and backwards. Basically I added the line GOTO MAIN after the RC read in routines as follows:

'================================================
MAIN:

RCX = RCIN(4)
RCY = RCIN(1)

'RC Walk


IF RCX >= 125 THEN ' RIGHT TURN
GOSUB right_turn
GOSUB standard_pose
ENDIF

IF RCX <= 75 AND RCX > 10 THEN 'LEFT TURN
GOSUB left_turn
GOSUB standard_pose
ENDIF

IF RCY > 125 THEN ' BACKWARD
GOSUB backward_walk
GOSUB standard_pose
ENDIF

IF RCY < 75 AND RCY > 40 THEN ' FORWARD
GOSUB forward_walk
GOSUB standard_pose
ENDIF

GOTO MAIN ' This is the line I inserted


'================================================
forward_walk:


Once I had added this line the forwards and backwards wolking worked immediately and with no delay. I didn't try the left and right moves. Give this a try and let me know how it comes out

Pev
Mo

I couldn't get this to work at all the first time I loaded it - I had a check and I think I have found the issue. The main routine is only ever called once. I added a single line of code and it immediately started to work for forwards and backwards. Basically I added the line GOTO MAIN after the RC read in routines as follows:

'================================================
MAIN:

RCX = RCIN(4)
RCY = RCIN(1)

'RC Walk


IF RCX >= 125 THEN ' RIGHT TURN
GOSUB right_turn
GOSUB standard_pose
ENDIF

IF RCX <= 75 AND RCX > 10 THEN 'LEFT TURN
GOSUB left_turn
GOSUB standard_pose
ENDIF

IF RCY > 125 THEN ' BACKWARD
GOSUB backward_walk
GOSUB standard_pose
ENDIF

IF RCY < 75 AND RCY > 40 THEN ' FORWARD
GOSUB forward_walk
GOSUB standard_pose
ENDIF

GOTO MAIN ' This is the line I inserted


'================================================
forward_walk:


Once I had added this line the forwards and backwards wolking worked immediately and with no delay. I didn't try the left and right moves. Give this a try and let me know how it comes out

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by Pev » Mon Apr 10, 2006 8:20 pm

Post by Pev
Mon Apr 10, 2006 8:20 pm

Forgot to mention I had to change the RCIN statements to match my setup but other than that it's the code you sent me

Pev
Forgot to mention I had to change the RCIN statements to match my setup but other than that it's the code you sent me

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by Morbeious » Tue Apr 11, 2006 12:17 am

Post by Morbeious
Tue Apr 11, 2006 12:17 am

oops! 8O I forgot that.. see what 15 years away from programming gets ya..

PS. Never move to Management, you might get paid, but you loose all the knowledge.. lol
oops! 8O I forgot that.. see what 15 years away from programming gets ya..

PS. Never move to Management, you might get paid, but you loose all the knowledge.. lol
Robots Own/Operated: HeathKit Jr, OmniBot 2000, Lego MindStorms, RSV2, RoboNova-1
Morbeious
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 56
Joined: Tue Mar 21, 2006 1:00 am
Location: Metro Detroit, Michigan, USA

Post by mochung » Tue Apr 11, 2006 4:14 pm

Post by mochung
Tue Apr 11, 2006 4:14 pm

Hi PEV,

YES you did it!!! You helped me solve my delay problem. I must say thank you and Morbeious for the effort! Ha now I can program more moves with different stick position!! Yea!!

Best,

Mo
Hi PEV,

YES you did it!!! You helped me solve my delay problem. I must say thank you and Morbeious for the effort! Ha now I can program more moves with different stick position!! Yea!!

Best,

Mo
mochung
Robot Builder
Robot Builder
User avatar
Posts: 10
Joined: Mon Apr 03, 2006 1:00 am

Post by mochung » Tue Apr 11, 2006 4:23 pm

Post by mochung
Tue Apr 11, 2006 4:23 pm

Hi PEV,

YES you did it!!! You helped me solve my delay problem. I must say thank you and Morbeious for the effort! Ha now I can program more moves with different stick position!! Yea!!

Best,

Mo
Hi PEV,

YES you did it!!! You helped me solve my delay problem. I must say thank you and Morbeious for the effort! Ha now I can program more moves with different stick position!! Yea!!

Best,

Mo
mochung
Robot Builder
Robot Builder
User avatar
Posts: 10
Joined: Mon Apr 03, 2006 1:00 am

Post by Pev » Tue Apr 11, 2006 4:46 pm

Post by Pev
Tue Apr 11, 2006 4:46 pm

Cool, Glad we were able to help

Pev
Cool, Glad we were able to help

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by Morbeious » Tue Apr 11, 2006 9:57 pm

Post by Morbeious
Tue Apr 11, 2006 9:57 pm

Glad to help, now on to setting up single stick mixing on the TX. (lol)
Glad to help, now on to setting up single stick mixing on the TX. (lol)
Robots Own/Operated: HeathKit Jr, OmniBot 2000, Lego MindStorms, RSV2, RoboNova-1
Morbeious
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 56
Joined: Tue Mar 21, 2006 1:00 am
Location: Metro Detroit, Michigan, USA


13 postsPage 1 of 1
13 postsPage 1 of 1