Go to advanced search

by pootle
Mon Aug 16, 2021 9:04 am
Forum: Python
Topic: Turbocharge python with numba
Replies: 0
Views: 201

Turbocharge python with numba

I'm doing some fairly heavy image processing, and I've been experimenting with numba to try and go faster than numpy, and speed gains range from 2X to 10X. It is also really simple to do. The "normal" way to speed up this sort of numpy processing is to hand code the inner function in C / C...
by pootle
Sun Aug 15, 2021 7:14 am
Forum: Python
Topic: Python timing behaviour - Why so bad?
Replies: 10
Views: 750

Re: Python timing behaviour - Why so bad?

1. I'm not familiar with the concept of 'real time priority' for a program. How would this be implemented in the context of a simple Python program like the ones above? Does this mean that a particular program would be given priority over other programs or over certain OS functions that might be ru...
by pootle
Fri Aug 13, 2021 5:53 pm
Forum: Python
Topic: Python timing behaviour - Why so bad?
Replies: 10
Views: 750

Re: Python timing behaviour - Why so bad?

You are running a program written in an interpreted language within a general purpose operating system, with no additional priority given to the program. Looks pretty much what I would expect running a program with very primitive timing code. You can generate very accurate and robust timings on a Ra...
by pootle
Fri Aug 13, 2021 6:16 am
Forum: Python
Topic: Compiling Python Code into an App
Replies: 5
Views: 565

Re: Compiling Python Code into an App

You don't need to compile it. Just run it as described above.
by pootle
Thu Aug 05, 2021 7:46 am
Forum: Python
Topic: Numba on pi 4?? - SOLVED
Replies: 1
Views: 420

Re: Numba on pi 4?? - SOLVED

