![attachment.php?attachmentid=73958](http://forums.parallax.com/attachment.php?attachmentid=73958)
Acroname moto board and md03 h bridge. The above is the file that was given to me. The tech support from acroname is Im not doing the math look in console etc bye bye. Their forum is not responding no support.
·Heres the problem. My motor-servo that has a ponentimeter feedback to the moto works flawlessly in every aspect except with the above file. I have attepmped 20 + stab in the dark configurations. Can I keep the md03 and then buy? a whatever parallax controller and then achieve my goals? My servo position hovers around 2 volts 0-5 when it should be
· a
· 1 volt input should equal a 1 volt position. The servo position is analog 1 yellow.
·Is the above program flawed?
Post Edited (mark8) : 1/28/2007 8:00:54 AM GMT
Comments
How is the motor/servo/feedback wired?· My guess is, to make this work, the feedback potientometer needs one end tied to +5 volts and the other side to ground.· The center or wiper would go to channel 4.· Is this how it's wired?·
Another thing to be careful with, are you using seperate supplies for the motor and the controller?· If yes, then you must tie all the·grounds together, but you must do this at only _one_ place, otherwise you create a ground loop and even more problems.
To answer your question about control with Parallax products, we need to know what the servo/motor is.· Any of the following: wiring diagram, link to website, model numbers, voltage/current etc.· Without knowing what your trying to control, I'm not sure we can help.
Post Edited (Desy2820) : 1/28/2007 10:40:23 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
0.0047uf ceramic disc----.·
Capacitors will absorb the energy stored in the inductive windings of the motor however in doing so, the voltage across them can go far above the motor drive voltage (hence the need for 300V breakdown). Another approach, which may be used in parallel with capacitors involves zener diodes. Two head to head zener diodes connected across the motor leads will clip voltage spikes coming from the motor. If the motor is running at 12V, 18V Zeners should be used. A higher substantially higher voltage is used because: Zeners ease into their conduction, it does not happen suddenly at their spec voltage. Depending on the motor drive circuit, the drive voltage may go over nominal for short periods or, for instance when NiCads are fully charged and first connected. Lastly, typically, other power elements of the drive circuit can handle 6V over voltages for short times or there are measures in the circuit to deal with them. Remember the point here is to reduce EM noise and clipping motor spikes at +/- 6V over nominal drive voltages is usually sufficient.····· The highest volt zener diodes at rat shack 1nt4742a 12 volt.··I should be able to tell if·twisting and isolating made any difference by datalogging. I need to completely rewire everything.
Post Edited (mark8) : 1/29/2007 3:55:42 AM GMT
Post Edited (mark8) : 1/29/2007 4:27:50 AM GMT
#include <aA2D.tea>
These two files
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Developmental dyslexia is a condition or learning disability which causes difficulty with reading and writing. Its standard definition is a difficulty in reading and writing in spite of normal or above-average intelligence and cognitive abilities.
Post Edited (mark8) : 1/29/2007 7:20:43 AM GMT
For motor EMI, try a small disc capacitor across the motor's terminals.· The cap should be rated about 50 volts.· I think a value of .01uF to start with, but do some research.· It's not the voltage spikes, it's the RF/EMI noise from the motor that's usually the problem.· The small value cap helps reduce the noise.
Hopefully, others will be able to help you further.·
Last question, are you feeding the tach input to the ADC?· Or just not using it right now?· Judging by the info you posted,·the ADC·isn't supposed to have·an input above 5V.·
That being said, here is the page on the Acroname website that you should look at:
www.acroname.com/brainstem/TEA/tea1.html
TEA is basically a subset of C. C isn't too difficult to learn, but it can be difficult for beginners. You should consider getting a good beginners book, such as Absolute Beginner's Guide to C by Greg Perry.
You can also check out this tutorial: cslibrary.stanford.edu/101/.
Once you have the basics down, you'll have a much easier time understanding the programs.
If I'm reading something into this discussion that isn't really there, I herewith apologize. If, however, the eventual goal is to have a PBASIC Stamp drive this Brainstem Module, there may wll be a problem awaiting you, which will be somewhat difficult to overcome. This is particularly true for a beginner.
Whenever one tries to use a piece of hardware that was designed to be operated from a PC, one must make sure that the necessary (asynchonous serial) communications protocal (if used) doesn't require FULL DUPLEX communication. FULL DUPLEX is the ability to transmit and receive data at the same time. This requires the use of a hardware UART for data buffering, which the PBASIC Stamp platforms do not possess. Thus, the PBASIC Stamp is incapable of full duplex communications directly.
If this was not part of the eventual plan, please ignore this message.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Developmental dyslexia is a condition or learning disability which causes difficulty with reading and writing. Its standard definition is a difficulty in reading and writing in spite of normal or above-average intelligence and cognitive abilities.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
··· aMotion_SetParameter(1, aMOTION_PARAM_P, 450);
··· aMotion_SetParameter(1, aMOTION_PARAM_LATENCY, 5);
··· aMotion_SetParameter(1, aMOTION_PARAM_COFFSET,· 1);
If The analog input does not have a stable signal it will go near 2 volts on the servos position. Signal to ground it now goes to .50 volts before it was 1.0 position the lowest I could obtain. With 2 AA s 2.33 volts between the ground and analog input = 2.33 servo position. Exactly what I need. Hopefully it will function properly when it goes back on the car.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Developmental dyslexia is a condition or learning disability which causes difficulty with reading and writing. Its standard definition is a difficulty in reading and writing in spite of normal or above-average intelligence and cognitive abilities.
Post Edited (mark8) : 2/2/2007 6:43:57 AM GMT
/* filename: glen.tea */
/* this line is a comment that is ignored by the compiler */
// so is this line
#include <aMotion.tea>
#include <aA2D.tea>
// some simple constants to make the code below easier
// to read and modify
#define MOTION_MIN 1
#define MOTION_MAX 1100
#define MOTION_CHANNEL 1
/* this is the main program, it loops for ever */
void main()
{
· // since the value 1 below is always considered true,
· // the while loop will run continuously
· while (1) {
··· int value;
···
··· // here, we read the analog value from port 4.
··· // this value will be from 0-1023 which cooresponds
··· // to 0-5V input
··· value = aA2D_ReadInt(4);
··· // here, we clamp the reading to never be below
··· // a certain minimum defined above
··· if (value < MOTION_MIN)
····· value = MOTION_MIN;
·
··· // similarily, we clamp the value to never exceed a
··· // certain value···
··· if (value > MOTION_MAX)
····· value = MOTION_MAX;
···· // now, we send this position value to the PID loop
··· // to adjust the position the PID will try to reach
··· aMotion_SetSetpoint(MOTION_CHANNEL, value);
··· aMotion_SetParameter(1, aMOTION_PARAM_P, 450);
··· aMotion_SetParameter(1, aMOTION_PARAM_LATENCY, 10);
··· aMotion_SetParameter(1, aMOTION_PARAM_COFFSET, -50);
·} // while
} // main
if (value· =·< 200 MOTION_MIN·· 1)·· these 2 lines are guesses
····· value =MOTION_MIN;
[*]You can loop (jumping for those assembly junkies) through your code by using special loop keywords. [*]These include while, for, and do while. [*]The while loops until the expression specified is false. For example while (x < 4) will loop while x is less than 4. [*]The syntax for for is different. Here's an example: for (i = 0; i < n; i++, z++). This code will loop until i is equal to n. The first argument specifies initializing conditions, the second argument is like the while expression: continue the for loop until this expression no longer evaulates to true. The third argument allows for adjustment of loop control variables or other variables. These statements can be null, e.g. for (; i < n; i++) does not specify initializing code. [*]do while is like a "repeat-until" in Pascal. This is useful for loops that must be executed at least once. Some sample code would be: do { /* do stuff */ } while (statement);
This compiled no errors ?
/* filename: glen.tea */
[*]/* this line is a comment that is ignored by the compiler */
// so is this line
[*]#include <aMotion.tea>
#include <aA2D.tea>
[*]// some simple constants to make the code below easier
// to read and modify
#define MOTION_MIN 50
#define MOTION_MAX 1034
#define MOTION_CHANNEL 1
[*]/* this is the main program, it loops for ever */
[*]void main()
{
· do {
··· /* do stuff */
· } while ( value < 200);
·· value = MOTION_MIN;
· // since the value 1 below is always considered true,
· // the while loop will run continuously
· while (1) {
··· int value;
···
··· // here, we read the analog value from port 4.
··· // this value will be from 0-1023 which cooresponds
··· // to 0-5V input
··· value = aA2D_ReadInt(4);
[*]··· // here, we clamp the reading to never be below
··· // a certain minimum defined above
··· if (value < MOTION_MIN)
····· value = MOTION_MIN;
·
··· // similarily, we clamp the value to never exceed a
··· // certain value···
··· if (value > MOTION_MAX)
····· value = MOTION_MAX;
···· // now, we send this position value to the PID loop
··· // to adjust the position the PID will try to reach
··· aMotion_SetSetpoint(MOTION_CHANNEL, value);
··· aMotion_SetParameter(1, aMOTION_PARAM_P, 50);
··· aMotion_SetParameter(1, aMOTION_PARAM_LATENCY, 10);
··· aMotion_SetParameter(1, aMOTION_PARAM_COFFSET,· 100);
·} // while
[*]} // main
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Developmental dyslexia is a condition or learning disability which causes difficulty with reading and writing. Its standard definition is a difficulty in reading and writing in spite of normal or above-average intelligence and cognitive abilities.
Post Edited (mark8) : 7/27/2007 8:35:31 PM GMT