完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我有HelkulEX电机(HTTP://www. sgBOtiC.COM/Trims/DaskHeSts/Rooptcs/HelkulExGun.PDF)
我想用PSoC开车。伺服电机有4个输入端。1-VCC 2-GND 3 - RX 4-TX。我能在PSoC中使用UART来驱动电机吗?UART参数和代码应该如何?我应该使用半双工全双工UART吗?有ARDUNO图书馆用于电机。我可以在PSoC中导入。伺服手册中有几个解释,我很困惑。如何编写简单电机驱动的代码?谢谢。。 以上来自于百度翻译 以下为原文 I have herkulex motor(http://www.sgbotic.com/products/datasheets/robotics/herkulexeng.pdf) I want to drive with psoc. There are 4 inputs on servo motor. 1-vcc 2-gnd 3- rx 4-tx . Can I drive the motor using uart in psoc. How should be uart parameters and code? Should I use half duplex full duplex uart? There is arduino library for motor. Can i import in psoc. There are several explanations in servo manual and I'm confused. How to write code for driving simply motor? Thanks.. |
|
相关推荐
13个回答
|
|
我做了UART的连接,但我有问题驱动电机。我在看数据表,但是我怎么会开车呢,我不知道。
以上来自于百度翻译 以下为原文 I made the connection for uart but i have problem driving motor. I'm looking datasheet but how can drive it, I don't know |
|
|
|
你能把你的汽车项目寄给我吗?所以可以看到最新的例子
以上来自于百度翻译 以下为原文 Can you send me your motor project? So ı can see uart motor example |
|
|
|
嗨,TurasGas,必须采取一些预防措施。请参阅第17, 18页。1)在不使用运动控制器或信号转换器的情况下,不要将伺服装置直接连接到PC机。尽管PC机和伺服机都使用串行协议(TXD,RXD),但由于电气差异,它们不能直接兼容。所以你必须与适当的RS232电压电平(12V)接口,而不是TTL电平。2)伺服系统必须与PC或运动控制器交叉连接。交叉连接的例子是伺服TXD到PC或运动控制器RXD,伺服RXD到PC或运动控制器TXD。所以你必须使用十字电缆。3)接口参数是否正确?8位/ 1位/奇偶校验/流量控制,没有PC管理工具包吗?如果你在PSoC之前用PC进行接口检查。在电机控制之前,你能用LED之类的东西检查界面吗?
以上来自于百度翻译 以下为原文 Hi TURASGAS, Some precautions have to do. Please refer page 17, 18 It is say. 1) Do not connect the servo directly to the PC without using the Motion Controller or Signal Converter. Even though both PC and the servo uses serial protocol (TXD, RXD ) they are not directly compatible due to electrical difference. : So you have to interface with proper RS232 voltage level(12V), Not by TTL level. 2) Servos must be cross connected to the PC or Motion Controller. Examples of cross connection would be Servo TXD to PC or Motion Controlller RXD, Servo RXD to PC or Motion Controller TXD. : So you have to use a cross cable. 3) Interface parameters are correct? 8bit / 1 stop bit/ parity none/ flow control none Have you a PC Manager Kit? If you have that do check interfacing by PC before psoc. Can you check the interface by LED, something , before motor control. |
|
|
|
你应该先尝试通过你的电脑连接到电机,和UYE终端程序来控制它。RealTebe会成为一个不错的客户端,因为它可以采用十六进制值来发送。
当你可以驱动电机,并知道它是如何运行的,你可以开始编写一个程序在PSoC上。 与UART一起工作很简单。将其配置为全双工,以适当的波特率为您的电机。为您的命令创建一个字节(UIT88T)数组,根据电机的协议定义填充该数组,然后将其交给UART。 在UART接收上,接收接收到的数据并将其写入另一个数组中。从那里您可以处理ACK响应。 以上来自于百度翻译 以下为原文 You should try first to connect to the motor via your PC, and uye a terminal program to control it. Realterm would make a nice client, since it can take hex values to send. When you can drive the motor, and know how it needs to be operated, you can start writing a program on the PSoC for it. Working with the UART is simple. Configure it as full-duplex, with the proper baud rate for your motor. Create a byte (uint8_t) array for your command, fill this array according to the protocol definition of the motor, and then hand it over to the UART. On UART receive, take the received data and write it into another array. From there you can process the ACK responses. |
|
|
|
数据页的第51页的示意图显示了接口。有一个MX3232驱动PC端,所以它使用标准的RS232电平(+-12V)。因此,使用一个真正的串行端口,或一个真正的USB -RS232电缆(不是一个串行TTL到USB转换器)。
以上来自于百度翻译 以下为原文 The schematic on page 51 of the data sheet shows the interface. There is a MAX3232 driving the PC side, so it using standard RS232 levels (+-12V). So use either a real serial port, or a real USB-RS232 cable (not a serial-TTL to USB converter). |
|
|
|
感谢PSoC03,HLI,BOB;
我编辑了Helper-Hulkulx.h文件,但是我看了UART的例子,我没有解决组件,所以我不写代码。示例HelkuleX数据表 ID(253),R(LED控制,地址(0x35)请求绿色LED on”。 对于PSoC,UARTHIPPARCHARE(),UARTHIPPUT数组(UIT88T地址)。当我检查HelkuleX数据表时,没有找到驱动电机地址图。我想我需要一个例子 设计01.BultLe02.Zip 1.3兆字节 以上来自于百度翻译 以下为原文 Thanks Psoc73,hli,bob; I edited helper herkulex.h file but I looked uart examples I didn't solve component, so I don't write a code. Example Herkulex datasheet that ID(253),r(LED Control, Address(0x35) request green led on. For psoc; UART_PutChar(),UART_PutArray(uint8_t address) like. When I examined herkulex datasheet, I didn't find driving motor address map. I guess I need an example
|
|
|
|
首先,让我清楚地知道什么是你不能的。你不能与马达接口吗?或者你不能编写程序代码?你能通过PC管理工具包检查与电机的接口吗?
以上来自于百度翻译 以下为原文 First of all, Let me know clearly what's you can't. Either you can't interface with the motor? or you can't write the programming code? And can you do check the interface with motor by PC Manager Kit? |
|
|
|
好吧,我知道了,但是我必须要睡一点觉,很抱歉,明天再看。
以上来自于百度翻译 以下为原文 OK I see, but I must gatta sleep a little, It is sorry, See tomorrow again. |
|
|
|
HelkulEX电机使用RS232TTL,从数据表-
以上来自于百度翻译 以下为原文 The Herkulex motor uses RS232 TTL, from the datasheet - |
|
|
|
正如你所看到的,控制器端是TTL,PC端满RS232物理层——
以上来自于百度翻译 以下为原文 As you can see, controller side is TTL, PC side full RS232 physical layer - |
|
|
|
图拉斯加你说你在编程方面有问题……在这种情况下,我们通常必须按照我们的需要发送电机的某些命令,并且可以通过UTART块中描述的简单TX API来完成。!!!!!!
第18页清楚地表明,你必须发送一个指定格式的数据包。 试试这个……发送双字节表头… 主体() { uTIN 16H=255;//0xFF UARTHAR11PUCHCHAR(H);//首字节 UARTHAR11PUCHCHAR(H);/ /第二字节的报头 } 因此,您可以发送其余的数据包内容。 -------------------------------------------------------------- 也请记住其他人规定的电压水平设置…幸运的是,我的电机是TTL兼容的…所以我可以直接连接我的马达引脚到我的PSoC。 当做。 以上来自于百度翻译 以下为原文 @TURASGAS.. you said you have problem with programming.....in such cases we mostly have to send certain commands for the motor to work as per our need, and that can be done by simple TX APIs as described in the UART block!!!!! Page 18 clearly suggests that you have to send a packet in a specified format. Try this....to send the TWO BYTES OF HEADER... main() { uint16 h = 255; // 0xFF UART_1_PutChar(h); // first byte of header UART_1_PutChar(h); // second byte of header } Accordingly you can send the rest of the packet contents. ------------------------------------------------------------ Also keep in mind the voltage-level settings as prescribed by others.....Luckily, my motor was TTL compatible...so I could directly connect my motor pins to my PSoC. Regards. |
|
|
|
嗨,这个马达可以与TTL UART连接在下一个案例中。设置和固定PSoC附近的电机或只用于测试模式。然而,它可能不是多点模式。这是一个通过TTL模式连接的例子。[ HTTP://Mab.Org/CuoBooo/HekuleX ]有许多特性和许多参数。为了控制这个马达,你想使用控制库。像这样[HTP://RoButiN.Autvias.Org/TunBu-HulkuleX-ARDUION-Loopal-2]如果没有PSoC的库,你必须做到。这是基本命令的示例代码。[ HTTP://wwwGunalFiel.Org/DealBoo/GS63E412BAH32 i0/Helkulx.ZIP.HTML]
以上来自于百度翻译 以下为原文 Hi, This motor can connect with also TTL UART in next case. Set and fix the PSoC nearby motor Or just only use for TEST mode. It might not be Multi-Drop mode however. This is show an example connect by TTL mode. [ http://mbed.org/cookbook/HerkuleX ] There are so many features and many parameters. To control this motor, you would like to be use control library. like this [ http://robottini.altervista.org/dongbu-herkulex-arduino-library-2 ] If no library for the PSoC, you have to make it. This is a sample code for basic command. [ http://www.generalfiles.org/download/gs63e412bah32i0/HerkuleX.zip.html ] |
|
|
|
谢谢鹅,pSOC73.
HTTP//RoButiN.AutviSt.Org/TunBu-Hulkulx-ARDUION-Loopal-2。在我看这个网站之前。我需要出现头文件来处理这个代码。我尝试生成头文件,但会产生一些错误,或者创建标题文件有一些技巧。 以上来自于百度翻译 以下为原文 Thanks Goose, Psoc73 [size=10.909090995788574px] http://robottini.altervista.org/dongbu-herkulex-arduino-library-2 . Before I looked at this site. I need to occur header file for be working this codes. I try to occur header file but get some error or there are some tricks for creating a header file. |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2100 浏览 1 评论
1846 浏览 1 评论
3665 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1782 浏览 6 评论
1532 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
561浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
413浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
433浏览 2评论
379浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
906浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-19 23:57 , Processed in 1.126235 second(s), Total 102, Slave 86 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号