PR23+SKPS PROGRAM

LED Blinking, Walking with Cytron Servo, Displaying RFID, Multi-function Mobile Robot......

PR23+SKPS PROGRAM

Postby carlobot » Tue Apr 20, 2010 11:51 pm

HI to everybody,

I am new in this forum and I need a help for my project (rover).I want drive two geared motors as this schema:PS2-->SKPS-->SK40C(PIC16F877A)-->(2)MD30.After charging PS23+SKPS sample code HEX this is the result:motors can run both CW or CCW so that they can move the rover forward and backward;motors can also run (one CW and one CCW)so that the rover can turn right.I was espected to can run motors (one CCW and one CW) to turn right but only one motor run CW and the other not runs so that rover cannot turn left.I have tried using various motorcontrollers(ad example the same Dual H bridge in the PR23 schema)with the same result.I tried to use single motor control alternating connections betwin RC1 and RC2 and I think that command signals from RC1 line are not like espected.For better understanding that is what happens when I press joypad buttons: LEFT-(motor1 cw-motor2 cw)//RIGHT-(motor1 ccw-motor2 ccw)//
UP-(Motor1 cw-motor2ccw)//DOWN-(motor1cw-motor2 stop).Regards Carlobot
carlobot
Newbie
 
Posts: 12
Joined: Fri Apr 09, 2010 11:25 pm

Re: PR23+SKPS PROGRAM

Postby carlobot » Wed Apr 21, 2010 5:37 am

HI

Sorry for my previous wrong information,I have been little bit confused explaining my problem due to various tests changing "in" pin position in the motorcontrol .Confirming that one joypad button and one joy stick don't make what it should be espected,I'll try to explain as reported in the C code. Pressing: "up" button - move forward(both motors run);
"down" button-move backward(both motors run);
"left" button-rotate left(both motors run);
"right"button"-rotate right(both motors run).In my test only one motor run.
"Left left joy" and "left right yoy" works fine,otherwise "Right up joy" run only one motor (same of "right"button and in same direction),"Right downn"joy works fine.I hope to get a help.Regards

carlobot
carlobot
Newbie
 
Posts: 12
Joined: Fri Apr 09, 2010 11:25 pm

Re: PR23+SKPS PROGRAM

Postby hyng » Wed Apr 21, 2010 1:20 pm

IF move forward and backward are working fine for both motors, the circuitry should be no problem. Maybe the coding has some minor error. . Do check your coding :mrgreen:
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: PR23+SKPS PROGRAM

Postby carlobot » Wed Apr 21, 2010 4:44 pm

That's what I suppose,unfortunately I'am a beginner and I don't know what needs to be modified and how.Looking at various examples(PR23-PR19-PR10) I found that pwm settings are common.What change is "TRIS" configuration.In the "PR23+SKPS" TRISC =0b10000000;//set PORTC pin as output(comment).It's correct configuration?That's is my doubt.Please help me.Regards
carlobot
carlobot
Newbie
 
Posts: 12
Joined: Fri Apr 09, 2010 11:25 pm

Re: PR23+SKPS PROGRAM

Postby ober » Wed Apr 21, 2010 5:44 pm

You need to understand the code in order to modify it, changing those parameters with luck will not help you.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: PR23+SKPS PROGRAM

Postby carlobot » Wed Apr 21, 2010 11:38 pm

Thank you for replying,

I ask you,as you without any doubt are much more expert than me, how I can try to solve the problem.Knowing wich is the response I have had using the example code and as I tried to explain, I kindly request to help me to understand wich is the part of code that needs to be corrected/modified. Thanks for your pacience,regards

carlobot
carlobot
Newbie
 
Posts: 12
Joined: Fri Apr 09, 2010 11:25 pm

Re: PR23+SKPS PROGRAM

Postby sich » Thu Apr 22, 2010 1:22 pm

Hi carlobot,

Your explanation are rather confusing...i read through your problem again and again but still couldn't get what actually you want to express. Sorry about that. Can you clarify please?
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm

Re: PR23+SKPS PROGRAM

Postby carlobot » Wed Apr 28, 2010 6:34 am

Hi,

just because I do'nt like surrender I restart to test from the beginning.As the PR23 schematic I connected SK40C to the Dual H Bridge to drive M1 and M2 motors.
The program "define" motors as follow:
#define motor_ra RC0
#define motor_rb RC3
#define motor_la RC4
#define motor_lb RC5;
in the part "motor control function" we found:
void forward ()
{
motor_ra = 0;
motor_rb = 1;
motor_la = 0;
motor_lb = 1;
}
void backward()
{
motor_ra = 1;
motor_rb = 0;
motor_la = 1;
motor_lb = 0;
}
.....................the program continue for the function "left" and "right".
With the aid of a voltmeter I mesured the state of motors define during the "pressing" buttons for mobility and "moving" joy sticks for analog control mobility.I found that all motor's state are like the program says with the exeption of motor_rb in the "backward function" were I found state "1" instead of "0".That is the cause,I think,of the malfunction(only one motor run in backward).I hope to have a help,regards

Carlobot
carlobot
Newbie
 
Posts: 12
Joined: Fri Apr 09, 2010 11:25 pm

Re: PR23+SKPS PROGRAM

Postby hyng » Wed Apr 28, 2010 9:19 am

Do you mean the motor_rb always 1 whenever it is backward or forward? so the motor_rb only run in one direction? but at the first post, you have mentioned both backward and forward is working fine. You are making me confuse.
If motor_rb really giving the output '1' in any case, then you need to troubleshoot it. have you define your motors' pin as output in your code? Are you sure the RC3 has the right connection in your circuitry? :|
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: PR23+SKPS PROGRAM

Postby carlobot » Wed Apr 28, 2010 11:14 pm

Hi Hing,

thank you for your interesting, I apreciate very much!
In my previous post I said that forward and backward were fine because I tried to change the output pins of the SK40C in the Dual H Bridge and result has been that left or right did'nt work fine; that dipends of were "RC3" is connected.As the original PR23 schematic I connected RC3 to the the "input 2" and I confirm that RC3 state is "1" in backward control function instead of "0" so that only one motor run in backward function.
In the right function RC3 state is "0" and is OK as program.Hope this explaination in my poor english helps.Regards,

Carlobot
carlobot
Newbie
 
Posts: 12
Joined: Fri Apr 09, 2010 11:25 pm

Next

Return to DIY Project Set

Who is online

Users browsing this forum: No registered users and 5 guests

cron