Tuesday, August 22, 2006


Eat your heart out!

I threw in a few extra lines of firmware code to keep track of average PWM settings and Pulse counts.

For a pulse count setting of 15 (0-18 scale) run over a 100,000 pulse test I got an average pulse count of 15.001421. That works out to a 0.0095% positive bias.

The average PWM setting turned out to be a shade over 212 (0-255 scale) . Interestingly, the longer the test ran the lower a PWM setting was required to keep on track with the required pulse count/unit time setting. It started out at a shade under 222. I guess when the gear box warms up it works better.

Oh yeah, it corrected for overshoot perfectly. :-D

BTW, I'm definitely going over to the 16F877A. I'm within 25 words of the upper limit of memory on the 16F628A and my code is fairly tight. :-(

I tightened it some more and got 200 words back, so I still have a little wiggle room left. :-)


Question: Is your motor attached to anything? Do your tests change if you actually have a load on the motor? Was your test with the motor actually attached to a threaded rod base, or free floating?

One semi-selfish question: what frequency is your pulse width modulation circuit running, compared to the feedback pulses per second? This will probably make or break the ability for my implicit PWM logic to work, once I've got everything ready to test.
For now it's floating. I've put load on it in earlier tests, though. It just pulls more current.

Now that I've got it working fairly well I plan on attaching it to a threaded rod axis and attaching that to a pantograph to see if I can get enough energy out of it to move a 300x300 mm horizontal working surface in a design very like reiyuki's at about 6 mm/sec.

Wish me luck!
***One semi-selfish question: what frequency is your pulse width modulation circuit running, compared to the feedback pulses per second?***

Sorry that I missed this in my last response. Just a second and let me look it up. Let's see. I'm using Mode 7 on a PIC 16F628A chip. My Oshonsoft reference manual says that Mode 7 is using 977 Hz.


When I first started trying to do PWM with brushed DC motors I tried a bunch of different modes and found that Mode 7 was a pretty good all-round frequency. It works well with both the GM4 gear motor and the Frankenmotor and fairly well with the Siemens gearmotor (used to run automobile electric windows).

It may be different with the Z8 that you're using, but that's what has worked for me.

Now feeback pulses, let me work back into that. My peak rpm with the GM4 and using 5.45v input to the 754410 has given me a peak rpm of about 45.

That's about .75 rps and I have 256 pulses per revolution, so we're talking about 192 pulses/sec max so far.

BTW, I'm using the internal crystal on the 16F628A which runs at 4 MHz. It's a pretty good little CPU but nothing spectacular.

I'm going to be using the same CPU in the 16F877A but I will be running that one at 20 MHz, so I should be able to handle a lot more interrupts.

BTW, ask all the selfish questions you want. This is an open source project. What I know or suspect is yours for the asking.
Hmm.. those numbers don't make me very confortable. What happened when you took the pulse width down to the 100-200 Hz range?

I may have to use PWM afterall, and track velocity to get splines to behave themselves. I was hoping to be able to keep it simple with the logic I proposed. I guess I can still try it, but I have a feeling now that it'll end up in feedback hell; with the motor savagely slashing back and forth across the desired position.
Probably your best bet would be to revisit that question of appropriate PWM frequencies. I was a real newbie when I did that little study and I stayed away from frequencies that had more or less than 8 bit inputs. Could have been that I missed something good.
Very cool. Auto-correcting PWM to maintain specific pulse rates. The gearbox/warmup is an interesting trait too, I wasn't expecting that.

We're on a good track to DC control. Being on travel, seems like all I can contribute is code and logistics.
I'm waiting with bated breath for more tests with threaded rods, and a little bit of wear and tear on those gears.

This is so exciting! ;)
***I'm waiting with bated breath for more tests with threaded rods, and a little bit of wear and tear on those gears.***

Just make sure that that bait is fresh. :-0

Yup, I want to go over to a 16F877A so that I can write in an autocalibration scheme to account for things like gear wear and temperature in the gearbox.
The next move, however, is to see if this plastic gearmotor has enough torque to push a 300x300 mm working surface around at 6 mm via a threaded rod and pantograph assembly.

I've got to configure that. I tried sketching it out this evening, but making sure the pantograph doesn't clash with the support system for the working surface is proving a little tricky.

I'll probably do a design study with AoI.
Why would you use a pantograph, again? It seems a more simple solution would be to either use a gear ratio on the motor to allow it to drive the thread at the correct speed directly, or use a threaded rod with fewer threads per unit length.

All that adding a pantograph would seem to do is simulate gearing up in one form or another.

If it is a matter of preventing binding from the thread, I'd say your idea for using rack and pinion would be a good solution. I suppose for the repstrap, you'd have to figure out how to aquire one -- my thinking here is just make a threaded rod repstrap, and first order to make on it is a rack and pinion.
I'm mostly just fooling around. There is a little bit of method to my madness, though.

First, I can mess with the gear ratio. To do that, however, I have to either find and buy gears that will do the job or I have to design some using the scripts that I wrote for AoI and then ask Adrian to make them for me.

The problem with reprapped gears is that at this point they have to be fairly big, viz, a tooth width of about 2 mm. That means that I have a minimum gear diameter of about 25 mm (20 toothed). I need to do a 1:6 gear ratio to get what I want. That's pretty big and nasty and probably says that I want to use more than 2 years, which makes things more complicated.

The same problem leaks over into a rack and pinion scheme. If you have your little gear motor running on a 25 mm gear working on the rack you're looking at a translation distance of ~79 mm/revolution. That means that you have to go to the 4096 shaft encoder to get the kind of resolution we want. That may be a good idea, but I'm not ready to do it just yet.

The fascinating thing about using the pantograph for me is that I can easily adjust the resolution of the thing by just changing some settings.
***that I want to use more than 2 years***

should have said...

***that I want to use more than 2 GEARS***
Post a Comment

Links to this post:

Create a Link

<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to
Posts [Atom]