Using an RC Controller with an Arduino [With code and wiring]

Поделиться
HTML-код
  • Опубликовано: 21 ноя 2024

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

  • @KordiakDG
    @KordiakDG Год назад +2

    I was struggling with a solution which I made in my AVR for whole day, but just a few minutes of watching your video solved my problem. Thank you:)

  • @Владимир-в8р7п
    @Владимир-в8р7п 3 года назад +6

    Finally I found what I need. Super, but part 2 is still not (The author does not abandon the topic. I really look forward to continuing. Thank you so much.

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

      Part 2 is live! I hope it gives you what you need

  • @shakejones
    @shakejones Месяц назад +1

    Great video+explanation+presentation! Thank you for sharing! Well done mate - NEW SUB 🙏🏻

  • @AmitsLife
    @AmitsLife Год назад +1

    I really appreciate your clear and concise video.

  • @gearscodeandfire
    @gearscodeandfire 4 месяца назад +1

    i needed this, this is great!

  • @AChi__
    @AChi__ 2 года назад +3

    Wow! You achieved superhero status with your level of crisp and crystal clear explanations. Yep, you earned yourself my humble sub as my token of thanks and appreciation. By chance, did you make the part 2 yet?

    • @AndyVickersNet
      @AndyVickersNet  2 года назад +2

      Thank you SO MUCH for the kind feedback! Part 2 just posted! I hope it lives up to part 1!

    • @AChi__
      @AChi__ Год назад

      @@AndyVickersNet Yes it did. Great stuff man 👍🏽👍🏽

  • @samiulhoque3769
    @samiulhoque3769 2 года назад +1

    This was really helpful! Any news on part 2 of this video?

    • @AndyVickersNet
      @AndyVickersNet  2 года назад +1

      Yes! This was released, please check it out!

  • @jeffrockow6282
    @jeffrockow6282 Год назад +1

    Very nice explanation. This is going to help me out a bunch. I realize there are 101 ways to code the same functionality, but I was wondering if you see an advantage in storing the PWM duration into RC_SHARED and then calling the rc_read_values subroutine to port the values into RC_VALUES. Why not just store the PWM duration directly into RC_VALUES and eliminate the rc_read_values subroutine altogether?

  • @frankhodges6734
    @frankhodges6734 3 года назад +2

    Good video and I look forward to part two.I like the plotter, hadn't seen anyone use that before. I have a project where I need to remotely control a 4000w hub motor that will be used as a winch. The motor's controller requires a 0 to 5v analog input signal to control the speed of the motor in one direction only so, I need the RC receiver PWM signal to enter the arduino nano that I have and come out as an analog signal. I understand the Nano does not have a real analog output but a pulsed output mimicking analog but, I was wondering if the tiny MCP4725 PWM to Analog module that I have could turn that into a smooth variable DC output. I've never done this sort of thing before and have spent some time scratching around the net trying to get some idea as to what code I would need and wondered if your code could be adapted. I would only be using one channel on my 3 channel receiver so would think the code would look rather spartan in comparison. Would you have any ideas on my problem please other than give-up {:-))

  • @crckdns
    @crckdns Год назад +1

    nice explanation,
    but does it work parallel?
    I mean, interrupt interrupts whole flow to compute a thing...
    what if at the same time second input comes in? or third? or all 4 channels?
    can it handle all 4 inputs at same time and provide proper reading/acting?

  • @chrisg.berdin3213
    @chrisg.berdin3213 3 года назад +2

    good instructions ,i need part2 of this video

    • @AndyVickersNet
      @AndyVickersNet  3 года назад +1

      If you have suggestions for part 2 let me know, I have been working on this video but I can certainly add more before I publish if you can think of something you would like to see!

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

      @@AndyVickersNet Great tutorial, thank you. I hope you continue to develop this series into a functional four wheel RC robotics platform. There are lots of impressive 4 wheel robot videos on youtube and some even use RC controls and have "skid steering" (turn in place) but I haven't seen a series that takes it from start to finish with the detail you're providing. Cheers!

  • @robertmurton7373
    @robertmurton7373 2 года назад +2

    Hello Andy have published part 2 yet. I was thinking of using a set frequency for pwm so I wouldn't need interrupts

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

      Second video is live! I am not sure what you mean with the set frequency. Is there a reason you want to remove the interrupts?

  • @vijaysulakhe5605
    @vijaysulakhe5605 16 дней назад

    Thanks, I am going to use Futaba FM 72.75 MHz Digital Proportional Radio Control to do experiment with Arduino, will it be OK?
    Kindly guide.

  • @bektinurwanto
    @bektinurwanto Год назад +1

    This metode to receive Ppm output from remote sir?

  • @ayushsalunkhe504
    @ayushsalunkhe504 2 года назад +1

    Great work sir keep it up

  • @charlmy8ightbuggy227
    @charlmy8ightbuggy227 2 года назад +1

    AWESOME Thank You

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

    Really helpful, thanks a lot!!
    how to control 2 DC motors (which has encoder with PWM ,DIR and A&B feedback pins) using RC receiver!!
    And Can the code support PPM
    (It would be great, Even if the video is about PPM and DIR pins only)
    thank you very much!!

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

      Part 2 has servo control in it. Setting up steppers would be very easy if you follow that example

  • @mertcapkin7263
    @mertcapkin7263 3 года назад +2

    Great video!

  • @muratozdemir1167
    @muratozdemir1167 Год назад

    Can you help with a code that can drive this project with a stepper motor?

  • @emperortech1312
    @emperortech1312 2 года назад +1

    Good

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

    How to make suspensi wit servo

  • @ARTronics-jy2gc
    @ARTronics-jy2gc 3 года назад

    hi bro nice presentaion. how to do codeing for rc car using arduino uno...........

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

      Part 2 of the RC controller series is up and that shows servos so it should get you half way there!

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

    I have and Arduino Nano, but it's not working, i change the pins from 18, 19, 20 and 21 to digital 8, 9, 10 and 12 but nothing- Help

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

      Only pins 2&3 are interrupts on the nano according to the arduino website:
      www.arduino.cc/reference/en/language/functions/external-interrupts/attachinterrupt/#:~:text=Uno%2C-,nano,-%2C%20Mini%2C%20other%20328%2Dbased

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

    Hello, sir can you help me in writing a Arduino code

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

      All the code is available on my website linked in the description

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

    I need part 2 ????

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

      Its been released! Please check it out and let me know if it helps!

  • @argentosebastian
    @argentosebastian Год назад

    I'm getting a "'rc_read_values' was not declared in this scope" error. Why??
    // Set the size of the arrays (increase for more channels)
    #define RC_NUM_CHANNELS 4
    // Set up our receiver channels - these are the channels from the receiver
    #define RC_CH1 0 // Right Stick LR
    #define RC_CH2 1 // Right Stick UD
    #define RC_CH3 2 // Left Stick UD
    #define RC_CH4 3 // Left Stick LR
    // Set up our channel pins - these are the pins that we connect to the receiver
    #define RC_CH1_INPUT 18 // receiver pin 1
    #define RC_CH2_INPUT 19 // receiver pin 2
    #define RC_CH3_INPUT 20 // receiver pin 3
    #define RC_CH4_INPUT 21 // receiver pin 4
    // Set up some arrays to store our pulse starts and widths
    uint16_t RC_VALUES[RC_NUM_CHANNELS];
    uint32_t RC_START[RC_NUM_CHANNELS];
    volatile uint16_t RC_SHARED[RC_NUM_CHANNELS];
    // Setup our program
    void setup() {

    // Set the speed to communicate with the host PC
    Serial.begin(9500);
    // Set our pin modes to input for the pins connected to the receiver
    pinMode(RC_CH1_INPUT, INPUT);
    pinMode(RC_CH2_INPUT, INPUT);
    pinMode(RC_CH3_INPUT, INPUT);
    pinMode(RC_CH4_INPUT, INPUT);
    // Attach interrupts to our pins
    attachInterrupt(digitalPinToInterrupt(RC_CH1_INPUT), READ_RC1, CHANGE);
    attachInterrupt(digitalPinToInterrupt(RC_CH2_INPUT), READ_RC2, CHANGE);
    attachInterrupt(digitalPinToInterrupt(RC_CH3_INPUT), READ_RC3, CHANGE);
    attachInterrupt(digitalPinToInterrupt(RC_CH4_INPUT), READ_RC4, CHANGE);
    }
    // Thee functions are called by the interrupts. We send them all to the same place to measure the pulse width
    void READ_RC1() {
    Read_Input(RC_CH1, RC_CH1_INPUT);
    }
    void READ_RC2() {
    Read_Input(RC_CH2, RC_CH2_INPUT);
    }
    void READ_RC3() {
    Read_Input(RC_CH3, RC_CH3_INPUT);
    }
    void READ_RC4() {
    Read_Input(RC_CH4, RC_CH4_INPUT);
    }
    // This function reads the pulse starts and uses the time between rise and fall to set the value for pulse width
    void Read_Input(uint8_t channel, uint8_t input_pin) {
    if (digitalRead(input_pin) == HIGH) {
    RC_START[channel] = micros();
    } else {
    uint16_t rc_compare = (uint16_t)(micros() - RC_START[channel]);
    RC_SHARED[channel] = rc_compare;
    }
    }
    void loop() {

    // read the values from our RC Receiver
    rc_read_values();
    }
    / this function pulls the current values from our pulse arrays for us to use.
    void rc_read_values() {
    noInterrupts();
    memcpy(RC_VALUES, (const void *)RC_SHARED, sizeof(RC_SHARED));
    interrupts();
    }
    // output our values to the serial port in a format the plotter can use
    Serial.print( RC_VALUES[RC_CH1]); Serial.print(",");
    Serial.print( RC_VALUES[RC_CH2]); Serial.print(",");
    Serial.print( RC_VALUES[RC_CH3]); Serial.print(",");
    Serial.println(RC_VALUES[RC_CH4]);