SMALL - espritmodel.com SMALL - Telemetry SMALL - Radio
Reply
Thread Tools
Old Oct 30, 2012, 03:03 AM
Registered User
Joined Oct 2012
224 Posts
i have tried to change the program, but does not work. motor cut off if the servo pulse more 1.8ms or 1.2ms (2.0 and 1.0 (
motor cut off when running high-speed


RaStartCount: movlw ArmPulsesReqd
movwf ArmPulseCount ; set required number of good pulses
bcf Flags,Stop1
bcf Flags,Stop2

RaNextPulse: call Measure ; measure servo pulse width
skpnz ; bad pulse ?
goto RaStartCount
movwf PrevCount ; remember servo pulse
movwf Index
movlw 38
subwf Index,F
skpc ; minimum = 1.2mS
clrf Index
movlw 75
subwf Index,W ; maximum = 1.8mS (index range: 0 to 75)
skpnc
subwf Index,F

ifdef DETECT_NEUTRAL
btfsc Flags,UseTable2 ; using throttle table 2 ?
goto RaTable2 ; yes, check for low thottle neutral
endif

clrf PCLATH
movf Index,w
call Table
xorlw 0 ; Throttle in center ?
skpnz
goto RaStop1 ; yes

ifdef DETECT_NEUTRAL
btfsc Flags,UseTable1 ; using thottle table 1 ?
endif

goto RaStartCount ; no, stick not at neutral

ifdef DETECT_NEUTRAL ; check if throttle is in low neutral position

RaTable2: clrf PCLATH
movf Index,w
addlw 76
call Table
xorlw 0 ; Table 2 neutral ?
skpz
goto RaStartCount ; no, stick not at neutral

RaStop2: bsf Flags,Stop2 ; now in Table 2 STOP region
btfss Flags,Stop1 ; was last pulse in Table 1 STOP region ?
goto RaCount ; no, continue
bcf Flags,Stop1
goto RaStartCount ; yes, restart

RaStop1: bsf Flags,Stop1 ; now in table 1 STOP region
btfss Flags,Stop2 ; was last pulse in Table 2 STOP region ?
goto RaCount ; no, continue
bcf Flags,Stop2
goto RaStartCount ; yes, restart

else ; not detecting offset neutral

RaStop1: bsf Flags,Stop1 ; now in table 1 STOP region
bcf Flags,Stop2

endif

RaCount: decfsz ArmPulseCount,F ; Do we have enough arm pulses?
goto RaNextPulse ; Not yet.
fantasy1988 is offline Find More Posts by fantasy1988
Last edited by fantasy1988; Oct 30, 2012 at 04:44 AM.
Reply With Quote
Sign up now
to remove ads between posts
Old Oct 30, 2012, 09:43 AM
Registered User
Joined Oct 2012
115 Posts
hello fantasy1988

I also encountered the same case as you, the motor cut off when the pulse exceeds 1.8 ms. should we wait Bruce abott program changes to improve it.
future88 is offline Find More Posts by future88
Reply With Quote
Old Oct 30, 2012, 04:22 PM
We want... Information!
Bruce Abbott's Avatar
Hastings, New Zealand
Joined Jan 2001
5,185 Posts
Quote:
Originally Posted by fantasy1988 View Post
if run forward too 1.8 or run reveser than 1.2 servo control pulse, the circuit automatically cut off,
1.2~18mS is just the range of throttle control. Pulse widths from 0.9mS to 2.2mS are accepted, and the motor should keep going in full forward or reverse unless your radio is creating out of range pulses or the signal is noisy.

To cater for noisy signals I have changed the code. V0.7 slows down the motor when out of range pulses are received, rather than simply holding the last good signal position and then cutting out after a short time. When the signal comes back into range it will instantly go back to the original throttle setting, so a noisy signal will cause the motor to surge.

It will still cut out if the signal is lost completely, or if the battery voltage drops too low. If you think the LVC (Low Voltage Cutoff) is causing trouble, you can disable it by connecting pin 6 directly to pin 1.


Quote:
2.7khz frequency is relatively high, change down from 100Hz to 600Hz.
This will require an extensive rewrite, because the code has critical software timing loops which are related to the PWM frequency. Rather than creating different code for each PWM frequency, I am attempting to develop interrupt-driven code which uses hardware timing. If this doesn't work well then I may drop the 12F675 and use a newer chip which has hardware PWM (eg. 12F617).
Bruce Abbott is offline Find More Posts by Bruce Abbott
Reply With Quote
Old Oct 30, 2012, 10:18 PM
Registered User
Joined Oct 2011
15 Posts
Quote:
Originally Posted by Bruce Abbott View Post

This will require an extensive rewrite, because the code has critical software timing loops which are related to the PWM frequency. Rather than creating different code for each PWM frequency, I am attempting to develop interrupt-driven code which uses hardware timing. If this doesn't work well then I may drop the 12F675 and use a newer chip which has hardware PWM (eg. 12F617).
Hi Bruce,

Using a chip with hardware PWM is the best choice, then we could change the PWM frequcncy to meet the request. I checked the 12F617 datasheet. It has one ECCP module, but only half bridge output. If the chip has full bridge output, it will be easy to replace 12F675.

I am not sure how to generate 2 PWM output to drive the 2 N-MOSFET. Using PWM (Enhanced Mode) CCP1/P1A, switch the output between TRISIO2 and TRISIO5?

Br,
Sam
txtchain is offline Find More Posts by txtchain
Reply With Quote
Old Oct 31, 2012, 07:58 AM
We want... Information!
Bruce Abbott's Avatar
Hastings, New Zealand
Joined Jan 2001
5,185 Posts
Quote:
Originally Posted by txtchain View Post
Using PWM (Enhanced Mode) CCP1/P1A, switch the output between TRISIO2 and TRISIO5?
Yes. In single PWM mode we can use the alternate pin function to steer the P1A PWM output to GP2 or GP5, modulating either the forward or reverse low-side FET(s). The other 3 sides of the bridge are controlled by setting the appropriate port bits in software.

However it should be possible to use half-bridge mode, which applies PWM to both the low-side and high-side FET(s). The alternate pin function then switches both P1A and P1B outputs, to provide forward or reverse with synchronous rectification. Single PWM mode will still be used for braking.

The pin assignments are almost the same as in my current circuit, so I should be able to use the same pc board with one minor modification (pins 2 and 7 must be swapped).
Bruce Abbott is offline Find More Posts by Bruce Abbott
Reply With Quote
Old Oct 31, 2012, 08:31 AM
Registered User
Joined Oct 2012
115 Posts
why not use 12F683, I thought it best in chips line 12fxxx ., and more common 12f617
future88 is offline Find More Posts by future88
Reply With Quote
Old Oct 31, 2012, 10:25 AM
We want... Information!
Bruce Abbott's Avatar
Hastings, New Zealand
Joined Jan 2001
5,185 Posts
Quote:
Originally Posted by future88 View Post
why not use 12F683, I thought it best in chips line 12fxxx ., and more common 12f617
It only has a single PWM output which isn't steerable - not very useful for a bidirectional ESC.

All the suppliers that I deal with stock both chips, but the 12F617 is significantly cheaper.
Bruce Abbott is offline Find More Posts by Bruce Abbott
Reply With Quote
Old Oct 31, 2012, 08:16 PM
Registered User
Joined Oct 2012
224 Posts
hi Bruce Abbott
I've been using your new program V 0.7. use mode slows down the motor, but I have difficulty with this change

when I brake, than 1.2ms pulse, mode brake operation ineffective, the motor continues to run.
program should maintain the motor speed when bad signal before the return signal good (not restart)

it does not restart when the signal is bad, but you just maintain its speed instead slows down
 when using mode slows down the motor, I usually move the joystick in neutral position, and the car becomes out of control with the sudden acceleration forward or backward when the returned signal good . (1.8ms or 1.2ms)


if this change does not affect program implementation you please correct it

I hope you can help me finish this, and forgive me for bothering you

Again thank you,wish you health
fantasy1988 is offline Find More Posts by fantasy1988
Last edited by fantasy1988; Oct 31, 2012 at 08:21 PM.
Reply With Quote
Old Nov 01, 2012, 01:53 AM
Registered User
Joined Oct 2012
224 Posts
I built the circuit diagram, using the program V0.7 of Bruce abbot
just a little hard on the pulse signal bad , it is nearing completion.i have used it for old car HSP 1/10

bec 5v 3a lm2576

use mc 34063 generate 20V power supply, driver circuit h-bridge circuit through opamp lm 324 .. fet 3205 may result in saturation (20v - 7,2v to 12,8v )
have brake,forward,reverser ( program v0.6 or v0.7 of Bruce abbot )
fantasy1988 is offline Find More Posts by fantasy1988
Last edited by fantasy1988; Nov 12, 2012 at 08:43 PM.
Reply With Quote
Old Nov 01, 2012, 07:47 AM
We want... Information!
Bruce Abbott's Avatar
Hastings, New Zealand
Joined Jan 2001
5,185 Posts
Quote:
Originally Posted by fantasy1988 View Post
when using mode slows down the motor, I usually move the joystick in neutral position, and the car becomes out of control with the sudden acceleration forward or backward when the returned signal good . (1.8ms or 1.2ms)
Just for you, here is V0.8, which does not slow down or reset when out of range pulses are received.
Bruce Abbott is offline Find More Posts by Bruce Abbott
Reply With Quote
Old Nov 01, 2012, 08:56 AM
Registered User
Joined Oct 2012
115 Posts
noise from the motor brushed 540 are great, its spikes hanging pic or kill pic. I think this circuit uses low power and small size motor.
I admire the ability to write Bruce abott program, I stopped viewing your site, there are many applications for RC, it was really helpful
hope to see construction projects esc brushed your use 12f617 chip, it's really perfect for brushled motor control applications with the leg create pwm available
future88 is offline Find More Posts by future88
Last edited by future88; Nov 01, 2012 at 09:03 AM.
Reply With Quote
Old Nov 06, 2012, 03:40 PM
We want... Information!
Bruce Abbott's Avatar
Hastings, New Zealand
Joined Jan 2001
5,185 Posts
Quote:
Originally Posted by future88 View Post
noise from the motor brushed 540 are great, its spikes hanging pic or kill pic.
First, check that the motor has interference suppression capacitors fitted (~100nF from each terminal to the case).

Secondly, make sure that the power supply wires feeding the 5V regulator are not passing motor current. The + and - wires going to the FETs should be separate from the wires going to the regulator (only joined together at the battery input terminals). To reduce voltage spikes, you should install a large low ESR electrolytic capacitor across the battery input terminals.

Here is the first draft of my code for the 12F617. Using hardware PWM enables frequencies down to 250Hz with excellent stability. In the next release I hope to improve accuracy of the input pulse measurement (have to figure out how to get Timer1 gate working properly on the alternate pin input).

NOTE: attached hex was produced in 'simulate' mode (no low voltage cutoff, no arming).
Bruce Abbott is offline Find More Posts by Bruce Abbott
Reply With Quote
Old Nov 06, 2012, 08:32 PM
Registered User
Joined Oct 2012
115 Posts
thank you for sharing

I will resist the impulse noise from the motor 540 for your pic by the way

new version using 12f617 chips, I saw a brief program and PWM control more flexible than previous versions

I will test, and error checking of the program

I saw your website, and I see you use two motors for boats, by connecting in parallel,




  if I want to use two separate motors with mixed signal functions, this schematic can work well?



mixer from radio transmitter, or use separate circuit
future88 is offline Find More Posts by future88
Last edited by future88; Nov 06, 2012 at 08:38 PM.
Reply With Quote
Old Nov 06, 2012, 11:15 PM
We want... Information!
Bruce Abbott's Avatar
Hastings, New Zealand
Joined Jan 2001
5,185 Posts
Quote:
Originally Posted by future88 View Post
if I want to use two separate motors with mixed signal functions, this schematic can work well?

mixer from radio transmitter, or use separate circuit
Yes. If you have a 4 channel+ transmitter with V-tail/Elevon mixing then you can use the elevator/rudder stick (Mode 1) or elevator/aileron stick (Mode 2) to get both forwards/backwards and turning control of the motors. The rudder servo can still be operated independently via the other horizontal stick function (ailerons in Mode 1 or rudder in Mode 2).

If the transmitter doesn't have suitable mixing functions then you can plug a v-tail mixer into the receiver to get the same effect.
Bruce Abbott is offline Find More Posts by Bruce Abbott
Reply With Quote
Old Nov 06, 2012, 11:42 PM
Registered User
Joined Oct 2012
115 Posts
hi bruce abbott

I do not use the transmiter 4 ch, I use the transmitter 2ch of car.and I would buy a separate mixer
I think the adjustment signal in neutral position 1.4 to 1.55 may be difficult
okay, I will check and report the results

future88 is offline Find More Posts by future88
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Ebay 320amp brushed esc and car starter narxer Power Systems 7 Aug 20, 2012 11:31 AM
Discussion Question about using a 10T brushed car esc in a boat, using twin 55T brushed motors SARCFAN Dock Talk 5 Jul 02, 2012 11:58 AM
Found --found/closed/thanks rcfanatic--Brushed r/c car ESC that can handle 11.1 lipo fly_right Cars - Cars and Parts (FS/W) 6 Apr 14, 2012 07:39 PM
Discussion Replacment brushed ESC for the NitroRCX drift car. B dog Electric Power Cars 5 Mar 06, 2012 08:20 PM