Go to advanced search

by PiGraham
Fri Apr 16, 2021 1:52 pm
Forum: General
Topic: Longish range wired communication
Replies: 3
Views: 118

Re: Longish range wired communication

RS232 or, better, 422 on twisted pair should be good for more than 30m.

See also
https://hackaday.com/2017/02/08/taking- ... ong-wires/
by PiGraham
Fri Apr 16, 2021 6:58 am
Forum: Python
Topic: X-Y Table Scan 4ft x 4ft Area
Replies: 13
Views: 535

Re: X-Y Table Scan 4ft x 4ft Area

Hey I was wondering if you could help me with this code. For some reason it is saying that for motor 2 the GPIO is already in use, how come it is saying that when I am using different GPIO pins and named it differently? If you call RPiGPIO.Setup on a pin that was previously setup without a call to ...
by PiGraham
Fri Apr 09, 2021 3:45 pm
Forum: MicroPython
Topic: Measure Motor speed with Pico and Micropython
Replies: 30
Views: 717

Re: Measure Motor speed with Pico and Micropython

here's how I change the PWM duty, it works fine... timeout simply stops it reading again for 1 second to allow it to settle. if (freq < freq_set - freq_limit or freq > freq_set + freq_limit): ew_normal += int((freq_set - freq) * 1250) ew_pwm.duty_u16(ew_normal) timeout = time.ticks_us() + 1000000 S...
by PiGraham
Fri Apr 09, 2021 2:44 pm
Forum: MicroPython
Topic: Measure Motor speed with Pico and Micropython
Replies: 30
Views: 717

Re: Measure Motor speed with Pico and Micropython

Its a 3 coil motor Is that a brushed dc motor? Bear in mind that the coils get energised as the commutator connects so there are distinct 'kicks' as the rotor turns. The consistency of timing pole to pole is probably highly variable and will depend more on the characteristics of the load than the m...
by PiGraham
Thu Apr 08, 2021 1:46 pm
Forum: Python
Topic: Execute file only once after status change in loop
Replies: 21
Views: 574

Re: Execute file only once after status change in loop

So you are not using any of the code I posted but something you have put together yourself. So exactly what code are you running and how does it not work. I tested the code you posted. Both on my test setup (with just jumper cables) that worked as it should, and on the 'production' setup which did ...
by PiGraham
Wed Apr 07, 2021 1:29 pm
Forum: Advanced users
Topic: Raspberry pi localisation and mapping
Replies: 1
Views: 92

Re: Raspberry pi localisation and mapping

I haven't used it, but I understand ROS has support for SLAM UWB radio location systems work indoors, but not cheap. If you can put markers or tags in known locations you could triangualte position fairly easily. QR codes on sticky labels. IR LED beacons (IR remote control type Tx Rx. BLE beacons IM...
by PiGraham
Tue Apr 06, 2021 8:24 am
Forum: Python
Topic: Execute file only once after status change in loop
Replies: 21
Views: 574

Re: Execute file only once after status change in loop

... If a second thread was running that could also update state then there would be a potential for .... Threading is a different can of worms. For no good reason (tiredness?) I saw the two conditionals were an error but replied as if they were a series of if() or case conditions that were clearly ...
by PiGraham
Mon Apr 05, 2021 8:23 pm
Forum: Python
Topic: Execute file only once after status change in loop
Replies: 21
Views: 574

Re: Execute file only once after status change in loop

It won't run the section with camOn.py, that part will never be executed, if state == 0 the first part (before the elif) gets executed and any elif sections after will be skipped entirely regardless of whether their condition is true or not. The elif as given effectively says if state != 0 and stat...
by PiGraham
Mon Apr 05, 2021 2:49 pm
Forum: Python
Topic: Execute file only once after status change in loop
Replies: 21
Views: 574

Re: Execute file only once after status change in loop

I have a script that does what it needs to do. Push button change the status and turns of the camera until it is pushed again. However the loop keeps executing the external file even when it is not necessary. Is there a way to have the external file been executed once until the status change? impor...
by PiGraham
Thu Apr 01, 2021 6:33 pm
Forum: Python
Topic: X-Y Table Scan 4ft x 4ft Area
Replies: 13
Views: 535

Re: X-Y Table Scan 4ft x 4ft Area

Start with examples for flashing LEDs.

https://magpi.raspberrypi.org/articles/ ... spberry-pi
by PiGraham
Thu Apr 01, 2021 6:16 pm
Forum: Python
Topic: X-Y Table Scan 4ft x 4ft Area
Replies: 13
Views: 535

Re: X-Y Table Scan 4ft x 4ft Area

Yeah well it is scanned a square area. Only one axis moves at a time. For it to go the x axis both stepper motors move the same direction and for it to go the y axis the one stepper motor moves clock wise the other counter. Movement speed is not important. Yeah its moving up to 5kg. Easy enough. Ju...
by PiGraham
Thu Apr 01, 2021 5:10 pm
Forum: Python
Topic: X-Y Table Scan 4ft x 4ft Area
Replies: 13
Views: 535

Re: X-Y Table Scan 4ft x 4ft Area

