完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
嗨,所有的,我试图控制方向的马达向前或BouWald,我发出信号,通过使用DACOF电位器。我正在研究CY8CY4C6464-24SXI。
如果有人能帮助我找出如何控制这将是伟大的。 谢谢 以上来自于百度翻译 以下为原文 HI all, i am trying to control the direction of the motor forward or bacward, i am giving out signal, by using DAC from Potentiometer. i am working on KIT number CY8C29466-24 SXI. If anyone can help me to figure out how to control that would be great. Thanks |
|
相关推荐
50个回答
|
|
|
我同意我们也应该避免使用全球性的东西。
以上来自于百度翻译 以下为原文 I agree that we should avoid using global vaiable as well. |
|
|
|
|
|
我确实看到了一个错误,每个数据表MSB和LSB都必须具有相同的列时钟。
数据表中的注释 在选择放置位置时,另一个考虑是MSB和LSB时钟必须来自同一个源。如果它们被放置在模拟阵列中的同一列中,就会自动发生这种情况。如果将它们放置在两个不同的列中,则必须将两个列多路复用器设置为同一个源。 问候,Dana。 以上来自于百度翻译 以下为原文 I did see one error, per datasheet both MSB and LSB must have the same column clock per the following note in datasheet - "An additional consideration, in selecting a placement location, is that the MSB and LSB clocks must be derived from the same source. This happens automatically, if they are placed in the same column in the analog array. If they are placed in two different columns, both column multiplexers must be set to the same source." Regards, Dana. |
|
|
|
|
|
我们需要斜坡,因为这个项目需要使电机减速到零,或者从零开始加速直到达到峰值。是的,我们将使用中断输入,但这将是我将要做的最后一件事。
在我用开关得到电机功能后,我必须计算出如何与输入频率相比测量电机的频率。 以上来自于百度翻译 以下为原文 we need the slope becasue the project requires to make motor slow down till reach zero, or start from zero and speed up till it reaches to the POT value. yes we will use the break-input but that will be the last thing i will do. after i get motor function right with the switches, i have to figure out how to measure the frequency of the motor compare to the input frequency. |
|
|
|
|
|
嗨,鲍伯,你能帮我弄清楚我做错了什么吗?或者我应该用什么来解决它,我看了你发给我的代码,我不认为它会对我有帮助,因为我必须控制电机,开关,运行/停止,方向CW/CW。
谢谢 以上来自于百度翻译 以下为原文 hi Bob, can you help me more to figure out what am i doing wrong or what should i use to solve it, i looked at code you sent me, and i donot think it will help me, because i have to control the motor my switches, RUN/STOP, and direction CW/CCW. Thanks |
|
|
|
|
|
全球化并不都是坏事:
我有一个应用程序,其中几个函数通过意图访问多个全局变量, 几乎所有通过指针,变量是双重的。节省大量的Flash,代码空间,通过 使用指向它们的指针。不通过栈传递的变量、代码空间和速度 保守的。 嗯,当正确使用时,球是好的。 注意机器结构宽度影响上述方法的效率。8位 使用上面的方法,在PSoC 1/3中,GULARS几乎没有任何节省。 问候,Dana。 以上来自于百度翻译 以下为原文 Globals are not all bad :) I have an application in which several functions access a number of globals by intent, almost all via pointers, variables are double. Saves a lot of FLASH, code space, by using pointers to them. Variables not gettting passed on stack, code space and speed conserved. Hmmmmm, globals are good, when properly used. Note machine architectural width affect efficiency of the above approach. So 8 bit globals barely get any savings at all in PSOC 1/3 using the above approach. Regards, Dana. |
|
|
|
|
|
有一个转速计时器用户模块,可用于测量电机的速度。这往往会变成一个类似于控制回路的计算(必须是)*因子来改变速度…
鲍勃 以上来自于百度翻译 以下为原文 There is a Tach-Timer usermodule which can be used in measuring the speed of a motor. This tends to start into something like a control-loop calculating (Must-Is) * Factor to change the speed... Bob |
|
|
|
|
|
我在你的代码中提出了一些建议,注意*********标记。
鲍勃 方向1.ZIP 98.1 K 以上来自于百度翻译 以下为原文 I put some suggestions into your code, watch out for ********* markings. Bob
|
|
|
|
|
|
下面是代码,是它停留在while循环中,我不知道如何得到电机的反应当我改变开关。
车轮快速固定装置 471.7 K 以上来自于百度翻译 以下为原文 Here is the code, the thing is that it stuck in the while loop, i dont know how to get the motor react when i change the switch.
|
|
|
|
|
|
嗨,所有人都知道如何改变电机的方向,一旦速度达到零…它应该像电机运行一样,一旦改变DIR开关应该下降到零&改变马达的方向& GT;上升到速度输入。
谢谢 以上来自于百度翻译 以下为原文 hi all, does anyone know how to change the direction of motor once the speed hit zero... it should works like motor is running, and once change dir switch should ramp down to zero -> change direction of motor -> ramp up to speed input. thanks |
|
|
|
|
|
虽然PSoC 3面向电机控制视频的一些技术
这里- HTTP://www. CyPress?COM/?RID=60521 问候,Dana。 以上来自于百度翻译 以下为原文 Although PSOC 3 oriented some techniques for motor control videos here - http://www.cypress.com/?rID=60521 Regards, Dana. |
|
|
|
|
|
对不起打扰了,但我是PSOC的新手,你能看看它,让我知道如何跳出环路,因为它没有检测到开关时,它的ON/OFF。并坚持在一个方向。
谢谢 方向11Zip 300.3 K 以上来自于百度翻译 以下为原文 sorry for bothering, but i am new with the PSOC, can you look at it and let me know how to get out the loop, because it doesnt detect the switch when its on/off. and stuck in one direction. Thanks
|
|
|
|
|
|
我提供的代码对您的运行和CW交换机起作用,但可能您没有看到如何。
你的C编程学习曲线似乎是在开始,所以你应该遵守以下几点提示: 在需要的函数中声明变量。不要使用全局(主(外))VARS,他们打开不必要的副作用的大门。 看“静态”存储类的含义 您还没有思考二进制:您定义为0x02运行,并停止为0xFD(这将被更好地声明为“运行”) 首先如果(功率和运行),将导致二进制,并将给出一个正确的结果。 第二个IF(Power and Posit),这将导致二进制和POT0DRAND 0xFD,这是您不想要的。 所以,它是(电源和运行)运行条件和!(电源和运行)停止条件。遵循我的例子说明的逻辑。 同样适用于CW/CW逻辑。 打开和关闭一个I/O端口,正如您已经开始定义的LED常量将不会像预期的那样。对于初学者,我建议使用LED组件和LeDyOn()、LeDyOf()API。 鲍勃 以上来自于百度翻译 以下为原文 The code I supplied acted on your RUN and CW switches, but probably you didn't see how. Your learning curve for C-programming seems to be at the beginning, so a couple of hints you should obey: Declare variables in the functions where you need them. Do not use global (outside of main() ) vars, they open the door for unwanted side-effects. Have a look at the meaning of "static" storage-class You are not yet thinking binary: you defined RUN as 0x02 and STOP as 0xfd (which would have been better declared as ~RUN) First if(POWER & RUN) which will result in the binary AND and will give a correct result. Second if(POWER & STOP) which will result in the binary AND of PORT0DR and 0xFD which you do not want. so, it is (POWER & RUN) for running condition and !(POWER & RUN) for stop condition. Follow the logic my example shows. The same applies for your CW/CCW-logic. Turning on and off a bit of an I/O_port as you have started by defining your LED-constants will not act as expected. for beginners I would suggest to use the LED-Component and the LED_On(), LED_Off() APIs. Bob |
|
|
|
|
|
也许你应该一步一个脚印地做
使用速度=0x7f;/半速。 首先检查硬件的工作情况。不要检测按钮,只需硬代码如下3个测试。 1。检查是否可用CW方向工作 将指令设置为连续波 (1) { 减速电动机 斜坡电动机 } 2。与CW设置方向一致。 3、检查是否可以为两个方向工作: 将循环更改为 (1) { 方向=连续波 减速电动机 斜坡电动机 减速电动机 方向=ccw 斜坡电动机 减速电动机 } 首先检查以上,然后返回你的结果 以上来自于百度翻译 以下为原文 May be you should do in one step a time Use speed = 0x7f; //half speed. Check the working of hardware first. Do not detect the buttons, just hardcode as following 3 tests. 1. Check if can work with CW direction set dirrction to CW while (1) { slow down motor ramp up motor } 2. Do the same with direction set to CCW. 3.Check if can work for both direction: Change the loop as following while (1) { direction = CW slow down motor ramp up motor slow down motor direction = CCW ramp up motor slow down motor } Check the above first, come back with your result |
|
|
|
|
|
因为对我来说,我不清楚100%个信号是什么,所以我首先提出了数字方法。
我产生了一个信号的方向和一个马达开/关。可以将需要时的第二信号转换成PWM以控制电机速度。 快乐编码 鲍勃 以上来自于百度翻译 以下为原文 Since it is not 100% clear to me what signals you exactly expect I made a digital approach at first. I generated one signal for the direction and one for motor on/off. You may turn the second signal at need into a PWM to control the motor speed. Happy coding Bob |
|
|
|
|
|
我不认为你发送的代码是帮助我的,我想通过递增或减量来控制速度,直到它达到锅的值,但是我必须先检查它是否处于运行模式,如果它是CWOR CWW,那么改变马达的方向,然后增加马达的速度,并且一次。是停止模式,它对CWOR CWW来说是有效的,所以它将减少到零。
以上来自于百度翻译 以下为原文 i dont think the code that you sent is helping me, i want to control the speed by incremting or decreamnting untill it get to the value of the POT, but i have to check first if it is in RUN mode then if it is CW or CCW then change direction of motor then increament the speed of the motor, and once it is on STOP mode, it wont matter CW or CCW so it will decreament till Zero. |
|
|
|
|
|
关于变量的一些额外的想法,首先是静态与全局的总结
全局变量是定义在任何函数之外的变量。它们的范围从定义它们的点开始。 持续到文件的末尾。它们具有外部链接,这意味着在其他源文件中,同名引用 内存中的相同位置。静态全局变量对源文件是私有的,在这些文件中它们被定义并且不冲突。 与其他源文件中的其他变量具有相同的名称。 我在主(外)外使用全局,使用代码库,因为一般说来减少拷贝。 变量传递中固有的操作。特别是在程序的核心结构。我也使用指向全局的指针 限制复制。这些代码具有显著的优点,代码大小减小,特别是对于非机器本地的变量。 飘浮。和速度优势,较少复制更多的MIPS为其他需要。 问候,Dana。 以上来自于百度翻译 以下为原文 Some additional thoughts on variables, first a summary of static vs global - Global variables are variables defined outside of any function. Their scope starts at the point where they are defined and lasts to the end of the file. They have external linkage, which means that in other [color=#0000FF !important]source [color=#0000FF !important]files, the same name refers to the same location in memory. Static global variables are private to the source file where they are defined and do not conflict with other variables in other source files which would have the same name. I use globals outside of main(), ones that are used thruout code base, because generally speaking lessens copying operations inherent in variable passing. Especially structures that are at heart of program. Also I use pointers to globals to limit copying. These have the significant advantage code size reduced, especially for variables not machine native, like longs and floats. And speed advantage, the less copying the more MIPS for other needs. Regards, Dana. |
|
|
|
|
|
谢谢大家,我工作了。现在我得到了时间捕获的工作。
以上来自于百度翻译 以下为原文 thanks guys, i got it to work. now i get work on time capture. |
|
|
|
|
|
你好,
对于控制和测量风扇速度的指南,您可以查看ATPSoC®1——智能风扇控制器。文档和示例项目将帮助您计数步进脉冲,并且您可以在方程中下降以将它们转换为RPM。 如果你需要更多的分辨率来控制电机的速度,你可以考虑使用一个16位的PWM用户模块,而不是DAC。你也会在AppNoT中找到这些细节。 当做, 阿文德 以上来自于百度翻译 以下为原文 Hi, For a guide to controlling and measuring fan speeds, you can have a look at PSoC® 1 - Intelligent Fan Controller. The document and example project will help you count the tach pulses and you can drop in the equations to convert them to RPM. If at all you need more resolution for controlling the speed of the motor, you can consider using a 16-bit PWM usermodule, instead of DAC. You will find these details in the appnote as well. Regards, Arvind |
|
|
|
|
|
(和)%$!!!!)这是项目文件
我想要一个“编辑”功能! 鲍勃 方向2.ip 105.7 K 以上来自于百度翻译 以下为原文 (§&%$!!!) and here's the project - file I WANT TO HAVE AN "EDIT" FEATURE! Bob
|
|
|
|
|
|
嗨,鲍伯,是的,我看了你的代码,我做了同样的概念,但是我的问题是当我尝试使用一个开关时,它被困在第一个循环中,而且永远不会从它出来,所以我应该用什么使它退出循环条件(电源和CW)去(?)例如(电源和CW)?
我还想加快速度,直到它变成一个斜坡的锅值,如增长。当我切换到不同的模式时,我希望它能滑动到零,然后慢慢地增加。 看看我做了什么,让我知道。 谢谢 车轮快速固定装置 478.3 K 以上来自于百度翻译 以下为原文 Hi Bob, yes i looked at your code and i did the same concept, but my problem is when i try to use a switch, it get stuck in the first loop and never come out from it, so what should i use to make it exit out the loop condition (POWER&CW) to go to (!(POWER&CW) for example? also i want to speed up untill it gets to POT value in a slope like increase slidelly. and when i switch to different mode, i want it to decrease slidlly to zero then increase slidelly. Take a look at what i have been done and let me know. Thanks
|
|
|
|
|
只有小组成员才能发言,加入小组>>
786个成员聚集在这个小组
加入小组cyUSB3014一直显示2.1,不能到3.0情况,谁遇到过
7136 浏览 0 评论
2479 浏览 1 评论
2169 浏览 1 评论
4033 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
2077 浏览 6 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
7615浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
6166浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
745浏览 2评论
713浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
8015浏览 2评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-3 22:22 , Processed in 1.229076 second(s), Total 114, Slave 96 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2029