制造商零件编号 5338
KITRONIK AUTONOMOUS ROBOTICS PLA
Kitronik Ltd.
所订产品一般在 7-10个工作日 内送达中国,具体时间取决于收货地点。
最低订购金额为人民币 300 元,顺丰快递免运费配送。
当用人民币下单时,按照国际贸易条款 DDP(DigiKey 支付关税、海关费用和当地税款)方式结算。
电汇预付
更多来自全授权合作伙伴的产品
下单后,从合作伙伴发货平均需要时间 1-3 天,也可能产生额外运费。可能另外收取运费。 实际发货时间请留意产品详情页、购物车和结账页面上的说明。
国际贸易结算方式:CPT(交货时支付关税、海关费用和适用 VAT/应付税金)
有关详情,请访问帮助和支持
License: See Original Project
Courtesy of Kitronik
Guide by Kitronik Maker
The ARP has 4 servo connections. These can be used to control standard hobby servos.
The servo connectors are located 2 towards the rear of the ARP, just outside the motors, and 2 towards the front, by the ultrasonic connector. Power is fed, via the power switch, directly from the battery voltage.
The connectors are standard 3 pin, Signal, Voltage, and GND connections for usual hobby servos. A brief guide to servos gives an overview and more information about what servos are and how they are controlled.
PIO and Servo Control
On the ARP the servo control signal is driven using the Pico's Programmable Input Output (PIO) functionality.
PIO is a facility that allows the Pico's processor to control things using a very simple state machine processor.
When the PicoAutonomousRobotics class is instantiated, it sets up the PIO state machines ready for use.
The PicoAutonomousRobotics class defines 2 methods that control the connection of the servos - registerServo(...), and deregisterServo(...)
registerServo(...) is called automatically for all servos when the class is instantiated, but if you wish to use the servo pins for another purpose you can call deregisterServo(...), which will stop the state machine running so the pin can be driven as normal GPIO.
It is not necessary to understand PIO to use the servos on the ARP, but if you wish to then start with this explainer from Raspberry Pi.
Make Some Movement
Plug a servo into the SV0 connector (near the On/Off switch) and create the following code in Thonny:
from PicoAutonomousRobotics import KitronikPicoRobotBuggy
buggy = KitronikPicoRobotBuggy()
while True:
if buggy.button.value():
buggy.goToPosition(0,180)
else:
buggy.goToPosition(0,0)
Save and Run the Code
When you press the button on the Pico the servo should move from one end of its travel to the other. When you release the button, the servo will move back again.
Sensor Control
You can also control the servos using the ARP sensors.
Ensure the front ultrasonic sensor is mounted and create the following code in Thonny:
from PicoAutonomousRobotics import KitronikPicoRobotBuggy
buggy = KitronikPicoRobotBuggy()
while True:
#multiply distance by 2 so 180 degrees range occurs over roughly a meter
Dist = buggy.getDistance("f") * 2
#check to make sure we are not driving past the end of a servo range
if(Dist>180):
Dist = 180
#drive the servo
buggy.goToPosition(0, Dist)
Run the Code
This code will move the servo arm in proportion to the distance sensed by the ultrasonic sensor. As the sensor detects an object getting closer the servo will move towards its 0 degree end, and as it gets further away the servo will move towards the 180 degree end. The code multiplies the distance detected by 2 so that the full range of servo movement only takes 90 cm of detection distance.
Multiple Servos
The ARP can drive up to 4 servos at once.
This variation of the first piece of code moves each servo in turn as the button is pressed and released:
from PicoAutonomousRobotics import KitronikPicoRobotBuggy
from utime import sleep
buggy = KitronikPicoRobotBuggy()
while True:
if buggy.button.value():
buggy.goToPosition(0,180)
buggy.goToPosition(1,180)
buggy.goToPosition(2,180)
buggy.goToPosition(3,180)
else:
buggy.goToPosition(0,0)
buggy.goToPosition(1,0)
buggy.goToPosition(2,0)
buggy.goToPosition(3,0)
Controlling multiple servos allows the ARP to be used for more complex projects.
Can you build a Robot arm?
Coding Resources for Pico-ARP:
Online Tutorials - Pico ARP
©Kitronik Ltd – You may print this page & link to it but must not copy the page or part thereof without Kitronik's prior written consent.
谢谢!
敬请关注收件箱中的 DigiKey 新闻与更新!
请输入电子邮件地址