Pas Home - Index
This week i continue to play with adafruit motor shield. I configure the shield to run in 3.3v mode compatible with Raspberry pi and convert the driving library in nodejs because i plan to use nodejs for easy comminucate beetween pi and other pi with open hab.
Configuring
The motor shield comme with configuration for 5v mode. The shield is made to be easily switch to 3.3v.
This is the instruction to switch to 3.3v
Testing
Adafruit give great using tutorial for use with Arduino here https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino.
For raspberry pi we only need 4 wire to drive the shield 3.3v, GND, and i2c SDA, SCL. I put on me github the code to run the shield with python https://github.com/pascalmartin/Adafruit-Raspberry-Pi-Python-Code/tree/master/Adafruit_MotorShield and for nodejs https://github.com/pascalmartin/ForgetMeNot/tree/master/bundles/motorshield/MotorShieldControler
I wiil also put step by step install quide on the github during the next day.
Video
In the video you can see the result. From left to right, #1 is drive by arduino, #2 is drive with raspberry pi in python and #3 is also drive by rasberry pi in nodejs
All 3 use the same program but arduino run faster, raspberry pi is slower but but I can adjust the speed in the software.
In the video is a bit difficult to see but all stepper motor run in 4 different mode (Single coil steps, Double coil steps, Interleave coil steps, Microstep steps) . Nodejs version seems to have a bug in the driver with Microstep mode, but i plan to use double coil steps for maximun torque. Later maybe I'll look to fix the bug