Shop OBEX P1 Docs P2 Docs Learn Events
HOw to control DC motor in the same way with using RC and 4 - in1 receiver? — Parallax Forums

HOw to control DC motor in the same way with using RC and 4 - in1 receiver?

huynhhuynh Posts: 16
edited 2009-03-11 21:33 in BASIC Stamp
Hi all memeber,

I had made the circuit for controlling of DC motor by PWM and Hbridge. I use Hbridge L293D and hex converting 74HC/HT14. the circuit looks like in site http://members.tripod.com/~ArtooDetoo/schemx.html. but I did connect enable pin of L293 to +5V instead of BSStamp.

I try to supply voltage and feed PWM to the logic input, then measure the output of pin 1Y and 2Y of Hbrigde (which use as input Pin for DC motor). The measurement give me some observation as:

- The voltage of 1Y 2Y pin willl change when I vary the lenght of PWM ( I start with pulse length of 0.5ms): volatge on one pin will decrease (pin 2Y), while voltage from Pin 1Y is increase. As a result, the voltage different between pin 1Y and 2Y will increase. But, these results are not as I expect.


In my project, I would like to replace the receiver and Radio transmitter of a helicopter by a micro controller Unit (MCU) (BX24 or BSstamp). One of importance step I need to deal with is generation of the input for DC motor by means of MCU. These inputs must to have same features as from Receiver.


Back to my testing. As I feed the PWM with the same rise time as in Radio to my board, the measured voltage from the 1Y and 2Y pin is smaller than in the volage produced by Receiver.

I would like to receive the suggestion about how to produce the input for DC motor which is same as input generated from a 4-in 1 Receiver.

Thank for your time,

Pthien

Comments

  • roadrunner3groadrunner3g Posts: 36
    edited 2009-03-08 12:49
    so you want to fly an electric helicopter? make sure it's a hobby grade model and not a cheap toy one. it will need an ESC, giro and servos. unless you like high speed landings keep the radio in and add a simple override subroutine. pulsin pin#,1,chx : pulsout pin#,chx . you will need 8 pins to do this. if you don't I hope you robo pilot has an early retirement plan.

    ch1 var word 'pitch
    ch2 var word 'roll
    ch3 var word 'ESC "throttle
    ch4 var word 'rudder

    rc:
    pulsin 1,1,ch1
    pulsin 2,1,ch2
    pulsin 3,1,ch3
    pulsin 4,1,ch4
    pulsout 5,ch1
    pulsout 6,ch2
    pulsout 7,ch3
    pulsout 8,ch4
    pause 10
    goto rc
  • huynhhuynh Posts: 16
    edited 2009-03-10 03:08
    Thank you for your suggestion about using ESC for DC motor. I am wondering that is there any ESC that can control two motors. In my project, I have to drive two motors at different RPM.

    I found some ESC such as GWS 400. unfortunately, It can control only 1 motor.

    About your above code, I understand that pulsout 1,1, ch1 will generate high voltage in ch1 ms, and pin1 will connect to PWM pin of servo. How about pulsin? where should we connect these Pins to?.What is the function of this command in the code?

    Thanks,
    Pthien,
  • roadrunner3groadrunner3g Posts: 36
    edited 2009-03-11 21:33
    Yes try the Sabertooth 10 RC Dual Motor Speed Controller. try one of the robot stores online. signal wire is connected to the RC receiver and one stamp pin per channel. just plug it in like a servo. make or buy a 3-wire plug with the same end as a servo on both ends. pulsin is used to read PWM signal from the RC receiver.
Sign In or Register to comment.