noel20 pisze:A może w linuxie da się zmienić, żeby zmieniając prędkość wrzeciona w programie zmieniała się częstotliwość, a nie wypełnienie?
tak
tylko konfiguracje
hal generaowaną ze
stepgen trzeba zmodyfikować
tj. zamienić moduł
pwngen na coś co generuje częstotliwość proporcjonalną do chcianego napięcia...
[ Dodano: 2013-10-12, 17:07 ]
Kod: Zaznacz cały
linuxcnc-dev/linuxcnc-dev/src/hal/components$ ls *.c
at_pid.c encoder_ratio.c mux_generic.c siggen.c supply.c
boss_plc.c freqgen.c pid.c sim_encoder.c threads.c
counter.c lcd.c pwmgen.c stepgen.c watchdog.c
debounce.c matrix_kb.c sampler.c streamer.c weighted_sum.c
encoder.c modmath.c sampler_usr.c streamer_usr.c
tyle mamy do wybodu
[ Dodano: 2013-10-12, 17:18 ]
siggen.c
'siggen.c', is a HAL component that generates square, triangle, sine, cosine, and sawtooth waves. I expect that it will mostly be used for testing. It is a realtime component.
It supports any number of signal generators, as set by the insmod parameter 'num_chan'. Alternatively,use the names= specifier and a list of unique names separated by commas. The names= and num_chan= specifiers are mututally exclusive.
Each generator has a number of pins and parameters, whose names begin with 'siggen.x.', where 'x' is the generator number.
Generator numbers start at zero.
Each generator is controlled by three pins. 'frequency' sets the frequency in Hertz. 'amplitude' sets the peak amplitude, and 'offset' sets the DC offset. For example, if 'amplitude' is 1.0 and 'offset' is 0.0, the outputs will swing from -1.0 to +1.0. If 'amplitude' is 2.5 and 'offset' is 10.0, then the outputs will swing from 7.5 to 12.5.
There are six output pins: 'square', 'triangle', 'sine', 'cosine', 'clock', and 'sawtooth'. All six run at the same frequency, amplitude, and offset.
This component exports one function per signal generator, called 'siggen.x.update'. It is a floating point function.
[ Dodano: 2013-10-12, 17:21 ]
stepgen.c
'stepgen.c', is a HAL component that provides software based step pulse generation. The maximum step rate will depend on the speed of the PC, but is expected to exceed 5KHz for even the slowest computers, and may reach 25KHz on fast ones. It is a realtime component.
It supports up to 16 pulse generators. Each generator can produce several types of outputs in addition to step/dir, including quadrature, half- and full-step unipolar and bipolar, three phase,
and five phase. A 32 bit feedback value is provided indicating the current position of the motor in counts (assuming no lost steps), and a floating point feedback in user specified position units is also provided.
[ Dodano: 2013-10-12, 17:23 ]
freqgen.c
'freqgen.c', is a HAL component that generates step pulses at a specific frequency in software. The maximum step rate will depend on the speed on the PC, but is expected to exceed 1KHz for even the slowest computers, and may reach 10KHz on fast ones. It is a realtime component.
Note that this is _not_ the preferred step pulse generator for EMC2. This module simply generates a frequency (velocity). A separate PID or other loop is needed to turn EMC's position commands into velocity commands, and the PID loop needs to be tuned, which adds unneccessary complexity to the machine setup. For EMC and other applications that use position instead of velocity commands, the component "stepgen" is preferred. It contains a built in, pre-tuned position to velocity converter. This module is provided only for special cases where it is more appropriate.