SIGGEN(9)

πŸ’– SIGGEN(9) β€” HAL Component πŸ’–

okay bestie, welcome to siggen, the signal generator of your dreams ✨ it lives in the HAL component family and it's literally the moment πŸŽ€


✨ NAME ✨

siggen β€” a signal generator, periodt πŸ’…


🌸 SYNOPSIS 🌸

loadrt siggen [num_chan=num | names=name1[,name2...]]

πŸ¦‹ DESCRIPTION πŸ¦‹

so siggen is a signal generator, right? and it's the girl for testing and any other application that just needs some simple waveforms 🫢. it makes sine, cosine, triangle, sawtooth, and square waves β€” with variable frequency, amplitude, and offset β€” and you can feed all of that into other HAL components. it's giving "utility icon" ngl πŸ‘‘

siggen supports a maximum of sixteen channels. how many actually get loaded? that's set by the num_chan argument when you load the module 🧚 alternatively, you can specify names= and hand it unique names separated by commas.

lowkey important: num_chan= and names= are mutually exclusive, bestie. pick one. and if you specify neither num_chan= nor names=? the default value is one. one channel. that's it. πŸ’€

πŸ’œ NAMING πŸ’œ

the names for pins, parameters, and functions get prefixed like this:

  • siggen.N. for N=0,1,...,num-1 when you're using num_chan=num
  • nameN. for nameN=name1,name2,... when you're using names=name1,name2,...

and the siggen.N. format is the one shown in all the descriptions below, so keep that in mind πŸ‘‡


⭐ FUNCTIONS ⭐

  • siggen.N.update (uses floating-point) β€” updates the output pins for signal generator N. every single time it's called it calculates a new sample ✨ it should be called many times faster than the desired signal frequency, to avoid distortion and aliasing. no cap, call it fast or the waveform gets messy 😭

πŸŽ€ PINS πŸŽ€

  • siggen.N.frequency float in β€” the output frequency for signal generator N, in Hertz. the default value is 1.0 Hertz.
  • siggen.N.amplitude float in β€” the output amplitude for signal generator N. if offset is zero, the outputs will swing from -amplitude to +amplitude. the default value is 1.00.
  • siggen.N.offset float in β€” the output offset for signal generator N. this value is added directly to the output signal. the default value is zero.
  • siggen.N.reset bit in β€” resets the output pins to pretermined states:
    • sine β€” 0
    • sawtooth β€” 0
    • square β€” -1 * amplitude
    • cosine β€” -1 * amplitude
    • triangle β€” -1 * amplitude
  • siggen.N.clock bit out β€” the clock output. a bit type clock signal output at the commanded frequency ⏰
  • siggen.N.square float out β€” the square wave output. it's positive while triangle and cosine are ramping upwards, and while sine is negative.
  • siggen.N.sine float out β€” the sine output. it lags cosine by 90 degrees.
  • siggen.N.cosine float out β€” the cosine output. it leads sine by 90 degrees.
  • siggen.N.triangle float out β€” the triangle wave output. ramps up while square is positive, and down while square is negative. it reaches its positive and negative peaks at the same time as cosine πŸ“ˆπŸ“‰
  • siggen.N.sawtooth float out β€” the sawtooth output. ramps upwards to its positive peak, then instantly drops to its negative peak and starts ramping again πŸͺš the drop occurs when triangle and cosine are at their positive peaks, and it coincides with the falling edge of square.

🌈 PARAMETERS 🌈

None. nothing. zero. empty. the void. πŸ™ˆ


that's the whole vibe check bestie, go make some waves πŸŒŠπŸ’–

LinuxCNC Documentation Β· 2007-01-16 β€” mwah, xoxo, go slay some HAL 🫢✨