Posts

A smoother sinusoidal motion profile

Image
 I have been looking at the motion problem beyond the snap to realize that its derivative, crackle, was not continuous in my case .  So I went ahead and looked for another expression; this time, I used chatGPT, and I asked for a sinusoidal function that: Be continuous. Started and ended at zero. Its definite integral was zero. Consisted of two positive pulses, with a negative pulse in between. It was suggested this function could do the work: j ( t ) = sin ( Ï€ t/T ​ ) sin ( 3 Ï€ t/T ​ ) So, after some back and forth with the integration constants, I got the signals of the chart you can see on the right.  How to use it? Turning that into a look-up table may be the more practical approach, depending on the computing power. In my application, using stepper motors with a step/direction interface requires the determination of the precise moment for each step pulse. That calculation might be done before starting the movement or, iteratively, calculating the time of the next step...

Asus PRIME B650-PLUS motherboard: a disappointing experience

Image
I am retiring from academia, so I had to burn some remaining cash and settled on building a new computer. After the latest troubles with Intel processors, I decided to look around for an AMD processor and motherboard. I wanted to have a generous amount of RAM as I have been playing a lot with different IA projects. So, I chose a 4nm Ryzen 7 9700X processor (8 cores, 40 MB cache), and I trusted the good reviews of the inexpensive Asus PRIME B650-PLUS , which I checked supported 128 HB of DDR5 RAM.  The build was easy, and I was quickly running Windows 11 and Ubuntu 24.04, but something fishy was going on: My DDR5 DRAM was only running at 3600 MHz, which the manufacturer marketed as 5200 MHz. I contacted the seller's support, and I was told that while the board could do 128 GB and 5200MHz memory, it could not do both at the same time, and the BIOS was choosing a more conservative frequency for the memory if I was using the four DRAM SIMMs (which I was). I could have taken the loss ...

DatagramPacket setLength() tricky business

Image
Java Network Programming uses the DatagramPacket class as the data representation for UDP datagrams. Whether you want to send or receive it, it will be a DatagramPacket . In a recent exam, we asked our students to create a simple UDP echo server.   The logic of such a server is that it waits endlessly until it receives a UDP datagram and then sends it back to the same address (IP and port number) from which it came. Nothing complicated, but the devil is in the details, and some students wrote a program that would create a new DatagramPacket for each datagram received. It is not wrong, as it works, but it is a bit wasteful, as it places more stress on memory allocation and garbage collection than needed.  However, I was surprised when chatGPT commented on the code I got from DeepSeek-R1 as a sample solution, where a call to setLength() was made after each iteration. It did not make sense to me, but chatGPT went on for quite a while, reasoning why it was needed. Eventually...

How does DeepSeek-R1 "think"?

Image
QUESTION: I f the center of a hexagon is located at a (0,0) coordinate, which are the coordinates of each vertex if the length of the side of the hexagon is 10 mm? Analyzing and reasoning phase Okay, so the user wants to find the coordinates of each vertex of a hexagon centered at (0,0) with a side length of 10 mm. Let me think about how to approach this. First, I remember that a regular hexagon can be inscribed in a circle. Each vertex is equally spaced around the circumference. The key here is relating the side length to the radius of the circumscribed circle. Wait, is the radius the same as the side length? Hmm, no, I think that's only true for a hexagon with a side length equal to the radius. Wait, actually, in a regular hexagon, the side length is equal to the radius of the circumscribed circle. Let me confirm that. In a regular hexagon, all sides are equal, and all internal angles are 120 degrees. The radius of the circumscribed circle (distance from center to a vertex) is ...