Ready? Steady? Wait…

On Thursday and Friday, I continue to work on the H-bridge code for the test PCB and finally find a way to implement some timers that should stop the current in the coil.

I also have to go to Télécom to cut another box for testing so that we can even work with the closing of our school. However, we do not have the cable and a battery, so even if our code may work, we cannot make our tests. We hope we could take it at school this week.

Now, I will merge my code with Ilan and Zennedine and I will try to implement a watchdog too that will halt the coil even in debug mode.

How to play with Kronos

Today, Sibille and I tested the common reference time sharing between Phyllos. After coding the whole part, it worked pretty well and we managed to communicate with three Phyllos and the main_stm almost on our first try. 

What was just a bit more challenging was when we tried to make the current time master (see yesterday’s post) disappear so that a new one could be reelected. 

The tests’ main points

We needed to make sure that we could propagate the time tops from the master chosen among the bottom PCBs, through the main PCB and up until the main STM32.… Read more

Finally we can send

Finally, after a few posts, and a lot of work, our testing device (ie our dev board and our ESP) can be a complete sender. As a reminder at first our device will receive images from our server but we also wanted it to be able to send data to another device. Since my last post here are the issue I faced and the solutions I found.

The first issue was to send the data to the other device once we got its topic. To ensure we send the correct amount of byte, I wrote a python script that played the role of our second device.… Read more

Task notify: Hello goodbye

On Wednesday, I spent some times implementing task notify on the sensor task, until implementing it on the h-bridge task. Then, I realize that it creates many memory errors and was not really useful since the thread should not call the function that change the multiplexer until the I2C communication was finished.

I also find the way to put some values in the esp32 that I used for the test as an I2C slave, and realized that it works with only 7 bits adresses whitout a read/write bit at the beginning, so I changed its adress and it correctely acknowledge to my communication.… Read more

Task Notify

On Tuesday, I realize that I need to make two tasks for the sensors. One that will enable the good sensor on the multiplexer, and another that will enable the sensor once the first one is finished. I would like to implement a semaphore, but the FreeRTOS manual suggest that I use a task notification instead of a semaphore. They use less RAM, but I still do not understand well how it works after a day at looking and testing it. I’ll sleep on it and hope that I will understand better how it works.

I also configure an ESP32 as an I2C slave device in order to have an ACK when I communicate with the STM because I have no other device that can do this job.

Become the sender !

As I wrote in my previous posts, the ESP, the STM and the server were working together to receive images or animations depending of what the user wants. Now it’s time for the STM to become the sender.

The objective:

We want the devices to be able to received images from the server but we also want to establish a connection between Touchs to send images from one to the other. On top of that at the end we want to have a communication between both devices in both ways. But as you may know chi va piano va sano. So first things firts, we implemented the emitting part for the first device.… Read more

The clearer, the better.

For the last two days, I mostly spent time making the code clearer. Some big functions got divided to make them easier to read and to modify once we will get the test PCB.

The second thing was to add semaphores to protect the variable shared between our threads on both the ESP and the STM. I also create a new thread that will be used to display the image or the animation we receive from the ESP. So far it only prints on the console the value of each bytes but having it already created allowed me to add the semaphores on the image so that when we will be trying to display images with the coils we will simply have to deal with the coils.… Read more

Steady, ready, capture !

I’ve been working on coding a section of a speed feedback system since Thirsday. We need a way to frequently measure the motor speed for two reasons:

  • To adjust the motor speed if it deviates from the target speed
  • To compute the precise time at which we need to flash the LEDs

To accomplish this, we have optical and hall sensors (we will use the sensor that gives the best precision) hooked up to our rotating PCB and our bottom fixed PCB. The rotating PCB is the one sending the commands to flash the LEDs, and the bottom is the one sending Dshot to our ESC.… Read more