Until now, I had only used a motor with a DC brush or a stepping motor, but I bought a brushless motor for stable high-speed rotation. I didn't have much information, so I bought a brushless motor made by Oriental Motor Co., Ltd. and ran it on a Raspberry Pi.
The features of brushless motors are described in detail on this site. → Servo-like performance at the same price as an inverter? What is the third option, brushless motor It seems that it is used for the rotation axis of a CD player.
Brushless motors require a control board and are not as widely distributed as other types of motors, so purchase them from the Oriental motor site. Of course, you can purchase from one.
By narrowing down by specifications, we will tell you the recommended motor. This time, I chose BLHM450KC.
The minimum requirements here are a brushless motor, a screwdriver, and a power/I/O signal cable. The connection cable does not have to be a 1.5m extension cable. Besides, AC adapter for supplying 24V DC → [AC adapter selected by amazon for reference] (https://www.amazon.co.jp/gp/product/B08CDBW8HY/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&th=1) Raspberry Pi for PWM input (Arduino etc. can be used as long as it can output PWM waveform) Please also prepare.
The user manual is available here for how to use the digital control board. → Manual for Oriental Motor Co., Ltd. site
Turn on pins 13 and 14 and give PWM input to 6 and 7 to rotate the motor.
** There is only one point to note. ** ** The input signals of this control board are ON: 0 to 0.5V (L level) and OFF 4 to 5V (H level).
Then, if the power is turned on with 0V specified, it will start moving immediately, which is dangerous. Of course, that is not the case, and when the power is turned on at 0V, the alert lamp on the control board flashes red 11 times. When the power is turned on, it will not start unless it is in the H level state (that is, OFF). If you turn it off, turn on the power, and then turn it on, it will be in operation.
You can easily control the speed by connecting the 6,7 PIN of the control board to the output PIN of the Raspberry Pi and generating the PWM waveform.
Reference code
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
pin_id = 4
GPIO.setup(pin_id, GPIO.OUT)
pin = GPIO.PWM(pin_id, 100) #100Hz
pin.start(0)
pin.ChangeDutyCycle(30)
time.sleep(3)
pin.ChangeDutyCycle(50)
time.sleep(3)
pin.ChangeDutyCycle(100)
time.sleep(3)
pin.stop()
GPIO.cleanup()
I didn't have much information, but if you connect according to the user manual, you can control it relatively easily with PWM control, so please try it.
Recommended Posts