Arduino
Where I stopped
-
https://www.youtube.com/watch?v=8hHebvSwBoM&list=PL7CjOZ3q8fMeek1xvabBmkl5TEw5Nhwqk&index=5.
-
https://www.youtube.com/watch?v=WMkN-uHd-Xo&list=PLGs0VKk2DiYw-L-RibttcvK-WBZm8WLEP&index=50.
Motor
Scale
-
1 step ~= 9.6 um (micro-meters).
-
104,167 steps = 1 meter.
Speed
-
1 meter, 180rpm, 1 step/stage, debug on => 2:53min.
-
1 meter, 180rpm, 1 step/stage, debug off => 2:53min.
-
1 meter, 200rpm, 1 step/stage, debug off => 2:36min.
-
Speeds above 200rpm visibly cause the motor to lose steps.
Optical Sensor
-
https://www.digikey.com/en/products/detail/tt-electronics-optek-technology/OPB829CZ/1636285.
Electrical construction
Specifications
-
Arduino Uno: Specifications .
Pinout Diagram
-
Arduino Uno: Diagram .
Language
Documentation
-
Constants: Documentation .
-
Using large numbers: https://forum.arduino.cc/t/solved-i2c-speed-to-400khz-howto/696441.
PWM
Registers
ASCII
Display LCD Poster Asus
-
I2C .
UART (Universal Asynchronous Receiver-Transmitter)
-
It is a Hardware protocol used in Arduino.
-
Brief explanation of UART as a Protocol: LiveOverflow clip .
Control box with Arduino and Driver
Arduino Pinout
Without Display
-
4: motor phases
-
1: 'little' back button
-
1: 'a lot' back button
-
1: 'little' forward button
-
1: 'a lot' forward button
-
1: stop button
-
1: calibrate button
-
1A: calibration sensor
-
1: acquisition trigger
-
(?) 3: RGB led
With Display
-
4: motor phases
-
1: back button
-
1: forward button
-
1: stop button
-
1: calibrate button
-
1A: calibration sensor
-
1: acquisition trigger
-
2A: potentiometers
-
2: display with serial i2c
-
(?) 3: RGB led
Display Debug
Writing types
'Parallel'
-
(begin) -> (register, value) -> (end)
-
It is not necessary to put a delay between the first and second 'write'.
-
8bits are used to store information.
-
Any extra bit on the left is not used.
-
Any extra bit on the right is used, doing a 'shifiting' in the sequence.
-
If you pass 8 bits and then pass fewer bits to the same register, the missing bits will assume their old passed value, that is, the memory of old iterations is maintained. That said, it is important that every sequence has 8 digits, writing 0 if necessary, to maintain the fidelity of the writing.
-
Multiple iterations per 'register':
-
If exactly the same value is passed, nothing happens, it just continues with the same behavior.
-
If a different value is passed, without delay, the register will assume the value of the first iteration.
-
If a different value is passed, with a delay of at least 1ms, the register will assume the value of the next iteration.
-
I tested delays between 1ms and 2000ms, it works equally within this range.
-
-
'Serial'
-
(begin) -> (value) -> (end)
-
Doing write_lcd(0x01, 0x00) is different from {write_lcd_serial(0x01) -> write_lcd_serial(0x00)}.
Tests
Writing Tests
-
write_lcd(0x01, 0x00);
-
CPU INIT.
-
-
write_lcd(0x01, 0b00000001 | 0x01);
-
DC XCADE.
-
-
write_lcd(0x01, 0b00000010 | 0x02) == write_lcd(0x01, 0b00000100 | 0x100) == write_lcd(0x01, 0b00100000 | 0x4000);
-
~little dots.
-
-
write_lcd(0x01, 0b00001000 | 0x08);
-
CNAS.
-
-
write_lcd(0x01, 0b00010000 | 0x0F);
-
DETCLASH, ~similar to DC XCADE.
-
-
write_lcd(0x01, 0b01011010 | 0x5A);
-
RESCRVCD, or, RESCRVCS.
-
Contrast Tests
-
write_lcd(0x01, 0x00);
-
2 vertical.
-
-
write_lcd(0x01, 0x02);
-
nothing.
-
-
write_lcd(0x01, 0x03);
-
1 vertical.
-
-
write_lcd(0x01, 0x04);
-
nothing.
-
-
write_lcd(0x01, 0x05);
-
1 vertical.
-
-
write_lcd(0x01, 0x06);
-
nothing.
-
-
write_lcd(0x01, 0x07);
-
1 vertical.
-
-
write_lcd(0x01, 0x08);
-
1 weak vertical.
-
-
write_lcd(0x01, 0x09);
-
nothing.
-
-
write_lcd(0x01, 0x0A)
-
2 weak vertical and 1 weak horizontal;
-
-
write_lcd(0x01, 0x0B);
-
nothing.
-
-
write_lcd(0x01, 0x0C);
-
nothing.
-
-
write_lcd(0x01, 0x0D);
-
nothing.
-
-
write_lcd(0x01, 0x0E);
-
1 weak vertical.
-
-
write_lcd(0x01, 0x0F);
-
nothing.
-
-
write_lcd(0x01, 0xFF);
-
1 vertical.
-
Register Scan
-
Approximately every 16bytes, the Backlight toggle (b) appeared, which leads me to believe that there is a looping in 16 total registers.
-
80c, 92b, 109b, 125b, 141b, 145c, 157b,160c,172b, 177c, 189b, 193c, 205b, 209c, 221b, 225c, 236b, 241c, 253b.
-
The byte value is imprecise, and some may have gone unnoticed in the process.
-
c: CPU INIT, b: Backlight toggle.
-
Voltage on the display
-
Using 5.6V instead of 6V improved the display contrast.