The Craftmans Shop > Radio Control Models
Bruder Manitou 2150 - RC conversion
ddmckee54:
I ordered some more stuff last night, an assortment of 5 colors of both 3mm and 5mm LED's, a couple of Arduino Nano development kits, and a couple extra Nanos. It's Christmas time, cut me some slack.
I used to program PLC's in industrial control systems as a living for many years. That was, I did the programming until the higher-ups decided that I should have minions to do the programming and that I should be sure they did it right. I don't even remember how many programming languages I've learned over the last 30+ years, but I can handle one more.
I've never done any Arduino programming, but I know that I've used it, one of my 3D printers is a Prusa clone and is running on a version of Marlin. I think that I've come up with a way that I can use an Arduino Nano to monitor 2 of the receiver channels and operate some lights in a mostly realistic manner. As Baldric would say, "Here's my clever plan M'lord."
I believe that a Nano has 14 digital I/O pins that can be configured as either inputs or outputs. I'll be using 2 pins as inputs to monitor the 2 receiver channels. That leaves me with up to 12 digital pins that I can use for outputs, that's a lot of different lights. The maximum load for a Nano output channel is 40 mA, but 20 mA is recommended. That 20 mA will happily drive most LED's, just gotta' remember to use a current limiting resistor or we're gonna' let the MAGIC SMOKE out of something. I've found that using an Arduino to monitor an RC channel is a fairly trivial thing to do. The typical RC system uses a separate pulse for each channel and these pulses will vary in length from 1-2 milli-seconds, depending on the transmitter's stick position. There's lots of open-source Arduino sketches out there on the ole' Interweb to do the monitoring, just grab one, copy, paste and edit.
I'll use the Arduino to monitor what would be the aileron and elevator channels for an RC airplane. For this model I'll use the aileron channel to control left/right steering and the elevator channel to control forward/reverse direction and speed. The way I figure it, by monitoring these 2 channels I'll be able to get semi-realistic operation for these lights:
Work lights
Headlights/Tail lights
Brake lights
Turn signals
Back-up lights
Rotating warning beacons
Work lights - This one will be the least realistic. If the power is on, and the transmitter's on, and there's no forward/reverse motion, then turn on the work lights. You don't really need the work lights on if you are inching the unit into position, or moving the unit from site to site. I suppose that I could add a daylight sensor into this too, I've got a few I/O pins to spare yet. Don't need no work lights if it's high-noon.
Headlights/Tail lights - If there's forward/reverse motion, then turn on these lights. Day-light don't matter, like the Wal-Mart drivers - Lights On for Safety.
Brake lights - It there is forward/reverse motion, and if the absolute value of the speed decreases X amount, and the turn signal is off (or if the turn signal is on and the blink is on), then turn on the brake lights for a short time? The X amount of decrease should keep the brake lights from turning on due to normal noise in the system. I'll make this brake light time on a variable that I can play with until it feels right, probably start it at about 1-2 seconds.
Turn signals - If there's forward/reverse motion, and if the speed is greater than X, and the left/right stick is not centered, and blink is on, then turn on the appropriate turn signal until the stick is centered. The "blink" will allow me to use one set of timers for ANY light that needs to blink at the same rate. I'm using the speed variable to keep the turn signals from being turned on at low speeds. I've rarely seen turn signals used in a construction site. This logic will also take into account whether this is a front turn signal where I will need to turn on/off a separate light, or the rear turn signal where I will need to turn on/off the appropriate brake light. The biggest glitch that I can see in this one is that you won't be able to signal your intentions. Instead you'll be that irritating guy the turns on his turn signal AFTER he's started turning the corner. Definitely won't pass driving school.
Back-up lights - If direction is reverse, the turn on the back-up lights.
Rotating warning beacons - I'll use these to indicate when the unit is traveling at speed. If there is forward/reverse motion and the speed is greater than X, turn on the beacons.
Any better ideas?
Don
kayzed1:
That sounds very interesting :zap: :clap: well that would be the outcome of me trying to do it.. Hydraulics and mechanics are ok but those little electronicy thingies...
ddmckee54:
kayzed1:
With me it was the other way around, hydraulics and pneumatics baffled me. Then I started to think of them as electrical/electronic circuits. Now I can find my way around in either, but I also know when to throw in the towel and talk to a pro.
Besides, these Nanos are almost dirt cheap. So if I let the magic smoke out of one or two, I'm not out that much. They will be run either from the 5 volts that's available on a USB for testing, or from a 2S Lipo battery pack in the model at about 6-7 volts. If I throw a 1/4 amp or 1/2 amp fuse in to protect the wiring not too much can happen, other than a little smoke that will smell REALLY bad.
Don
ddmckee54:
Some neat stuff vitally important material arrived over the weekend, I got my 6 position 2 pole rotary switches from Digi-Key, they're cute LITTLE suckers.
I designed a bracket that will hold a sub-micro servo and the switch, I also had to design the control arm the servo will use to change the switch position. The first attempt didn't work out so well, things mostly fit, but I didn't have the switch oriented correctly, The switch needs to have the number 1 position 60° ccw of vertical for all of the detent positions to line up correctly with the servo throw. There are 2 flats on the switch that keep the switch body from rotating, and a flat on the switch shaft to properly orient the knob, or in my case control arm. When I modeled the switch flat on the switch, my calibrated Mk I Eyeballs didn't notice that the flat on the shaft did not line up with the switch detent positions - it's halfway in between.
I'm going to be using 5 positions of the switch and I want the #3 position to be vertical, this will make getting the linkages set up sooooo much easier. I initially had the bracket 3mm thick, I had 4.5-5mm of available threads on the switch body and the nut is 1.5mm thick so I thought I was in like Flynn. Not so much, no room for the lock washer. I also discovered my original assumption, that the flats on the switch body would be enough to properly orient the switch, doesn't exactly work in the real world. The switch comes with a keyed sheet metal locating ring with protruding tabs that will lock the switch into position. I didn't think I'd need it, I was wrong. By the time everything gets tightened down, the switch position can change by 10° or more, this is not acceptable.
I redesigned the bracket, I cut out a section around the switch opening and rotated that section. I couldn't figure out a way to measure the angles with what equipment I had. I guestimated this angle at 10-15°, so I rotated the section 10° - turns out I SHOULD have rotated it 15°. While I still had it loose from the rest of the bracket, I also thinned this section down to 2mm. This gives me an additional 1mm of usable threads on the switch, along with the room for the locating ring AND the lock washer. I also did a couple of other things to improve the print quality and reduce the print time, went from 70 minutes to 59.
I discovered that I couldn't get a programmer to modify the digital servos I had. I had a couple of cheapies that I got from HobbyKing a couple of years ago - go figure. So I ordered a couple of Hitec HS-5055 sub-micro's and a programmer to match. They SHOULD be a drop in fit in the bracket. If not, well, it's not like I haven't re-designed this bracket a couple of times already.
I also got my spool of "Translucent Red", and I'm a little disappointed, this stuff is more transparent than translucent. I think you could print fairly respectable tail light lenses with this stuff. The search for a redder red filament was on - again. I found one that the reviewers consistently said was the "reddest red" they ever seen, and it's called... "Enzo" Red, yup, it looks like Ferrari Red on a spool. We'll see how close it comes to matching the Bruder red plastic. If this one doesn't work, then screw it - I'm just gonna get a can of rattle-can red and paint everything to match.
I'll take some pictures tonight, after I've got the switch oriented correctly.
Don
ddmckee54:
I took some pictures last night and kept the best two, they are attached below. You've got a view of the actuator arm side of the switch, and the pins side of the switch. The actuator arm is in the #3 position. Positions 1 & 2 are CCW of center, and positions 4 & 5 are CW of the center #3 position. A quarter is shown as a scale reference. The servo shown is one that I had in my junk box, but it's supposed to be the same size as the Hitec servos I've got ordered.
This will probably be the last of the pictures for a while, I got my Arduino Nano's last night so I'll be busy learning how to program them, doing the programming, and testing/debugging my programming.
Don
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version