Questions tagged [python]

On-topic questions related to Python would include embedded programming, using it as a tool for circuit analysis, or how Python interacts with computational hardware. Questions about libraries, algorithms, syntax, or code optimization should be directed to stackoverflow.com.

Filter by
Sorted by
Tagged with
0
votes
0answers
25 views

Are my charging equations being used correctly in my lithium ion battery Python simulation?

This is a continuation of a previous question I asked (Are my equations correct for a simple lithium ion battery model in Python?). My issue now is I do not believe I am using the charge equations ...
0
votes
0answers
18 views

Is it possible to specify a script that should be executed as soon as synthesis starts in Synopsys Synplify?

The Synopsys Synplify Pro is used internally to carry out synthesis in Libero and probably other places. Is there a method to assign a tcl or python script to be executed just before or just after ...
2
votes
0answers
17 views

Trinket M0 PWM ValueError: duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)

I'm trying to control a servo motor from a Trinket M0. My circuitpython code is: ...
0
votes
1answer
44 views

Response time of RTS and DTS pins of the chip FT232RL (USB to Serial)

I'm controlling the values ("High" or "Low") of RTS and DTR pins in FT232RL using python package serial. My question is what's the maximum time between executing the command ser....
2
votes
3answers
147 views

How can I model an optical filter using python?

Say I have an RGB LED which transmit intensity modulated signals, at one symbol transmission I want to send a symbol with all three chips.. Can I just model three bandpass optical filters like RF ...
0
votes
1answer
60 views

Controlling a digital switch using Python through USB

I have an RF digital switch that takes two digital inputs (AB) in order to decide from which antenna port to take the input. Is their a simple way to use Python to send the AB values through the USB ...
1
vote
1answer
266 views

Using Python to simulate an LTspice netlist

I am new to Python, and I want to simulate LTspice circuits automatically using Python. I added the library ltspice and scripted a fair amount in order for Python to automatically generate an ...
0
votes
0answers
75 views

Are my equations correct for a simple lithium ion battery model in Python?

I am trying to create a simple battery model in Python based on the RC circuit from, http://firsttimeprogrammer.blogspot.com/2015/07/electric-circuits-101-rc-and-rl-circuits.html. I have attached ...
2
votes
1answer
44 views

Compute electric field in complex 3D geometry

I have a CAD file with a pretty complex geometry. I would like to compute the electric field generated by this geometry when a specific charge density is defined. I guess I will have to go through ...
0
votes
2answers
88 views

20kg digital servo not working, probably because my frequency calculations are very wrong (raspberry pi)

summary I changed my servos for a more powerful one and cannot get it to work, I believe it is because I can't get the right duty cycle calculation in the code explanation I have a robotic arm that I ...
0
votes
0answers
34 views

How do I set up serial communication between two Holybro Telemetry Radios?

I have two USB Holybro 915 MHz Telemetry Radios. These are usually used with Mavlink for communication between drones and ground stations, but I would like to use them to send small amounts of data - ...
1
vote
1answer
145 views

How to find out the used code?

I have a data stream that looks like x\xdam\xdd]\xc4\xeemZ\xc7q)2\xcc\xd6cL\x1a1\x8c\xc9hc\x0c)\xeb^\xaf\xd7Z (...) How can I find out what I do see here? At the ...
1
vote
4answers
52 views

with a L298N controller I need to “warm up” the motor to get it to run without stopping, why and how to do it with python

I understand that this will be a very trivial question but I cannot find an explanation online, probably because in my ignorance I'm asking the wrong question, to support my explanation I'm leaving ...
1
vote
2answers
147 views

I fried my Raspberry Pi while using L298N but I don't understand why

Everything seems to indicate that I fried my raspberry pi: the green light wouldn't turn on, I changed the SD card for a new one but it still didn't work. That is a shame because I was having a lot ...
0
votes
0answers
36 views

Gamecube controller hack with raspberry pi

Electrical noob here. I am trying to control a gamecube controller from a raspberry pi. Meaning: I want to have wires from the pi soldered onto the board of the gamecube contoller and emulate button ...
0
votes
0answers
22 views

How to store data in Keithley2400 buffer during measurements and retrieve through rs232?

I am trying to do an IV measurement (source current, sense voltage) store into the Keithley2400 buffer and retrieve the measured data (voltage and current) into my python program variable 'data'. <...
3
votes
2answers
80 views

Error correctly identifying Ls and Rs from measured Vin and Vo in LTSpice

