Shop OBEX P1 Docs P2 Docs Learn Events
Motor Controller Confusion — Parallax Forums

Motor Controller Confusion

spainespaine Posts: 51
edited 2005-05-18 18:04 in Robotics
So, I ended up purchasing the Motor Mind C from Parallax, but I truly believe that it is not what I wanted.

Basically, I'm making a R/C boat. However, I'm hoping to transmit and receive data via RF Serial Line. My lap top will actually be acting as the control module.

I was hoping that my boat would be fast. Not necessarily 32 mph fast, but perphas 10-15 mph. From what I saw today though, it looks like the motors that do that are rated at 6-24vdc and 9A. Now that I review the Motor Mind C, I see that it can only handle 2.25A, and that is with cooling.

There must be an easy way to use the ESC that the RC Boating community already has, and simply attach it to my BS2p24, or is that just not possible?

If any one knows if this is possible (and how to do it), I would appreciate any insight.

Thanks,
Stephen

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2005-05-14 12:26
    Let's see -- I believe you have an R/C reciever, which outputs a 'servo control signal' for each channel (which is a 1 to 2 mSec pulse repeated every 20 mSec). Now "ESC" stands for "Engine Speed Control" (I think). I believe it reads a Servo control signal, and uses the width of the pulse to control a throttle setting.

    So, if all these things are true, then:

    You can easily generate a Servo control signal (or an ESC control signal) if you use the PULSOUT command, as long as you make sure you have code to repeate the command every 20 mSec.

    You can read a Servo control signal from the R/C reciever outputs using the 'PULSIN' command.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-05-14 13:04
    So, you want to go from a laptop, to a serial port, to a R/C transmitter to control the speed and direction of your boat, right?

    Do you have software for this or are you going to write your own interface?

    Why so complicated when there already are R/C transmitters and receivers that can do the whole process independently?
    That is indeed the easy way. But, it is part of the R/C world, not really the robot world.

    The Motor Mind C is clearly advertised to control motors FOR ROBOTICS. The speeds are much slower as the robot would be bouncing off the wall and the amperages are approriately lower. The two motors allow one to use two motors to steer [noparse][[/noparse]such as a sumo bot]. The R/C uses another channel with rudder.

    I am sorry you got off to a bad start, but it really seems to be you want oranges, and Parallax provides apples.

    And, you will have heat at the amperages you want regardless of your system.· Also, that is a lot of electricity to have around water [noparse][[/noparse]especially salt water].· Things must stay dry or get very funky.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    G. Herzog in Taiwan
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-05-14 15:52
    Stephen, I undertsand the frustration of purchasing something only to find it doesn't do what you need it to. Do you need bi-directional control of the motor or can you get away with forward only? If you can, you can use a single transitor and PWM to contol it. If not you can construct your own H-bridge using transistors suitible for handling the motor's current.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • spainespaine Posts: 51
    edited 2005-05-15 17:18
    Paul,

    Thanks for the reply, I believe your right an H-bridge that can handel things might be for the best. However, I was also just looking at taking the Electronic Speed Control that comes with the model boat, and plug it into the BS2p24 directly.

    However, someone above posted a reply and discussed Heat (and moisture), and that is a point of concern that I have. I know there must be some thing that I can do though, because there are model boats that go up to 32 MPH now.

    I was reading this book on robots, and I see that a gear-box might be able to help attain speeds (or at least give power).

    Thanks again for your reply,
    Stephen

    Paul Baker said...
    Stephen, I undertsand the frustration of purchasing something only to find it doesn't do what you need it to. Do you need bi-directional control of the motor or can you get away with forward only? If you can, you can use a single transitor and PWM to contol it. If not you can construct your own H-bridge using transistors suitible for handling the motor's current.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-05-15 23:34
    I think that a gearboxed motor wouldn't be what you are looking for. Your looking for ultrahigh RPMs and a screw (propeller) which is matched to the motor's top RPM to provide the highest thrust while keeping the load on the motor at an optimal level. Im thinking a brushless DC motor would be the best suited for a really high speed motor boat, they are all the rage in model R/C airplanes. But using them opens another can of worms, they use a feedback method of operating which means a much more complicated interface than either servos or brushed DC motors. But there are drivers modules availible for purchase that are quite small since they are designed for RC airplanes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-05-16 16:06
    I seem to have missed something. You want a 32mph boat and think an H-bridge is what you need, right?

    The only reason to have an h-bridge is to allow reversal of the motor's direction. At 32mph, that would be disaster!

    It seems that a brushless motor with a matched propeller or a matched gear box and propeller systems is what you want. All this could be controlled by the ESC, if it is intended for brushless motors.

    All motors that drive propellers [noparse][[/noparse]either in air or in water] require by matched to their propellers to achieve best performance. It is about matching both RPM and power output.

    In other words, you cannot throw any old motor together with any old propeller and get satisfactory performance. There is the need to consider 'fluid dynamics' and to minimize turbulence. If ignored, the propeller cavitates [noparse][[/noparse]spins in a fashion that creates pockets of turbulence that serve no useful purpose and can cause a lot of nasty vibration].

    The short story is that in order to get the best, you need to buy a whole set of things that have been proven to work with a hull of similar size and design.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    G. Herzog in Taiwan

    Post Edited (Kramer) : 5/16/2005 4:38:44 PM GMT
  • spainespaine Posts: 51
    edited 2005-05-17 19:29
    Kramer,

    After seeing your post, and the replies of others, I agree, I do want to use a prefab boat with a motor, and matching propeller. I see that most of the model boats use certain devices (such as an ESC). I wasn't sure if an ESC could be plugged into a BS2p24 directly. Most of the ESC's that I have seen on Hobby Boat sites, say that they are rated for something like 16 or 30 Amps. Likewise the Motors themselves are rated at such high amperage. I didn't know if the ESC could interface directly with the Stamp, or if I had to provide some other protections.

    Any help on interfacing the BS2 --> ESC -- > Motor would be appreciated.

    Also, after reviewing normal cruise speeds of boats... I now realize that 32mph is extremely fast. I'm looking for 12-15 mph on the high side, possibly slower during cruising.

    Thanks,
    Stephen
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-05-18 01:08
    From some quick research on the web, an ESC has a few connections.

    1. Two wires, which are to come from the battery. Don't get them backwards, you'll kill the ESC.

    2. 3-wires to the motor. I assume Positive, Negative, and Ground, but I'm not sure.

    3. 3-wires to the RF Reciever. Here is where you'll connect your BS2P. This connection looks identical to a 'Servo' interface, except for some ESC units they expect to PROVIDE power on the +V line, not recieve it. In any case, you want to connect 'ground' to the BS2 ground, and the 'signal' wire to a BS2 I/O pin.

    OK, now that you have your BS2 connected, you can use the 'standard' PULSOUT command to control it like it was a Servo. You can connect the Reciever signal pin to another BS2 I/O pin, and use PULSIN to read a 'commanded' speed -- then either copy it to the PULSOUT with the BS2, or implement your own speed control code.

    Note that most ESC's are rated by Amps that they can deliver to the motor. These can be 15, 30, 80, 100 Amps. This is not the 'CONTROL' current (which comes from the Reciever or your BS2) but the Battery Power current (that's the current that actually turns the motor). Your CONTROL signal merely tells the ESC what percentage of its battery Power current to pass to the motor.

    You probably should put a 220 ohm resistor in the 'control' line to the ESC, just to cut down on inadvertent accidents -- but the BS2 will NOT be supplying the POWER current, it will only supply a very small CONTROL signal.
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-05-18 01:13
    By the way, having browsed the web a bit, you should be aware that these things can be dangerous. You are controlling 10 amps to a small motor. It might be a good idea to build a 'pure' RF version (maybe buy it off the shelf) and use it for a while. This will get you some experience with the amount of power involved.

    "Robotically Controlling" something is a neat thing to do -- but you MUST be able to shut the thing off if it 'runs away' -- which it can do if you don't program it right. This has not been a problem with my projects with Mindstorms robots (or the Parallax BOE-Bot) because you can just pick the thing up if it 'goes crazy'. With a 10 amp motor boat, you may injure yourself if you just 'pick it up' at those times.

    People who haven't built autonomous robots may not appreciate that you have a little microprocessor with your program controlling quite a lot of power. Little microprocessors have no sense of what is safe -- YOU have to program in cut-offs yourself. That little sucker can seem to have a mind of its own -- and it's not an intelligent mind.
  • spainespaine Posts: 51
    edited 2005-05-18 05:07
    Allan,

    I see what you are saying. Just in the short time that I received my BS2, I have learned that this is going to be a little more difficult then I originally expected. However, at this point the BS2 is primarilly going to be used as a passthrough for signals, and to drive the servo and motor. I haven't really mentioned in full what I'm trying to do, but attached is the first diagram that I drew up of what I'm trying to do. Basically I want to create a GPS guided boat, but the GPS data will be transmitted to my laptop via an RF serial line. My laptop is the one that is doing all data processing and navigation calculations, and would then transmit calculated drive and turn signals to the boat.

    Since I got started I have encountered a number of difficulties, but it has been a fun learning curve.

    Once I get this done, I hope to make a second pass at the boat where I would move all primary processing on-board the boat through the use of a single board linux box, but I would also provide a RF-link still to communicate with it when I chose. I am considering finding a way to communicate via Cell phones, which should provide extended range. I would like to add a video camera in the future also. Finally, I would hope to add Solar Cells to provide power (however, I don't know if the motors at such high Amps could ever be driven with solar cells).

    If you have any input, I greatly appreciate it. Thanks for your description of the ESC --> BS2 connection it definitely makes sense now. The only thing I'm unsure of, is that 10 Amp rating on the motor... I'm not confused about the connections, rather I don't understand how most models only have one (maybe 2) 7.52 V @ 1500 mAh batteries to drive them. How can the motor require such high current with such low amperage from the batteries?

    Thanks,
    Stephen
  • spainespaine Posts: 51
    edited 2005-05-18 05:09
    I did a quick reply last time instead of replying to you, but I wanted to add this diagram of my voyager project.

    Thanks,
    Stephen
    1875 x 1462 - 539K
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-05-18 14:53
    The battery thing is this.

    A 1500 mA-hour battery will produce 1500 mA (or 1.5 Amps) for one hour. This actually depends on the discharge rate, it is not a linear curve, but that 1500 mA-hour is the 'average' capacity for the battery.

    If it WAS linear, you could drain this battery in 60 seconds (let's see, 1.5 Amp-hours * 60 minutes per hour is 90 Amps for one minute). Things would get quite warm -- 90 amps is more than my house takes. On the other hand, that's 90 amps at 7.2 volts. Power (heat) is current times voltage (P = IV) so that's 648 watts. That's a lot for a small package, but my space heater will put out 1500 watts, so that's not incredible.

    Now, if you run it for 10 minutes, that's 9 amps for 10 minutes -- and there is your 9 to 10 amp control figure. Now Voltage equals Current times Resistance (V = IR). So R=V/I. 9 amps at 7.2 volts would require a resistance of 0.8 ohms. And the P=IV means you would dissipate 64.8 watts in the process.

    It looks like much of the hardware you are looking at expects short (10 minute) runs at high speed -- then have a recharge cycle, or a battery swap. That may not match what you are trying to do. Just be aware.

    Oh, and if you DON'T use full throttle, but sit at 500 mA or so, you can run that boat for 3 hours. (1500 mA-hours / 500 mA = 3 hours).
  • GadgetmanGadgetman Posts: 2,436
    edited 2005-05-18 16:22
    How big is the boat?

    There are 5000mAh (5AH) D-size ni-cad cells available.
    They're not cheap, though.
    (I'm waiting on a set of 10 of those for a laptop I'm rebuilding... )

    Seeing your drawing; yes you want the batteries as low as possible, particularly if you got big ones.

    Using GSM phones to expand the range shouldn't be too difficult. Just make certain the one for your boat has a built-in 'modem'.
    Not all that have a data-connector have it. On some modern ones it's there just to synch the calendar with a PC, and on some older models you need an external 'modem' adapter for it.
    If you do find one for the boat, remember to use a 'null-modem' cable if you're connecting it to the programming port on your BS2 board.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-05-18 16:40
    One thing you need to consider is maintaining a close eye on the battery charge, if not you run the risk of draining the batteries dead while it is in the middle of the lake or whatever body of water. You could do this by having a super bright LED blink when the battery charge drops below a preset point, that way you can steer it into shore before it dies.
  • spainespaine Posts: 51
    edited 2005-05-18 17:13
    Paul,

    I agree, battery monitoring is important. For the first run I'm looking at some very isolated tests in locations where I will be able to retrieve the boat if needed. This would possibly give me a reason to go up to Lake Tahoe smile.gif

    As I move forward, I'm looking at using a couple different chips that I have found at Maxim. I think that they will be able to assist in battery monitoring, and once the batteries hit a certain "alarm level" a signal would be transmitted back to me. However, if I move to it becoming more autonomous, and through the use of solar cells, I would look at it either switching between a second set of rechargables (or something).

    I appreciate the comments you are all making, Thanks.
    Stephen
  • spainespaine Posts: 51
    edited 2005-05-18 18:04
    Thanks a lot again Allan. I remember the formulas from school, and I see them all the time in robotics books, but it is nice to have it explained in simple terms (as I would use it).

    You are right about the hardware that I'm looking at being better suited for short - fast runs. However, the motor (and model) that I first select will only be used as a prototype. After I have a good working proof of concept of the programming, I am hoping to spend some time (and get help from others) on selecting the best shape and calculating the best motor for that shape. I would hope to find a design that limits drag (water and air), and maximizes the motor and propeller. The structural design would provide a large area for maximum solar-cell.

    Attached is what I hope to some day have, which I think would be the most efficient. However, I have no clue as to how one would truly design a boat.

    Thanks again,
    Stephen
    3295 x 2539 - 1M
Sign In or Register to comment.