Shop OBEX P1 Docs P2 Docs Learn Events
HB25 + 12V wiper DC Motor = underpower — Parallax Forums

HB25 + 12V wiper DC Motor = underpower

ericbong84ericbong84 Posts: 9
edited 2008-11-10 19:18 in BASIC Stamp
Hi, everyone. I'm eric from Malaysia. I have some matters that needs to be solve ASAP. I'm doing this flight simulator by using 2 HB25 with 2 DC wiper motor(12V) and potentiometer (270)·as a feedback. With this combination, it is considered to be a big servo motor.

Here's the problem:

Mechanical frame ( 2 degree of freedom) is done and so is the flight simulator visual from Mircosoft FlightSIM's game. The movement of the frames are moving fine without human load. But when i sit on it, the motors doesn't really support my weight. The motors are moving but not strong enough. It's moving really slow. I mean really really slow.·Sometimes, it stuck at current angle.·Why is·that?·How should i improve this? The motors are moving fine when i use·diret current from the PSU (12V).

Here's my coding for the movement:


' Flight Sim interface
' =========================================================================
' File...... BS2 interface v1.1 HB-25 motors.bs2
' Purpose... Heavy duty servo interface with HB-25
' Author....
' E-mail....
' Updated... 16-9-2008
'
' {$STAMP BS2p}
' {$PBASIC 2.5}

'
[noparse][[/noparse] Program Description ]
.............


' Receives 2400 8N1 on serial programming interface
'
[noparse][[/noparse] I/O Definitions ]
T2400······ CON···· 396····· ' baud rate: 2400bps is the more stable
T4800······ CON···· 188
T9600······ CON···· 84
Inverted······· CON···· $4000····· 'using inverted you can use the on-board serial port of the BS2 (not compatible with x-sim)
Open··········· CON···· $8000····· 'using open signal you must use external max232 circuit
Baud··········· CON···· T2400 + Open·· 'select here the baud speed and the signal type
RX CON 0 ' receive (from PC)···· Connent the max232 circuit to pin 0 of the BS2
CTS CON 1 ' Clear To Send (to PC)
CS····· PIN·· 15
Clk···· PIN·· 14
Dio···· PIN·· 13
pitchport PIN 2·· 'the bs2 port that is connected the HB-25 that moves the Pitch axis
bankport PIN 1··· 'the bs2 port that is connected the HB-25 that moves the bank axis
Sgl CON %1 ' single ended
Dif CON %0 ' differential
Raw2mV CON $139B ' 19.6 mV per count
'
[noparse][[/noparse] Variables ]
sglDif VAR Bit ' adc mode (1 = SE)
oddSign VAR Bit ' chan (Sgl), sign (Dif)
adc VAR Byte(2) ' channel values
mVolts VAR Word(2) ' millivolts
Offset········ CON···· 1875···················· ' changes the center of the motors
SetPoint······ VAR···· Word···················· ' the input from computer that servos try to follow
Kpx············ CON···· 8······················ ' Proportionality constant (different for x and y for the joyrider!)
Kpy············ CON···· 12
error········· VAR···· Word···················· ' One element error array
p············· VAR···· Word···················· ' Proportional term
pitch VAR Byte
bank VAR Byte
Lights VAR Byte
ground VAR Lights.LOWNIB.BIT1·· 'example of how you can pull a bit of the booleans byte (for portdrvr and BFF driver)
brakes VAR Lights.BIT5
i VAR Word
bankpot VAR Word
bankpotA VAR Word··············· ' keeps the values from the feedback potetiometers
pitchpot VAR Word
pitchpotA VAR Word


HIGH CS ' deselect ADC
'
[noparse][[/noparse] Initialization ]
DEBUG "Waiting for HB-25 to power on..."
HIGH pitchpsu················· ' turns on the switch of the bank PSU
DO : LOOP UNTIL pitchport = 1· ' Wait For HB-25 Power Up
LOW pitchport················· ' Make I/O Pin Output/Low
PAUSE 5······················· ' Wait For HB-25 To Initialize
PULSOUT pitchport, 1875········ ' Stops any rotation of the motor
DEBUG "Pitch HB-25 is ready..."
HIGH bankpsu·················· ' turns on the switch of the bank PSU
DO : LOOP UNTIL bankport = 1·· ' Wait For HB-25 Power Up
LOW bankport·················· ' Make I/O Pin Output/Low
PAUSE 5······················· ' Wait For HB-25 To Initialize
PULSOUT bankport, 1875········· ' Stops any rotation of the motor
DEBUG "Bank HB-25 is ready..."
DO
FOR i = 1 TO 100········ 'Initially centering servos on power up so the pitch-bank are set to 0 degrees
· SetPoint = 127
· sglDif = Sgl
· oddSign = 0
· GOSUB Read_0832
· bankpot = adc(oddSign)
· bankpot = bankpot
· DEBUG CLS
· DEBUG "BANK = ", DEC bankpot, CR
· error = SetPoint - bankpot
· p = Kpx * error
· bankpotA = p + Offset
· bankpotA = bankpotA MAX 2500
· bankpotA = bankpotA MIN 1250
· DEBUG "= ", DEC bankpotA, CR
· PULSOUT bankport, bankpotA
· PAUSE 10

