Adventures in Science: Using an RC Hobby Controller with Arduino

Поделиться
HTML-код
  • Опубликовано: 21 авг 2017
  • AVC homepage: avc.sparkfun.com/
    1 Channel Demo code: gist.github.com/ShawnHymel/52...
    Learning how to control motors and drive your robot is the first step in creating your combat bot. We look at how to read a pulse width signal from an RC receiver using an Arduino and convert that into a PWM signal for driving motors. We use only 1 channel in this video, as mixing channels for steering is saved for another episode.
  • НаукаНаука

Комментарии • 60

  • @jesusesquibel4181
    @jesusesquibel4181 6 лет назад +10

    As someone who is really interested in coding and physical computing, I really appreciate all of your videos. Thank you for taking the time to explain to those of us who are interested in growing.

    • @ShawnHymel
      @ShawnHymel 6 лет назад +1

      Glad to hear that they're helping! Keep tinkering and coding!

  • @domiflichi
    @domiflichi 6 лет назад +5

    Thank you thank you! This is almost exactly what I've been wanting to learn how to do for my latest project!

  • @jimbobillybob1959
    @jimbobillybob1959 6 лет назад +2

    Great break down! Keep these videos coming.

  • @Taran72
    @Taran72 5 лет назад +3

    Great Video! thank you for sharing the code.

  • @michaelsteinbach
    @michaelsteinbach 6 лет назад

    On my JR XY421, they use the same assembly for both sticks. It's pretty easy to take the controller apart and add a spring to the left stick if you want it to center like the right stick.

  • @moadtheconquer
    @moadtheconquer 6 лет назад +1

    Awesome work bro .. keep going

  • @naboulsikhalid7763
    @naboulsikhalid7763 2 года назад

    GOD bless you, at last I found it. My project to use RC controller to drive my skateboard. 100000 Thank you

  • @iamamazingist
    @iamamazingist 6 лет назад

    very nice and useful video,, clear explanation,, thanks,,

  • @charlespenny9611
    @charlespenny9611 6 лет назад +2

    Was having trouble and figured “someone has to of done this before right?”. Very helpful, very fun!

  • @agusbintarto
    @agusbintarto 3 года назад

    thank you for sharing the code.

  • @TeagueChrystie
    @TeagueChrystie 6 лет назад

    Fantastic. Thanks.

  • @teddymekbib5007
    @teddymekbib5007 4 года назад

    Thank you very much.

  • @TheTwtwo
    @TheTwtwo 6 лет назад

    A really fun way of doing this is using a falling or rising edge interrupt, and a PPM enabled reciever, you can decode 6 channels via 1 input.
    void pulseDetect(){
    pulsePrevious = pulseRising;
    pulseRising = micros();
    pulseLenght = micros() - pulsePrevious;
    if (pulseLenght > 3500 && pulseLenght < 20000 ){ // Sync pulse of CPPM Frame detection max fram length is about 20000 microseconds
    channel =0 ; // To store sync pulse value in ppmValue[0] , now channel 0 is set all other pulses will be read and stored, until next sync pulse.
    }
    ppmValue[channel] = pulseLenght;
    channel = channel+1;
    if (channel > 13){ //this allows incase code starts after sync all pulses will be dumped into these out of bounds channels.
    channel = 12;
    }

  • @BarefootBeekeeper
    @BarefootBeekeeper 6 лет назад

    Here's a question for anyone who knows: what happens with the trimmers on the transmitter when you convert it to Arduino? Can they be incorporated do they still do their job? If so, how are they connected? If not, how do you trim the quad before/during flight?

  • @nikken_s_f3200
    @nikken_s_f3200 3 года назад

    I like this!

  • @martinerzberger5419
    @martinerzberger5419 6 лет назад +2

    pulseIn blocks until the IO port goes high. So in this case, it's blocked for 19 out of 20ms. If you want to use the Arduino for more than just RC control (e.g. to drive some APA102 LEDs on the robot) then you have to use an interrupt handler for the RC pulse. Since this is not much more complex, I would never use pulseIn to read RC signals.

    • @ShawnHymel
      @ShawnHymel 6 лет назад

      Very true, and thanks for pointing it out. Interrupts are definitely the way to go, but pulseIn is a bit easier to explain to beginners if you're just driving some motors.

    • @LSUtiger607
      @LSUtiger607 6 лет назад

      Shawn Hymel . Could you do an additional video explaining interrupts? I've been struggling to read multiple PWMs while also doing computation on the arduino and driving outputs. For example, my stepper motor output behaves very erratically when I'm reading multiple PulseIn PWMs. Thanks.

    • @martinerzberger5419
      @martinerzberger5419 6 лет назад

      Yes, I agree, the code is easier to understand. I am a tad sensitive about this subject because I once wasted several days trying to understand why stuff did not work as expected. In the end it was pulseIn that blocked the Arduino way too long ;)

    • @martinerzberger5419
      @martinerzberger5419 6 лет назад

      @LSUtiger607: If you need more than one RC signal I would use a receiver that can output all channels over a combined line. This way you only need one port of the Arduino, and you have more processing power left. A (German) code sample for one particular type of signal (PPM, or Pulse-Pause-Modulation) is here: github.com/tinue/SUMO_Analyse

    • @ShawnHymel
      @ShawnHymel 6 лет назад

      @LSUtiger607 Good to know there's interest in interrupts. I will add it to my list of videos to make (I'd like to get through other basic programming concepts first, though). Geaux Tigers ;)

  • @CHUMODAN111
    @CHUMODAN111 3 года назад

    полезно. спасибо

  • @learnings...1448
    @learnings...1448 6 лет назад

    thank you for the great videos......
    can you create a video on how to manage power in the robot for battlebot.......
    really it is so hard to manage........

  • @jpsalis
    @jpsalis 5 лет назад +2

    Ooh boy, I went away with pwm receivers for Arduino, I needed too many channels and didn't want to buy a mega for extra interrupts. PPM and serial are a lot better I've seen, since they use a single output.

    • @JohnDoe-ir8te
      @JohnDoe-ir8te 5 лет назад

      Learn how to make an Arduino PCB and add PWM motor drivers like the tb6612

  • @AllThingsGundam
    @AllThingsGundam 6 лет назад

    Hello sparkfun, May I use 2 SparkFun Motor Driver - Dual TB6612FNG on 1 uno ardunio? This will be my first time making a robot for the beetle weight class and a robot period. Thanks Derek.

  • @reynery
    @reynery 5 лет назад

    The receiver for a FS-I6 is the same as this one?

  • @pobringengineer637
    @pobringengineer637 6 лет назад

    could you do a video about mixing 4 channel up tp 6 channel with arduino and rc

  • @abrahamrodriguez6462
    @abrahamrodriguez6462 3 года назад

    the creme of the creme

  • @casbremer7793
    @casbremer7793 4 года назад

    i am trying to use a helicopter receiver with the remote but with the code there is no min -255 and max 255 showing but only the big numbers

  • @christianparedes5625
    @christianparedes5625 4 года назад

    I love you!!!!

  • @RobertCowanDIY
    @RobertCowanDIY 6 лет назад

    Hey Shawn, are entering this bot for AVC? What weight class?

    • @ShawnHymel
      @ShawnHymel 6 лет назад

      I am not, since I'm having to run the Logistics division as a judge. Otherwise, I considered making a 1 lb bot. I know, a Robert vs. Shawn showdown would have been epic :) Are you entering?

    • @RobertCowanDIY
      @RobertCowanDIY 6 лет назад +1

      Bummer. Yeah, I'm registered. I'll be bringing my 1lb robot, Sgt. Cuddles (to defend the title from last year!) and a new 30 pounder, called crippling depression.

    • @ShawnHymel
      @ShawnHymel 6 лет назад

      Sweet. I'll have to sneak away at some point during AVC to check them out.

  • @jmahan47
    @jmahan47 5 лет назад +1

    Has the Demo and code for 2nd channel steering been posted?

    • @yptechtips2420
      @yptechtips2420 3 года назад

      ruclips.net/video/Bx0y1qyLHQ4/видео.html

  • @harshitjain4793
    @harshitjain4793 5 лет назад

    where should i suppose to connect the APWM and BPWM pins on the arduino

    • @rahulbgautam
      @rahulbgautam 4 года назад

      learn.sparkfun.com/tutorials/tb6612fng-hookup-guide?_ga=2.57332905.207522859.1591551093-2137521739.1591551093#hardware-setup

  • @frikkiesmit327
    @frikkiesmit327 6 дней назад

    Speedcontrollers can be expensive

  • @shahadatshishir3816
    @shahadatshishir3816 4 года назад

    Can you show, how we can control servo motors using PCA 9685 servo driver and a Radio Controller(Flysky CT6B)...?
    We are facing so much problems on this issue..😥😣

  • @saisravanichavva8578
    @saisravanichavva8578 2 года назад

    Can you please help me how the same joystick can be used to control 2 DC motors of 90v (heavy duty robot). As all the Dc motor drives are max rated up to 58v on the market.

  • @wanghe0001
    @wanghe0001 10 месяцев назад

    Not really understand the STBY_PIN =9, which l298n's pin should I connect from Arduino board digital PIN 9 ?

  • @HungNguyen-oz1jc
    @HungNguyen-oz1jc 3 года назад

    How do I power up the arduino if I don't use USB cable instead of an external battery coming form a 5V ESC connected to the Receiver?

    • @HanZie82
      @HanZie82 3 года назад

      If you are sure its 5V connect it to the Arduino 5V line. If you're not sure either dont use it or use the power in port. (on smaller models called Vin)

  • @joseantonioschannel
    @joseantonioschannel 2 года назад

    I'm using an L298N with an Arduino Uno r3, my RC controller is an Element6 with a paired receiver, and the code just doesn't want to play. Only one channel, forward; anyone else having this problem?

  • @lazarusmagellan2367
    @lazarusmagellan2367 4 года назад +2

    Could I set both sticks to operate multiple servos?

    • @user-ox1dr3ec7m
      @user-ox1dr3ec7m 3 года назад +1

      also wondering this

    • @HanZie82
      @HanZie82 3 года назад

      Yes, just make sure you name them differently.

    • @lazarusmagellan2367
      @lazarusmagellan2367 3 года назад

      @@HanZie82 thank you. I used them in replacement of a Johnson bar for a valve gear

  • @biggusmaximus1651
    @biggusmaximus1651 3 года назад

    but the signal pwm that received from receiver is unstable so you cant control the pwm is this true sir?

  • @saravanana5419
    @saravanana5419 3 года назад

    Hello, could you inform how to connect rxsr receiver to arduino?

    • @HanZie82
      @HanZie82 3 года назад

      Watch the video!

  • @procactus9109
    @procactus9109 6 лет назад

    Sooo, who's under the desk ?

  • @tpc-vids1589
    @tpc-vids1589 4 года назад

    I'm getting zero in between my values

  • @alimustafa2682
    @alimustafa2682 6 лет назад

    Cool ! first

  • @pepper669
    @pepper669 6 лет назад

    Excellent tuorial, except the war rhetoric.