Gas station without pumps

2017 November 18

Checking out the new gearmotors

Filed under: Robotics — gasstationwithoutpumps @ 09:07
Tags: , ,

Last night I did some quick checks of the new 210 rpm and 300rpm motors (one of each).  The new 210rpm motor seems to be substantially the same as the ones that came with the wheels, but the 300rpm motor is indeed faster.  I assumed that the difference in speed would come from a difference in the gear box (same motor but different gear ratio), but instead it seems to come from a different motor on the same gearbox.  The 300rpm motors have a lower DC resistance and so take more current at the same voltage.  That shifts the speed-vs-torque line upward, giving more free-running speed and more stall torque.  The cost, of course, is that they take more current to provide the extra torque.

It may be worthwhile for me to use these beefier motors in my robot, since I can PWM to lower speeds, and the torque-per-amp seems to be about the same for the two motors (assuming that the gearhead efficiency is the same).  One of these days I’ll have to build myself a stand for testing running torque and stall torque on my motors and characterize them properly—but probably not until after mechatronics is done, as the details of the motors are not on the critical path for completion.

2017 November 8

Gearhead motors for mechatronics

Filed under: Robotics — gasstationwithoutpumps @ 14:05
Tags: , , ,

I have already selected and purchased the gear motors I plan to use for the robot in the mechatronics course.  They come with shaft encoders, metal mounting brackets, and wheels, and cost me $25.51 for two motors with shipping from AliExpress.  The specs sounded very promising:

Wheel diameter: approx. 65mm
Shaft diameter: approx. 4mm
Voltage: DC 6V
Speed: 210 rpm
Encoder motor end: 11 signals
Rated voltage: DC 6V
No-load speed: 210RPM 0.13A
Max efficiency: 2.0kg.cm/170rpm/2.0W/0.60A
Max power: 5.2kg.cm/110rpm/3.1W/1.10A
Stall torque: 10kg.cm 3.2A
Retarder reduction ratio: 1 : 34
Hall resolution: hall x ratio 34.02 = 341.2PPR

I did some testing on the motors earlier and found that they do not meet the specs given on the web site at all.

The gear ratio is 2 (11/5)^3 = 21.296, determined both by comparing turns of the shaft to encoder counts and by counting teeth on the gears, not 34. I was a bit leery about disassembling the gearbox, but I managed to take it apart and put it back together without mishap.

The encoders do give 11 pulses per motor shaft revolution, but that translates to 234.256 pulses per output shaft rotation, not 341.2. With four edges in the quadrature encoding, I could, theoretically, measure rotation with a resolution of 0.384°.

At 5.99V, the no-load current is 64mA and the shaft speed is 189.4 rpm (determined from the gear ratio and the frequency of the encoder ticks).

I did not measure stall torque, but stall current was 1.3A at 5.72V, for a resistance of 4.4Ω, which would be about 1.36A at 6V, not 3.2A.  I should be able to estimate the torque, if I assume a gearhead efficiency of about 50%, which seems to be typical for cheap gearhead motors. Using natural units (Nm/A or V s/radian) for the motor coefficients, I have Ke≈0.3 Vs/radian, so Kt≈0.15 Nm/A, which would provide a maximum torque of about 0.2Nm (28 oz in or 2 kg cm) at 1.36A. I refined this estimate a little using gnuplot (still with the 50% efficiency assumption).

The stall torque was not measured, but was estimated at 0.1 Nm (1.9 kg.cm) assuming a 50% gearhead efficiency.

Since I plan to run my motors at 6V, not 12V, this motor is near the middle of the current range that Gabriel Elkaim suggested in class, though I’m near the high end for rpm, so torque may be less than desirable for moving the robot.

I have thought about two ways of installing the motors:

Here is a view of motors mounted on MDF, assuming that the motors will be on top of the board. The MDF has about 8~mm of clearance from the floor.

An alternative mounting scheme with the motors below the MDF.

