完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
所以,驱动步进的微妙问题——同时用你的SOC做其他事情……如I2C、ADC+DAC、滤波等。 我想驱动一些步进电机使用此驱动程序:HTTP://www. SmithJauS.COM/EasyDeDrVIE/PSOC 5或教程: 我在网上发现的问题是,你需要为你的步骤发送脉冲,并将它们计时。当然最简单的方法是使用延迟FCT…但这会杀死一切,或者导致一个急促的动作。 你有没有想过如何利用这些微小的资源?我正在寻找运行电机,也测量负载传感器(总共8)和8个数字信号在同一时间:车轮脉冲反馈以及6个其他数字传感器。我没有这个项目。目前我使用的是普通的直流电动机,具有PWM功能,但要切换到步进电机。 Accel/DeCelp控件也会有类似于这种方法的惊人之处:HTTP://www. AfSPayCE.COM/MIKEM/ARDIONI/AccelPistPur/我认为这是周围最开放的图书馆中最优秀和最精致的。 我的想法是使用计时器或武器?不知道这有多好,但它必须是一种方法,同时保持代码的其余部分运行。 谢谢你的帮助! 以上来自于百度翻译 以下为原文 Hello, So, the delicate issue of driving steppers - whilst doing something else with your SoC ... like, I2C, ADC+ DAC, filtering etc. I am looking to drive some stepper motors using this driver: http://www.schmalzhaus.com/EasyDriver/ and a PSoC 5 or course :) The problem I find on the web is that you need to send the pulses for your steps and time them. Of course the easyest way is using the Delay fct ... but that will kill everythig else or result in a jerky motion. Do you have any idea on how this might be done with minmum resources? I am looking to run the motor and also measure loads of sensors ( 8 in total) and 8 digital signals in the same time: wheel pulse feedback as well as 6 other digital sensors. I don't have a project for this. At the moment I am using normal DC motors with a PWM function but would like to switch to steppers. Accel / decel control would also be amazing to have - something similar to this approach: http://www.airspayce.com/mikem/arduino/AccelStepper/ - I think this is the nicest and most refined of the open libraries around. My thoughts were of using a Timer or ARMs SysTick? not sure how well that would work but it must be a way to do it whilst keeping the rest of the code runnng. Thanks for the help! |
|
相关推荐
32个回答
|
|
谢谢Dana,
我看着他们在我发布重大信息但他们都使用大量的资源。我发现时间的最好方法就是这小小的I2C控制器恩智浦:HTTP:/ / www.nxp。COM /产品/ interface_and_connectivity / I2C / i2c_bus_controller_and_bridge_ics / pca9629apw HTML #支持。 但总是值得一问,如果有一个很酷的方式做它在PSoC,我错过了。… 以上来自于百度翻译 以下为原文 Thanks Dana, I looked at them before I posted - great information but they all seem to use significant resources. The best way I found to date is this little I2C controller from NXP: http://www.nxp.com/products/interface_and_connectivity/i2c/i2c_bus_controller_and_bridge_ics/PCA9629APW.html#support But always worth asking if there is a crazy cool way of doing it on a PSoC that I missed. . . |
|
|
|
如果关注的是在没有软件滞后的情况下启动电机,使其发生急促运动,您可能需要使用UDB来构建接口,以便它将沿着处理器代码的一侧运行。据thea3967数据表,你需要有一个至少2我们一步一步架,1和1我们在台阶上销,所以这看起来像一个定时器/ PWM /或只是一个描述状态机的工作。所以,基本,PSoC不产生相位,电机,控制器,而唯一需要做的是在PSoC的一致率产生一个脉冲,这是离的有刷直流电机,你已经工作了。
电机的平稳加速可以利用微型步进销智能使用实现,MS1 MS2全/之间,一半的选择等,可以根据你需要的汽车旅行的距离,或增加时,电机的起动/停止。在thea3967,有4步长,可以实现,可以移动到一个precicse位置,或用一个恒定的步进脉冲流从PSoC产生旋转速度的控制。 希望有帮助! 扔出 A367数据表 435.1 K 以上来自于百度翻译 以下为原文 If the concern is stepping the motor without software lag making jerky motion, you might want to considder using the UDBs to build the interface so that it will operate along side of the processor code. According to the A3967 datasheet, you are required to have a step frame of at least 2 uS, with 1 uS on and 1 uS off on the step pin, so this looks like a job for a timer/PWM/ or just a Datapath state machine. So, esssentially, the PSoC isn't generating the phasing of the motor, the controller is, and the only thing the PSoC need do is generate a pulse at a consistant rate, which is not that far off from the brushed DC motor with which you have been working. smooth acceleration of the motor can be achieved by using smart use of the micro-stepping pins, MS1/MS2 to select between full,half, etc. and that can be based on the distance you need the motor to travel, or ramped up when starting/stopping the motor. on the A3967, there are 4 step sizes that can be achieved, which can be used to move to a precicse position, or used to control the speed of rotation with a constant step pulse stream being generated from the PSoC. Hope that helps! Chuck
|
|
|
|
是的,似乎结合步长可以给一些很酷的功能。
生成脉冲都必须在硬件中完成。或者使用一个串行发送器(UART TX)和一个缓冲预设定的话只是基于我需要多少步缓冲?超过规定的比特/秒的速度-这限制了速度离散BPS瓦尔斯但应该没有CPU -我想? 以上来自于百度翻译 以下为原文 Yes, it seems that combining the step sizes can give some cool features. Generating the pulses will all have to be done in hardware. Or using a serial sender ( UART TX ) and a buffer - just preload the set word in the buffer based on how many steps I need to take ? than set the Bits per sec as speed - this limits the speeds to discrete BPS vals but it should work without CPU - I think ? |
|
|
|
使用这个芯片并用PSoC控制它。当然,您可以复制该设备的内部,并将您需要的程序重新编程到PSoC5中。
鲍勃 以上来自于百度翻译 以下为原文 Use this chip and control it with your PSoC. You may of course copy the insides of that device and re-program what you need into the PSoC5. Bob |
|
|
|
在这个价格可能购买另一个PSoC 5LP,并添加裸场效应晶体管驱动器。
问候,Dana。 以上来自于百度翻译 以下为原文 At this price maybe buy another PSOC 5LP and add a bare fet driver. Regards, Dana. |
|
|
|
我强调的是第二句话,那就是“复制”。
鲍勃 以上来自于百度翻译 以下为原文 My emphasis was on the second sentence, that with the "copy" Bob |
|
|
|
你不能复制该装置内因为有一个显着的
量的转换、热、调节、以及其它类似的东西。你可以, 通过一些努力,实现的功能部分合成 采用PSoC +外部传感器模拟组件。但是乱糟糟的。 当然你可以复制一些数字为PSoC。 最有效的方法是外部电源驱动或无MOSFET, 在最小栅极驱动能力,热,和PSoC控制。 问候,Dana。 以上来自于百度翻译 以下为原文 You cannot copy the inside of that device because there is a significant amount of slew, thermal, regulation, and other analog stuff. You could, with some effort, implement partial synthesis of the functionality of the analog with PSOC + external sensors, components. But messy. You can of course copy some of the digital into PSOC. Most cost effective approach is external power driver with or without MOSFETs, at minimum gate drive capability, with thermal, and PSOC for control. Regards, Dana. |
|
|
|
感谢所有的信息!我认为这是一个很好的选择,也可以得到PSoC和仿真I2C驱动程序-有负载的分布式计算潜力。
就在这一刻,我订购了一双这样的集成电路:PCA969A——希望它们能很好地工作,但我会在测试的时候告诉你们。 以上来自于百度翻译 以下为原文 Thanks for all the info! I thought it's a nice option to also get a PSoC and emulate the I2C driver - that has loads of distributed computational potential. For the moment I ordered a pair of these ICs: PCA9629A - hopefully they will work well but I'll let you know as I test. |
|
|
|
由于电机驱动电流和瞬态布局和旁路是
设计中的一切。希望这些会有所帮助。 HTTP://www. CyPress?COM/?RID=39677 AN57 821—PSoC®3、PSoC 4和PSoC 5LP混合信号电路板布局考虑 HTTP://www. CyPress?COM/?RID=40247 AN5826-PSoC®3和PSoC 5LP内部模拟路由考虑 HTTP://www. CyPress?COM/?RID=39974 AN58304-PSoC®3和PSoC 5LP -用于模拟设计的引脚选择 www. DROPBOX.COM/S/RUAF9BOE1717JK8N/PCB%20LayOut.Zip 问候,Dana。 以上来自于百度翻译 以下为原文 Becuse of motor driving currents and transients layout and bypassing is everything in the design. Hopefully these will help - http://www.cypress.com/?rID=39677 AN57821 - PSoC® 3, PSoC 4, and PSoC 5LP Mixed Signal Circuit Board Layout Considerations http://www.cypress.com/?rID=40247 AN58827 - PSoC® 3 and PSoC 5LP Internal Analog Routing Considerations http://www.cypress.com/?rID=39974 AN58304 - PSoC® 3 and PSoC 5LP – Pin Selection for Analog Designs www.dropbox.com/s/ruaf9booe17jk8n/PCB%20Layout.zip Regards, Dana. |
|
|
|
所以…只是发布一些更新。I2C驱动器似乎是好的,但是它需要一个额外的高电流集成电路,增加了复杂性和成本。
我发现了这个小家伙:HTTPS://www. SpkFun.com /Posiths/LayRe/13226(基于Alelgo 3967 IC),只需要一个脉冲序列和一个方向PIN。 我现在最大的问题是…你认为如何最好地从PSoC产生一个特定的长度脉冲序列?我需要生成X脉冲,知道我有多少输出,同时也做其他事情-我不想阻止CPU。 我在考虑一个计时器,它会给我一个特定频率的脉冲。但是我需要一个计数器来知道我产生了多少个脉冲。 或者一个向下计数器,它可以计数脉冲而不是停止在零上。 欢迎任何想法:-谢谢! 以上来自于百度翻译 以下为原文 So... just to post some updates. The I2C driver seems to be ok, however it needs an extra high current IC, increasing complexity and cost. I have found this little guy: https://www.sparkfun.com/products/retired/13226 ( based on the Allegro 3967 IC ) which only needs a pulse train and a direction pin. My big question now is .... How do you think would be best to generate a specific length pulse train from the PSoC ? I need to generate X pulses and know how many I have output and also do other things in the mean time - I don't want to block the CPU. I am thinking of a timer that will give me the pulses at a specific frequency. However I need a counter with that to know how many pulses I have generated. Or maybe a down counter that would count the pulses than stop on zero. Any ideas are welcome :) - Thank you! |
|
|
|
该psoc5中断系统是足够快的速度来处理定时器计数下降到零。更具挑战性的将不同的脉冲频率允许启动坡道具有步进运行速度。
鲍勃 以上来自于百度翻译 以下为原文 The interrupt system of the PSoC5 is fast enough to handle a timer counted down to zero. More challenging will be to vary the pulse frequency to allow for start ramps having the stepper running at faster speeds. Bob |
|
|
|
假设你想脉冲计数的W / O CPU干预,定时器、PWM
开发的脉冲和计数器的计数脉冲和盖茨N脉冲 你。相当简单,计数器定时器使能门用D和你 使用控制条重置D启动另一个突发脉冲。或基本变体 这个方案。 问候,Dana。 以上来自于百度翻译 以下为原文 Given that you want a pulse train counted w/o CPU intervention, a Timer or PWM to develop the pulses and a counter that counts the pulses and gates N pulses for you. Fairly simple, down counter could gate the timer enable off with a D and you use a control reg to reset the D to initiate another burst of pulses. Or basic variants of this scheme. Regards, Dana. |
|
|
|
所以…我试着做检查,在软件中停下来,运气不好。我最大的问题是准确地捕捉脉冲完成时,即计数完成,并能够重新启动后。我没有找到任何好的方式来存储和使用TC / COMP脉冲。
你提到Dana的硬件解决方案似乎更好。但在SR触发器导致我哪里也不去,我可不设置它所以它停止后的步骤进行,并等待登记复位。 我想我可以禁用PWM曾经的步骤进行,或设置脉冲为零。不是,是一个新命令重置计数器,带回所需的速度脉冲的情况: 我设置它做X步骤。一旦它完成,它就会停止。我可以再次运行,保持速度zeroor设定一个新的步数。 对于速度的设置,很简单,只是改变PWM的频率和发送更多的脉冲,因此更高的速度。 这在理论上是一个简单的问题,捕捉从TC /脉冲比较Sr和设置我的PWM零。还更新了粘性状态寄存器中的值。比我读条如果脉冲做更新新的命令。 不知道它为什么不起作用。 CyrWrk.Soviv02.Zip 2.2兆字节 以上来自于百度翻译 以下为原文 So... I tried to do the checks and stops in software with no luck. The biggest problem I have is to capture accurately when the pulses are done, i.e. count complete and be able to restart after. I didn't find any good way to store the TC/ Comp pulse and use that. The hardware solution you mentioned Dana seems better. But trying a SR Flip Flop led me nowhere - I can't set it up so it stops after steps are done and waits for a reset from register. I am thinking I could disable PWMs once steps are done or set the pulse to zero. Than, for a new command reset counter and brings pulses back to desired speed. The scenario is: I set it to do X steps. Once it finished it will stop. Than I either run again, keep speed zero or set a new step number. Regarding speed setup, it's very easy, just change the PWM frequency and it sends more pulses - hence higher speed. This should in theory be a simple problem- capture pulse from TC/Compare in a SR and that sets my PWM to zero. Also updated a value in a sticky status register. Than I read the reg and if pulses are done update new command. No idea why it will not work. |
|
|
|
使用一个不同的更高的时钟为你的粘状态寄存器(如果你仍然需要它们)
我强烈建议使用中断驱动的方法。将中断组件连接到计数器,使用“SytTeX”来定义代码中的处理程序。不要忘记通过读取计数器状态来删除中断原因。使用计数器的非常高的时钟,参见数据表:时钟不被计数,它被用来检测计数输入上的脉冲!!!! 连接PWM计数。设置PWM频率和脉冲宽度。设置计数器倒计时,加载脉冲数和启动计数器。 启动PWM。 在计数器的中断处理程序中停止PWM,读取计数器状态和停止计数器。设置一个易失性全局标志来指示步进已经完成。 快乐编码 鲍勃 以上来自于百度翻译 以下为原文 Use a different much higher clock for your sticky status register (if you still need them) I strongly suggest to use an interrupt-driven approach. connect an interrupt component to your counter, use _StartEx to define the handler within your code. Do not forget to remove the interrupt cause by reading the counter status. Use a very high clock for the counter, see datasheet: The clock is not counted, it is used to detect a pulse on the count input!!! Connect PWM to Count. Setup PWM frequency and pulse width. Set counter to count down, load number of pulses and start counter. Start PWM. In counter's interrupt handler stop PWM, read counter status and stop counter. Set a volatile global flag to indicate that stepping is done. Happy coding Bob |
|
|
|
这里是一个基本的脉冲突发发生器。nPrime=时间周期+ 2
它是由写入到TrimPulsCub控制寄存器触发的。 问候,Dana。 DS1ZYQualPrimt3.PNG 43 K Cyrkky.Access 01.Zip 1.8兆字节 以上来自于百度翻译 以下为原文 Here is a basic pulse burst generator. The Npulses = Timerperiod +2 Its triggered by a write to TrigPulseTrain control register. Regards, Dana.
|
|
|
|
注意,你可以用PWM替换定时器,从而增加占空比控制。
或者使用计数器,基本逻辑应该为设计工作。 问候,Danma。 以上来自于百度翻译 以下为原文 Note you can replace timer with PWM so that you add duty cycle control. Or use a counter, basic logic should work for the design. Regards, Danma. |
|
|
|
谢谢鲍伯和Dana。
我得到了ISR项目作为suggestedby Bob上升,并最终运行。 但是,你建议的HW方法相当简洁,我喜欢没有处理器干预的事实。我需要改变脉冲频率。我认为它可以通过改变时钟到派生时钟(使用另一个定时器)来实现。 以上来自于百度翻译 以下为原文 Thanks Bob and Dana. I got the ISR project as suggested by Bob up and running in the end. However, the HW approach you suggest is quite neat and I like the fact I have no processor intervention. I would need to vary the pulse frequency. I think it can be done by changing the clock to a derived one (using another timer) |
|
|
|
使用时钟API来改变它们的频率,我使用的频率为1 MHz。在组件数据表中。
独自离开闹钟 问候,Dana。 以上来自于百度翻译 以下为原文 Use the clock APIs to change their frequency, the one I used as 1 Mhz. In component datasheet. Leave the BUS_CLK clock alone Regards, Dana. |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2069 浏览 1 评论
1824 浏览 1 评论
3633 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1760 浏览 6 评论
1509 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
507浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
357浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
410浏览 2评论
357浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
854浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 10:10 , Processed in 1.497920 second(s), Total 115, Slave 98 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号