Recent content by George1988

  1. G

    Hardware Quadrature Code for Teensy 3.x

    Hi, did anyone manage to get the quad_ decoders working on teensie 3.6. I am trying by reading this post and the manuals to understand how to change the pin assignments in the existing library of davidthings. I am quite new to embedded and all look Chinese to me. Any help will be great. My...
  2. G

    MPU 9250 (not working)

    Hi Brian, Thank you for your feedback regarding the code however I think this is not the cause of problem. Today I tried your basic SPI example without any other slave device connected to teensie. I connected teensie to sparkfun IMU breakout...
  3. G

    MPU 9250 (not working)

    Hello, I am trying to read data coming out of an MPU9250 imu. I download Brian R Taylor library but it doesn't seem to work in my case. Whenever I run the code below I get the following: IMU initialization unsuccessful Check IMU wiring or try cycling power Status -1 So I assumed that...
  4. G

    Teensie RTOS (Real time operational system)

    Thank you for your valuable help. I was thinking using FreqMeasureMulti library instead of pulseIn to estimate the frequency.Since FreqMeasureMulti library uses CPU clock cycle to estimate frequency and is not task timing related is there an issue by using this library while using the...
  5. G

    FreqMeasureMulti does not work on Teensy 3.6

    I tried only to read one frequency from pin 3 (for sure the sensor works fine) If I print freq3.available I get 0 as a value. read() gives constantly 4294967295. #include <FreqMeasureMulti.h> // Measure 3 frequencies at the same time! :-) FreqMeasureMulti freq3; void setup() {...
  6. G

    Teensie RTOS (Real time operational system)

    Thank you for your answer I am a newbie so is FTM capture this: https://www.nxp.com/docs/en/application-note/AN5142.pdf and how do I use it with teensie 3.6? Thank you for your help!!!
  7. G

    FreqMeasureMulti does not work on Teensy 3.6

    I am writing my code to measure two frequency values to estimate the velocity of two rotary encoders. I am trying to use the FreqMeasureMulti library to get two readings from the encoders, and the example file at...
  8. G

    Teensie RTOS (Real time operational system)

    For a university project I use this real time operational system developed by Fernando Trias : https://github.com/ftrias/TeensyThreads. I use two rotary encoders one two estimate bicycle velocity and one to estimate rpm of the pedal cadence sytem. For the estimation of velocity I use the pulseIn...
  9. G

    SD card initialization failed

    A couple of days ago the SD card initialization was successful and I could log data with the code below. Today I couldn't make it work again. I tried also to use SD card data logging example but it seems that the sd card can not be initialized. Am I missing something?? #include <SD.h> #include...
  10. G

    Data logging

    #define ENCODER_OPTIMIZE_INTERRUPTS #include <Encoder.h> // library used to measure encoder counts of handlebars and fork https://www.pjrc.com/teensy/td_libs_Encoder.html #define rearencoderA 0 #define pedalencoderA 2 unsigned long duration; unsigned long duration1; unsigned long freq...
  11. G

    float variable to pwm

    Thank you for your answer. I solved the problem with the motor rotation, I will post all of the details when I will finish the project. . I tried to estimate dt time using millis and micros functions but I think the time of 352 μs is wrong.As a first step I would like to know the time the...
  12. G

    float variable to pwm

    Thank you for your feedback. As you can see below I set my resolution to 16 bit =0- 65535 and the Torqueamp to signed int variable so I guess I will get values -32768 0 +65536. I have set my motor drive such as that it outputs 0 volt at 50% of the duty cycle so when my duty cycle is less the...
  13. G

    float variable to pwm

    Hello, for a university project I am trying to command a motor using torque control. To do so I read two absolute encoder and estimate the torque based on a simple equation (Torque= Kp*(handlebarangle-forkangle);). I am getting the estimated torque as a float variable and I need to transform...
  14. G

    Teensie 3.6 SPI communication not getting SCK signal as an output

    Thank you manitou. Below is my code. it is working and I am able to get the counts as an output of the encoder. After checking the manual again I realized that I need to mask out the first MSB bit and also the two LSB. I manage to get rid off the two LSB and now I am trying to get rid of the...
  15. G

    Teensie 3.6 SPI communication not getting SCK signal as an output

    Thank you manitou. I tried it out the SPI library works fine. I am trying to mask off the last 3 garbage bits to get the DAC number coming as an output of my encoder but since I am a newbie I am struggling doing that. I guess I have to read more. Thank you for the feedback so far.
Back
Top