On Monday 10 June 2013 04:25:17 Gene Heskett did opine:

Update, big math error discovered while sleeping on it.
 
> Let me talk to myself & you eavesdrop.
> 
> Lets consider a D/A consisting of an LM2907 to derive the controlling
> voltage.
> 
> What have we got to play with in a .hal module?
> 
> BASE_THREAD 25 microseconds
> SERVO_THREAD 1 millisecond in most default machines
> 
> Load a counter with the desired number of pulses to be generated in this
> SERVO_THREAD.  Capped of course at SERVO_THREAD/BASE_THREAD, = 40,000 in
> this example case.

Actually 1000 u-s/ 25 u-s= 40, not 40,000

> If the counter has not counted down to zero using BASE_THREAD as a
> countdown clock, generate a pulse that is parport reset time in duration
> (3.3u-secs in my case) and decrement the counter, continuing to do this
> until the counter is zeroed, then be quiet till the counter is reloaded
> on the next SERVO_THREAD.
> 
> Repeat as long as there is a digital value available.  Stop is of course
> fully inactive regardless of residual count.
> 
> With the above thread timings, and without any dithering, we will have
> an output granularity of .03 rpms when the top speed is 1200 rpms.
> 
Correction, 30 rpms with no dithering, which gives us a figure of how much 
to dither it.

> The output will be groups of pulses, with the groups spaced at
> SERVO_THREAD times.  With a 1 kilohertz update rate, we can probably
> filter the output with a 20 hz corner frequency filter if we don't like
> the 1 kilohertz tone from the motor which, given the mass of the
> spinning stuff, should result in a very steady motor speed with or
> without the filter.  Suitable scaling and the PID controller should be
> able to handle the load variations.

Here, I'd use 2 hardware oneshots in the LM2907 interfacing, one to drive 
an S-H of the LM2907's output if a BASE_THREAD time goes by without a new 
pulse so as to actually update the output just once each SERVO_THREAD, and 
one to reset the S-H output to zero if a SERVO_THREAD time goes by without 
a pulse.  This would give a step function but steady output, therefore not 
needing the Low Pass filter, while still offering a stop in close enough to 
real time "for the girls I go with."  2 trimmer pots on the interface, one 
to set say 30 u-s if BASE_THEAD is 25 u-s, and one to set 1.1ms for a "hey 
no update, its been stopped" reset.  The actual output to the controller 
would be sampled and held at the end of the last pulse sent, or reset to 
zero if no update sent in a SERVO_THREAD time.

> The LM2907 implementation could come right out of the chips app notes.

With the hardware S-H and one shot additions mentioned above.

On the dithering, it should not be just random noise, but a weighted 
average correction, eg add a count if the average is low, or subtract a 
count if its average is high, with reload of the average register with the 
target value at any speed change.  Basically an up-down counter driven by 
the difference between commanded and most recently sent, so it would hunt 
in the right direction.

For pulse generation, charge_pump, enabled by the non-zero status of updown 
looks enticing, but also slow & would need 2x as much dither because its a 
divide by 2 of BASE_THREAD, but might be usable to cobble up a test case.  
How hard would it be to incorporate the stepgen pin 'reset' into a 
charge_pump like module, doubling its bandwidth?

Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
My views 
<http://www.armchairpatriot.com/What%20Has%20America%20Become.shtml>
It is a hard matter, my fellow citizens, to argue with the belly,
since it has no ears.
                -- Marcus Porcius Cato
A pen in the hand of this president is far more
dangerous than 200 million guns in the hands of
         law-abiding citizens.

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to