This is probably basic stuff, but I wanted to make sure it’s doable with the BotBoard and Atom Pro before I buy parts.
I want to be able to have a BB2/BAP control a RC ESC just as an RC receiver would. I’m guessing I’d use an analog port and control it like a servo, but I’m not 100% sure.
I also want to be able to switch something on and off. I already have the BattleSwitch from lynxmotion. Does this hook up directly to a digital or analog port on the ABB, or do I need something else?
Are you saying that all the outputs are digital? Are servos controlled from digital outputs?
I’m not clear about what you’re saying regarding the BattleSwitch. I have one and would like to hook it up to the ABB. This must be possible or else why does it even exist?
Unfortunately, all the documention I can find on microcontrollers seems to assume that everyone already knows how to hook everything up. I have some idea about this stuff, mainly regarding hooking up analog sensors, but that’s about it.
Ok. That’s good to know. Digital output are probably fine.
There are a few different things I may want to switch, like lighting or an electric (non-drive) motor. Why does it depend on what you want to turn on/off? That doesn’t make sense to me. Seems like anything should work as long as it’s within the voltage and amp requirements.
I don’t necessarily have a particular ESC in mind. I have several. But it should not matter, right? They all look the same to an RC receiver. They have to, or RC vehicles would not work…
If anyone on the forum has used the BB2/BAP to simulate an RC receiver, I’d love to hear from you.
As long as the load you wish to switch is within the limits of the BattleSwitch, that’s all I was getting at.
I don’t yet know what an ESC has for the receiver interface, so that’s why I asked for an example. All ESC’s may or may not interface the same. I have no place to start an analysis at this point. Maybe I can even use the same “system” to control my BEC’s.
I don’t think anyone has ever used a BAP or similar uP to simulate an R/C receiver. Receivers have an RF signal (HF, VHF, etc) as an input, and recover R/C servo digital signals for often up to eight channels. But you probably knew that! A small (slow) processor can’t do that. Receivers are for the most part an analog device, and a uP is a digital device. Possibly you meant something else?
Edit:
All I see an ESC doing is taking an R/C PWM signal, and controlling the speed of a 3-phase brush-less motor. In addition, it typically supplies the 5V power to the receiver, and shuts off on a low voltage to protect the LiPo battery. It sounds like it could be driven from a BAP R/C PWM output. Is that what you want to do with it?
Right, when I say “simulate an RC receiver”, I just mean the output. Sorry if that wasn’t clear. I want to use the lynxmotion PS2 controller. If it’s PWM, that should work fine. Of course, I don’t know exactly how to do that unless it’s just the same as controlling a servo. Same with the switch.
Sorry I don’t know much about the RC world so I don’t know what you mean about controlling an ESC. However I do know BAP and I have interfaced Baps at both ends. I have worked with a few others on the DIY Remote control, that uses these: lynxmotion.com/Product.aspx? … egoryID=46
For this project we have code that runs in the remote control and generates the correct pulses to make the transmitter happy. I also have code that runs in the robot, that you take the RC receiver and plug in 6 or 7 jumpers in between the BAP and the receiver and I decode the signals, which you then can use to do whatever you want. There is more details up on the thread: viewtopic.php?f=21&t=4399. This is the same remote that for example that Zenta has used in his different hex robot videos. I have also used this same receiver code to handle the hitec 6 receiver.
As for Battleswitch this is easy. They use standard servo type signals. For example on my Mech Brat you can turn on or off the gun with the HSERVO command (could use other commands as well)
if LGunWaitingToCycle then
hservo [LGUNP\-7000\0] ; again failsafe if the gun internal switch fails
else
hservo [LGUNP\7000\0]
endif
There’s many ways to control an ESC from the Atom Pro / Bot Board II. The code can be simple to complex, but the bottom line is this. Create a positive going pulse that is from 750uS to 2250uS long that repeats every 20mS. On a Hitec servo 750uS will be almost full CCW, 1500uS would be around centered, and 2250uS would be pretty much full CW. The servo can move a full 180° so if the 1500uS is 0° then 750uS would be around -90° and 2250uS would be around 90°. For a speed controller it’s usually more like 1000uS to 2000uS with 1500uS being stopped. The clock wise or counter clock wise direction would be selected by which way the motor is connected, and there are many ESC’s that can control simple DC PM motors. If you have a battle switch or pico switch they can be controlled the same way.
Now bear in mind this program also handles the arm, so it’s pretty complex, but if the arm is not there and you don’t press the button on the PS2 to enable it, it’s no big deal. I do not know if we have a tutorial on controlling an ESC with this set up that is simple. But there are lots of examples of creating these servo pulses and even interfacing the PS2. Just go back to the website, click information, assembly guides, then search through the different projects. If it uses an Atom Pro then the code is there for the taking.
ESC just means Electronic Speed Controller. In the RC world this usually refers to a single motor controller, but technically the Sabertooth is an ESC.
Yes I suppose the Sabertooth could be called an ESC, but I got the impression that and ESC controlled 3-phase brushless motors. It would be handy if there was one for a DC brushed motor as well. Know of one?
I’m also interested in switching a BEC from 5v to 6v output via a control signal from a BB2. There is a jumper on the BEC to accomplish this, which might indicate that a simple level might allow it to switch. Maybe not. Anyone know?
Jim is right, the ESC is usually either brushed or brushless. A brushed ESC which works with any brushed motor that won’t fry it. The sensored brushless ones are usually specific to a small set of brushless motors due to the different types of brushless motors. Brushless motors tend to be vendor-specific. The “sensorless” brushless motors and ESCs are mostly interchangable AFAIK.
Of course there are exceptions to the above, like the Novak GTB, which can be run in either brushed or brushless mode…