How to delay until a next increment of time occurs ?
Rob Gaddi
rgaddi at highlandtechnology.invalid
Thu Nov 14 16:22:01 EST 2019
On 11/14/19 12:34 PM, R.Wieser wrote:
> Dennis,
>
>> The R-Pi has never, to my knowledge, been billed as suitable
>> for industrial/real-time/process-control...
>
> I have not read those specs to be honest. But for some reason I assumed
> that a 1.4 GHz machine should easily be able to generate a 1.6 KHz signal,
> even using Python. I was wrong. It can, but just barily and not without
> jitter and hickups. Lesson learned.
>
> Regards,
> Rudy Wieser
>
The machine itself would be fine. But between Python and Linux (probably the
bigger culprit), there are lots of things that aren't interested in your
deterministicity.
Just run it bare-metal; I'm sure that's straightforward on an rPi and has no
gotchas or complications that would lead to days/weeks of frustration.
On an actually practical note; ever since they started baking the quasi-realtime
stuff into the Linux kernel, you've been able to use the whole
sched_setscheduler(2) family of calls (from C) to set a process's real-time
priority. That might get things good enough to do the job, though how one gets
there from Python I couldn't tell you. Naïvely I'd say to just use ctypes to
wrap those calls, but that's some low-level stuff to be getting into from a very
high-level language. Might work?
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
More information about the Python-list
mailing list