As an exercise (using Python to process LTSpice exported data), I am trying to determine the values of Rs and Ls that were used in a circuit, from the the measurements of Vin, Vout, and the phase lead/...
0
votes
1answer
126 views

Which Raspberry Pi 3B+ GPIO pin is connected to which module in Adeept Motor Hat v2.0?

I need to find out which GPIO pin on the raspberry pi will be connected to which module when I fit the Adeept Motor Hat v2.0 on the 40 GPIO pins. I am attaching the image and the schematic of the ...
0
votes
0answers
29 views

Simulating Railroad ECode track circuit from a Raspberry Pi

I'm looking to simulate a track circuit by sending out digital voltages of 2.5 volts from the raspberry pi at varying intervals of time (see image below). My question before I go too far into coding ...
0
votes
0answers
18 views

Using Encoder data to map / visualize

I have a little robot, with two wheels and two encoders. I get the way and speed of each wheel in software. I am using the speed to calculate these equations: ...
0
votes
0answers
109 views

Precise sampling rate for data acquisition with Arduino and Python

I built a simple data logger with Arduino and Python (Accelerometer --SPI--> ESP32 --USBSerial--> RPi). I used the timer interrupt to control the output data rate, which is set to 300Hz. But I noticed ...
1
vote
0answers
27 views

Finding the impedance of a distribution line from R,X,C values [closed]

I have real industry data of distribution feeder with line data consisting of r ,x and c values as shown in the attached figure. ...
0
votes
2answers
151 views

Python to trigger USB square wave pulse for camera

I'm sorry if this was posted somewhere, but I'm trying to trigger a FLIR camera for acquisition using a USB port. I already purchased a USB split cable, and have queried the ports, so I know exactly ...
1
vote
0answers
16 views

Discrete Cosine Transform (DCT) Coefficient Distribution

I have two images : Original Image Binarized Image I have applied Discrete Cosine Transform to the two images by dividing the 256x256 image into 8x8 blocks. After, I want to compare their DCT ...
0
votes
1answer
110 views

How to free up memory in a CircuitPython board?

I'm using a Feather M0 Express from Adafruit with a DS3231 Precision RTC FeatherWing for a custom clock project that displays time with LEDs. The clock works as follows: When the clock gets plugged ...
0
votes
0answers
34 views

M5Stick turns off randomly

I recently got an M5StickC, and I'm programming it using UIFlow. I wrote some code for it, and it works fine for about 45 minutes (not plugged in, not on Wifi), then it just turns off for no reason. I ...
1
vote
1answer
38 views

PCA9456A i2c switch channel 1 not showing up

I am using an PCA9456A i2c switch to help me toggle between i2c devices with the same address, but i am having problems opening channel 1 (second channel out of 4) and i ran out of ideas what is ...
0
votes
4answers
170 views

FFT of a square wave

I'm generating a square wave as PWM whose frequency is set to 25 Hz. On the oscilloscope, I've got: The data referred to the image above was stored and maniputed, then I plot it using jupyter ...
0
votes
0answers
28 views

Raspberry pi not getting any data from hx711

I'm trying to combine two boards into one: SparkFun Load Sensor Combinator(basically just a wheatstone bridge) and SparkFun Load Cell Amplifier. The data will be transmitted to a Raspberry Pi 3 so ...
0
votes
0answers
48 views

How to use MLX90640 thermal camera code for a AMG8833 thermal camera?

So I want to use the AMG8833 sensor with my raspberry pi and some machine learning code, but the code was using the platypush package which is meant for the MLX90640 thermal camera. But after some ...
0
votes
1answer
140 views

Help with understanding the Memory Map of MLX90393

(Using a Raspberry Pi 3 Model B+ and python) I needed some assistance in understanding the memory map of MLX90393 I've attached the memory map here and you could also find it in the datasheet. I'm a ...
0
votes
1answer
96 views

ESC control with Raspberry Pi

I'm trying to control some ESC and brushless motors using a raspberry pi. I used the pigpio library to control them using servo pulses. But it seems that my motors wont increase rpm after a limit ...
0
votes
1answer
781 views

VISA: (Hex 0xBFFF0015) Timeout expired before operation completed

I'm writing a simple code in Python to remotely send commands from PC to RSHameg HM8134-3, using USB. I'm using visa to do so. Something to note, when I write to it, it doesn't give me any errors(...
0
votes
0answers
50 views

