Using G Codes to Test the Motor and Relay
-
Greetings,
W98e have assembled and Cartesean Machine, would like to test the DC Motors and Relay connected. Have created M950 for the Motor´s and Relay as shown below in the Config.g file.
; Fans
M950 P1 C"out1" Q100 ; Allocate GPIO port 1 to OUT_1 (fan output), 100Hz
M950 P2 C"out2" Q100 ; Allocate GPIO port 2 to OUT_2 (fan output), 100Hz
M950 P3 C"out9"P1 & P2 are for the motor´s and P3 is for the relay
-
Can i test the Initial testing of these motor´s and relay using the M42 command as shown below?
M42 P1 S0.5
M42 P2 S0.5
M42 P3 S1.0 -
after the above testing we have created few macro files for these devices, can we use the M98 P¨filename.g¨ command to test the behaviour of macro files?
M98 P¨TORCH ON¨
{Actual file name is 1.TORCH_ON, should the serial number 1. and _ also to be mentioned in the M98 Command}
Requesting your insights plz........
-
-
Greetings
With reference to the above query, I have tested the Feeder Motor and Relay using the M42 command and they are working well.
With regards to the M98 Command, the default location is the sys folder.
The macro files are placed in the macro folder, is the M98 command to be placed with the subfolder location asM98 P/macro/TORCH ON.g
Is the M98 COMMAND placed above is correct?
Requesting your insights plz
-
@SANJR said in Using G Codes to Test the Motor and Relay:
M98 P/macro/TORCH ON.g
no, it should be
M98 P"0:/macros/TORCH ON.g"
-
@jay_s_uk Thanks for the update provided
-
With regards to the above topic of testing the Motor
M42 Command was used to teset the feedrate of the motor using the command
M42 P1 S0.2
The command was repeated for several times and output of the motor in terms of mm/min was checked.
It was observed there was no consistency in the output. I am sharing the result of the Output for 8 trials conducted
Trial 1 : 5.3 Meters/Min
Trial 2 : 4.2 Meters/Min
Trial 3 : 4.2 Meters/Min
Trial 4 : 6.4 Meters/Min
Trial 5 : 7.2 Meters/Min
Trial 6 : 7.6 Meters/Min
Trial 7 : 7.6 Meters/Min
Trial 8 : 7.6 Meters/MinMotor used was an DC Bushless Motor configured as GPIO.
What is the reason for this difference in output? And how to overcome this issue?
Requesting to share your insights plz
-
With reference to the above query
Requesting any suggestions to acheive the consistent output of the DC brushless motor would be helpful
-
@SANJR I’d guess it’s to do with the PWM frequency of 100Hz you’re using:
M950 P1 C"out1" Q100 ; Allocate GPIO port 1 to OUT_1 (fan output), 100Hz
Where did that frequency come from? If it’s switching a relay to turn the motor on, is the relay capable of using this frequency? And is the motor? If it helps, link to the specifications for both.
Ian
-
The motor is connected directly to an fan output 1 and configured as GPIO Port 1. Relay was not used to connect the motor.
The frequency Q100, was assumed to make the motor at the full and normal speed.
I have removed the Q100 in the M950 Code in the config.g file, and the macro to run switch on the motor and run at 50% frequency.
In config.g file (Modified Command)
M950 P1 C"out1" ; Allocate GPIO port 1 to OUT_1 (fan output)In Macro file - Motor ON & Run @50% frequency
M106 P1 S1.0 ; Turn on the motor at full Speed
M42 P1 S0.5 ; Set 50% PWM on GPIO port 1The Q100 had no effect on the DC motor; its the S parameter at the M42 that is changing the speed as it is varied.
Any more suggestions or insights to solve the issue of inconsistency ........
-
Hi,
With reference to the above query, As per the initial diagnosis, the motor is rotating in an anticlockwise direction; it was supposed to rotate in a clockwise direction; hence, the input and output of the motor are reversed.
Is this behavior due to any problem in wire connection to OUT 1 like it is reversed? And whether this could be an problem to the inconsisten ouput from the motor?
I am attaching an As is wiring scematic and representation of As Is and To be of the motor functioning
Any of your suggestions could help to understand this problem and tackle them plz....