Shop OBEX P1 Docs P2 Docs Learn Events
Ramping up motors — Parallax Forums

Ramping up motors

More CoffeeMore Coffee Posts: 2
edited 2011-01-28 16:44 in BASIC Stamp
Hi all ..Im new here ,I dont know a whole lot ,In fact nothing as far as writing code goes,but i have a question,problem.

I would like to control three motors via R/C..75 Mhz FM surface frequency to control thrusters on a model ship

Example.
Using three brushed motors or brushless (whatever makes it sing easily)
Assuming 12v operation
Assuming I use 3 identical Electronic Speed Controls, These would be negotiating the high current andvoltage required by the motors
Assuming that the motors on each thruster are identical
Assuming that at full power/demand each motor turns 3000rpm

What I would like to accomplish:

The first motor engages in real time with command from the transmitter
when the first motor reaches 1000 rpm the second motor comes online and attains 1000 rpm

Both motors spin up as demand for power increases to 2000rpm at which time the third motor comes online and come's up to 2000rpm

then all three spin up to 3000rpm which is full power and thrust


Is it possible to use the Stamp in stepping form to control the three ESC's ?
How would it interface with the Reciever and ESC's?

Comments

  • Spiral_72Spiral_72 Posts: 791
    edited 2011-01-25 20:03
    Sure!

    The RC stuff is controlled by a series of pulse width modulated signals. Each "Packet" is 20ms (milliseconds) or each packet is sent every 20ms.

    The ESC spins the motor in relation to a PWM signal sent to it (within that 20ms packet).... If I remember right; The longer the PWM signal is held high, the faster the motor spins. You would use the PULSOUT command for this.

    I imagine it would work something like this:

    -The Rx is connected to the first ESC and motor. You will need to tie into that signal with a Y-cable so that the BS can monitor the PWM signal sent to the ESC
    -You will need a tach and do some testing, but the time the PWM signal is held HIGH will correspond to the motor speed read from a tach. Hopefully this relationship is linear (I'm pretty sure it is)
    -Once ESC #1 reaches the setpoint you've determined, you will send ESC#2 a PWM signal, constantly repeating every 20ms. For example: IF ESC1 = 560 THEN PULSOUT ESC2,560

    The same principle can be used for both auxiliary ESC's


    The setpoint will be something different, but I'll use 560, 1120 and 1680 as examples for 1000, 2000 and 3000 rpm.

    main:
    IF ESC1<560 THEN PWMESC2=0: PWMESC3=0
    IF ESC1>560 THEN PWMESC2=ESC1: PWMESC3=0
    IF ESC1>1120 THEN PWMESC2=ESC1: PWMESC3=ESC1
    IF ESC1>1680 THEN DEBUG "FULL POWER!",CR
    PULSOUT ESC2,PWMESC2
    PULSOUT ESC3,PWMESC3
    PAUSE 16
    GOTO main






    PAUSE 16ms may not be exactly right. It should be 20ms - PULSOUT#1 - PULSOUT#2.... I'd just adjust it until you get smooth running motors.

    I used < and > because it's not likely you'll catch the signal exactly at the setpoint when you hit the throttle.

    The code won't work if you copy and paste, but it gives you the idea. Good luck! and I hope this made sense :)
  • bsnutbsnut Posts: 521
    edited 2011-01-26 01:50
    I am going to expand Spiral72's idea with a small change to aloud for a setpoint control.

    What, I am suggesting is changing the Y cable to two different cables. The first servo cable will be connected from the RC receiver to the Basic Stamp I/O pin and the second servo cable gets connected from a different Basic Stamp I/O pin to your ESC, which controls the motor speed. This means BS will control and set the motor speed, which gives you more flexibility and this will needed to be done for each motor.

    The code that Spiral72 did should work and all is needed is the setpoint code.

    I this gives you some idea how to do it.
  • More CoffeeMore Coffee Posts: 2
    edited 2011-01-26 16:41
    Clear as mud...

    That code takes me way back,,remember the old Tandy Color Computer III,with a whopping 128k of memory. I have a basic grip on it. Icons are different but the language feels similar. Its not that intimidating ..I thank you gentlemen very much ..I have a toe hold now..
  • Spiral_72Spiral_72 Posts: 791
    edited 2011-01-28 05:55
    Me too, but I never had that kind of resources! Mine was the CoCo I with 32k (I think, or was it 64k?) Those stupid cassette tapes seemed like they always lost my most valuable programs. I started saving my progs 5 & 6 times just to be sure.
  • $WMc%$WMc% Posts: 1,884
    edited 2011-01-28 16:44
    I had a CoCo II with only 16K RAM, But it would keep me entertained for hours. I hated those cassette drives too.They did make me out to be a pretty good typist though! I had a daisy wheel printer and I would always print-out my really good stuff.Since those tapes would fail constantly.
    '
    A couple of months ago I got some new tires put on my truck.The guy behind the counter used a Laptop computer and a USB printer to print out the before and after data from the front end alignment machine via WiFi.He then went to another computer to process my bankcard and receipt, I peeked over the counter and I see and old TRS-80 running a DOS program with and old mono-chrome monitor. Next I here and faint but familiar sound.The guy opened up a home made plywood cabinet and there was a daisy wheel printer in it.
    '
    These old machines are still out there,Still working.
Sign In or Register to comment.