· sglDif = Sgl
· oddSign = 1
· GOSUB Read_0832
· pitchpot = adc(oddSign)
· pitchpot = pitchpot
· DEBUG CLS
· DEBUG "PITCH = ", DEC pitchpot, CR
· error = SetPoint - pitchpot
· p = Kpy * error
· pitchpotA = p + Offset
· pitchpotA = pitchpotA MAX 2500
· pitchpotA = pitchpotA MIN 1250
· DEBUG "= ", DEC pitchpotA, CR
· PULSOUT pitchport, pitchpotA
· PAUSE 10

NEXT

'
[noparse][[/noparse] Program Code ]

Begin:
SERIN 0,16624,60000,timedOut,[noparse][[/noparse]WAIT("KD"),HEX2 Lights,HEX2 pitch,HEX2 bank]

SetPoint = bank
FOR i = 1 TO 100
· sglDif = Sgl
· oddSign = 0
· GOSUB Read_0832
· bankpot = adc(oddSign)
· SetPoint = SetPoint MIN 80······· ' limits the min - max values from the computer
· SetPoint = SetPoint MAX 170
· error = SetPoint - bankpot
· p = Kpx * error
··bankpot = p + Offset
· bankpot = bankpot MAX 2500····· 'limits the min - max values that are to be send to
· bankpot = bankpot MIN 1250······ 'the motors to keep them inside the servo signal requirements
· PULSOUT bankport, bankpot······ 'Sends the servo pulse to the HB-25
· PAUSE 10
· SetPoint = pitch
· sglDif = Sgl
· oddSign = 1
· GOSUB Read_0832
· pitchpot = adc(oddSign)
· SetPoint = SetPoint MIN 106
· SetPoint = SetPoint MAX 148
· error = SetPoint - pitchpot
· p = Kpy * error
· pitchpot = p + Offset
· pitchpot = pitchpot MAX 2500
· pitchpot = pitchpot MIN 1250
· PULSOUT pitchport, pitchpot
· PAUSE 10
NEXT
GOTO Begin
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
timedOut:
FOR i = 1 TO 50········ 'Centering servos on timeout so the pitch-bank are
······················· 'set to 0 degrees until computer respond and regaining control.
· SetPoint = 127
· sglDif = sgl
· oddSign = 0
· GOSUB Read_0832
· bankpot = adc(oddSign)
· bankpot = bankpot
· error = SetPoint - bankpot
· p = Kpx * error
· bankpot = p + Offset
· bankpot = bankpot MAX 2500
· bankpot = bankpot MIN 1250
· PULSOUT bankport, bankpot
· PAUSE 5

· sglDif = sgl
· oddSign = 1
· GOSUB Read_0832
· pitchpot = adc(oddSign)
· pitchpot = pitchpot
· error = SetPoint - pitchpot
· p = Kpy * error
· pitchpot = p + Offset
· pitchpot = pitchpot MAX 2500
· pitchpot = pitchpot MIN 1250
· PULSOUT pitchport, pitchpot
· PAUSE 5

NEXT
'LOW 15················· 'Light a Led on p15 is connection is timeout
GOTO Begin
LOOP

'Here is the meaning of the Byte with booleans when used with Portdrvr interface:
'Bit0··· Landing lights
'Bit1··· Plane ON ground
'Bit2··· Stall
'Bit3··· Overspeed
'Bit4··· Autopilot
'Bit5··· Brakes
'Bit6··· Landing gear
'Bit7··· Flaps
'
[noparse][[/noparse] Subroutines ]
' Reads ADC08x32
Read_0832:
LOW CS
' send start, mode, channel
SHIFTOUT Dio, Clk, MSBFIRST, [noparse][[/noparse]%1\1, sglDif\1, oddSign\1]
' read raw counts from ADC
SHIFTIN Dio, Clk, MSBPOST, [noparse][[/noparse]adc(oddSign)\8]
HIGH CS
RETURN

