PWM using BS2SX to Motor Control (XAVIEN XDDCMD-1)
Can anyone give some pointers on PWM driven motor controls?
I've been trying to to use an XDDCMD-1 motor control from Xavien.com for awhile but there's no joy
Here's the simplest snippet I've cut it down to and still all I can get is some ticking noise from the motors of an TYKO truck chassis typically driven with 6V.
brake CON 0
pwminput CON 1
m1direction CON 2
Turn:
LOW brake
HIGH m1direction
PWM pwminput,255,((250) */ $280)
PAUSE 200
GOTO TURN
I've varied the value in parenthesis over different ranges but no luck.
I've checked the input voltages to the controller and I've even hooked up the Parallax 'Scope and I know the pwm signals are the height (5v) and width I expect.
Maybe I shouldn't have ANY pauses, maybe I shouldn't repeat...? Maybe I should just stick to web development? [noparse]:)[/noparse]
How are you using PWM with other controllers? Is there an intermediate circuit between the Stamp pins and the controller?
Thank you sincerely for any insight into this. I really looked forward to using this chassis as a platform going forward.
Sincerely,
Bob
I've been trying to to use an XDDCMD-1 motor control from Xavien.com for awhile but there's no joy
Here's the simplest snippet I've cut it down to and still all I can get is some ticking noise from the motors of an TYKO truck chassis typically driven with 6V.
brake CON 0
pwminput CON 1
m1direction CON 2
Turn:
LOW brake
HIGH m1direction
PWM pwminput,255,((250) */ $280)
PAUSE 200
GOTO TURN
I've varied the value in parenthesis over different ranges but no luck.
I've checked the input voltages to the controller and I've even hooked up the Parallax 'Scope and I know the pwm signals are the height (5v) and width I expect.
Maybe I shouldn't have ANY pauses, maybe I shouldn't repeat...? Maybe I should just stick to web development? [noparse]:)[/noparse]
How are you using PWM with other controllers? Is there an intermediate circuit between the Stamp pins and the controller?
Thank you sincerely for any insight into this. I really looked forward to using this chassis as a platform going forward.
Sincerely,
Bob
Comments
But yes, it does look like you need some intermediate circuitry. Take a look at the Help page for the PWM command in PBasic, and you'll see a simple little circuit consisting of a 10K resistor and a .1 uf capacitor.
I suggest that you hook up that circuit without using the motor controller, and make sure that you're properly outputting analog voltages (using a simple voltmeter to check it). Then hook it up to the controller.
In addition, I don't understand why you don't just have something like
PWM pwminput, 255, 50 ' Charge the capacitor for 50 ms, assuming a BS2, output 5v
or
PWM pwminput, 128, 50 ' Charge the capacitor for 50 ms, assuming a BS2, output 2.5v
It's not clear what you expected to do with that expression in the parentheses for the Duration argument.
Finally, there's a datasheet for the hardware used on the controller here:
www.national.com/ds/LM/LMD18200.pdf
Post Edited (sylvie369) : 1/10/2009 12:11:57 PM GMT
I've seen that circuit and believed it was to deliver an analog voltage.
The specs for that 18200 looks like it needs a specific waveform switching between 0 and 5v.
I'll grab an R & C though based on your suggestion and create that circuit between the stamp pin and the controller though.
I really want this little thing to be my platform so whatever it takes!
For as the expression, I was switching between the BS2 and BS2SX and so I wanted a conspicuous place to add the adjustment.
There was also an expression there because I expected to have more complexity there before I started having this issue.
Thank you for your input. It unbelievable how humbling these chips and simple connections can make one feel.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Yeah, that's for sure. Don't assume I know what I'm talking about - it wasn't clear to me from the Xavien manual how PWM is going to control that motor.
If you're switching between BS2 and BS2sx you're going to have to change the timing dependent on the chip, as the PWM page of the PBasic manual indicates. You might want to use conditional directives to opt between timing constants dependent on which chip is being used.