RC Remote Control Raspberry Pi Pico
Vložit
- čas přidán 25. 07. 2024
- The Raspberry Pi Pico does not come with any kind of wireless build-in, but that doesn't mean you can't control it without wires. You can easily add an RC controller such as ones used to control RC model Airplanes.
In this video I will explain about the type of controller I use and how you can connect the 6-channel receiver to a Raspberry Pi Pico and read the input signals using PWM.
The model I used is the Flysky FS-i6 which is relatively inexpensive controller for RC model planes. Although designed for model airplanes it can be used with other models and in this case to send signals to a Raspberry Pi Pico. You could also use other types of controllers such as those designed for cars or boats, as long as they provide a PWM output pulse typically used for controlling servo motors.
In the video I show how I used a logic analyser and digital oscilloscope to check the signal and how I set about creating the code to detect the PWM duty cycle on the Raspberry Pi Pico. This can then be used to control other devices such as robots or animatronics.
For more details and to download the example code see:
www.penguintutor.com/news/elec...
00:00 Introduction to RC controlled Pico
01:08 Flysky FS-i6 RC
02:28 RC servo motors
03:12 PWM for Analog voltage
03:32 PWM for Servo motor control
04:32 Viewing the waveforms on logic analyser
09:26 Viewing the waveforms on an oscilloscope
10:51 Checking the Pico datasheet
11:31 Wiring the RC receiver to the Raspberry Pi Pico
12:55 Example PWM duty cycle code
13:31 Modifying the code for multiple channels
14:08 Code demonstration
14:37 Future project using RC controller
Related videos:
About the Pico: • Raspberry Pi Pico - mi...
About PWM: • Model Train Automation...
Mecanum Omnidirectional Robot: • Mecanum Omnidirectiona... - Věda a technologie
I've now added another video which gives a better solution.
Please see this video: czcams.com/video/_Fz9lJXu2DE/video.html which shows how you can use I-Bus as a better alternative to PWM.
I've been trying to find out how to do the reverse of this and wondered if you had any pointers. Specifically, I would like to have my Raspberry Pi communicate to the servo receiver as if it was the RC controller. Does that RC controller (or other models you know of) have an interface that you can use to send commands to it. To be clear, instead of a human pushing the joysticks on the RC controller, I want to programmatically control my airplane from my Pi. Perhaps you know of a different transmitter/receiver pair which has a programatic interface if not. In the video at 8:59 you said "then you've go the programmable interface". Is this what you meant by that?
@@joireland it's not something I've tried. It should be possible but it may be a lot of work in trying to understand which control signals to send.
Firstly when I say programmable interface for the controller that is to allow buttons to be mapped to different codes, not so you can use microcontroller to send comments.
One solution is to have a microcontroller on both ends. This is most flexible but would need space and power on your aircraft for additional controller and power etc.
A better solution may be to get an RF transmitter designed to connect to a microcontroller that works at the same frequency as existing transmitter. Unfortunately that is not something I am particularly familiar with. It would mean needing to understand what signal you need to send. I expect there is documentation somewhere but it's likely going to be a lot of research unless you can find an example that someone has already done.
This is excellent. For a while I was trying to figure out how create my own controller and hack a drone. But controlling the controller using raspberry pi is definitely a better option. Thanks for taking the time to show and explain the change in the pulses.
This is amazing! Thanks for the video! just what I need for my engineering projects
Thanks for your video, that help me out, it is so nice to learn how to communicate pico with RC receiver... thank you ~
Congratulations this is a usefully video thanks
EXACTLY what I was after!
Can you create a code to read PPM channels?
Hi! If I'm trying to use a Jetson Nano (basically a Raspberry Pi 4), how can I do it?
It is possible, but difficult to read PWM on a Raspberry Pi. The advantage of a microcontroller is that it is able to read the pins in real-time.
To do the same on a Raspberry Pi needs responsive code, which would need to be implemented in a low level language.
There is another technique involving I-Bus. I've recently bought another receiver with I-Bus so I'll be investigating that in future, but I need to finish my current project first.
Did you manage to finish your robot? I am wondering about Flysky remote controller that you are using. Is it suitable for complex robots (mecannum wheeled cars, hexapods, humanoids) ? Pretty much all videos on youtube are using that controller for RC planes. Can't really see anyone using it for "normal" (crawling/walking/jumping) robots. And I wouldn't want to buy it just ot see that it is not suitable for robotics.
What BitScope hardware are you using? Thank you.
It's a Bitscope micro.
www.bitscope.com/product/BS05/
This looks like it might also work with a small drone as well.
Indeed - if you just wanted remote control then you could just wire the receiver directly to the drone, but using a Pico may allow it to make some other decisions if you wanted to add some custom logic in there. You would probably need to do some testing though, I'm not sure how well the Pico can handle multiple outputs and inputs simultaneously. It does have dual cores and PIO but you would need to respond quickly to signals to keep a drone flying correctly.
it can be connected to a raspberry pi 4?
Whilst is may be possible to read a PWM signal on a Raspberry Pi a microcontroller is better suited as it is better to read in real-time.
The use of i-bus receiver will probably work better, but I haven't had a chance to try that yet.
can i upgrade flysky fs i6 using resberry pi pico and whick pin i should connect on pico
What do you mean by upgrade?
If you mean to use the flysky with a Pico then you can either use the PWM signal as discussed in this video - or if you have an i-bus receiver then you can follow this guide: czcams.com/video/_Fz9lJXu2DE/video.html
If you mean upgrade the firmware on the controller then that's beyond the scope of what I've covered.
@@PenguinTutor I mean upgrade the firmware on the controller suing Resberry pi pico
@@mdmuntaharul6795 The Pico is used for connecting to the receiver, but you wouldn't normally use it for connecting directly to the controller. I would use a computer for that instead.