need help deciphering accel/gyro datasheet for i2c communication using python RPi

I have barely any knowledge in this area, the most I have done is used my RPi3 with pre-built python libraries for sensors such as ADS1115 so I didn't have to go through the process of understanding ...
1
vote
2answers
192 views

Writing commands to a microcontroller with a STM32f chip from python

Manual to the micro controller: https://drive.google.com/file/d/0B8PmY6nhQadKSVc5OE04c3ZJaFU/view?usp=sharing , where page 18-19 introduces the serial communication protocol. The micro controller on ...
1
vote
1answer
105 views

Lighting up LEDS via I2C Bus of a NeoTrellis 4x4 RGB Led Matrix

Many attempts to write to an i2c slave to make rgb leds light up have failed. The hardware in question is found at: https://learn.adafruit.com/adafruit-neotrellis There is an arduino library and a ...
0
votes
0answers
42 views

Implementation of complementary filter and output of sensor while stationary

The code for a complementary filtered angle is not outputting the expected angle. I can get close to 90° using arctan formula from the accelerometer sensor data. Whereas, the complementary filter ...
0
votes
1answer
128 views

What's a better way to integrate an ODE for one time-step than the Euler method?

I'm simulating a simple cart-pendulum system for purposes of testing different control strategies and data-driven approaches. I need to simulate the dynamical system one time-step at a time. I'm ...
0
votes
2answers
48 views

Voltage drop after writing to slave register with I2C protocol

I'm trying to control this bipolar stepper motor with an Adafruit Huzzah32 (ESP32) board and a stepper driver shield. Power sources: ESP32: 5V USB port Shield: 4 AA-batteries in series I ...
2
votes
0answers
439 views

PV cells (photovoltaic) I-V curve plot simulation

I am trying to plot the I-V curve using python because that helps me in understanding PV cells / solar panels (and diodes as a general thing). I know the formulas ...
0
votes
0answers
58 views

Serial communication between raspberry and laptop not giving right values

I want to communicate between a Raspberry Pi 3 model B and a laptop using a USB to RS-232 cable and this RS-232 to 3.3V TTL converter via the serial module in Python: GND is connected to board pin #6 ...
1
vote
1answer
148 views

Sudden raspbery pi power cut or random long delay when running stepper motor using pigpiod

So I wrote another program that can run stepper motor nema 34 using leadshine DM860 driver and this is the example of my code: ...
0
votes
2answers
538 views

AttributeError: 'NoneType' object has no attribute 'send' pigpiod

So I create an another program that can run stepper motor clockwise and counter clockwise with a ramp up and ramp down in there and adding limiter switch on GPIO 16 and 26 to stop the ...
0
votes
0answers
60 views

Converting the output of a Proportional Control System to a meaningful drive of a Peltier

Trying to create a PID controller for temperature control using a Peltier element, I decided to take it step by step and create first the Proportional and then the Integral and the Derivative ...
0
votes
3answers
291 views

Monte Carlo Simulation In Python instead of HSPICE

Suppose I have a resistor and I want to simulate process variation on it. When I was reading online, I noticed that Monte Carlo simulation is used for this purpose. I also noticed that HSPICE has ...
0
votes
1answer
43 views

Getting valid input from Ultrasonic range finder

(I am posting this question here since I feel that the issue is a part of my lacking understanding of the electronics, and not a ) I am trying to monitor the feed hopper for my pellet furnace. I had ...
0
votes
2answers
304 views

Increase the ramp up stepper motor performance

I'm driving a NEMA34 bipolar stepper motor with the following specifications: Holding torque 5.9 Nm Step angle 1.8° Resistance / phase 0.33±10% Ω Inductance / phase 3.00±20% mH Max load axial 65 N ...
1
vote
1answer
428 views

Tektronix TBS 2000 oscilloscope to Python

I am a total beginner when it comes to communicating to your electronic devices using python. I installed PyVISA, Open Choice Talker Listner (Tektronix), a few other items. I was able to send basic ...
0
votes
0answers
61 views

Checking for signals above strength threshold over SDR on VHF

So I have a small NooElec Software Defined Radio and I've got it working well with my Raspberry Pi using GQRX as a controller and to visualize the SDR output. My goal though is to use a python script ...
-1
votes
3answers
165 views

Need Help with Python Script - ' 4 Dollar Programmer'

I am working on an embedded project and have made my first PCB with a processor mounted on board. The trouble seems to be actually getting my code onto that processor! I was sort of banking on being ...