Categories

RoseOnRails – work in progress!

Hi all.

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 😉

Valeh VALIOLLAHPOUR AMIRI

4 comments to RoseOnRails – work in progress!

  • Haha, thanks for the link, it’s always good to refresh old memories.

    About the LED strip control I would normally tell you to play with FPGAs as much as possible because it’s fun and it’s the future. But in real life you might be limited in budget, time and space!
    => would a good cortex M4 be too slow? (I don’t think so but I don’t know your project that well)

  • valeh

    Thank YOU for the post 🙂 !
    Uh, actually we’ll finally be using the STM32, so it’s fine (no more Verilog ^^!)

  • alexandre

    For the pwm frequency, the main point is : Do you want to hear it ( a very annoying noise, but easier to debug) , or not. Fot the first cas select a frequency lower than 10 khz. For the noiseless version, go to 20 kHz or higher.

  • valeh

    Finally, we’ll probably put something like a bit more than 21kHz (so fortunately it won’t be audible 🙂 !)