Has anyone had trouble with ctra mode %01010?
shanghai_fool
Posts: 149
I am trying to count frequency using last example in AN001 but it seems to be erratic.
The input is from my scope reference·(1 kHz @3.6v p-p) but the reading varies substantially ~1500.
Prop is running 80MHz and I do mode %01000 (pos pulse width) just great.
When I use a variable input squarewave, it doesn't follow it.
I only added a waitcnt after the display loop otherwise I couldn't get a clear reading.
I know I'm missing something but I can't see it. I will try again toorrow with fresh eyes.
Donald
·
The input is from my scope reference·(1 kHz @3.6v p-p) but the reading varies substantially ~1500.
Prop is running 80MHz and I do mode %01000 (pos pulse width) just great.
When I use a variable input squarewave, it doesn't follow it.
I only added a waitcnt after the display loop otherwise I couldn't get a clear reading.
I know I'm missing something but I can't see it. I will try again toorrow with fresh eyes.
Donald
·
Comments
I wouldn't think that the 1kHz from your scope would show that much jitter, but a value of 1500 indicates about a 2% error.
Can you attach the code that you are using to get these readings?
You say that %01000 works great... what about mode %01100 (NEG detector) ... or even mode %01110 (NEGEDGE detector) What are the results from these modes?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I am using the example in the tech note. I have also tried· %01110· with the same results.
Is there some additional input filtering needed on the input pin? I would think anything with <12.5ns risetime would be sufficient.
Donald
I've only played with Prop Asm a few times so feel free to ignore me if I'm off base here but I did notice the following difference from AN001
cognew(@entry, @freq) ' your code
cognew(@entry, freq) ' AN001
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Aka: CosmicBob
Thanks anyway.
I tried·the code you posted on my end and I get values ranging from 1006 to 1018 on·my scope.
The only thing I did differently was change the input pin from 23 to 7 ... and I have the routine displaying to·a TV.
·to read....
·Is your scope ground connected to the Propeller ground?· Is pin 23 on your board connected to anything else?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I think we are working on the same type of project, and I would appreciate some details of your interface. I am trying to drive a hard disk motor with a prop and L293D, and while it can drive the motor, starting from a dead stop requires my spinning the shaft by hand. I am running out of ideas, but will try sine waves next and a set of three TIP120 circuits. Are you controlling the brushless with the prop? How do you do it?
Cheers!
Paul Rowntree
That may be part of my problem. I do not use the VGA but I have the parts mounted and there are some resistors connected there.
@ Paul,
I think you may have hit the nail on the head and is exactly what I am thinking after looking closer at my "square wave". My scope is a 25MHz. Rigol and having been used to a 150MHz scope, I did not pay enough attention to the rise time which is way too long. Even the scope test output is too long. There is way too much time in "no man's land" at Vcc/2. Even driving with the op-amp comparator output is too slow. I need some Schmitt triggers on the input but, unfortunately tomorrow starts New Year's and no one will be working for a couple of weeks so I can't get any parts.
I am controlling the motors with a common RC type ESC (electronic speed control) but I want to keep the rpm's close as well. I know the exact static thrust each prop has relative to the rpm. I can effectively "weigh" the aircraft at hover. The 2 motors will be controlled via gyro/accellerometer/Kalman filter. If I could phase lock sync the motors, I would probably try that also but I don't want to design the ESC's.
My filter circuit is a standard Chebychev 3 pole low pass to get rid of the ESC's high freq noise. It puts out what I thought was a clean signal except the AD8594's slew rate isn't quite good enough. I will try to pick up some 74LVC14A's first chance I get.
I was trying to figure out how to read 2 counters at the same time with accuracy but decided to wait 1/2 second for one and the 1/2 sec for the other. I'm still not sure how accurate I can get though. I may also try measuring pulse width instead. At 5000 RPM, a 12 pole motor produces 1 kHz signal.
While I am waiting, I will workl on other aspects of my project. Like a really accurate receiver pulse width detector that works with PCM of PPM pulses. The current one in OBEX isn't quite accurate enough for PCM.
Happy Lunar New Year everyone and welcome year of the OX.
Donald
It shouldn't matter if you are using a VGA,TV, or serial to view the reported data... the TV just happened to be my "Debug of Choice" at the moment while I was running your code.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com