CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Random reset
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
luckyluke



Joined: 18 Apr 2006
Posts: 45

View user's profile Send private message

PostPosted: Fri Mar 31, 2017 8:24 am     Reply with quote

Sorry about pwm frequency it is 6219 Hz Embarassed

I didn't get the "minimum pwm percentage".
Is it minimum percentage which robot start to move?
If so it is %5 with fully charged 3s lipo.
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Fri Mar 31, 2017 8:43 am     Reply with quote

It's the lowest PWM percentage you use.
If you want full torque at this, it's pulse width must be greater than the time it takes for current to climb to it's full value. So for the data from the motor,

5*L/R = 75.6uSec

So with this being 5% of your full pulse width, the highest PWM frequency you can use and have full torque from the motor is:

1/(76.5uS*20) = 661Hz.

So currently your PWM frequency is massively limiting the motor torque (particularly during start-up).....
luckyluke



Joined: 18 Apr 2006
Posts: 45

View user's profile Send private message

PostPosted: Fri Mar 31, 2017 9:30 am     Reply with quote

I misunderstood.
I thought it was the first point that motors move the robot.

My minimum is %50 for turning maneuver.

I will setup pwm to 500 Hz.

Have a look at this video, see what is this for:

https://www.youtube.com/watch?v=QZK6KX8qj-A

At 1:19 somebody has a reset problem !!
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Fri Mar 31, 2017 10:21 am     Reply with quote

Seriously, the changes will only reduce it.
You need to actually design your supplies and inter-wiring carefully to avoid it.
It's worth realising that the starting current even with the 2S battery will be 2A momentarily as power is first applied. With the 3S, it'd be right on the 'absolute maximum' rating for the drive electronics....

How is your code setup to stop?. Does it brake the drive or let the motor coast?. Understand if the latter, that there can be exceptionally large voltages.
How about reverse?. Do you bring the motor to a halt before applying reverse?.
luckyluke



Joined: 18 Apr 2006
Posts: 45

View user's profile Send private message

PostPosted: Fri Mar 31, 2017 12:49 pm     Reply with quote

start up maneuver for example

Code:

(%75 duty)
forward 75 left, reverse 75 right 100msec
forward75 left, brake right  5msec     thats where it generally reset
forward 75 left, forward 75 right 150msec
forward 75 left, brake right  5msec
forward 75 left, reverse 75 right 260msec


and very first time of hitting there would be reset
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Fri Mar 31, 2017 1:27 pm     Reply with quote

So when you switch from 'forward', to 'right', what is done to the left motor?. Is it braked or allowed to free run?. If you are going forward, and the motor has reached full speed, how is it ramped down for the turn?. How long do your acceleration and deceleration ramps take?. Given it is on a tiny operation, it suggests that your code may be making a mistake in this operation, perhaps doing something like stopping the motor 'dead' or letting it freewheel and as a result a nasty current spike is resulting, which is what is glitching the supply.....

If a behaviour occurs at a particular transition, then it strongly suggests that something about this transition is causing a problem. That it is the shortest, may suggest that the code does something incorrect when the motor hasn't finished changing speed.
luckyluke



Joined: 18 Apr 2006
Posts: 45

View user's profile Send private message

PostPosted: Fri Mar 31, 2017 3:33 pm     Reply with quote

I have function motor(left,right);

motor(75,-75)
motor(75,0)
motor(75,75)
motor(75,0)
motor(75,-75)

0 is means set up hbridge forward with zero duty.
If it was forward it will be free run,
if it was reverse it will be brake.

There is no ramp for increasing or decreasing.
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Sat Apr 01, 2017 12:42 am     Reply with quote

If you have no ramp, and no deceleration time, then if you go from a forward to reverse on a motor, it will cause horrible current spikes. Also if you are allowing the motor to free-wheel and you switch from 'forward' to 'right', then the driven motor on the left will tend to push the right hand motor which is already spinning making dynamo generation terrible. Understand that the energy coming from a motor when you do this, will be being fed back into he power rails via the trap diodes. I hate to think what current may be going through these, and what is being fed onto the power rails. You should be looking at ramping the motor speed a little. Otherwise your code is like a driver who insists on stopping their car by driving into a wall....
luckyluke



Joined: 18 Apr 2006
Posts: 45

View user's profile Send private message

PostPosted: Sat Apr 01, 2017 3:21 am     Reply with quote

I need sudden movements because of this i didn't consider ramping.
Now i am adding it and will try again.
luckyluke



Joined: 18 Apr 2006
Posts: 45

View user's profile Send private message

PostPosted: Mon Apr 10, 2017 12:21 am     Reply with quote

Problem has been solved with the suggestions of Ttelmah.

Changes i made:
Regulator has been replaced to robust model mic29500 with tantalum capacitors.
A 1000uf added to driver supply.
10 nf and tvs diodes added to motors
driver, sensor and microcontroller + - lines separated in the pcb.
luckyluke



Joined: 18 Apr 2006
Posts: 45

View user's profile Send private message

PostPosted: Tue May 16, 2017 2:03 am     Reply with quote

Just a follow up to this:
Got the unit working, and have done rather well in a recent robot competition with it. Very Happy Very Happy
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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