Frequency Generation
rapscaLLion
Posts: 75
Hi,
I am using the Synth object to generate frequency at the moment. The Synth object gives a 50% duty cycle over a variable period. What I am wondering if there is an object that will allow me to change the duty cycle. What I need is to be able to have a specific, consistent pulse duration followed by a variable delay, the total timing of which results in the same period as the synth object would deliver. I am sure this would be simple enough to write myself in ASM, but I am finally understanding SPIN and haven't gotten far into ASM yet. If someone can point me to an object I can use that would be perfect. I have been unable to find one myself in the obex, but perhaps I have missed one or someone has posted an object on the forum.
Thanks!
I am using the Synth object to generate frequency at the moment. The Synth object gives a 50% duty cycle over a variable period. What I am wondering if there is an object that will allow me to change the duty cycle. What I need is to be able to have a specific, consistent pulse duration followed by a variable delay, the total timing of which results in the same period as the synth object would deliver. I am sure this would be simple enough to write myself in ASM, but I am finally understanding SPIN and haven't gotten far into ASM yet. If someone can point me to an object I can use that would be perfect. I have been unable to find one myself in the obex, but perhaps I have missed one or someone has posted an object on the forum.
Thanks!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
I have not seen such an object.
I don't know the desired range of timings, but perhaps you can solve this· without using the timers.
If SPIN is not fast enough, you might try it in PropBasic?
Good Luck, Christof
John Abshier
rapscaLLion, what pulse width, range of frequencies, and number of channels are you looking for?
-Phil
Up to 31: obex.parallax.com/objects/506/
Up to 6: obex.parallax.com/objects/422/
Only 1: I don't have it in the OBEX, but I have it, if you want it I can upload it
The lower the number of the outputs, the higher the precision.
I am not quite sure exactly what you need, but the 31 output object allows unique duties for each output, while the other two objects allow one duty for all outputs. The objects could be modified easily to change that though (I'll do it if you want).
The other issue, depending on your needs, is the cog has to be restarted to change the frequency, the duty, or which outputs are on.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
Post Edited (Bobb Fwed) : 8/4/2010 6:12:38 PM GMT
It is way more precise than the other objects, and it goes to a lot higher frequencies (haven't tested exactly how high), but a quick glance says the PASM could go somewhere around 6MHz at 50% duty. But if I remember correctly, there is some math overflow in the SPIN when you go that high, so it won't work. But that can be fixed. I have used it up to 500kHz.
EDIT: it turns out the limit for this object is about 2.35MHz at 50% and higher (3MHz) if you have the duty close to 24%.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
Post Edited (Bobb Fwed) : 8/4/2010 5:04:51 PM GMT
Are your trying to adjust A,B, or C?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
Always include as much info as possible in the original question.
Where is the data-sheet for this motor?
That way we can tell what range the numbers need to be in.
Here are the data sheets for the motor and controller. They are fairly sparse in terms of useful information as you can see. Any help you can provide in terms of how to drive this without encountering the pitchy/whiny noises would be great. There are certain parts of the speed ramp up and down which are practically silent (actual mechanical noise only), and others where the darn thing sounds like a slot machine.
It is a steppermotor with 200 steps per revolution
and a steppermotorcontroller
I guess the dutycycle is not important here.
The steppermotorcontroller is able to create MICRO-steps.
With switches SW5-SW8 off on on on you are working in halfstep mode
400 steps per revolution.
If you choose more steps per revolution this might cause the noise
You have switches SW1-SW3 to set the current. This means the voltage
is switched ON/OFF at a high frequency (10kHz-25kHz) to get more torque out of the motor.
These are two possible reasons for the noise you hear.
best regards
Stefan
We are doing 400ppr with halfsteps. Setting a higher ppr results in the same noise, only much louder. Varying the synth object coding (playing with the pulse and delay timings) results in identical speeds but with varying levels of noise, the only problem is I can't seem to ramp up or down without the motor "singing" with a distinctly "stepping" tone. By that I mean as the speed ramps up, the tone steps up, and vice-versa as the speed ramps down.
Any thoughts as to how to modify the synth object to limit the singing as much as possible?