Welcome! Log In Create A New Profile

Advanced

Hobby Servo

Posted by sas888 
Hobby Servo
April 25, 2019 04:09PM
Good day

I need assistance please and I am so frustrated that I am stuck with this problem.

I have the hobby servo MG90S and I am unable to get it to work on my smoothie. I have the 5X v1.1 board.

I went through the switch module and used the config from there (which I pasted below).

I have used pins 1.24 and 1.23 (disabled endstops to free up 1.24) and both pins did not work. I have tried both the Software and Hardware PWM methods. I sent various M280 Sxxx codes and the servo does not move.

I have a multimeter that measures frequency and checked the PWM signal is at 50Hz. It does not measure duty cycle.

To test whether the servo is working fine and enough power is being supplied to the servo from the Smoothie, I connected the 5V and Gnd from Smoothie and using the signal from the Arduino Uno I have (while connecting both Smoothie and Arduino grounds) and this controls the servo fine.

Software PWM tried:

# Switch module for servo control using S/W PWM
switch.servo.enable true # Enable this module
switch.servo.input_on_command M280 # M280 S7.5 would be midway
switch.servo.input_off_command M281 # Same as M280 S0 0% duty cycle, effectively off
switch.servo.output_pin 1.24 # May be any spare pin
switch.servo.output_type swpwm # Software pwm output settable with S parameter in the input_on_command
switch.servo.pwm_period_ms 20 # set period to 20ms (50Hz) default is 50Hz
#switch.servo.startup_state false # false uses startup_value on boot true uses default_on_value
#switch.servo.startup_value 7.43 # On boot and HALT it will set this PWM value
#switch.servo.default_on_value 3.3 # This PWM value will be set if M280 doe snot have an S parameter, it is also the value used if startup_state is true

Hardware PWM tried:

# Switch module for a second servo control using H/W PWM
switch.servo.enable true # Enable this module
switch.servo.input_on_command M280 # M280 S7.5 would be midway
switch.servo.input_off_command M281 # Same as M280 S0 0% duty cycle, effectively off
switch.servo.output_pin 1.24 # Must be a PWM capable pin
switch.servo.output_type hwpwm # H/W pwm output settable with S parameter in the input_on_command


Thank you!
Re: Hobby Servo
April 26, 2019 11:33AM
Ok managed to get it working.

I tried pin 3.25 (another PWM pin) and it worked, and tried 2.2 which also worked.

For some reason pins 1.24 and 1.23 although they are PWM pin do not work as such. When I measured the voltage when sending the Gcode, such as M280 S0 and then M280 S5, the voltage did not change

Also I have a RepRap Panel which uses pin 3.25 This pin is used for the B Phase of the rotary encoder on the panel. When I swopped 3.25 with 1.23 the encoder the B phase did not work.

I am not sure whether my board is faulty or whether these pins are just normal pins.
Sorry, only registered users may post in this forum.

Click here to login