PWM to RS232

Hi all,

Just wondering if there is such a thing out there to convert PWM signals into RS232 commands?

Ryan

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • I think this might be what you're looking for.

    Let me know if you need anything else.
  • Hi Ryan,

    I've mentioned this before here at DIY drones (and I don't think I'm the only one to have done this ....)

    I have taken a stock ardupilot, soldered 2 wires on the back of the board to connect ch3 + ch4 to the mux input, and then have massaged, abused, and tweaked a version of the ardupilot firmware to do the following:

    1. Read 4 channels of PWM signal into the processor and store the most current values internally. The code uses an interrupt based approach so timing values are pretty tight and accurate, and PWM signals are read as fast as the receiver sends them. Thinking about how the system is laid out, I have additional DIO pins available so I think I could probably handle at least 6 channels in, maybe more if we really abuse the hardware design?

    2. At 50hz, the system broadcasts the PWM input (receiver) values out the RS232 port using a binary (or ascii) protocol. Currently I am modding my firmware to support a reading and reporting a couple of the available analog channels on the ardupilot. (i.e. pressure sensor, voltage sensor, etc.)

    3. The firmware also reads servo position commands (incoming on the serial port, from a host computer.) I don't let the ardupilot compute servo positions itself. All the autopilot / filter / pid / navigation / etc. smarts is upstream on the faster processor.

    4. The built in manual / autopilot safety switch function of the ardupilot is maintained. When in manual mode, the pilot has absolute direct control of all the servos at all times. In auto mode, the firmware positions the servos based on whatever the host computer is commanding.

    So this allows me to build an advanced autopilot around a higher power processor (like an ARM9 gumstix, or an MPC-5200 with hardware floating point). All the servo / pwm functionality is pushed out to a separate piece of hardware. I like this because my host computer can be just about anything that has a serial port (or a usb<->serial converter) ... my desktop PC, a laptop, a gumstix, maybe even god help us a Mac. :-)

    If your needs are more simple, there are plenty of devices that you can use to drive servos based on serial commands (search pololu.com for instance.) However, to my knowledge, I haven't found anything that can easily read an RC receiver and broadcast those values out an RS232 port, accept servo commands via the same RS232 port, and have the auto / manual safety switch all built into the same hardware. The $25 ardupilot does all this if you only need 4 channels in and out. The ardupilot mega should be able to handle 8 channels in and out (but can only auto/manual switch the first 4 of those channels.) If you need to switch or read or control more channels you might consider pasting on a second ardupilot.

    Regards,

    Curt.
This reply was deleted.

Activity

DIY Robocars via Twitter
RT @IndyAChallenge: Here is the ROS-based small-scale vehicle platform showing the ROS Visualization (Rviz) screen with multiple ROS nodes…
7 hours ago
DIY Robocars via Twitter
RT @IndyAChallenge: Here is Black & Gold Autonomous Racing's simulated racecar running a lap @IMS and showing the team's code overtaking ot…
7 hours ago
DIY Robocars via Twitter
7 hours ago
DIY Robocars via Twitter
RT @donkey_car: New Maintainers! Donkey Car 4.0 and more! Here is our September Newsletter! https://donkeycar.substack.com/p/september-donkey-newsletter?r=2ji2t&utm_campaign=post&utm_medium=web&utm_source=copy
8 hours ago
DIY Robocars via Twitter
RT @chr1sa: Kinda cool that we just hit 2,500 members of our Bay Area self-driving car racing league. More than 10k globally. Fast, cheap…
8 hours ago
DIY Robocars via Twitter
RT @chr1sa: Our next @DIYRobocars virtual AI car race is next Saturday. Compete from home using the @donkey_car simulator -- no physical ca…
yesterday
DIY Robocars via Twitter
RT @RoboticMasters: Students from @Sydney_Uni working hard on improvements and changes to @donkey_car simulator. @diyrobocars @adafruit…
yesterday
DIY Robocars via Twitter
Practice virtual race this Saturday; the real thing will be on Oct 3 https://www.meetup.com/DIYRobocars/
Wednesday
DIY Robocars via Twitter
Wednesday
Derrick Davies liked lisa TDrones's profile
Wednesday
DIY Robocars via Twitter
Sep 21
DIY Robocars via Twitter
RT @SahikaGenc: AWS DeepRacer & Hot Wheels Track https://youtu.be/4H0Ei07RdR4 via @YouTube
Sep 14
DIY Robocars via Twitter
Sep 8
DIY Robocars via Twitter
RT @davsca1: We are releasing the code of our Fisher Information Field, the first dedicated map for perception-aware planning that is >10x…
Sep 8
DIY Robocars via Twitter
RT @SmallpixelCar: How this works: 1)object detection to find cones in single camera image, 30 frames/sec on @NVIDIAEmbedded Xavier. 2)comp…
Sep 8
DIY Robocars via Twitter
RT @SmallpixelCar: Use two color cones to guide the robocar. No map needed, on onsite training needed. Just place the cones and it will fol…
Sep 7
More…