After a few false starts I have a simple answer for this: Start with 64bit version of raspberry pi OS (numba website says there is only limited functionality on 32bit OS') I found this post on how to get miniconda going . So download the shell script for arm 64 from here . wget https://github.com/co...
by pootle
Mon Aug 02, 2021 9:03 pm
Forum: Python
Topic: Numba on pi 4?? - SOLVED
Replies: 1
Views: 420

Numba on pi 4?? - SOLVED

I've been trying out numba on my laptop, and it is very impressive for some image processing I am working on - 5 -10 times faster than numpy, sometimes even more. But my eventual target is a pi 4. There was some talk 2-3 years ago on pi 3, but it seems to have been pretty quiet since then. It might ...
by pootle
Thu May 13, 2021 6:32 am
Forum: Python
Topic: how to control 2 or more motors with async using PIGPIO Library?
Replies: 4
Views: 486

Re: how to control 2 or more motors with async using PIGPIO Library?

is it possible to make different acceleration and different frequency and different pulses can you write a couple of code or fix the given example? Yes absolutely possible, but not simple. I have a library here that drives multiple steppers using waves using A4988 style driver chips. - you have not...
by pootle
Sat Apr 10, 2021 5:53 pm
Forum: Python
Topic: Use a web browser to run your GUI - a minimal library
Replies: 3
Views: 330

Re: Use a web browser to run your GUI - a minimal library

I was planing to build an app which started with Tkinter and later to Flask all is ment to control script to make backup copys of my photos on "normal" SD from the camera. Could this be a replacement to have a live update as how many photos has been checked, copied, duplicated? Should wor...
by pootle
Sat Apr 10, 2021 11:13 am
Forum: Python
Topic: Use a web browser to run your GUI - a minimal library
Replies: 3
Views: 330

Use a web browser to run your GUI - a minimal library

I got fed up with all the messy quirks when trying to use libraries like tk or qt4. Also I wanted an easy way to control an app on a headless pi. So I've written a tiny (Python) library that uses python's http server library (so only for local network use) that makes it easy to put a web front end o...
by pootle
Tue Dec 29, 2020 8:57 am
Forum: Python
Topic: (solved) servo GPIO jitter
Replies: 6
Views: 319

Re: servo GPIO jitter

It could be that you need a decoupling capacitor up close to the servo. For smaller servo motors I use a typically a 22uF and a 100pF across the power supply as close as possible to the motor.

Is it the same type of servo that worked OK before?
by pootle
Fri Dec 11, 2020 8:23 am
Forum: Python
Topic: time.sleep for milliseconds in a for-loop raspberry pi 4B python takes longer time
Replies: 16
Views: 2014

Re: time.sleep for milliseconds in a for-loop raspberry pi 4B python takes longer time

Some simple feedback to tack account of execution and random operating system delays should fix this. Just adjust the delay dependent on the actual time: import RPi.GPIO as GPIO import time axisStepPin = 21 GPIO.setmode(GPIO.BCM) GPIO.setup(axisStepPin, GPIO.OUT) GPIO.output(axisStepPin, GPIO.LOW) s...
by pootle
Tue Dec 08, 2020 8:13 am
Forum: Automation, sensing and robotics
Topic: Wiring 10x DS18B20 probes on a breadboard
Replies: 6
Views: 637

Re: Wiring 10x DS18B20 probes on a breadboard

470pf at the sensor is good - or even 100pf , but one other consideration: How electrically noisy is the environment? Some electric motors in particular can be a problem. A domestic environment is usually good (but avoid fridges - the motor area - if possible). If the environment is noisy, then twis...
by pootle
Mon Dec 07, 2020 8:35 am
Forum: Automation, sensing and robotics
Topic: Wiring 10x DS18B20 probes on a breadboard
Replies: 6
Views: 637

Re: Wiring 10x DS18B20 probes on a breadboard

This is indeed drastic overkill, and large electrolytic capacitors are not good at decoupling. I run 4 sensors on 3m of cable with no decoupling at all. 470pf are a reasonable value, the initial huge one isn't going to help. 470uF is about 1000 time too large and being electrolytic they won't do the...
by pootle
Tue Nov 10, 2020 7:28 am
Forum: Python
Topic: PIGPIO Stepper Motor Control
Replies: 31
Views: 2532

Re: PIGPIO Stepper Motor Control

Just enter

Code: Select all

 sudo systemctl enable pigpiod
directly in a shell. It will then start automatically on every boot.
by pootle
Mon Nov 09, 2020 8:03 am
Forum: Python
Topic: PIGPIO Stepper Motor Control
Replies: 31
Views: 2532

Re: PIGPIO Stepper Motor Control

The video showing glitchy / noisy operation looks very like you are trying to run too fast without ramp up. There is always a step rate below which the motor can instantly stop and start - the speed varies with motor, load and voltage. The motor can go (a lot) faster than this, but only if it is sta...
by pootle
Mon Nov 09, 2020 7:54 am
Forum: Python
Topic: PIGPIO Stepper Motor Control
Replies: 31
Views: 2532

Re: PIGPIO Stepper Motor Control

Any easy way to have the daemon start automatically? (At system startup, or when the program is called.) I tried using os.system("sudo pigpiod") at the top of the script and I also tried creating a separate script with that code and adding it to start up. Neither seems to work. Not sure h...
by pootle
Thu Nov 05, 2020 7:49 am
Forum: Python
Topic: PIGPIO Stepper Motor Control
Replies: 31
Views: 2532

Re: PIGPIO Stepper Motor Control

... it needs a soft start acceleration ramp. I think the simple Sleep timed loop has already been tried and failed. But the OP is aiming for 15 - 30 rpm, even with a 1.8 degree stepper motor this only requires a maximum of 100 full steps per second, and is well below the speed at which ramping is r...
by pootle
Wed Nov 04, 2020 8:09 am
Forum: Python
Topic: PIGPIO Stepper Motor Control
Replies: 31
Views: 2532

Re: PIGPIO Stepper Motor Control

For the speed you want waves are a complicated solution. Can I suggest some minor changes to the basic loop you posted earlier... for x in range(10): pi.write(17, 1) # set tom's gpio BCM 17 to high time.sleep(delay) pi.write(17, 0) # set tom's gpio BCM 17 to low time.sleep(delay) First, use gpio_tri...
by pootle
Sun Nov 01, 2020 9:17 am
Forum: Python
Topic: PIGPIO Stepper Motor Control
Replies: 31
Views: 2532

Re: PIGPIO Stepper Motor Control

The code you need is very dependent on the driver chip you are using - what driver hardware are youo using.

And yes, assuming you are not using a really advanced driver chip like one of the TMC ones (here for example), then waves are the ultimate way to get accurate timing.
by pootle
Tue Oct 20, 2020 5:16 pm
Forum: Python
Topic: TensorFLow, YoloV4Tiny and sudoku
Replies: 19
Views: 1403

Re: TensorFLow, YoloV4Tiny and sudoku

I wrote a very simple brute force solver in about 60 lines of Python, it runs on a Pi 4 in usually less than 1 second. A version with simple optimisations, (about 100 lines of python typically runs 50 - 100 times faster) - the example quoted earlier by Hermann earlier solves in 2 milliseconds. (add ...
by pootle
Tue Oct 13, 2020 8:03 am
Forum: Python
Topic: TensorFLow, YoloV4Tiny and sudoku
Replies: 19
Views: 1403

Re: TensorFLow, YoloV4Tiny and sudoku

the main app (detect_sudoku.py) tries to import sudokuGridSorter and fails as there is no module of that name..........
by pootle
Mon Sep 28, 2020 6:56 am
Forum: General discussion
Topic: Isolating Public server on local network
Replies: 15
Views: 3375

Re: Isolating Public server on local network

VPN is the simplest answer, the other way (potentially safer) is to run a dmz using (for example) pfSense on an old laptop / PC or pre-setup on somethng like a netgate SG-1100. Your exisitng router then just gives access to your "public" pi and pfsense and everything else is behind pfsense...
by pootle
Wed Sep 02, 2020 6:30 am
Forum: General discussion
Topic: Multiple stepper motors
Replies: 4
Views: 343

Re: Multiple stepper motors

While a pi can drive 2 or 3 steppers with simple driver circuits very well, 8 is challenging if you want to drive them at speed. I would suggest using smart drivers such as those from TMC . Starting at this level you will have to write a lot of software unless you have a framework (like ROS ) in mind.
by pootle
Sat Aug 15, 2020 4:14 pm
Forum: General discussion
Topic: Humor: Syslog Messages
Replies: 17
Views: 1074

Re: Humor: Syslog Messages

An error message from a network processor in the 1980's

"Error: name already approximately in use"

There was a good reason for this too.
by pootle
Fri Aug 14, 2020 8:00 am
Forum: General discussion
Topic: Stepper motor with matlab
Replies: 1
Views: 250

Re: Stepper motor with matlab

Stepper motors need regular pulses to run smoothly. Using writedigitalpin (through an arduino?) to provide step pulses from matlab will not be able to generate regularly spaced pulses. Writedigitalpin is intended for non time-critical (in computer timescales) uses such as driving indicator LEDs, or ...

Go to advanced search