Skip to main content
Topic: correct PWM messages output? (multiple pulses generation) (Read 2967 times) previous topic - next topic

correct PWM messages output? (multiple pulses generation)

I write here because i don't which thread could be more suitable.

I was playing with servos and found this behaviour, trying to find if there was a way to send multiple positions in the PWM generator for servos was active, without getting out from it, which i don't know if it's ok (remember i was playing with options and commands to see a way to repeat the pwm pulses):

Code: [Select]
2WIRE>(0)
 0.Macro menu
 1.ISO7816-3 ATR
 2.ISO7816-3 parse only
2WIRE>0
WRITE: 0x00
2WIRE>S90
PWM disabled
Servo active
2WIRE>90
WRITE: 0x5A
2WIRE>S 90
PWM disabled
[b]Servo active[/b]  <=  (1)
2WIRE>S -90
PWM disabled
[b]Position in degrees[/b]  <= different behaviour than the previous point (1)

(90)>10
Servo active
[b]WRITE: 0x5A[/b]  <=== ?????????? it doesn't appear when using normally just in this case

Well, the servo worked fine in all situations, but the messages in the serial terminal were these ones. Because i have the BP since some days ago, i can't say if these messages are ok or not, anyway they aren't consistent.

This encourages me to ask if there is a way to send multiple positions to the servo once the servo is active, something like:

Normal behaviour:

Code: [Select]
2WIRE>S
Position in degrees

(90)>0
Servo active
2WIRE>

Here the servo is powered and stable with the PWM, but.. i can't send any other position. I have to get out from the PWM mode and re-enter. It would be nice if i could do something like:

Code: [Select]
2WIRE>S
Position in degrees

(90)>0
Servo active

(0) > 20
Servo active

(20)> 10
Servo active

...

2WIRE>

... to generate 3 different positions without getting out from the Servo pwm generator. It'd be handy in the BP.


Also i noticed you can enter in the Servo mode from the 1-WIRE mode (it's not specified in the documentation).


am i wrong or there is some issue with the messages? is possible to generate different pulses without getting out from the PWM generator? if not, could it be added in future firmware releases?

Thank you

Re: correct PWM messages output? (multiple pulses generation

Reply #1
Thanks for the bug report. It looks like there is a little glitch in the servo handling. It is not consuming the input characters properly. These functions were contributed to the project so I am not intimately familiar with then, but I will check it out this week when I do Bus Pirate firmware updates.
Got a question? Please ask in the forum for the fastest answers.

Re: correct PWM messages output? (multiple pulses generation

Reply #2
You can do multiple commands in one go. SSS would set the servo position three times. SSSS four times, etc.

Off course the bug needs to be addressed first (i think)

Re: correct PWM messages output? (multiple pulses generation

Reply #3
[quote author="Sjaak"]You can do multiple commands in one go. SSS would set the servo position three times. SSSS four times, etc.

Off course the bug needs to be addressed first (i think)[/quote]

Wanna work on this bug tonight at IRC channel? :)

Re: correct PWM messages output? (multiple pulses generation

Reply #4
For firmware v6 I updated the behavior.

First, there are only 0-180 settings possible. - is not support and that was causing some errors here.

New mode does not show the disabled PWM message unless S is pressed without a value.

New mode also loops as requested, enter the value and hit enter to update the servo. Hit x or enter to exit.

Documentation updated:
http://dangerousprototypes.com/docs/Bus ... de#S_Servo
New server guide from the feature author (not complete) here:
http://dangerousprototypes.com/docs/Bus ... umentation
Got a question? Please ask in the forum for the fastest answers.