Shop OBEX P1 Docs P2 Docs Learn Events
motor — Parallax Forums

motor

nkodnkod Posts: 2
edited 2008-10-21 10:12 in Propeller 1
I have a·motor.It has·5 pins. Pin1: External Clock, Pin2: Lock Detector, Pin3: Motor Enable, Pin4: GND, Pin5: +24V.Can someone please guide me into connecting it to Propeller Demo Board?

Post Edited (nkodeih) : 10/20/2008 2:44:14 PM GMT
«1

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-09-16 16:54
    It sounds like you are interfacing with a proprietary DC brushless motor controller. The pins you describe are not part of a raw DC brushless motor. You really need to get more information from the vendor on how to operate the controller, such as the meaning of each pin (beyond simply giving it a name), how·each pin·operates, and examples of controlling the board in either code or a timing diagram. The information you provided us simply isn't enough to provide you an answer.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • T ChapT Chap Posts: 4,223
    edited 2008-09-16 17:34
    The clock is probably PWM (some frequency and Duty) easily done by the Prop.

    The motor defaults to full speed with no clock.

    It appears the rotation is fixed CCW.

    Turn motor on and off with enable.

    If you don't need speed control, then just turn the enable on and off. If you need speed control, read up on PWM, or get a PWM object, experiment with Freq and Duty, see what works. Considering the clock input is already held high with 5 volts, a simple transistor may do the job, or Darlington, with the Prop driving it.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-09-16 17:54
    Ok the datasheet does provide more information, enough to experiment with the board. Motor enable should be pulled low to run it, the external clock likely has some relationship to the speed you want the motor to turn, this relationship will have to be determined experimentally. Lock detector is a feedback signal to tell you that the motor is turning at the rate you have specified.

    Good luck and let us know how it goes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-09-16 22:04
    No nothing so complicated is necessary. You do need to provide 24V to the motor, but during development you should not introduce something as complex as a DC/DC converter in the equation. You should instead find a pre-made 24V source either in a wall wart or a programmable bench top supply. The 0.4V is simply the required low, not the power you should be applying to the pin. These pins should be driven by the propeller, and ideally through a transistor as shown in No 24.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • evanhevanh Posts: 15,545
    edited 2008-09-17 00:11
    What do you want from this motor? If you are wanting to run it in both directions you'll be out of luck me thinks.

    As Paul has said, it's a straight pulse follower with an internal pick-up to compare with the supplied clock signal. The faster you clock it the faster it'll spin. There is no direction control.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-09-17 18:11
    It's better to ask questions if you are unsure than to hook it up and promptly destroy it. I am not an expert picking out transistors for a particular application, but since you do not need to supply a large amount of current I think something like the PN2369A (availible from Mouser and Digi-Key) should work fine. The resistors are pullup so thier value isn't critical, typically anything in the 1k-4.7k range should work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 9/17/2008 6:17:22 PM GMT
  • evanhevanh Posts: 15,545
    edited 2008-10-11 01:28
    I just got a PM from nkodeih but replying doesn't work so I reply here instead ...
    nkodeih said...
    i would like to ask you if you can send me a simple software to control this brushless motor
    No, I can't give an example code due to me not yet having written a single line of Prop code, but, to give you a direction to look in, I'd target the counters. You should be able to easily set one up to pulse at a programmable rate.

    The datasheet says control frequency (in Hertz) is rpm/10. So, for 30000 rpm you would want a setting of 3000 Hz on one counter.
  • evanhevanh Posts: 15,545
    edited 2008-10-11 01:36
    If you don't mind using a whole Cog for the task then another way would be a looping sequence of waits and bit flips. Something like:


    loop:
    waitcnt cnt,13333 ' 166667 ns (half of 3 kHz).
    xor output,outputbit
    jmp loop
  • Cluso99Cluso99 Posts: 18,069
    edited 2008-10-11 03:11
    What you probably have is a brushless DC motor with inbuilt ESC.

    To get an idea of what the motor and ESC do look up the wiki on Brushless DC Motors, Inrunner and Outrunner. That hopefully will give you a link to ESC (Electronic Speed Control??).

    Try looking up the radio control hobbies - electric aeroplanes.

    You can also look at www.hobbycity.com· They sell lots of Brushless·motors and ESCs and there is some·explanation although I have not seen an inbuilt ESC.
  • evanhevanh Posts: 15,545
    edited 2008-10-11 04:26
    Thinking about that. It's probably better than a speed controller. My guess is the built-in drive is 1:1 position locked to the six phases of it's feedback sensors. Which in-turn translates to the motor windings.
  • evanhevanh Posts: 15,545
    edited 2008-10-11 07:35
    I've just found the PropTool tutorial examples that get installed for the starter kit manual, there looks to be a bunch of good pulsing examples you can start with. In particular the (Ch3-Ex6)-Blinker1.spin example.
  • SapiehaSapieha Posts: 2,964
    edited 2008-10-17 10:11
    Hi nkodeih.

    You can't drive this motor by PWM.

    You must drive it with variable frequency with 50% duty cycle.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.
    For every stupid question there is at least one intelligent answer.
    Don't guess - ask instead.
    If you don't ask you won't know.
    If your gonna construct something, make it·as simple as·possible yet as versatile as posible.


    Sapieha
  • T ChapT Chap Posts: 4,223
    edited 2008-10-17 15:22
    Use the same code, set duty to 50%. Then change the cycle length to set the right speed. Short cycle length is faster, long cycle(period) is slower speed.

    Your code above is already 50% duty, and should be spinning the motor. You may have a damaged motor driver.

    Just for a test, unplug the ext clock input,m it is pulled high internally to 5v. Try your propeller pulse on the enable in.

    Usually what gets damaged is the transistors on the front end of those drivers, maybe your enable is still ok as you stated that if you touch the enable to GND you get a single revolution. One rev should equal one pulse.

    Post Edited (Originator) : 10/17/2008 3:35:05 PM GMT
  • evanhevanh Posts: 15,545
    edited 2008-10-17 22:51
    You've got two problems with your use of pwmAsm.spin. I suggest ditching it and using a copy of FrequencySynth.spin from the PropTool examples library. It's nice and simple to use: Just specify the counter(A or B), the output bit, and the frequency.
  • evanhevanh Posts: 15,545
    edited 2008-10-18 12:38
    All GNDs have to be joined together, including the transistor's emitter.

    The FrequencySynth.spin method is fixed at 50% duty. You can't get it wrong.
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-10-18 18:02
    Hello nkodeih,

    YES really ALL GNDs 3,3V, 5V, 24V
  • evanhevanh Posts: 15,545
    edited 2008-10-18 22:11
    Yes, Vss is the GND for the Prop. And any 0volt as well.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-10-18 22:32
    Does that Prop-board you're using have on-board resistors on the I/O pins?

    Looking at your pic (shema.jpg), unless it's hidden, you need a resistor·between the Prop output pin and the base of that transistor.
  • kwinnkwinn Posts: 8,697
    edited 2008-10-19 21:03
    This motor sounds like one that came from a laser bar code scanner or similar equipment judging by the "number of facets" in the spec sheet.

    The "Enable" allows the motor to run. In most cases this would be a low level (0V), but not always.

    The "Lock" signal comes from the motor controller to indicate that the RPM of the motor matches the clock frequency/10.
    According to the spec sheet the motor should lock to the incoming clock in 4 seconds or less.

    The "External Clock" controls the speed of the motor. The clock frequency in Hz controls the speed of the motor. The duty cycle should be 50% +/- 10%
    350KHz = 35000 RPM, 25KHz = 2500 RPM.
  • kwinnkwinn Posts: 8,697
    edited 2008-10-19 21:09
    PS - This motor is probably expecting 5V (or even or 24V) signals so trying to drive it with 3.3V may not work or only works intermittently. Personally I would use opto isolators to connect the motor to the micro.
  • evanhevanh Posts: 15,545
    edited 2008-10-19 22:15
    kwinn said...
    350KHz = 35000 RPM, 25KHz = 2500 RPM.
    Err, nope. Equation is f(Hz) = N(rpm) / 10. N is stated as being the motor rated speed. So, that 350kHz should be 3.5kHz.

    Another reason why I'm confident is because if you divide the rpm by a further 6 then it becomes one clock per revolution. Funnily, three phase brushless trapezoidal motors use a 6 phase sensor for commutation.


    Regarding the 5 volt signalling. nkodeih is already using a transistor, combined with the internal 5v pullup, to voltage shift the clock.
  • evanhevanh Posts: 15,545
    edited 2008-10-19 22:18
    nkodeih said...
    i would like to ask about the counter can i write like this? :
    ==snip==
    Why? The Synth module sets the counter modes for you.
  • evanhevanh Posts: 15,545
    edited 2008-10-19 23:36
    Just set them both to zero to be sure.
  • evanhevanh Posts: 15,545
    edited 2008-10-20 12:14
    Hmm, total posts zero now. :/

    I presume he would have deleted the whole thread if he could. I think Mr nkodeih might have some mental stability issues.
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-10-20 12:54
    Hello evanh,

    your last post does NOT sound nice to me. I was provocant in some postings too
    and have gone too far. I learned from this I hope.

    English is not my native language but I think I have enough understanding to see
    that this sentence makes a joke on the back of nkodeih. I explicit want to say
    stop making posts in this manner.

    What about possabilities like beeing on holiday for three weeks out on an island with not even a telephone
    to relax completely ?

    best regards

    Stefan
  • evanhevanh Posts: 15,545
    edited 2008-10-20 21:35
    Of course I was intentionally harsh, the dude has deleted everything he posted. Even the opening post now!

    There was nothing wrong with what he had written. They were good questions. He got to learn how to deal with both the motor and the Prop.

    Now there is nothing left but our ethereal replies. Why?
  • evanhevanh Posts: 15,545
    edited 2008-10-20 21:40
    (expletive), he's even changed the subject from labelling the subject matter to an amazing "motor". Very descriptive of him.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-10-20 23:21
    Hey guys, can we tone it down some? While nkodeih didn't react in a desirable way (I forget his subsequent posts, and they've been deleted), we should still try to show patience with people just coming onto the forum. Sometimes they are easily confused, don't have a firm grasp on the subject, and sometimes they are speaking in a foriegn language they have a tenuous grasp on. And·occasionally people feel chastened when that wasnt the other poster's intention. It is way too easy to read anger into someones post when you have no vocal intonation or body language to provide clues into the meaning behind the words. We should try to make everyone feel welcome, even if you think they have no business attempting what they are asking help on. The best thing to do when somone gets your goat is just to ignore them. The next best thing is to hold off on·hitting the·submit button, take a walk or bathroom break, then reread you post thinking "how badly can I interpret what I'm about to post?". If that second reading comes off harsher than you intend, edit the post so that the more sinister interpretation is no longer there.

    Thanks,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 10/20/2008 11:54:32 PM GMT
  • evanhevanh Posts: 15,545
    edited 2008-10-21 10:02
    The reaction to my last few posts just goes to show what happens when there is deletions like this. There was nothing harsh said by anyone prior to me noting that nkodeih had deleted everything except the opening post.

    My comment has nothing to do with confusion over what was said but purely instead by what was done.
  • evanhevanh Posts: 15,545
    edited 2008-10-21 10:12
    There is no language barrier that I can see. nkodeih wrote the questions clearly. And learned plenty from the answers.

    Eg: The clarification of what is a GND signal is a question of basic functional diagram reading. It's not a question of language differences.
Sign In or Register to comment.