Article to estimate velocity of motor with quadrature encoder
To estimate motor end shaft speed, if you read the links related to estimating motor speed with a quadrature encoder, the first solution applied is correct because the high resolution of the encoders is enough.
Resolution of one revolution of the end shaft of the motor.
- Counts per revolution 7 (CPR)
- Motor reduction ratio 380:1 (MRR)
- Quadrature encoder resolution 4 (QER)
1 revolution = CPR * MRR * QER = 7 * 380 * 4 = 10640 counts
so
360 degrees / 10640 counts = 0.0338 degrees by count
See paper for Identification and Real Time Control of a DC Motor
Instead of use the method to identify, you can use System Identification Toolbox when you have data of input and output of the system.
From this link, you can extract the initial state for Raspberry Pi Model A, B, B+, the Compute Module, and the Raspberry Pi Zero because uses the Broadcom BCM2835. In addition, it's the same value for BCM2836 and BCM2837, check on 'The power on state is defined in BCM283X ARM Peripherals page 102' or nearest page.
Related links:
I build a electric circuit, when I discovered that the motor runs went turn on the raspberry and the components, and then I discovered that some pins are connected to 3V3 when turn on, so I search the information related with 'Raspberry GPIO pin states on powerup'. The mistake was gpio 3 was connected to 3V3 when turn on so, the motor start tu running, to patch a little bit, you can specify in the init files of the raspberry, some changes in the initial state. It's a patch because one second is running the motor XD.
For full knowledge about it, search a lot in the internet, but you can power up from gpio, but it's not designed for that, needs a stable 5V input and no protection.