Motion Mind Module
http://www.solutions-cubed.com/solut...d/MM1_2005.htm
http://www.solutions-cubed.com/solut...s/MOTMDS_4.pdf
Thanks!
Motion Mind Module
http://www.solutions-cubed.com/solut...d/MM1_2005.htm
http://www.solutions-cubed.com/solut...s/MOTMDS_4.pdf
Thanks!
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=390&stc=1">
Well i guess you could fix about everything by reading the actual motor position and tell him to go to the readed position.
well to make it more clear... here's a snip of the idea
it's an idea. Let us know!Code:MAIN: IF (UP = 0) AND (DOWN=1) THEN serout FM, T9600 ,["W01 01 200", CR, LF] 'Write velocity limit value serout FM,T9600,["P01 270000", CR, LF] 'Send MOVETO_ABSOLUTE command ENDIF IF (DOWN = 0) AND (UP = 1) THEN serout FM, T9600 ,["W01 01 200", CR, LF] 'Write velocity limit value serout FM,T9600,["P01 0", CR, LF] 'Send MOVETO_ABSOLUTE command ENDIF if (DOWN = 1) AND (UP = 1) then ' SERIN motor position ' SEROUT motor position to make him stop endif goto MAIN End
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
OR... use a variable and increment/decrement it on each IF THEN statement... the only thing... i don't know how the movement will be produced... probably it will not going to be purely smooth.
try
there's probably something i missed in the math condition but, this have to work... well i guess.Code:PositionHB var byte PositionLB var word T9600 con 84 ' 9600 bauds MAIN: IF (UP = 0) AND (DOWN=1) THEN serout2 FM, T9600 ,["W01 01 200", CR, LF] 'Write velocity limit value if positionlb < 9999 then if positionhb != 27 then positionlb = positionlb+1 endif else positionlb = 0 if positionhb < 27 then positionhb = positionhb+1 endif endif serout2 FM,T9600,["P01 ",dec2 positionhb,dec4 positionlb,_ CR, LF] 'Send MOVETO_ABSOLUTE command ENDIF IF (DOWN = 0) AND (UP = 1) THEN serout2 FM, T9600 ,["W01 01 200", CR, LF] 'Write velocity limit value if positionlb then positionlb = positionlb - 1 else positionlb = 9999 if positionhb then positionhb = positionhb-1 endif endif serout2 FM,T9600,["P01 ",dec2 positionhb,dec4 positionlb,_ CR, LF] 'Send MOVETO_ABSOLUTE command ENDIF goto MAIN End
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
thanks mister_e I am gonna try your first thing, this is for a motorized shade application so the next step is to have the position constantly store the absolute position in the PICs eeprom incase the main power is cut it won't be confused when power is applied again. Thats aways off, first thing is first, I shall try your solution!
I tried your first solution and no go. When you flip the switch one way it still goes forward and when you flip the switch the other way it still goes reverse. But if you were to flip it from left to center it would still spin and NOT shut off. Same if you were to flip it from right to center. It would still move (the motor) until it gets to that absolute position. Some how I have to ustilize that _break pin because brining it low disables the H-Bridge. I have to do that somehow where if the switch is to the left or right its not pulled low. Mister E. It is wired up like your diagram in your previous posts.
now it's me that need to sleep
what about the second option now???
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Second Solution doesn't work eaither.
The problem is i think the code is right (your first solution) its just mechanically/electrically/wirely I need your help on how I can wire up the SPDT switch to go low when its in the center disableing the H-Bridge. the _brake line would be low. But when the switch is thrown left or right the _break line can not be low so the H-Bridge is reenable. Right now it is wired up like your schematic.
Bookmarks