GDBug and other glitches

Executing our code from flash

Last week Sibille and I moved our bare-metal code for the processor-PCB (which so far was directly inserted in RAM by the GDB debugger) into the Flash memory proper, and wrote code that will execute from Flash to copy everything in RAM and continue execution from there.

However, we soon noticed a strange bug: the GDB debugger now ignored every breakpoint we tried to set in RAM (breakpoints to parts of the code executed in Flash before the copy to RAM still worked fine). After a lengthy debug session, Alexis determine that it‘s a bug from the GDB debugger and not from our code.… Read more

Live wire

Yesterday evening, the whole groupe work together to test the power transmission through the ball bearings. Those tests are significant to determine if we need to add a 5V-regulator on the main board, and which regulator we choose for the bottom PCB  to account for the tension drop.

Electrical setup

We had ordered the resistors (two 0.5Ohms/25W resistors and one 0.1Ohm, 30W)  described in this article and used them to build the following electrical setup:

The generator supplies 5V because we plan to use a 5V regulator on the bottom PCB and send 5V to the main board through the ball bearings. … Read more

Another success for the Ultimaker

Yesterday the print for the support of the LED PCBs finished, and it was a success:

This was again printed using the Ultimaker 2.

Under it you can also see the support for the processor PCBs, everything fits well:

We also had our school mechanic drill all the necessary holes on the PVC platform, and we will try to make the whole structure turn with our motor today.

I also printed a model which exactly matches the size and shape of the top PCB, and one for the petal PCB, and it fits very well:

As you can see both printed PCB perfectly matches the holes of the structure 🙂

We’ll keep you updated on how well our structures fares at 30 rotations a second !

Bare-metal succes

Today, Sibille and I ran the final tests for the led-driving PCBs software using Vlaya’s SPI generation code. We wanted to make sure that if the main board sends an entire SPI frame (24 LED configuration instructions and a “TOP” command), the CPU managed to configure all the LEDs and turn them on. It does 🙂

On the nucleo devboard, we can observe 20 out of 24 timers. Have a look at the outputs we measured with the logic analyser : 

LEDs fired for two cycles (duty cycle proportional to LED ID)

Here is a link to the processor Reference manual.… Read more

Time and material

LED-driving software

Today, Xavier and I continued to work on the software for the LED-driving processors. We have obtained fairly satisfying results 🙂 

First, we managed to fix the bug explained here for TIM1. 

We had just forgot to set one bit (MOE bit) in the configuration : TIM1 is an “advanced timer” and this bit is mandatory to enable the outputs. As for TIM9, it is actually not available on the dev board we use. But it is a “general purpose timer”, so we won’t hopefully have any trouble with it.

Then, with the help of Vlaya, we use her SPI generation code to test our SPI reception.… Read more

Pretty Animations

These past few days I’ve been working on the animation generator. Here’s a result:

I wrote a generator in C (which will later be the code used on the main board) which has a generate_frame function which will generate the next frame of a procedural animation. The generate_frame function can be called an arbitrary amount of times.

The code can export the frame to a file, which is then read by my animation simulator script I wrote for blender.

The simulator takes a few secondes to read the frames (5 secondes for a 500 frames animation for instance), and can then display the animation in real time (same as in the gif)

The simulator can also render high quality realistic animations as the one you can see in our project presentation , but even a small animation will take a day of rendering

Here’s all the concepts / techniques I have been working on right now (most of them are already implemented) which the generator uses:

Virtual Petals

The virtual petals are the petals you appear to be seeing go down (age) on our phyllo animations.… Read more

Quick update on the power transmission

Yesterday we put the flexible plastic tube to isolate the inner metallic tube from the axis on our power transmission (see this post ). With the help of Karim, Sibille and me devised a way to test if power gets across our ball bearings using some large resistors. We were able to see that we can transmit 30 amps, but the resistors’s resistance was too low for proper testing, so we could not test the voltage drop.

It is crucial for us to test the voltage drop, since right now we are transmitting 5V through the ball bearings and powering devices that function on 5V on the rotating part.… Read more

When the bug lies in your debug print function…

Here’s a riddle:

A for loop with index i and stop condition i < x contains a code which prints i and does some non relevant computations. When x is greater than y the code prints i up to x-1 (as you would expect), but when x is smaller than y the code prints i up to 51. The threshold y is slightly random (it hovers around 1120), but the 51 is not. What is happening ?

Well, first here’s more precise information on what actually happens: if x > y the code actually doesn’t print all the values up to y-1, it only prints the first 51 values and the values between y and x-1 .… Read more

Successful print of the PCB holding structure

Today I managed to print the support for the processor PCBs without any major flaws:

I changed the design a little bit in order to ease the printing and make the structure more robust: I removed the openings / holes on the sides and made the whole structure thicker. I also used the Ultimaker 2 printer of the fablab instead of the zortrax since the zortrax are somewhat broken right now. (hopefully it’s not because of all our printings)

I also printed a piece with the same shape and dimensions as our processor PCBs, and it fits perfectly in the structure.… Read more

Uncrossing wires

Today Sibille and I made great strides on the bare-metal code for the led-driving processors.

Debugging

Yesterday we left off unable to see the PWM outputs on the processor pins. Today we started by remedying an oversight: we set about configuring the clocks. 

On top of that, it turns out that yesterday we didn’t pay enough attention when reading the documentation for the board: the documentation includes pinout information for other boards with other processors, and we were looking at the wrong processor…

We were then able to use a Saleae Logic analyser to observe the PWM output. At first, the frequency was off, and we spent much time looking at our clock configuration before realising that the timer prescaler didn’t behave in the way we expected (it turns out that frequency division ration if the prescaler value plus one, which is a neat way of avoiding a “division by zero” type of situation). … Read more