This morning I started with BLE: I continued what I had started yesterday, namely understading the example code (LEDButtonService application) provided by nrf for beginners, in order to implement my own application with a custom service compliant with our project. I started by compiling the program… which took me a certain amount of time, since it wasn’t compliant with the SDK v5.1. This useful link helped me a lot in accelerating the process and finally the compilation was successful 🙂 (still using pure-gcc of course… extremely useful as well!)
Then I flashed the program and tried to test it with gatttool (and hcitool). I managed to connect to the device but for a totally mysterious reason (as always with BLE!!), the connection lasted only 1s (roughly). I tried a lot of things (changing parameters related to the connection and advertising intervals that seemed relevant, checking configuration of hcitool and gatttool, testing other apps, another PC, etc.). Finally, I decided to test the app on someone else’s board in case I might have done something wrong on mine… unfortunately I took this decision a bit late, so there was no one else in a406 anymore. I’ll ask for the board tomorrow…
Apart from that, I discussed with Noémie and Gleison about whether or not we should use an FPGA (or an STM32) for controlling the led stripes… the decision is still pending..
Gleison also suggested that we measure the exact voltage in the rails (so far we thought it was 15V DC!!!) but in fact it’s an AC square signal (of amplitude about 20V)!! Soooo we need a diod bridge to rectify the voltage (and probably smooth it with capacitors).
Another important question to which we yet have to answer is the PWM frequency we’ll be using to control our motor. It doesn’t have to be too high (to prevent consumption and heating), nor too low (since the internal inductane of the motor verifies: u=L*di/dt and thereofore the lower the frequency, the higher di/dt and thehigher the induction voltage). So, I tried to do a Simulink simulation of our circuit (motor, PWM and H-bridge).
I didn’t have the time to complete it though becuase we need the value of the resistance and indictance of the motor. How should we measure the inductance?? Not knowing at all how to procede, I asked Google and found this awesome post from drix which fully explains what we’re supposed to do. Now it’s a bit late to do the measurements! We will do this tomorrow (and then I’ll be able to do the Simulink simulation with the values found for L and R of the motor).
See you 😉