Adventures in Science: Using an RC Hobby Controller with Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 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.
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 59

  • @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.

  • @naboulsikhalid7763
    @naboulsikhalid7763 2 ปีที่แล้ว

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

  • @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.

  • @Taran72
    @Taran72 5 ปีที่แล้ว +3

    Great Video! thank you for sharing the code.

  • @charlespenny9611
    @charlespenny9611 5 ปีที่แล้ว +2

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

  • @moad8baddi
    @moad8baddi 6 ปีที่แล้ว +1

    Awesome work bro .. keep going

  • @iamamazingist
    @iamamazingist 6 ปีที่แล้ว

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

  • @agusbintarto
    @agusbintarto 3 ปีที่แล้ว

    thank you for sharing the code.

  • @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 ;)

  • @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

  • @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;
    }

  • @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........

  • @TeagueChrystie
    @TeagueChrystie 6 ปีที่แล้ว

    Fantastic. Thanks.

  • @wanghe0001
    @wanghe0001 9 หลายเดือนก่อน

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

  • @teddymekbib5007
    @teddymekbib5007 4 ปีที่แล้ว

    Thank you very much.

  • @saisravanichavva8578
    @saisravanichavva8578 ปีที่แล้ว

    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.

  • @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

  • @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

  • @PhilipChandler
    @PhilipChandler 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!

  • @jmahan47
    @jmahan47 5 ปีที่แล้ว +1

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

    • @yptechtips2420
      @yptechtips2420 3 ปีที่แล้ว

      th-cam.com/video/Bx0y1qyLHQ4/w-d-xo.html

  • @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..😥😣

  • @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

  • @biggusmaximus1651
    @biggusmaximus1651 2 ปีที่แล้ว

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

  • @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

  • @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.

  • @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)

  • @CHUMODAN111
    @CHUMODAN111 3 ปีที่แล้ว

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

  • @abrahamrodriguez6462
    @abrahamrodriguez6462 3 ปีที่แล้ว

    the creme of the creme

  • @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 3 ปีที่แล้ว

    I'm getting zero in between my values

  • @alimustafa2682
    @alimustafa2682 6 ปีที่แล้ว

    Cool ! first

  • @pepper669
    @pepper669 6 ปีที่แล้ว

    Excellent tuorial, except the war rhetoric.