Comments

  • ericbong84ericbong84 Posts: 9
    edited 2008-11-07 19:31
    This project of mine is with references to Mr. Thanos Kodoyiannis. Here's his website, http://ptyxiouxos.net//greekbotics/user_projects/Flight_Simulator/thanos_home_motion_flight_simulator.htm

    Please igonore the adc's MAX and MIN value. I'm using potentiometer with 270 degree (a rough guess) and using 12V regulator to mark up the voltage for·rotating degree of the potentiometer to avoid less noise in readings.

    Please, i am in need of help. Thank you very much.
  • SRLMSRLM Posts: 5,045
    edited 2008-11-07 19:43
    First off, if you have large amounts of code, please attach it using the attachment manager. It's much easier to read than in a pasted in format.

    A Brushed DC motor gets the most torque when it's moving at a relatively high speed. If your motors are moving very slowly, that indicates that they are stalled. The easiest thing to do would probably be to gear it down. You can use real gears, or a belt and pully system. Alternatively, you can use stepper motors, since these get the most torque at slow speeds.
  • ercoerco Posts: 20,256
    edited 2008-11-07 20:43
    With respect, brushed DC motors exhibit maximum torque at stall. The torque decreases nearly linearly as RPM increases, up to zero torque at the no-load (peak) RPM. Peak power is produced at one-half the no-load RPM, and can be fairly well estimated as (stall torque/2)x(no-load RPM/2).

    The problem is most likely the use of a gearmotor which uses worm gears. They are notoriously inefficient due to frictional losses from the worm sliding against the gear. Their only redeeming virtues are compact size, low parts count, and self-locking (of value in certain applications). They are useful only for a light loads: wiper or window-lift applications. But in a heavy-load application such as yours, there is excessive binding, loss of mechanical power, motor stalling/overheating and rapid gear wear.

    IMHO your best option is to switch to gearmotors with traditional spur-gear design. Alternatively, linear actuators are quite effective but very pricey.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • ercoerco Posts: 20,256
    edited 2008-11-07 23:03
    eric: I just re-read your post and noticed your comment: "The motors are moving fine when i use direct current from the PSU (12V)." Do you mean that the motors move your body weight easily when you make a direct battery connection to your motor, and that you are convinced that the motor controllers (or the software) are causing the power problem?

    erco

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-08 00:01
    erco said...
    With respect, brushed DC motors exhibit maximum torque at stall.
    That's true of some DC motors.· It's untrue of other DC motors.

    There are three general classes of·DC motors.· There are series motors (field in series with armature), shunt motors (field in parallel with armature), and compound motors (with a series field AND a shunt field).

    Series motors generally exhibit fairly constant torque (proportional to excitation voltage)·at various speeds including stall.· Automobile starters are invariably series motors.· Because the torque of a series motor doesn't vary much with speed, series motors typically exhibit extremely high no-load speeds.· Running a series motor with no load will sometimes result in its flying apart at overspeed.· Adding load to a series motor slows it down but does not have much effect on its torque, nor on its electrical current consumption at constant voltage.· Overloading a series motor will stall it, but won't generally result in overheat.· It sounds to me as if this poster is using a series motor and supplying it with insufficient excitation voltage for the load.

    Shunt motors tend to exhibit relatively constant speed.· "Relatively" constant means that it won't slow down as much with added load as a series motor would.· Adding load to a shunt motor (at constant voltage) makes it conduct more current (mostly in the armature), but won't slow it down much until overload occurs, at which point it will usually overheat and sometimes melt.· The no-load speed of a shunt motor depends on the field current -- the less the field current, the faster the no-load speed, which is not what the layman would expect.· The no-load speed of a shunt motor doesn't vary much with excitation voltage.

    Compound motors (there are two subtypes, one in which the two field windings aid each other and one in which the two field windings buck each other) exhibit properties rather midway between the other types, depending (among other things) on the ratio between the field strengths of the two (or more) field windings.· Usually the fields are aiding, but sometimes a motor will be built with bucking fields as a means of controlling its field strength and thus its torque and speed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i
  • ercoerco Posts: 20,256
    edited 2008-11-08 02:23
    Touche, Carl!· I left out·the qualifying words 'permanent magnet' motor, which I assumed eric is using. Dangerous to assume these days! So to be precise, what I said is generally true of brushed, permanent magnet DC motors, per http://hades.mech.northwestern.edu/wiki/index.php/Brushed_DC_Motor_Theory·and http://lancet.mit.edu/motors/motors3.html#tscurve

    Your characteristic info on series & shunt-would field coils is very interesting, I'll look into that.·Great insight and thanks for keeping me honest, OM!

    73's

    erco· KM6DS

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • ericbong84ericbong84 Posts: 9
    edited 2008-11-08 03:15
    erco: "Do you mean that the motors move your body weight easily when you make a direct battery connection to your motor, and that you are convinced that the motor controllers (or the software) are causing the power problem?"

    The motors easily move my body weight when i use direct connection to the battery. I wasn't sure what cause the motors to stall at certain position. Not to mention, great loss of power too. Is it because i use pulsout command? For my info, HB-25 shouldn't have anything to do with the power lost.... i think. It's quite confusing for me.

    Thank you for reply, guys.
  • SRLMSRLM Posts: 5,045
    edited 2008-11-08 03:33
    So I made a generalization… I apologize.
    Anyway, the problem seems not to concern the motor at all. Or rather, not the power of the motor. Is there any way for you to measure how much current you are drawing? 25 Amps should be enough, but you never know. Also, have you tried longer/shorter pulse widths?
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-11-08 04:23
    Folks -

    Another thing to be considered is the gauge of the wires which supply power to the motor. If the gauge isn't sufficiently large, you'll be driving the voltage through some lengthy resistors.

    I wouldn't use anything smaller than 12 gauge over 20 amps, and nothing smaller than 14 gauge between 15 and 20 amps. Less than 15 amps I wouldn't use any smaller than 16 gauge wire. In all cases I'm speaking of stranded copper wire.

    For larger amperage motors I also wouldn't trust a soldered connection. A lug and bolt would provide a much better connection, and it can be removed easily if necessary.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When all else fails, try inserting a new battery.

    Post Edited (Bruce Bates) : 11/8/2008 4:42:27 AM GMT
  • stamptrolstamptrol Posts: 1,731
    edited 2008-11-08 13:18
    It seems the motors are strong enough when run directly from the power supply. It would be useful to measure the current when running in this condition with the human aboard.
    It may be surprising to see how much current the wiper motor can draw.

    Then do a test to make sure the HB-25 is delivering at least its full rated current with the human aboard. Depending on the amps observed in the across the line test, the HB-25 may be going into current limit which could explain the sluggish performance.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-08 20:39
    erco said...
    Touche, Carl!· I left out·the qualifying words 'permanent magnet' motor, which I assumed eric is using.
    Ah so.· PM motors tend to act like shunt-wound motors, because both types are constant-field-strength devices.· By "wiper motor" I had assumed the original poster meant a motor intended to drive windhield wipers on a car.· These are never PM motors, I think.· In my (limited) experience, permanent-magnet fields are used only on the tiniest and weakest of motors.· Windshield-wiper motors are pretty small too, and I think it would take an awfully large gear ratio to lift a human with one, even a bony fashion model, but they're probably shunt-wound to make it easy to control the speed.· Controlling the speed of a series motor is not exactly easy, because you've got to modulate a much greater current.· In shunt-wound motors, the field current is usually very much smaller than the armature current, and therefore not so expensive to control.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i
  • be80bebe80be Posts: 56
    edited 2008-11-09 19:33
    Just a idea did you read the part about using a car battery for power that 2 400watt psu may not put out the power needed them psu are not all a like 1 makers 400watt may only put out 200watts or less at 12 volts the 400watts being the
    total of all 5 volts plus the 12 volts and some put out a lot more I looked at the site you got the idea from it looks cool setting in a chair and feeling like your in a plane moving in the air the feed back to the chair looked real good i don't even
    fly but 1 of them would be cool to play with.
  • remmi870remmi870 Posts: 79
    edited 2008-11-10 09:00
    have you tried to drive the motor with you on it by joging the hb25, just write a simple program to step it through, if you still run into problems, you may want to think about using a large capacitor( like a automotive cap used for audio amplifiers) to help with spikes, ive used power supplies to run motor drivers and occationaly i get a problem with undervoltage.
  • ercoerco Posts: 20,256
    edited 2008-11-10 19:18
    Per Remmi, start with the simplest program to control your HB-25s. Add the flight sim portion only after you get the motor drive issues worked out.

    Check out http://www.mydreamflyer.com/dreamflyer.html# ·to see a nice motorless solution. I saw this at CES last January and it's very nice. They gimbal the whole seat at the CG·(seat+rider) and only the joystick motion moves the whole setup. You can add or remove weights to adjust for different people. It is very sensitive (light actuation force) and fun to try. Long story short, if your system can be balanced better mechanically, it will use less motive power and·have a·faster response·in the long run.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
Sign In or Register to comment.