Shop OBEX P1 Docs P2 Docs Learn Events
Radio Control — Parallax Forums

Radio Control

SpeakerSpeaker Posts: 34
edited 2006-12-13 18:50 in Robotics
1.0ms full reverse.· 1.5ms stop.· 2.0ms full forward.· Is this the only standard, or one among many?· Is this same format used between xmtr and rcvr?· What about an RC airplane?· With a unidirectional motor, is it a special motor speed controller which ignores anything below 1.5ms?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-20 16:39
    Standard servos use a pulse width from 1.0ms to 2.0ms for their full range of motion, commonly 180 degrees. Many servos have a wider range of motion, some with a wider pulse width (maybe from 0.5 to 2.5ms). Continuous motion servos are standard servos modified to remove the position feedback to the servo mechanism. They typically will stop with a pulse width of 1.5ms and will go in one direction for shorter pulses and the other direction for longer pulses, usually with increasing speed the further away they are from 1.5ms. Most of these do have an adjustment to set the stop pulse width. Usually between transmitter and receiver, the same pulse width is used although they commonly have multiple channels with several pulses combined in time.

    I've not heard of a unidirectional servo motor. There are some motor controllers that accept servo pulses for control of a DC motor. It may be that they can be set for unidirectional use in which case they probably ignore pulses that would be too short or too long.
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-10-20 16:42
    That's the standard that is used on Futaba servo and RC radio gear. I believe it's pretty generally the standard for aviation based, or even ESC servo's.

    My understanding is, in model aviation or R/C car use the transmitter sends out a repeated signal reflecting the positions of the joysticks on the 'remote'. And 1.0 mSec (or a little less, actually) is 'far left', and 2.0 mSec is 'far right' (I could have the directions reversed, but you get the idea). 1.5 mSec is 'centered'.

    So, the 'remote' is sending multiple 'channels' of these signals. The RC reciever on the plane recieves these signals, and breaks them out into their 'channels' -- Aileron, rudder, etc -- and sends these signals to the connected Servo's. The electronics in the Servo's then move the output shaft position to match the commanded input pulse width -- and there you go.

    I haven't personally had to use an ESC yet (Electronic Speed Control), so you'd probably have to look at the documentation for one to see how it interprets this 'command signal'.

    Now, the "Modified" servo's are modified so they don't just swing through 180 degrees, but instead spin forward or reverse. The 'modification' removes any mechanical stops preventing full rotation, and disconnects the feed-back variable resistor in the Servo, so the SERVO alway's thinks the shaft is at 'center point'. Command full left, and the servo spins the shaft continuously in the full-left direction. Command 1.5 mSec, and the servo thinks the shaft is centered and stops. Command 1.0 mSec, and the servo spins the shaft continuously in the full-right direction.

    Since this signal IS used between the Rcvr and its servo's, in theory you can put a BS2 between the Rcvr and its servo's. The BS2 recieves (with a PULSIN) what the Rcvr is commanding, and then decides what to send on to the Servo's (with a PULSOUT).
  • ZootZoot Posts: 2,227
    edited 2006-10-21 01:08
    Just my two cents -- I would check your actual transmitter and see what pulses you get when you swing the joystick(s) back and forth (hook up receiver signal pins with resistors to Stamp pins and use PULSIN).

    Some of the transmitter/receivers I've used generate values pretty close to 1.0 - 1.5 - 2.0 MS, but some have varied as much as 10-20 percent... the current transmitter/receiver I'm using gives me real values of aprox 1.15 MS - 1.9 MS. If you know what values you are really getting, then you can "map" those values to the full forward/reverse pulse values of your servos, motor controller, whatever. You can also set your trims on the joysticks to give you a good center (off) value.
    Additionally, when a transmitter is turned off, depending on the receiver, one or more channels will go to "0" -- this is a way you can have your program check to see if the transmitter is actually turned on (if you are getting "0" on any of your channels the transmitter is off or you have a bad connection -- either way your platform is not receiving signal from the remote at that moment).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • PureGrainPureGrain Posts: 21
    edited 2006-11-24 20:53
    Zoot said...
    Just my two cents -- I would check your actual transmitter and see what pulses you get when you swing the joystick(s) back and forth (hook up receiver signal pins with resistors to Stamp pins and use PULSIN).

    Some of the transmitter/receivers I've used generate values pretty close to 1.0 - 1.5 - 2.0 MS, but some have varied as much as 10-20 percent... the current transmitter/receiver I'm using gives me real values of aprox 1.15 MS - 1.9 MS. If you know what values you are really getting, then you can "map" those values to the full forward/reverse pulse values of your servos, motor controller, whatever. You can also set your trims on the joysticks to give you a good center (off) value.
    Additionally, when a transmitter is turned off, depending on the receiver, one or more channels will go to "0" -- this is a way you can have your program check to see if the transmitter is actually turned on (if you are getting "0" on any of your channels the transmitter is off or you have a bad connection -- either way your platform is not receiving signal from the remote at that moment).

    How can·I connect this to the BOE? I have some small emitter and reciever I scalped from some of my kids toys. I wanted to test too see if I can use them somehow to make this thing work. Keep in mind I am a total newb to this stuff.
  • Randy EvansRandy Evans Posts: 24
    edited 2006-11-25 15:28
    ESC come in two flavors: Reversable and non-reversable. The reversable ones work just like a servo. When the stick is in the middle the receiver sends 1.5ms pulses to it and either nothing goes to the motor or the lower half of it's h-bridge turns on for braking. As you push the stick forward. the receiver sends out larger pulses (up to 2.0ms) and the ESC's h-bridge turns on in one direction with increasing PWM. Rush the stick back and the h-bridge reverses. I tried replacing the continuous servos in my BOE-bot with 2 ESCs and 2 motors and hooked the ESCs to P12 and P13 (where the servos went) and it worked perfectly. I did have to use a separate battery for the motors.

    Randy
  • LawsonLawson Posts: 870
    edited 2006-11-30 07:17
    Yes this same format is used between the Transmitter and Reciever of most AM and FM RC equipment. If you poke arround with a oscillascope on the reciever or transmitter you will find one pin with a signal that consists of a "frame start pulse" that is longer than 2ms followed by the channel one pulse, then the channel two pulse, etc. This frame then repeats at 50-70Hz depending on the transmitter.
  • RickCRickC Posts: 7
    edited 2006-12-02 02:55
    Just wondering if this works better than the ir remote does?
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-12-03 22:02
    Absolutely it works much better. Greater range, more dependable. It also costs around $80 for a cheap transmitter -- some multi-channel transmitters are over $200. So IR is better when all you've got is $20 or so for parts.
  • slamerslamer Posts: 52
    edited 2006-12-04 21:23
    RC control of the Toddler with an Airplane radio.

    '
    [noparse][[/noparse] Title ]
    ' Toddler Program 43.1: Turning with Radio commands
    ' Demonstrates basic turning process which requires four movements
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    '
    [noparse][[/noparse] I/O Definitions ]
    TiltServo······ CON···· 13····················· ' Tilt servo on P12
    StrideServo···· CON···· 12····················· ' Stride servo on P13
    '
    [noparse][[/noparse] Constants ]
    MoveDelay······ CON···· 15····················· ' in micrcoseconds
    TiltStep······· CON···· 9······················ ' TiltServo step size set value 5-9
    StrideStep····· CON···· 9······················ ' StrideServo step size set value 5-9
    RightTilt······ CON···· 620···················· ' Tilt limits
    CenterTilt····· CON···· 750
    LeftTilt······· CON···· 880
    RightStride···· CON···· 650···················· ' Stride limits
    CenterStride··· CON···· 750
    LeftStride····· CON···· 850
    '
    [noparse][[/noparse] Variables ]
    MoveLoop······· VAR···· Nib···················· ' Loop for repeat movements
    Pulses········· VAR···· Word··················· ' Pulse variable
    CurrentTilt···· VAR···· Word
    CurrentStride·· VAR···· Word
    NewValue······· VAR···· Word
    Dx············· VAR···· Pulses
    Mx············· VAR···· Word
    Direction······ VAR···· Word
    Turn··········· VAR···· Word
    Checktime······ VAR···· Word
    '
    [noparse][[/noparse] EEPROM Data ]
    '
    ' The following state tables are lists of movement state numbers.
    ' A xx indicates the end of a list.
    ' These are used with the Movement routine.
    TL············· CON···· 0
    TC············· CON···· 1
    TR············· CON···· 2
    SL············· CON···· 3
    SC············· CON···· 4
    SR············· CON···· 5
    xx············· CON···· 255
    WalkForward···· DATA··· TR, SL, TL, SR, xx
    WalkBackward··· DATA··· TR, SR, TL, SL, xx
    TurnLeft······· DATA··· TL, SR, TC, SL, xx
    WideTurnLeft··· DATA··· TL, SR, TC, SL, TR, SL, TL, SR, xx
    TurnRight······ DATA··· TR, SL, TC, SR, xx
    PivotRight····· DATA··· TR, SL, TC, SR, TL, SL, TC, SR, xx
    PivotLeft······ DATA··· TL, SR, TC, SL, TR, SR, TC, SR, xx
    FinishForward·· DATA··· TR, SC, TC, xx
    '
    [noparse][[/noparse] Main Routine ]
    ······ GOSUB ResetCC
    ··· Direction = 766
    ··· Turn = 766
    ··· Again:
    ··· Direction = 766
    ··· Turn = 766
    ··· Checktime = 0
    ··· PULSIN 1,1, Direction 'measure· positive pulse pin 1
    ··· PULSIN 2,1, Turn 'Measure positive pulse pin 2
    ··· 'Use (1) FOR logic HIGH OR (0) FOR logic LOW
    ··· 'IF Time=0 THEN· cleanup·· 'if 0 try again
    ··· 'IF time=1 THEN cleanup
    ··· RCTIME 1,1,Checktime
    ··· 'test for valid signal with rctime
    ··· IF Direction· > 1000 AND Direction < 1040 THEN Forward
    ··· IF Direction <· 600 AND Direction > 490 THEN· Backward
    ··· IF Turn· > 1000 AND Turn < 1040 THEN Slowright
    ··· IF Turn <· 600 AND Turn > 490 THEN Slowleft
    ··· 'IF Checktime· > 1040 THEN cleanup
    ··· 'IF Checktime <· 485 THEN cleanup
    ··· GOTO Again
    Main_Program:
    · GOSUB ResetCC
    ··· Forward:
    ··· 'FWD walking
    ···· 'FOR MoveLoop = 1 TO 2
    ····· Mx = WalkForward
    ····· GOSUB Movement
    ··· 'NEXT
    ···· Mx = FinishForward
    · GOSUB Movement
    ··· RETURN
    ··· Backward:
    ····· 'Bkwrd walking
    ···· 'FOR MoveLoop = 1 TO 2
    ····· Mx = WalkBackward
    ····· GOSUB Movement
    ····· Mx = FinishForward
    · GOSUB Movement
    ··· 'NEXT
    ··· RETURN
    ··· Slowright:
    ······ GOSUB ResetCC
    ····· 'Quick right turn
    ··· FOR MoveLoop = 1 TO 5
    ····· Mx = PivotRight
    ····· GOSUB Movement
    ··· NEXT
    ··· RETURN
    ····· Slowleft:
    ···· 'Quick· left turn
    ··· FOR MoveLoop = 1 TO 5
    ····· Mx = PivotLeft
    ····· GOSUB Movement
    ··· NEXT
    ···· RETURN
    ····· GOSUB ResetCC
    ······ 'Slow right turn
    ··· 'FOR MoveLoop = 1 TO 5
    ····· Mx = TurnRight
    ····· GOSUB Movement
    ··· 'NEXT
    ··· RETURN
    ··· 'Slow left turn
    ··· GOSUB ResetCC
    ··· 'FOR MoveLoop = 1 TO 5
    ····· Mx = TurnLeft
    ····· GOSUB Movement
    ··· 'NEXT
    ··· RETURN

    ··· 'FOR MoveLoop = 1 TO 5
    ····· 'Mx = WideTurnLeft
    ····· 'GOSUB Movement
    ··· 'NEXT
    · Mx = FinishForward
    · GOSUB Movement
    END

    '
    [noparse][[/noparse] Subroutines ]
    '
    Movement: Move feet using DATA table referenced by Mx
    '
    ' Input: Mx = table index, table ends in xx
    Movement:
    · READ Mx, Dx·································· ' read next action
    · Mx = Mx + 1
    · IF Dx = xx THEN MovementDone················· ' skip if end of list
    · GOSUB DoMovement····························· ' execute movement
    · GOTO Movement································ ' loop until done
    DoMovement:
    · BRANCH Dx,[noparse][[/noparse]TiltLeft,TiltCenter,TiltRight,StrideLeft,
    ··············· StrideCenter,StrideRight]
    ··············································· ' will fall through if
    ··············································· ' invalid index
    MovementDone:
    · RETURN

    ' ----· Movement routines can be called directly ----
    TiltLeft:
    · NewValue = LeftTilt
    · GOTO MovementTilt
    TiltCenter:
    · NewValue = CenterTilt
    · GOTO MovementTilt
    TiltRight:
    · NewValue = RightTilt
    MovementTilt:
    · FOR Pulses = CurrentTilt TO NewValue STEP TiltStep
    ··· PULSOUT TiltServo,·· Pulses
    ··· PULSOUT StrideServo, CurrentStride
    ··· PAUSE MoveDelay
    · NEXT
    · CurrentTilt = NewValue
    · RETURN
    StrideLeft:
    · NewValue = LeftStride
    · GOTO MovementStride
    StrideCenter:
    · NewValue = CenterStride
    · GOTO MovementStride
    StrideRight:
    · NewValue = RightStride
    MovementStride:
    · FOR Pulses = CurrentStride TO NewValue STEP StrideStep
    ··· PULSOUT TiltServo,·· CurrentTilt
    ··· PULSOUT StrideServo, Pulses
    ··· PAUSE MoveDelay
    · NEXT
    · CurrentStride = NewValue
    · RETURN

    '
    Move feet to initial center position
    ResetCC:
    · CurrentTilt·· = CenterTilt
    · CurrentStride = CenterStride
    · FOR Pulses = 1 TO 100 STEP StrideStep
    ··· PULSOUT TiltServo, CenterTilt
    ··· PULSOUT StrideServo, CenterStride
    ··· PAUSE MoveDelay
    · NEXT
    DoReturn:
    · RETURN

    Post Edited By Moderator (Chris Savage (Parallax)) : 12/13/2006 9:04:40 PM GMT
  • WarrlokWarrlok Posts: 77
    edited 2006-12-13 16:50
    allanlane5 said...
    That's the standard that is used on Futaba servo and RC radio gear. I believe it's pretty generally the standard for aviation based, or even ESC servo's.

    My understanding is, in model aviation or R/C car use the transmitter sends out a repeated signal reflecting the positions of the joysticks on the 'remote'. And 1.0 mSec (or a little less, actually) is 'far left', and 2.0 mSec is 'far right' (I could have the directions reversed, but you get the idea). 1.5 mSec is 'centered'.

    So, the 'remote' is sending multiple 'channels' of these signals. The RC reciever on the plane recieves these signals, and breaks them out into their 'channels' -- Aileron, rudder, etc -- and sends these signals to the connected Servo's. The electronics in the Servo's then move the output shaft position to match the commanded input pulse width -- and there you go.

    I haven't personally had to use an ESC yet (Electronic Speed Control), so you'd probably have to look at the documentation for one to see how it interprets this 'command signal'.

    Now, the "Modified" servo's are modified so they don't just swing through 180 degrees, but instead spin forward or reverse. The 'modification' removes any mechanical stops preventing full rotation, and disconnects the feed-back variable resistor in the Servo, so the SERVO alway's thinks the shaft is at 'center point'. Command full left, and the servo spins the shaft continuously in the full-left direction. Command 1.5 mSec, and the servo thinks the shaft is centered and stops. Command 1.0 mSec, and the servo spins the shaft continuously in the full-right direction.

    Since this signal IS used between the Rcvr and its servo's, in theory you can put a BS2 between the Rcvr and its servo's. The BS2 recieves (with a PULSIN) what the Rcvr is commanding, and then decides what to send on to the Servo's (with a PULSOUT).
    weeeee, yes u can use ur rc reciever with a bs2 here some code i found· .dont know why u would use a resistor?. use caution with toy rx,s some of them may opperate at higher voltages and with relays instead of esc,s or h-bridges. the standard rc/rx the ones u can hook a servo up too work when hooked up strait to the boe,mine did

    Post Edited (Warrlok) : 12/13/2006 5:05:28 PM GMT
  • ZootZoot Posts: 2,227
    edited 2006-12-13 18:50
    Using a resistor between any device capable of producing current and your Stamp pin will help prevent short-circuit (possibly damaging your Stamp) if that pin were ever to be set to be an OUTPUT.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
Sign In or Register to comment.