Shop OBEX P1 Docs P2 Docs Learn Events
New user: Model R/C control question — Parallax Forums

New user: Model R/C control question

EnVeeTeeEnVeeTee Posts: 3
edited 2005-01-11 13:40 in BASIC Stamp
I don't know if this is the right forum - forgive me if not! I have a Model R/C control question...

I'm trying to·produce a hovering platform using 4 small electric motors and propellors and a model R/C receiver. The receiver outputs a pulse between 1 and 2ms which my speed controllers work from.

I need to mix the output of the reciever as follows:

Throttle + Elevator to control the fore and aft motor speeds for pitch control
Throttle + Aileron· to control the left and right motor speeds for roll control
Thottle + Rudder to control all for for yaw control

1. Can I use a BASIC STAMP?
2. Any model recommendations?

I know I'll need other modules but its the mixing I'm stuck on

Many thanks

Nigel

Comments

  • achilles03achilles03 Posts: 247
    edited 2005-01-10 16:37
    Nigel,
    If I understand your goal correctly, you should be able to do this with a BS2, although it might not be the most effecient way to do it. First of all, I think it will be difficult to control the craft if you try to control each motor individually. Instead, I would use the throttle as an overall speed offset (it affects all motors equally), while using the aileron and elevator controls to differ the speeds of the motors for control. For example, if the craft is sinking, you'd prefer to just throttle all motors up at the same time using the throttle. Also, if the craft is rolling sideways, you'd want to move the appropriate aileron control to temporarily increase the appropriate motor's speed, thus orienting the craft.

    Having said that, yes, you could use a BS2. The best way I can think of doing it is to quickly sample the R/C outputs and have the BS2 adjust the voltage on the motors accordingly. You'll probably have to play around with the voltage adjustment values between your BS2 and the motors to get the desired response (you don't want to tap the ailerons and have it flip over). Also keep in mind that the motors will have a lag time associated with them, and will take some time to speed up to the correct speed... you may want to program the BS2 to overadjust to compensate. You also may want to consider a faster chip, like the BS2sx or BS2p, which can sample 2.5 and 3 times faster respectively.

    Hope that helps,
    Dave
  • steve_bsteve_b Posts: 1,563
    edited 2005-01-10 19:23
    You'd have to be certain that all the motors behave the same though!

    No two motors are built alike!· tongue.gif

    They'll have different operating curves based on current/voltage.

    Are all your props the same?· Balanced to the center pivot point?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://members.rogers.com/steve.brady
    http://www.geocities.com/paulsopenstage

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."

  • Ken GraceyKen Gracey Posts: 7,387
    edited 2005-01-10 19:47
    Nigel,

    Since you are using electronic speed controls for the motors, moving to a BS2SX or BS2P won't buy you any improvement in managing the 1 to 2 ms pulses. These pulses are going to be 1 to 2 ms, regardless of the Stamp model you choose. However, the faster Stamps could save some time in calculations and data management, but this might not be important considering you have 20-40 ms between servo refreshes for other uses. Even with our R/C twin-engine airplane synchronizer project (http://www.parallax.com/dl/mm/video/RCAirplanes.mpg) we managed two receiver inputs, two throttle outputs, two encoder inputs with a BS2, including some proportional control math routines during the downtime.

    Ken Gracey
    Parallax, Inc.
  • Don BuczynskiDon Buczynski Posts: 31
    edited 2005-01-10 20:41
    Helicopter gyro's might be another way to reduce the processing load on the BS2. http://www.centuryheli.com/products/gyros/index.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don Buczynski

    http://www.buczynski.com
  • achilles03achilles03 Posts: 247
    edited 2005-01-10 21:09
    Maybe I'm not understanding the scenario correctly.··I·originally thought the scenario EnVeeTee·described involved a R/C receiver, which outputs PWM into the BS2, which in turn controls the motors.· Going back, I see that you have speed controllers between the motors and the BS2.

    "IF" this is in fact the case, then the stamp would have to output atleast 4 PWM simultaneously (one for each speed controller/motor), which·the BS2·can't do.· "IF" this is the case, and you still want to use the BS2, then I would take out the speed controllers and put in something that can regulate the voltage on the motors in place of the speed controller (like a heavy-duty digital-to-analog converter).· It seems the problem is combining the throttle with the other components.

    Dave
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2005-01-10 21:26
    Dave,

    It is not necessary for the servo PWMs to be sent simultaneously - these small pulses can be transmitted subsequently. The duty cycle is such that the on-time is very short relative to the low time. In fact, you can read R/C channel pulse widths using a BS2 one after another using a series of PULSINs. I can see no reason to use a D/A for this reason.

    His psuedo-code would work like this:

    READ R/C Channel 1
    READ R/C Channel 2
    .
    .
    .
    any math, routines, inputs here
    .
    .
    .
    Output Channel 1
    Output Channel 2
    Go to top

    And add channels as you see fit.

    Ken Gracey
    Parallax, Inc.
  • EnVeeTeeEnVeeTee Posts: 3
    edited 2005-01-10 23:05
    Thanks for the input folks.

    I think I do need to use speed controllers, the current draw on the motors can be quite high (20Amps peak) so I suspect it would have to be a pretty heavy duty D/A converter!

    I'm beginning to think along the lines that Ken Gracey has posted:

    Read Throttle Channel
    Read Elevator Channel
    Read Rudder Channel
    Read Aileron Channel

    Mix outputs as required

    Output to Front/Rear/Left/Right motor controller.

    So the question now becomes:
    What starter kit do you guys recommend to get me up and working with this so I can get my fingers dirty?

    Thanks again
    Nigel
  • prathbunprathbun Posts: 2
    edited 2005-01-11 00:36
    Uhm.. what about using an r/c transmitter that has servo mixing built-in?

    pete
  • EnVeeTeeEnVeeTee Posts: 3
    edited 2005-01-11 08:23
    Pete

    The transmitters that I have and the ones I have looked at cannot mix at that level. I think there are some really expensive ones which come close but they are upwards of £1000.00. And what with the real object of the game is to investigate STAMPs its cheating really!

    Thanks anyway

    Nigel
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-01-11 13:40
    I would recommend a Board Of Education (BOE) with BS2 package. Make sure you purchase the right power adapter for your country. It's around $120, and has a prototoyping area, as well as Servo connections on the board.

    You can use the prototyping area to connect your devices to the BS2. Really, the BOE is mostly just for routing signals. Once you've proven your concept using the board, all you'll need will be a nine-volt battery and the BS2 and some way to connect the signals to the BS2 pins (and Servo power, of course).
Sign In or Register to comment.