I need to ask for a favour.
The last 2 month I have been working on a project for a theater company I volunteer for. I was asked to build the Chitty Chitty Bang Bang car. (Attached you will see a photo.) In addition to it looking like Chitty it needed to tilt, roll, up/down. For that we will be using pneumatics.
Two weeks ago they asked if it could be RC controlled. No small feat for something that size. I think I have all the necessary controls for the motors. The motion (tilt, roll, up/down) also is RC controlled by a 2nd controller.
What I need help with is to convert 4 PWM RC signals to relays. For example on 1 input Rely 1 ON at 0%, Rely 2 ON at 50% and Relay 3 ON at 100%. So basically 1 PWM to 3 or 4 digital outputs with programmable set points. I know .NET mf and the boards I have (cerbuino, G400HDR, etc) should be able to do that.
I have until Friday to get it done. (In addition to finishing the mechanical build.) Can anyone point me in the right direction. I just don’t have time right now to do the necessary research. Thanks so much.
Use SignalCapture class to measure the pulse-width. RC signal pulse-widths generally range from 1.5ms (for the centerpoint position) to 2.0ms for the maximum position, and 1.0ms for the minimum position. Based on the pulse width duration, you can fire the desired output pin.
Yep, agree, signalcapture to establish what the PWM limits are, and as that changes you can control digital outputs.
Or, go oldskool. Use the RC controls to control actual RC servos, and have the rotation of the servo switch in additional controls.
I don’t think you’ll be successful in using PWM to switch relays. Relays take significant time to switch on and off (in terms of PWM frequencies, at least…), and they produce significant back-emf each time they switch. Furthermore, you’ll run into wear issues (the little metal tab can only move back and forth so many times before it breaks off, and you’ll likely run into contact welding from arcing before that happens).
You might want to use PWM to switch MOSFETs. Your loads (motors) are inductive (and likely high-current) so make sure you understand the implications.
@ Godefroi I think you’re mis-interpreting how this RC system works.
An RC receiver generates a PWM output signal that translates to a servo rotation. The final “control” surface here is a relay that invokes some action in Chitty. The intent here was to use a RC transmitter to send a signal that then was output by the receiver and then switched in relays - when at 0% only relay 1 on, 50% relay 2 comes on, then 100% relay 3 comes on.
No need for a micro to do this. Just use and RC (resistor-capacitor) low-pass filter to convert the PWM to a DC voltage and use a comparator to compare it to a voltage set by a potentiometer.
I know you wanted 0%, 50% & 100% to do 3 things on one channel, but maybe these might help.
I don’t know if you have a multichannel remote, but if you do maybe this might help in a pinch.
Thanks so much for the comments. I didn’t get the motion portion done for opening night.
I have 3 more weekends after this weekend. So I still will need to get this done.
I don’t see anyway around using a controller. I have seen the relays but I really need multiple relays per channel.
Not having the time to research this right now, how many signal capture channels can a verb handle?
@ Brett - Ah, yes, seems you’re right. Makes much more sense to me now, and it’s not nearly so frightening
Thanks everyone for the help. I failed to get back and update this post.
The signalcapture command worked perfectly. I am reading the 4 RC signals with the cerbuino to control various functions of the Chitty car. I am using a Load Module to drive the pneumatic solenoids.
(The driving portion is a separate RC system.)
I have attached a link to a short video of the first night with the car being able to drive and “fly”. (the timing was a little rough.) Forgive the video and audio quality it was a cheap video camera in the balcony.
(Now time to get back to real work.)
@ skeller - Wow. Nice job. Spent a few years on the technical side of the theatre business before I got into computers, and that’s a great piece of work there. Well done.
@ skeller - FANTASTIC! That really deserves a much bigger write-up. I’ll DM you…
Agree, pictures and everything.