 |
 |
| View previous topic :: View next topic |
| Author |
Message |
rovtech
Joined: 24 Sep 2006 Posts: 288
|
|
Posted: Mon Feb 20, 2017 12:52 pm |
|
|
Yes, #28 wires. there is very little voltage drop for the few hundred mA drawn by the motors. The wires would have to be pretty heavy to avoid voltage drop from the battery to the end of the arm (over 4ft) so the surge current has to come from the capacitor.
Each section has its own PCB, capacitor, 5v power supply, and PIC. The arm has Base section, upper arm section, forearm section, wrist section, and the gripper section with gripper, camera, lights, lasers. The power and I2C wires are daisy chained through each section so the total capacitance is the sum of the distributed capacitance. I was using 500uF per board but am ordering 4700uF which will fit the space on the board.
Exceeding the sense input on the L298 was not the problem. The sense voltage is always positive because of the H bridge and was going a bit high. I reduced the sense resistors from 2.2ohms to 0.5ohms which actually made the problem worse because it allowed more surge current.
I changed the software a bit to avoid slamming into reverse. The relevant parts are (in appropriate places and same for the forearm):
| Code: | // global variables
short arm_dir = 1; // shows motor direction UP
short arm_run = 0; // arm is running
// stop if the arm has reached limits
if (arm_posn>down_limit) // if lower range limit exceeded
{
while (arm_posn>(down_limit-2)) // move off limit
{
move_up();
arm_posn=read_adc();
}
stop_arm(); // stop
at_arm_limit = 1; // set flag in status
}
if (arm_posn<up_limit) // if upper range limit exceeded
{
while (arm_posn<up_limit+2) // move off limit
{
move_down();
arm_posn=read_adc();
}
stop_arm(); // stop
at_arm_limit = 1; // set flag in status
}
// function 'move_up' moves the arm up
void move_up (void)
{
if (!arm_dir&&arm_run)
{
output_low (PIN_C3); // coast to a stop
delay_ms(250);
}
output_low (PIN_C6);
output_high (PIN_C4); // Set direction UP
output_high (PIN_C3); // enable L298
arm_run = 1;
arm_dir = 1;
delay_ms(50);
}
// function 'move_down' moves the arm down
void move_down (void)
{
if (arm_dir&&arm_run)
{
output_low (PIN_C3); // coast to a stop
delay_ms(250);
}
output_high (PIN_C6);
output_low (PIN_C4); // Set direction DOWN
output_high (PIN_C3); // enable L298
arm_run = 1;
arm_dir = 0;
delay_ms(50);
}
// function 'stop_arm' stops the arm motors
void stop_arm (void)
{
output_low (PIN_C3); // disable L298
arm_run = 0;
}
|
|
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20059
|
|
Posted: Mon Feb 20, 2017 1:07 pm |
|
|
| Be aware of the limitations of capacitors. Get ones with the lowest ESR you can find, and then parallel these with a smaller capacitor with good HF performance (ceramic or polyester typically). Problem is that electrolytic capacitors have poor high frequency performance. You will get better ESR performance from 2*2200uF, in parallel, rather than 1*4700uF. Generally larger capacitors in the same volume have worse ESR figures (just like high capacity batteries, where they sacrifice thickness on the electrodes to get the extra capacity). If you put an HF signal into a large electrolytic capacitor, it behaves like it has several hundred ohms of series resistance, while the same capacitor at a few kHz, may have an ESR only a tiny fraction of an ohm. Look for designs sold as 'extreme performance' (Vishay), Oscon (Sanyo) etc.. |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|