I believe that I will install the motors above the MDF, since that would put optical sensors for tape very close to the floor (improving signal-to-noise ratio) and allow me to mount battery and other power electronics on the same level as the motors, keeping the center of gravity low.

If the motors are placed between the wheels as close together as possible while staying coaxial, the space between the tires is about 13.5cm and the outside edges of the tires are about 19cm apart. If the wheels are not outboard, then 3.5cm by 6.5cm wheel wells will need to be cut in the MDF, with 13cm between the inner edges of the wells.

2017 August 23

Motor testing

Filed under: Data acquisition,Robotics — gasstationwithoutpumps @ 02:20
Tags: , ,

I bought some 6V motors with mounting brackets, wheels, and Hall-effect rotary encoders from Ali Express (https://www.aliexpress.com/item/1-set-2-set-High-torque-Electric-Encoder-Gear-Motor-DC-6V-210RPM-0-13A-Mayitr/32820157282.html), which arrived today, so I spent most of the day playing with them and trying to characterize them.

The first thing to do was to try to relate voltage, current, and speed.  I used the power supply in the Analog Discovery 2 to drive the motor through a resistor, monitoring both the voltage across the motor and the current through the resistor.  I used a Teensy LC board running PteroDAQ to monitor the frequency of the pulses from one of the Hall-effect sensor.  Initially I had tried looking at the pulses with the logic analyzer of the Analog Discovery 2, which gave me a fine short trace from which I could look at individual pulse widths and periods, but not get a long-term average frequency.

Varying the voltage on the motor gave different speeds, and the speed was linear with the voltage.  The current also went up with the voltage, but not linearly (it remained around 40mA even for very low voltages, and only went up to about 67mA at the highest voltages).

The standard simplified model for a motor is an “RLV” model: a resistor, an inductor, and a speed-dependent voltage source (referred to as the back-EMF).  V(s) = R I + L dI/dt + V_s s, where the speed is s, and the current is I. With a constant input voltage, the inductor is not really modelable, so I came up with an RV model:

The speed here is represented by the Hall-effect sensor, which gives 11 ticks per turn of the motor shaft. The back-emf is about 7.64 mV/Hz and the resistance is about 4.8Ω.

I needed about 2.5–3V to start the motor, but once it was running I could reduce the voltage to around 0.667V before the motor stopped (the lower speeds in the plot above were done by reducing the voltage with the motor running).

I tried measuring the impedance of the motor with the new impedance tool of Waveforms 2015. I got somewhat different results depending on the frequency used and the test voltage. For ±1V and low frequencies (under 300Hz), I got around 3.5–3.6mH+4.25Ω, but at higher frequencies the inductance dropped and the resistance increased: at 40kHz I had 1.946mH+438.5Ω. With a 5V signal I got 5.1mH+4.88Ω around 20Hz and down to 1.62mH+484Ω at 40kHz. The resistances at low frequencies are fairly consistent with the resistance I inferred from the back-EMF+IR model. So I’m reasonably comfortable in modeling the motor as having
V(s) = (7.64 mV/Hz) s + 4.8\Omega \,I + 4mH \,dI/dt.

I may have to tweak that inductance, though, as I’m not sure which frequency’s inductance is relevant.

I also recorded the turn-on transients of the motor. I tried first doing this by turning on the power supplies while the oscilloscope was waiting for a trigger, but the power supplies turn on quite slowly, so I added an nFET to the negative rail and controlled the gate with a pushbutton. The pushbutton connected the gate to a positive voltage and the gate had a large pulldown resistor to ground. The large pulldown resistor eventually turns the FET off when the button is released, but slowly enough that contact bounce does not result in turning the nFET on and off.

The voltage initially spikes up to the supply voltage, then the current increases through the inductor, until the resistive voltage divider controls the voltage. Then the motor starts moving and the back emf increases. The initial spike is very short (about 2ms), but spinning up the motor takes over 200ms.

You can see the enormous commutator signal in the voltage and the current. The current is directly controlled by the commutation—the voltage signal is only affected because of the IR drop across the 10Ω sense resistor I used for sensing the current.

We can use the initial turn-on spike to estimate the inductance, by looking at the exponential curve for the growth of the current:

The current is growing towards 412.5mA with a time constant of 311.76µs.

The inductance is just R times the time constant, where R is the series resistance (the 10Ω sense resistor and the 4.8Ω internal resistance—I’ll ignore the on-resistance of the MOSFET). L = 311.76 \mu s 14.8\Omega = 4.61 mH.

All the speed measurements here were in terms of how fast the Hall-effect sensor on the motor shaft was pulsing, but how fast is the output shaft of the gearbox turning? There are two questions: what is the ratio of sensor pulses to motor rotations, and what is the ratio of motor rotations to output shaft rotations?

The website for the motor claimed “Encoder motor end: 11 signals”, which I took to mean that there were 11 pulses per rotation.  I confirmed this by doing a Fourier transform of the commutation signal (the current) and of the pulse signal.  The fundamental of the pulse corresponded to the 11th harmonic of the current, so there were 11 pulses per turn of the motor shaft.

Determining the gear ratio (ratio of motor speed to output shaft speed) was more difficult.  I set up an optical interrupter to be blocked by a bit of electrical tape on the end of the output shaft once per revolution, and recorded the optical signal on every rising edge of the Hall-effect pulse using PteroDAQ.  By recording for a while, I could count the number of Hall-effect pulses for some integer number of shaft rotations.  Taking the pulses/output rotation and dividing by 11 gave me the motor-shaft rotations per output shaft rotation (the gear ratio I was seeking).  Getting a real number for this was fairly straightforward, but I wanted a rational number using products of small integers, corresponding to the gear teeth on the gears!

For one run, I had 856 shaft rotations with 200523 or 200524 pulses (depending whether I counted between rising edges or falling edges of the optical signal), giving me 234.255841121 to 234.257009346 pulses per rotation, or a gear ratio of 21.2959855565 to 21.2960917587.

I did a longer run with 4811 shaft rotations with 1126978 pulses or 1127000 pulses , giving me 234.250259821 to 234.254832675 pulses per rotation or a gear ratio of 21.2954781655 to 21.2958938795.

I converted the gear ratio to a continued fraction using my pocket calculator, getting

21+\frac{1}{3+\frac{1}{3+\frac{1}{-3+\frac{1}{2+\cdots}}}},

which expands to

21 + 1/3 = 21.3333333…

21 + 3/10 =21.3

21 + 8/27 = 21.29630…

21 + 37/125 = 21.296  = 2662/125 = 2 * 11^3 / 5^3   

The last ratio factors nicely, and looks feasible for a gear ratio.  To confirm my estimate, I carefully took apart one of the gearboxes and counted the teeth on the gears.  I got

  • motor shaft 12T
  • engages 22T linked to 10T
  • engages 22T linked to 10T
  • engages 22T linked to 10T
  • engages 24T on output shaft

This gearing does indeed give me the 2 (11/5)^3 gearing I calculated!

So my gear ratio is exactly 21.296 and I have exactly 234.256 pulses per rotation of the output shaft (with the quadrature coding from two Hall effect sensors, I get exactly 937.024 transitions per rotation).

With 6.0364V across the motor, I got 752.37Hz from the sensor, so the output shaft was rotating at 3.212Hz, or 192.7 rpm (somewhat slower than the claimed 210 rpm for 6V no load). The wheels that came with the motors have a circumference of 215mm, so the maximum speed would be 69cm/s, which is about 1.54 mph—not a real zippy machine, but more than fast enough for a small robot.

The tires are pretty squishy, though, and if I want to use the wheel turns to keep track of location, I’ll probably want wheels whose diameter doesn’t vary with the load—perhaps I could wrap the hubs with friction tape. The hub circumference is only 161mm. I could also laser-cut some wheels to get whatever diameter I want.

2014 March 5

Sixteenth day: Arduino demo

Filed under: freshman design seminar,Pressure gauge — gasstationwithoutpumps @ 20:57
Tags: , , , , , ,

Today’s class in the freshman design seminar went well. I started by returning the drafts of the design reports and giving some generic feedback. I realized on reading the reports that I had not given a good explanation of what I meant by describing the components of the system—two of the groups had given me long parts lists on the first page of their reports, something that would only really be appropriate in an appendix. I explained that what I wanted was what the main blocks in the block diagram were, and that they should use the block diagram to organize their report, writing a page for each block. I also suggested that they use the block diagram to partition the project among the group members, with each group member working on a different component, then getting back together to reconcile any discrepancies. Note that this is much more like real engineering group work than the usual K–12 group project, which is usually done most efficiently by turning the whole project over to the most competent member of the group.

After the feedback on design reports, I offered the students a chance to get a demo of building an Arduino program with sensing and motor control. This was a completely extemporaneous demo—I had gathered a number of possibly useful components, but had not tested anything ahead of time nor even figured out what order to do the demo in.  I asked the students if they wanted me to start with sensing or control—they asked for the motor control first.

I started by pulling a motor out of box of motors I had gotten when the elementary school my wife works at cleaned out their closets.  I told the students that I had no idea what the spec of the motor were, but since it came from an elementary school, it probably ran on 3v batteries.  I tested the motor by hooking it up first to the 3.3v, then to the 5v power on my Arduino Uno.  It spun just fine on 3.3v, but squealed a bit on 5v, so we decided to run it on 3.3v.

I then pulled out the Sainsmart 4-relay board that I had bought some time ago but never used.  I explained how a relay worked, what single-pole double-throw meant, and normally open (NO) and normally closed (NC) contacts. I used the board unpowered with the NC contacts to spin the motor, then moved the wire over to the NO contacts to turn the motor off.  I then hooked up power to the board and tried connecting input IN1 to power to activate the relay.  Nothing happened. I then tried connecting IN1 to ground, and the relay clicked and the motor spun.  The inputs to the Sainsmart board are active low, which I explained to the students (though I did not use the terminology “active low”—perhaps I should have).  I did make a point of establishing that the relay provides very good isolation between the control logic and the circuitry being controlled—you can hook up AC power from the walls to the relay contacts without interfering with the logic circuitry.

Having established that the relay worked, the next step was to get the class (as a group) to write an Arduino program to control the motor using the relay. With me taking notes on the whiteboard, they quickly came up with the pinMode command for the setup, the digitalWrite and delay for the loop, and with only a tiny bit of prompting with a second digitalWrite and delay to turn the motor back off.  They even realized the need to have different delays for the on and off, so we could tell whether we had the polarity right on the control.  Here is the program we came up with:

#define RELAY_PIN (3)

void setup()
{   pinMode(RELAY_PIN, OUTPUT);
}

void loop()
{
  digitalWrite(RELAY_PIN,LOW); // turn motor ON via relay (or off via transistor)
  delay(1000);  // on for 1 second
  digitalWrite(RELAY_PIN,HIGH); // turn motor OFF via relay (or on via transistor)
  delay(3000); // off for 3 seconds
}

I typed the code in and downloaded it to the Arduino Uno, and it worked as expected.  (It would be nice if the Arduino IDE would allow me to increase the font size, like almost every other program I use, so that students could have read the projection of what I was typing better.)

I then offered the students a choice of going on to sensing or looking at pulse-width modulation for proportional control.  They wanted PWM. I explained why PWM is not really doable with relays (the relays are too slow, and chattering them would wear them out after a while.  I did not have the specs on the relay handy, but I just looked up the specs for the SRD-05VDC-SL-C relays on the board: They have a mechanical life of 10,000,000 cycles, but an electrical life of only 100,000 cycles.  The relay takes about 7msec to make a contact and about 3msec to break a contact, so they can’t be operated much faster than about 60 times a second, which could wear them out in as little as half an hour.

So instead of a relay, I suggested an nFET (Field-Effect Transistor). I gave them a circuit with one side of the motor connected to 3.3V, the other to the drain of an nFET, with the source connected to ground.  I explained that the voltage between the gate and the source (VGS) controlled whether the transistor was on or off, and that putting 5v on the gate would turn it on fairly well. I then got out an AOI518 nFET and stuck it in my breadboard, explaining the orientation to allow using the other holes to connect to the source, gate, and drain.

I mentioned that different FETs have the order of the pins different, so one has to look up the pinout on data sheet. I pulled up the AOI518 data sheet, which has on the first page “RDS(ON) (at VGS = 4.5V) < 11.9mΩ”. I explained that if we were putting a whole amp through the FET (we’re not doing anywhere near that much current), the voltage drop would be 11.9mV, so the power dissipated in the transistor would be only 11.9mW, not enough to get it warm. I mentioned that more current would result in more power being dissipated (I2R), and that the FETs could get quite warm. I passed around my other breadboard which has six melted holes from FETs getting quite hot when I was trying to debug the class-D amplifier design. The students were surprised that the FETs still worked after getting that hot (I must admit that I was also).

I hooked up the AOI518 nFET using double-headed male header pins and female jumper cables, and the motor alternated on for 3 seconds, off for one second. We now had the transistor controlling the motor, so it was time to switch to PWM. I went to the Arduino reference page and looked around for PWM, finding it on analogWrite(). I clicked that link and we looked at the page, seeing that analog Write was like digitalWrite, except that we could put in a value from 0 to 255 that controlled what fraction of the time the pin was high.

I edited the code, changing the first digitalWrite() to analogWrite(nFET_GATE_PIN, 255), and commenting out the rest of the loop. We downloaded that, and it turned the motor on, as expected. I then tried writing 128, which still turned the motor on, but perhaps not as strongly (hard to tell with no load). Writing 50 resulted in the motor not starting. Writing 100 let the motor run if I started it by hand, but wouldn’t start the motor from a dead stop. I used this opportunity to point out that controlling the motor was not linear—1/5th didn’t run at 1/5th speed, but wouldn’t run the motor at all.

Next we switched over to doing sensors (with only 10 minutes left in the class). I got out the pressure sensor and instrumentation amp from the circuits course and hooked it up. The screwdriver I had packed in the box had too large a blade for the 0.1″ screw terminals, but luckily the tiny screwdriver on my Swiss Army knife (tucked away in the corkscrew) was small enough. After hooking up the pressure sensor to A0, I downloaded the Arduino Data Logger to the Uno, and started it from a terminal window. I set the triggering to every 100msec (which probably should be the default for the data logger), the input to A0, and convert to volts. I then demoed the pressure sensor by blowing into or sucking on the plastic tube hooked up to the sensor. With the low-gain output from the amplifier, the output swung about 0.5 v either way from the 2.5v center. Moving the A0 wire over to the high-gain output of the amplifier gave a more visible signal. I also turned off the “convert to volts” to show the students the values actually read by the Arduino (511 and 512, the middle of the range from 0 to 1023).

Because the class was over at that point, I offered to stay for another 10 minutes to show them how to use the pressure sensor to control the motor. One or two students had other classes to run to, but most stayed. I then wrote a program that would normally have the motor off, but would turn it full on if I got the pressure reading up to 512+255 and would turn it on partway (using PWM) between 512 and 512+255. I made several typos when entering the program (including messing up the braces and putting in an extraneous semicolon), but on the third compilation it downloaded successfully and controlled the motor as expected.

One student asked why the motor was off when I wasn’t blowing into the tube, so I explained about 512 being the pressure reading when nothing was happening (neither blowing into the tube nor sucking on it). I changed the zero point for the motor to a pressure reading of 300, so that the motor was normally most of the way on, but could be turned off by sucking on the tube. Here is the program we ended up with

#define nFET_GATE_PIN (3)

void setup()
{   pinMode(nFET_GATE_PIN, OUTPUT);
    pinMode(A0, INPUT);
}

void loop()
{ int pressure;
  pressure=analogRead(A0);
  if (pressure < 300)
  {    digitalWrite(nFET_GATE_PIN,LOW);  // turn motor off
  }
  else
  {   if (pressure>300+255)
      { digitalWrite(nFET_GATE_PIN,HIGH);  // turn motor on full
      }
      else
      {    analogWrite(nFET_GATE_PIN,pressure-300); // turn motor partway on
      }
  }
}

Note: this code is not an example of brilliant programming style. I can see several things that I would have done differently if I had had time to think about the code, but for this blog it is more useful to show the actual artifact that was developed in the demo, even if it makes me cringe a little.

Overall, I thought that the demo went well, despite being completely extemporaneous. Running over by 10 minutes might have been avoidable, but only by omitting something useful (like the feedback on the design reports). The demo itself lasted about 70 minutes, making the whole class run 80 minutes instead of 70. I think I compressed the demo about as much as was feasible for the level the students were at.

Based on how the students developed the first motor-control program quickly in class, I think that some of them are beginning to get some of the main ideas of programming: explicit instructions and sequential ordering. Because we were out of time by the point I got to using conditionals, I did not get a chance to probe their understanding there.

2013 June 9

Three-phase motor

Filed under: Hexmotor H-bridge board,Robotics — gasstationwithoutpumps @ 17:10
Tags: , , ,
Picture of 3-phase motor from capstain side (similar to the view in the catalog, but a better, higher-resolution image).

Picture of 3-phase motor from capstan side (similar to the view in the catalog, but a better, higher-resolution image).

About a year ago, I bought some cheap motors from American Science and Surplus, including one that they listed as

36-STEP MOTOR
40788P1 36-STEP MOTOR
$2.75 EACH

DESCRIPTION
The 36 Steps
This new 12VDC 1A stepper motor with 36 steps per revolution was for a printer, maybe. Or a scanner, maybe. Whichever, it’s mounted on a 2-1/2″ x 2″ plate with a 3/4″ long shaft with a 5/8″ dia rubber wheel out one side and a 15-tooth, 2″ dia plastic sprocket on the side with the leads. The (5) blue leads opposite the white go to 2.8 Ohm coils. Sorry, no wiring diagram available. Samsung P/N 02914900.

My son and I were looking through my drawer of parts when we came across it, and he was interested enough to try to figure out the wiring.  We were not able to find any information about this part on-line.  If someone has more info than what is in this blog post, please let us know!

Connections for three-phase motor: HA, G, 5, A, B, C.

Connections for three-phase motor: HA, G, 5, A, B, C.

The wiring on the back was a bit mysterious, as there are 6 wires, but they are not labeled in an obvious way for a stepper motor (HA, G, 5, A, B, C). With an ohmmeter, my son determined that the A, B, and C connections were all about 3Ω from each other, and had no DC connections to the other three wires, which also seemed to have no low-resistance connections among themselves.

The three phasors for three-phase inputs to a motor (or outputs when the motor is run in reverse as a generator).  Note that the three phasors are 120˚ out of phase, but the differences B-A and C-A are only 60˚ out of phase with each other.

The three phasors for three-phase inputs to a motor (or outputs when the motor is run in reverse as a generator). Note that the three phasors are 120˚ out of phase, but the differences B-A and C-A are only 60˚ out of phase with each other.

I conjectured that the motor was not a standard stepper motor, but a 3-phase brushless DC motor.

We tested this conjecture by hooking up an oscilloscope to measure the voltages B-A and C-A as we spun the motor shaft by hand.  Sure enough, we got sinusoidal voltages out, with different phases. We were a bit confused, though, as the phases looked to be about 60˚ apart, when we were thinking that they should be 120˚ apart.

The figure to the left explains our confusion.

I further conjectured that the other three connections were supposed to be for feedback from a Hall-effect sensor, so that the motor could be controlled in a feedback loop. I hooked up “G” and “5” to Gnd and a 5-volt supply, and put an oscilloscope probe monitoring the HA-G pair. Sure enough there was a small periodic spike as we spun the shaft, synchronized with the sine waves on the ABC connections. It struck me as very strange that the spike went negative from a zero baseline, though, so I tried adding a 22kΩ pullup resistor, which turned the small, narrow spike into a clean square wave alternating between 0v and 5v, with a period the same as the sine waves and a 50% duty cycle.  For connection to an Arduino, no resistor is needed, as an input pin can be configured to use an internal 20kΩ pullup.

With the Hall-effect sensor working, we could determine how many periods of the sinusoid there were in one revolution of the shaft.  We marked the capstan so that we could judge a full revolution, and counted 6 cycles per revolution.  We also counted 36 “click stops” per revolution (6 per cycle), which would correspond to the permanent magnet rotor lining up with pole pieces for A, B, C, A’, B’, C’.

I next wanted to determine how fast I could spin the motor and what phase relationship the Hall-effect sensor should have to the sinusoids input at A, B, and C.

I decided to use my Hexmotor H-bridge board to control the motor.  The board is not designed for 3-phase control, so I can’t do independent pulse-width modulation (PWM) on arbitrary half-H-bridges. So I used 3 separate H-bridge chips, each of them with only one half-bridge under PWM control.  Initially I tried using a sinusoid approximation with different PWM values every 15˚, then every 30˚, then every 60˚.  I finally ended up with a simple square wave for each of A, B, and C, which I could have arranged to do with just two of the H-bridge chips.

I wrote a program first to see where the Hall-effect falling edge occurred when the motor was given a constant frequency input for a fairly slow spin.  This should be the phase for the rotor almost in phase with the magnetic field, and the maximum torque should occur when the rotor lags the field by about 90˚. When the rotation is slow, I get that the falling edge of the Hall-effect pulse comes about 22% of a cycle (80˚) after the rising edge of the A pulse, so maximum torque should occur when it lags by 170˚ (47% of a cycle).

I then wrote a simple feedback loop that looked at the difference between when the falling edge occurred in the cycle and when it would occur for maximum torque, and adjusted the period (gradually) unto the falling edge was close to the desired point.  Under no load, with a 6.4v power supply to the H-bridges, I could spin the motor up to about 3.8msec per cycle, 22.8msec/rotation, or 2600 rpm.  With a 14.5v  supply to the H-bridges, the feedback loop had some problems with hunting (it tended to stall, at which point it backed off to a much lower speed and re-accelerated).  I observed times of about 2.6 msec/cycle (3850 rpm) just before stalling.  With either power supply, the motor got quite warm, so I don’t believe that it is really designed to operate continuously at those speeds.

I also learned not to put even moderate currents through the flexible jumper wires that I have—I melted the insulation on a couple of them.  Replacing them with 22-gauge solid hookup wire eliminated the problem.

I suppose that the next step in characterizing the motor would be to measure the torque at different speeds and rotor lag angles.  I haven’t figured out an easy way to do that though, as it involves mechanical design. I should also see how slow the motor can be stepped, to see if it could be used as a stepper motor.

The next step in programming would be to make a more usable interface, so that users could specify combinations of speed, torque, time, or number of steps to move. Because I switched to square wave control, I could probably rewrite the code to use only two of the H-bridge chips, or maybe even 2 3-phase motors on with only 3 H-bridge chips, since I don’t need to worry about which pins have PWM control and which don’t.

I think I’ve played with the motor enough today, though so I’ll leave these tasks for a time when I actually have a use for the 3-phase motor.

Next Page »