I seem to be coming to this discussion very late. How to answer the age old question that has dogged robot builders since the beginning of time " How to make my robot drive straight ". I have lost count at how many hours I have spend chasing this unicorn :) There is a few options. 1. Stepp...
I usually use Hobby Lipo batteries for all my projects as they are cheaper and have higher energy density as well as can handle much higher amps if needed. But I would guess you are not running them in a UPS (uninterruptable power supply) mode that allows connecting/disconnecting the charging sourc...
In most cases when people uses stepper motors on CNC type machines they don't usually have measuring device but rather use step count for the stepper motor. i.e they have a limit switch and on start up it moves all the way till it triggers the limit switch then counts the steps that the stepper moto...
I usually use Hobby Lipo batteries for all my projects as they are cheaper and have higher energy density as well as can handle much higher amps if needed.
Just out of interest why are you using a rack and pinion over a lead screw or belt pulley?? There is tons of buy off the shelf and plug and play of these 2 systems here is example of belt driver for a linear actuator https://www.aliexpress.com/item/Durable-HPV2-Linear-Guide-Set-Openbuilds-V-Linear-A...
I tend to use these little time of flight sensors that are used on drone for obstacle avoidance https://www.aliexpress.com/item/GY-530-VL53L0X-World-smallest-Time-o-f-Flight-ToF-laser-ranging-sensor/32773126352.html?ws_ab_test=searchweb0_0,searchweb201602_8_10065_10068_10130_10547_319_317_10548_1069...
Thanks for the replies. Yes, I use non-rechargable batteries indeed. Why is it that rechargable batteries provide more current or in other words why do they have a lower internal resistance? Then this would also mean that I should rather use a 20A fuse when I use rechargable batteries and the 5A fu...
A fuse is basically a weak point. When something shorts out then current can flow very high and what ever can handle the lowest current will burnout first. So to protect the rest of your components you will add a fuse(weak point) so if there is a short and current goes high the fuse burnouts rather ...
Normally when you get a heap of weird chars like that it means the configuration n is wrong (most common the baud rate). Your post you show the setup on windows and the setup on RPi and they match but I suspect that maybe windows changes the baud rate when printing??? especially since your only send...
U can get these dual h-bridge very cheap that will drive larger motors https://www.aliexpress.com/item/Special-promotions-2pcs-lot-L298N-motor-driver-board-module-L298-for-arduino-stepper-motor-smart-car/32224772756.html?ws_ab_test=searchweb0_0,searchweb201602_4_10065_10068_10130_10547_319_317_10548...
I assume that your using a call back when a mouse event occurs. If so what I would do is have a global variable that holds a time stamp that is updated every-time the call back occurs then in your main loop compare the time stamp to current time and if the needed time has passed then zero the array
OK this is a long story and I will see if I can answer it as short and simple as possible with giving you enough info. For useful motor control you need to build up layers of behavior with each layer building on the top of the lower layer. First layer speed control: You make a function that controls...
It can be easily achieved like this The problem with that code is that unless you do use a callback or something like that, if the button is pressed while the sensor is being read, it won't be detected. The DS18B20 can take a second or so to read. I had no idea that reading that temp sensor was so ...
to elaborate a little more. When a function is called it will create/allocate any variables that are used within the function that are not declared global then when the function returns it will destroy/de-allocate all variables that are not global. So every time you call your function it creates a n...
I generally wouldm't use call back threading for such a simple task. It can be easily achieved like this import time #add code to setup the pin for button pressed start_time = time.now() While True: #if 10 seconds has passed then read sensor if time.now() - start_time > 10: #code to read sensor goes...
Ok I haven't used the MCP3008 ADC but do know of it. I mainly use the ADS1115 or the ADC pins of a MCU. Now your trying to do this in a very usual way. Your code to read the sensors sets up the SPI and then reads the data then turns the data into a string. The data being returned is an integer why t...
Well then you have a few options. Just write it in block of 4096 this shouldn't slow you down too much as it is still large blocks not individual pixels. I do believe it maybe possible to change the max size of SPI buffer but not sure on exact linux kernal settings. After a bit of googling it seems ...
So what happens is python is slow to call a function. So calling the function to write to the SPI takes much longer than the writing. So make a buffer and write the whole screen in 1 write rather than call it over and over in a for loop. Something like this #create a buffer to hold a 16bit image of ...
I written my own drivers for these little screen before and once once u run initialization code then set the window you want to write too you can just send the RAMWR (ram write) command then send the image buffer to the SPI then it will appear on the screen. here is a good example of a driver I wrot...