The motion I expect is for it to start from home (0,0) then move 4 ft on the x axis then 1 ft in the y direction then it would move back down 4 ft in the x direction and once it does that it moves another 1 ft in the y direction. The best way I guess I could describe what it looks movement wise is ...
by PiGraham
Thu Apr 01, 2021 4:38 pm
Forum: General discussion
Topic: tracking the location of multiple pieces of equipment
Replies: 6
Views: 350

Re: tracking the location of multiple pieces of equipment

Would I need independent GPS modules on each to be able to locate the item or would WI-FI be good? What software would work for this? Wi-Fi should be adequate, if each sit has good coverage. Each access point can be named so that you (your software) can identify it. Is every item of equipment power...
by PiGraham
Thu Apr 01, 2021 1:57 pm
Forum: Beginners
Topic: GPIOzero - relay controlled by bistable switch
Replies: 93
Views: 2076

Re: GPIOzero - relay controlled by bistable switch

Great job there pcmanbob!
by PiGraham
Thu Apr 01, 2021 1:42 pm
Forum: Beginners
Topic: GPIOzero - relay controlled by bistable switch
Replies: 93
Views: 2076

Re: GPIOzero - relay controlled by bistable switch

Alchoni_ wrote:
Thu Apr 01, 2021 1:33 pm
There's no way to say how grateful I am, thank you for your time and patience. Everything works like a dream and mechatronics has never given me so much fun yet :D

Thanks again,
Alchoni_
That's excellent news. Have fun.
by PiGraham
Thu Apr 01, 2021 12:14 pm
Forum: Beginners
Topic: GPIOzero - relay controlled by bistable switch
Replies: 93
Views: 2076

Re: GPIOzero - relay controlled by bistable switch

I will solder everything one more time because I have two more transistors, use better resistors and generally improve circuit and then I will test everything and give a feedback You would be better setting it up on a breadboard for testing , because just soldering components together as you are ma...
by PiGraham
Wed Mar 31, 2021 8:06 pm
Forum: Other projects
Topic: Pygame won't detect ctrl+C or esc key
Replies: 9
Views: 385

Re: Pygame won't detect ctrl+C or esc key

rpiMike wrote:
Tue Mar 30, 2021 8:56 pm
The following will detect Escape and Ctrl-C:

Yes, that works.
by PiGraham
Wed Mar 31, 2021 9:25 am
Forum: MicroPython
Topic: Setting the usb baud rate ?
Replies: 6
Views: 271

Re: Setting the usb baud rate ?

You are sending \n but not receiving it?
I don't know, sorry.
Try stdin.input() to not treat \n as EOL? Do you receive it then?
Use a different delimiter and parse it yourself?
by PiGraham
Wed Mar 31, 2021 7:21 am
Forum: Python
Topic: X-Y Table Scan 4ft x 4ft Area
Replies: 13
Views: 535

Re: X-Y Table Scan 4ft x 4ft Area

What sort of motion do you expect? How is it defined? Many CNC systems are controlled by GCode. But you use the word 'scan' which might suggest a more linear traverse. Controlling motion along smooth curves and sharp corners is different to moving the gantry to each quadrant in turn for ,say, photog...
by PiGraham
Wed Mar 31, 2021 6:29 am
Forum: Automation, sensing and robotics
Topic: Electrical Spark at Power Supply Plug-In
Replies: 12
Views: 545

Re: Electrical Spark at Power Supply Plug-In

I would estimate the largest of the sparks reached about a 10 mm radius and shot out in multiple directions. Thin blue arc or bright yellow flash? There is a big difference between striking an arc across 10mm of air and spitting out sparks for 10mm from an intermittent metal to metal contact. If th...
by PiGraham
Wed Mar 31, 2021 6:12 am
Forum: MicroPython
Topic: Setting the usb baud rate ?
Replies: 6
Views: 271

Re: Setting the usb baud rate ?

Do you need to set it? It isn't an actual Rx Tx serial connection, it's only a USB endpoint.
I'm not certain about this, but I don't think it matters what baud rate is reported or set.
by PiGraham
Tue Mar 30, 2021 8:23 pm
Forum: Other projects
Topic: Pygame won't detect ctrl+C or esc key
Replies: 9
Views: 385

Re: Pygame won't detect ctrl+C or esc key

I suggest you try some minimal code using pygame events for key input and clean exit. Get that working the try merging into the rest.
Output debug info with print or set some text object you are rendering onscreen to show key codes.
by PiGraham
Tue Mar 30, 2021 4:29 pm
Forum: Other projects
Topic: Pygame won't detect ctrl+C or esc key
Replies: 9
Views: 385

Re: Pygame won't detect ctrl+C or esc key

Looking for a key event should be the way to go. Why do you have running=false in the fist clause and running false pygame.quit() in the second? Are you getting the events but it not exiting, or can you not catch the keys? Does it work for some other key, say 'X'? I found this that may be relevant. ...
by PiGraham
Tue Mar 30, 2021 12:49 pm
Forum: Automation, sensing and robotics
Topic: Electrical Spark at Power Supply Plug-In
Replies: 12
Views: 545

Re: Electrical Spark at Power Supply Plug-In

I have been trying to wrap my head around why this is happening, but I don't see see how any changes I have made would cause this. Was hoping someone might have an idea or two I can check out. Why d you mentions changes? Do you think the same setup previously never sparked and now it does? Is the c...

Go to advanced search